Added support for receipt templates, added default and short version (#678)

This commit is contained in:
FrancescoUK
2016-06-26 20:06:37 +01:00
parent 0293b6dbd8
commit 586c8f8db9
24 changed files with 460 additions and 214 deletions

View File

@@ -224,6 +224,7 @@ class Config extends Secure_Controller
public function save_receipt()
{
$batch_save_data = array (
'receipt_template' => $this->input->post('receipt_template'),
'receipt_show_taxes' => $this->input->post('receipt_show_taxes') != NULL,
'receipt_show_total_discount' => $this->input->post('receipt_show_total_discount') != NULL,
'receipt_show_description' => $this->input->post('receipt_show_description') != NULL,

View File

@@ -340,7 +340,7 @@ class Sales extends Secure_Controller
$data['total'] = $this->sale_lib->get_total();
$data['discount'] = $this->sale_lib->get_discount();
$data['receipt_title'] = $this->lang->line('sales_receipt');
$data['transaction_time'] = date($this->config->item('dateformat').' '.$this->config->item('timeformat'));
$data['transaction_time'] = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'));
$data['transaction_date'] = date($this->config->item('dateformat'));
$data['show_stock_locations'] = $this->Stock_location->show_locations('sales');
$data['comments'] = $this->sale_lib->get_comment();
@@ -664,17 +664,19 @@ class Sales extends Secure_Controller
public function receipt($sale_id)
{
$sale_data = $this->_load_sale_data($sale_id);
$this->load->view('sales/receipt', $sale_data);
$data = $this->_load_sale_data($sale_id);
$this->load->view('sales/receipt', $data);
$this->sale_lib->clear_all();
}
public function invoice($sale_id)
{
$sale_data = $this->_load_sale_data($sale_id);
$data = $this->_load_sale_data($sale_id);
$this->load->view('sales/invoice', $data);
$this->load->view('sales/invoice', $sale_data);
$this->sale_lib->clear_all();
}

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Zeige MWSt";
$lang["config_receipt_show_total_discount"] = "Zeige Gesamtrabatt";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Berechne Durchschnittseinkaufspreis";
$lang["config_recv_invoice_format"] = "Format Eingangsrechnung";
$lang["config_return_policy_required"] = "Rücknahmepolitik erforderlich";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Receivings Invoice Format";
$lang["config_return_policy_required"] = "Return policy is a required field";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Mostrar impuestos";
$lang["config_receipt_show_total_discount"] = "Mostrar Descuento Total";
$lang["config_receipt_show_description"] = "Mostrar descripcion";
$lang["config_receipt_show_serialnumber"] = "Mostra numero de serie";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc precio promedio (Recepción)";
$lang["config_recv_invoice_format"] = "Formato de Factura de Recepción";
$lang["config_return_policy_required"] = "Política de Devolución es requerida";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Receivings Invoice Format";
$lang["config_return_policy_required"] = "Le Message est un champ requis";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Prikaži porez";
$lang["config_receipt_show_total_discount"] = "Pokaži ukupni popust";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Računaj prosječnu cijenu (primke)";
$lang["config_recv_invoice_format"] = "Oblik ulaznog računa(primke)";
$lang["config_return_policy_required"] = "Polje za povratne obavijesti je potrebno";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Adók mutatása";
$lang["config_receipt_show_total_discount"] = "Összes kedvezmény mutatása";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Átl. Ár számitása (visszáru)";
$lang["config_recv_invoice_format"] = "Visszatérítési számla formátum";
$lang["config_return_policy_required"] = "Return policy is a required field";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Format Nota";
$lang["config_return_policy_required"] = "Kebijakan retur wajib diisi";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Toon VAT";
$lang["config_receipt_show_total_discount"] = "Toon Totale Korting";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Formattering Order #";
$lang["config_return_policy_required"] = "De retourvoorwaarden moeten ingevuld worden";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Mostrar Impostos";
$lang["config_receipt_show_total_discount"] = "Mostrar total desconto";
$lang["config_receipt_show_description"] = "Exibir descrição";
$lang["config_receipt_show_serialnumber"] = "Exibir número serial";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc Médio de Preço (Recebimento)";
$lang["config_recv_invoice_format"] = "Formato da fatura de recebimento";
$lang["config_return_policy_required"] = "A política de devolução é um campo obrigatório";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Receivings Invoice Format";
$lang["config_return_policy_required"] = "Возвратний полис обязательный пробел";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "ใบส่งของ";
$lang["config_return_policy_required"] = "ต้องกรอกเงื่อนไขการคืนสินค้า";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Receivings Invoice Format";
$lang["config_return_policy_required"] = "İade Politikası zorunlu alandır";

View File

@@ -151,6 +151,9 @@ $lang["config_receipt_show_taxes"] = "Show Taxes";
$lang["config_receipt_show_total_discount"] = "Show Total Discount";
$lang["config_receipt_show_description"] = "Show Description";
$lang["config_receipt_show_serialnumber"] = "Show Serial Number";
$lang["config_receipt_template"] = "Receipt Template";
$lang["config_receipt_default"] = "Default";
$lang["config_receipt_short"] = "Short";
$lang["config_receiving_calculate_average_price"] = "Calc avg. Price (Receiving)";
$lang["config_recv_invoice_format"] = "Receivings Invoice Format";
$lang["config_return_policy_required"] = "退換貨政策為必填";

View File

@@ -4,6 +4,18 @@
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
<ul id="receipt_error_message_box" class="error_message_box"></ul>
<div class="form-group form-group-sm">
<?php echo form_label($this->lang->line('config_receipt_template'), 'receipt_template', array('class' => 'control-label col-xs-2')); ?>
<div class='col-xs-2'>
<?php echo form_dropdown('receipt_template', array(
'receipt_default' => $this->lang->line('config_receipt_default'),
'receipt_short' => $this->lang->line('config_receipt_short')
),
$this->config->item('receipt_template'), array('class' => 'form-control input-sm'));
?>
</div>
</div>
<div class="form-group form-group-sm">
<?php echo form_label($this->lang->line('config_receipt_show_taxes'), 'receipt_show_taxes', array('class' => 'control-label col-xs-2')); ?>
<div class='col-xs-1'>

View File

@@ -43,197 +43,6 @@ $(document).ready(function()
<?php echo anchor("sales/manage", '<span class="glyphicon glyphicon-list-alt">&nbsp</span>' . $this->lang->line('sales_takings'), array('class'=>'btn btn-info btn-sm', 'id'=>'show_takings_button')); ?>
</div>
<div id="receipt_wrapper">
<div id="receipt_header">
<?php
if ($this->Appconfig->get('company_logo') != '')
{
?>
<div id="company_name"><img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" /></div>
<?php
}
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<div id="company_address"><?php echo nl2br($this->config->item('address')); ?></div>
<div id="company_phone"><?php echo $this->config->item('phone'); ?></div>
<div id="sale_receipt"><?php echo $receipt_title; ?></div>
<div id="sale_time"><?php echo $transaction_time ?></div>
</div>
<div id="receipt_general_info">
<?php
if(isset($customer))
{
?>
<div id="customer"><?php echo $this->lang->line('customers_customer').": ".$customer; ?></div>
<?php
}
?>
<div id="sale_id"><?php echo $this->lang->line('sales_id').": ".$sale_id; ?></div>
<?php
if (!empty($invoice_number))
{
?>
<div id="invoice_number"><?php echo $this->lang->line('sales_invoice_number').": ".$invoice_number; ?></div>
<?php
}
?>
<div id="employee"><?php echo $this->lang->line('employees_employee').": ".$employee; ?></div>
</div>
<table id="receipt_items">
<tr>
<th style="width:40%;"><?php echo $this->lang->line('sales_description_abbrv'); ?></th>
<th style="width:20%;"><?php echo $this->lang->line('sales_price'); ?></th>
<th style="width:20%;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th style="width:20%;" class="total-value"><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
foreach(array_reverse($cart, true) as $line=>$item)
{
?>
<tr>
<td><?php echo ucfirst($item['name']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td class="total-value"><?php echo to_currency($item[($this->Appconfig->get('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?></td>
</tr>
<tr>
<?php
if($this->Appconfig->get('receipt_show_description'))
{
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
}
?>
<?php
if($this->Appconfig->get('receipt_show_serialnumber'))
{
?>
<td><?php echo $item['serialnumber']; ?></td>
<?php
}
?>
</tr>
<?php
if ($item['discount'] > 0)
{
?>
<tr>
<td colspan="3" class="discount"><?php echo number_format($item['discount'], 0) . " " . $this->lang->line("sales_discount_included")?></td>
<td class="total-value"><?php echo to_currency($item['discounted_total']) ; ?></td>
</tr>
<?php
}
?>
<?php
}
?>
<?php
if ($this->Appconfig->get('receipt_show_total_discount') && $discount > 0)
{
?>
<tr>
<td colspan="3" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($subtotal); ?></td>
</tr>
<tr>
<td colspan="3" class="total-value"><?php echo $this->lang->line('sales_discount'); ?>:</td>
<td class="total-value"><?php echo to_currency($discount * -1); ?></td>
</tr>
<?php
}
?>
<?php
if ($this->Appconfig->get('receipt_show_taxes'))
{
?>
<tr>
<td colspan="3" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($this->config->item('tax_included') ? $tax_exclusive_subtotal : $discounted_subtotal); ?></td>
</tr>
<?php
foreach($taxes as $name=>$value)
{
?>
<tr>
<td colspan="3" class="total-value"><?php echo $name; ?>:</td>
<td class="total-value"><?php echo to_currency($value); ?></td>
</tr>
<?php
}
?>
<?php
}
?>
<tr>
</tr>
<?php $border = (!$this->Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('receipt_show_total_discount') && $discount > 0)); ?>
<tr>
<td colspan="3" style="text-align:right;<?php echo $border? 'border-top: 2px solid black;' :''; ?>"><?php echo $this->lang->line('sales_total'); ?></td>
<td style="text-align:right;<?php echo $border? 'border-top: 2px solid black;' :''; ?>"><?php echo to_currency($total); ?></td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<?php
$only_sale_check = TRUE;
$show_giftcard_remainder = FALSE;
foreach($payments as $payment_id=>$payment)
{
$only_sale_check &= $payment['payment_type'] == $this->lang->line('sales_check');
$splitpayment=explode(':',$payment['payment_type']);
$show_giftcard_remainder |= $splitpayment[0] == $this->lang->line('sales_giftcard');
?>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $splitpayment[0]; ?> </td>
<td class="total-value"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<?php
if (isset($cur_giftcard_value) && $show_giftcard_remainder)
{
?>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $this->lang->line('sales_giftcard_balance'); ?></td>
<td class="total-value"><?php echo to_currency($cur_giftcard_value); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="3" style="text-align:right;"> <?php echo $this->lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?> </td>
<td class="total-value"><?php echo to_currency($amount_change); ?></td>
</tr>
</table>
<div id="sale_return_policy">
<?php echo nl2br($this->config->item('return_policy')); ?>
</div>
<div id="barcode">
<img src='data:image/png;base64,<?php echo $barcode; ?>' /><br>
<?php echo $sale_id; ?>
</div>
</div>
<?php $this->load->view("partial/footer"); ?>
<?php $this->load->view("sales/" . $this->config->item('receipt_template')); ?>
<?php $this->load->view("partial/footer"); ?>

View File

@@ -0,0 +1,191 @@
<div id="receipt_wrapper">
<div id="receipt_header">
<?php
if ($this->Appconfig->get('company_logo') != '')
{
?>
<div id="company_name"><img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" /></div>
<?php
}
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<div id="company_address"><?php echo nl2br($this->config->item('address')); ?></div>
<div id="company_phone"><?php echo $this->config->item('phone'); ?></div>
<div id="sale_receipt"><?php echo $receipt_title; ?></div>
<div id="sale_time"><?php echo $transaction_time ?></div>
</div>
<div id="receipt_general_info">
<?php
if(isset($customer))
{
?>
<div id="customer"><?php echo $this->lang->line('customers_customer').": ".$customer; ?></div>
<?php
}
?>
<div id="sale_id"><?php echo $this->lang->line('sales_id').": ".$sale_id; ?></div>
<?php
if (!empty($invoice_number))
{
?>
<div id="invoice_number"><?php echo $this->lang->line('sales_invoice_number').": ".$invoice_number; ?></div>
<?php
}
?>
<div id="employee"><?php echo $this->lang->line('employees_employee').": ".$employee; ?></div>
</div>
<table id="receipt_items">
<tr>
<th style="width:40%;"><?php echo $this->lang->line('sales_description_abbrv'); ?></th>
<th style="width:20%;"><?php echo $this->lang->line('sales_price'); ?></th>
<th style="width:20%;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th style="width:20%;" class="total-value"><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
foreach(array_reverse($cart, true) as $line=>$item)
{
?>
<tr>
<td><?php echo ucfirst($item['name']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td class="total-value"><?php echo to_currency($item[($this->Appconfig->get('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?></td>
</tr>
<tr>
<?php
if($this->Appconfig->get('receipt_show_description'))
{
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
}
?>
<?php
if($this->Appconfig->get('receipt_show_serialnumber'))
{
?>
<td><?php echo $item['serialnumber']; ?></td>
<?php
}
?>
</tr>
<?php
if ($item['discount'] > 0)
{
?>
<tr>
<td colspan="3" class="discount"><?php echo number_format($item['discount'], 0) . " " . $this->lang->line("sales_discount_included")?></td>
<td class="total-value"><?php echo to_currency($item['discounted_total']) ; ?></td>
</tr>
<?php
}
?>
<?php
}
?>
<?php
if ($this->Appconfig->get('receipt_show_total_discount') && $discount > 0)
{
?>
<tr>
<td colspan="3" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($subtotal); ?></td>
</tr>
<tr>
<td colspan="3" class="total-value"><?php echo $this->lang->line('sales_discount'); ?>:</td>
<td class="total-value"><?php echo to_currency($discount * -1); ?></td>
</tr>
<?php
}
?>
<?php
if ($this->Appconfig->get('receipt_show_taxes'))
{
?>
<tr>
<td colspan="3" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($this->config->item('tax_included') ? $tax_exclusive_subtotal : $discounted_subtotal); ?></td>
</tr>
<?php
foreach($taxes as $name=>$value)
{
?>
<tr>
<td colspan="3" class="total-value"><?php echo $name; ?>:</td>
<td class="total-value"><?php echo to_currency($value); ?></td>
</tr>
<?php
}
?>
<?php
}
?>
<tr>
</tr>
<?php $border = (!$this->Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('receipt_show_total_discount') && $discount > 0)); ?>
<tr>
<td colspan="3" style="text-align:right;<?php echo $border? 'border-top: 2px solid black;' :''; ?>"><?php echo $this->lang->line('sales_total'); ?></td>
<td style="text-align:right;<?php echo $border? 'border-top: 2px solid black;' :''; ?>"><?php echo to_currency($total); ?></td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<?php
$only_sale_check = TRUE;
$show_giftcard_remainder = FALSE;
foreach($payments as $payment_id=>$payment)
{
$only_sale_check &= $payment['payment_type'] == $this->lang->line('sales_check');
$splitpayment=explode(':',$payment['payment_type']);
$show_giftcard_remainder |= $splitpayment[0] == $this->lang->line('sales_giftcard');
?>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $splitpayment[0]; ?> </td>
<td class="total-value"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<?php
if (isset($cur_giftcard_value) && $show_giftcard_remainder)
{
?>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $this->lang->line('sales_giftcard_balance'); ?></td>
<td class="total-value"><?php echo to_currency($cur_giftcard_value); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="3" style="text-align:right;"> <?php echo $this->lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?> </td>
<td class="total-value"><?php echo to_currency($amount_change); ?></td>
</tr>
</table>
<div id="sale_return_policy">
<?php echo nl2br($this->config->item('return_policy')); ?>
</div>
<div id="barcode">
<img src='data:image/png;base64,<?php echo $barcode; ?>' /><br>
<?php echo $sale_id; ?>
</div>
</div>

View File

@@ -0,0 +1,185 @@
<div id="receipt_wrapper">
<div id="receipt_header">
<?php
if ($this->Appconfig->get('company_logo') != '')
{
?>
<div id="company_name"><img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" /></div>
<?php
}
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<div id="company_address"><?php echo nl2br($this->config->item('address')); ?></div>
<div id="company_phone"><?php echo $this->config->item('phone'); ?></div>
<div id="sale_receipt"><?php echo $receipt_title; ?></div>
<div id="sale_time"><?php echo $transaction_time ?></div>
</div>
<div id="receipt_general_info">
<?php
if(isset($customer))
{
?>
<div id="customer"><?php echo $this->lang->line('customers_customer').": ".$customer; ?></div>
<?php
}
?>
<div id="sale_id"><?php echo $this->lang->line('sales_id').": ".$sale_id; ?></div>
<?php
if (!empty($invoice_number))
{
?>
<div id="invoice_number"><?php echo $this->lang->line('recvs_invoice_number').": ".$invoice_number; ?></div>
<?php
}
?>
<div id="employee"><?php echo $this->lang->line('employees_employee').": ".$employee; ?></div>
</div>
<table id="receipt_items">
<tr>
<th style="width:50%;"><?php echo $this->lang->line('sales_description_abbrv'); ?></th>
<th style="width:25%;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th colspan="4" style="width:25%;" class="total-value"><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
foreach(array_reverse($cart, true) as $line=>$item)
{
?>
<tr>
<td><?php echo ucfirst($item['name']); ?></td>
</tr>
<tr>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td class="total-value"><?php echo to_currency($item[($this->Appconfig->get('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?></td>
</tr>
<tr>
<?php
if($this->Appconfig->get('receipt_show_description'))
{
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
}
?>
<?php
if($this->Appconfig->get('receipt_show_serialnumber'))
{
?>
<td><?php echo $item['serialnumber']; ?></td>
<?php
}
?>
</tr>
<?php
if ($item['discount'] > 0)
{
?>
<tr>
<td colspan="2" class="discount"><?php echo number_format($item['discount'], 0) . " " . $this->lang->line("sales_discount_included")?></td>
<td class="total-value"><?php echo to_currency($item['discounted_total']) ; ?></td>
</tr>
<?php
}
?>
<?php
}
?>
<?php
if ($this->Appconfig->get('receipt_show_total_discount') && $discount > 0)
{
?>
<tr>
<td colspan="2" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($subtotal); ?></td>
</tr>
<tr>
<td colspan="2" class="total-value"><?php echo $this->lang->line('sales_discount'); ?>:</td>
<td class="total-value"><?php echo to_currency($discount * -1); ?></td>
</tr>
<?php
}
?>
<?php
if ($this->Appconfig->get('receipt_show_taxes'))
{
?>
<tr>
<td colspan="2" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($this->config->item('tax_included') ? $tax_exclusive_subtotal : $discounted_subtotal); ?></td>
</tr>
<?php
foreach($taxes as $name=>$value)
{
?>
<tr>
<td colspan="2" class="total-value"><?php echo $name; ?>:</td>
<td class="total-value"><?php echo to_currency($value); ?></td>
</tr>
<?php
}
?>
<?php
}
?>
<tr>
</tr>
<?php $border = (!$this->Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('receipt_show_total_discount') && $discount > 0)); ?>
<tr>
<td colspan="2" style="text-align:right;<?php echo $border? 'border-top: 2px solid black;' :''; ?>"><?php echo $this->lang->line('sales_total'); ?></td>
<td style="text-align:right;<?php echo $border? 'border-top: 2px solid black;' :''; ?>"><?php echo to_currency($total); ?></td>
</tr>
<?php
$only_sale_check = TRUE;
$show_giftcard_remainder = FALSE;
foreach($payments as $payment_id=>$payment)
{
$only_sale_check &= $payment['payment_type'] == $this->lang->line('sales_check');
$splitpayment=explode(':',$payment['payment_type']);
$show_giftcard_remainder |= $splitpayment[0] == $this->lang->line('sales_giftcard');
?>
<tr>
<td colspan="2" style="text-align:right;"><?php echo $splitpayment[0]; ?> </td>
<td class="total-value"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?></td>
</tr>
<?php
}
?>
<?php
if (isset($cur_giftcard_value) && $show_giftcard_remainder)
{
?>
<tr>
<td colspan="2" style="text-align:right;"><?php echo $this->lang->line('sales_giftcard_balance'); ?></td>
<td class="total-value"><?php echo to_currency($cur_giftcard_value); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="2" style="text-align:right;"> <?php echo $this->lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?> </td>
<td class="total-value"><?php echo to_currency($amount_change); ?></td>
</tr>
</table>
<div id="sale_return_policy">
<?php echo nl2br($this->config->item('return_policy')); ?>
</div>
<div id="barcode">
<img src='data:image/png;base64,<?php echo $barcode; ?>' /><br>
<?php echo $sale_id; ?>
</div>
</div>

View File

@@ -40,18 +40,19 @@ ALTER TABLE `ospos_customers`
UPDATE `ospos_app_config` SET `key` = 'receipt_show_total_discount' WHERE `key` = 'show_total_discount';
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('receipt_show_description', '1'),
('receipt_show_serialnumber', '1'),
('invoice_enable', '1'),
('country_codes', 'us'),
('notify_horizontal_position', 'right'),
('notify_vertical_position', 'top'),
('payment_options_order', 'cashdebitcredit'),
('protocol', 'mail'),
('mailpath', '/usr/sbin/sendmail'),
('smtp_port', '465'),
('smtp_timeout', '5'),
('smtp_crypto', 'ssl');
('receipt_show_description', '1'),
('receipt_show_serialnumber', '1'),
('invoice_enable', '1'),
('country_codes', 'us'),
('notify_horizontal_position', 'right'),
('notify_vertical_position', 'top'),
('payment_options_order', 'cashdebitcredit'),
('protocol', 'mail'),
('mailpath', '/usr/sbin/sendmail'),
('smtp_port', '465'),
('smtp_timeout', '5'),
('smtp_crypto', 'ssl'),
('receipt_template', 'receipt_default');
DELETE FROM `ospos_app_config` WHERE `key` = 'use_invoice_template';

View File

@@ -76,7 +76,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('mailpath', '/usr/sbin/sendmail'),
('smtp_port', '465'),
('smtp_timeout', '5'),
('smtp_crypto', 'ssl');
('smtp_crypto', 'ssl'),
('receipt_template', 'receipt_default');
-- --------------------------------------------------------

View File

@@ -76,7 +76,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('mailpath', '/usr/sbin/sendmail'),
('smtp_port', '465'),
('smtp_timeout', '5'),
('smtp_crypto', 'ssl');
('smtp_crypto', 'ssl'),
('receipt_template', 'receipt_default');
-- --------------------------------------------------------

View File

@@ -76,7 +76,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('mailpath', '/usr/sbin/sendmail'),
('smtp_port', '465'),
('smtp_timeout', '5'),
('smtp_crypto', 'ssl');
('smtp_crypto', 'ssl'),
('receipt_template', 'receipt_default');
-- --------------------------------------------------------

View File

@@ -150,6 +150,9 @@ config_receipt_show_taxes,Adók mutatása,Zeige MWSt,Toon VAT,Mostrar impuestos,
config_receipt_show_total_discount,Összes kedvezmény mutatása,Zeige Gesamtrabatt,Toon Totale Korting,Mostrar Descuento Total,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Mostrar total desconto,Pokaži ukupni popust
config_receipt_show_description,Show Description,Show Description,Show Description,Mostrar descripcion,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Exibir descrição,Show Description
config_receipt_show_serialnumber,Show Serial Number,Show Serial Number,Show Serial Number,Mostra numero de serie,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Exibir número serial,Show Serial Number
config_receipt_template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template,Receipt Template
config_receipt_default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default
config_receipt_short,Short,Short,Short,Short,Short,Short,Short,Short,Short,Short,Short,Short,Short
config_receiving_calculate_average_price,Átl. Ár számitása (visszáru),Berechne Durchschnittseinkaufspreis,Calc avg. Price (Receiving),Calc precio promedio (Recepción),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc Médio de Preço (Recebimento),Računaj prosječnu cijenu (primke)
config_recv_invoice_format,Visszatérítési számla formátum,Format Eingangsrechnung,Formattering Order #,Formato de Factura de Recepción,Receivings Invoice Format,Receivings Invoice Format,Receivings Invoice Format,Receivings Invoice Format,ใบส่งของ,Receivings Invoice Format,Format Nota,Formato da fatura de recebimento,Oblik ulaznog računa(primke)
config_return_policy_required,Return policy is a required field,Rücknahmepolitik erforderlich,De retourvoorwaarden moeten ingevuld worden,Política de Devolución es requerida,Return policy is a required field,Le Message est un champ requis,退換貨政策為必填,Возвратний полис обязательный пробел,ต้องกรอกเงื่อนไขการคืนสินค้า,İade Politikası zorunlu alandır,Kebijakan retur wajib diisi,A política de devolução é um campo obrigatório,Polje za povratne obavijesti je potrebno
1 label hu-HU de-CH nl-BE es en fr zh ru th tr id pt-BR hr-HR
150 config_receipt_show_total_discount Összes kedvezmény mutatása Zeige Gesamtrabatt Toon Totale Korting Mostrar Descuento Total Show Total Discount Show Total Discount Show Total Discount Show Total Discount Show Total Discount Show Total Discount Show Total Discount Mostrar total desconto Pokaži ukupni popust
151 config_receipt_show_description Show Description Show Description Show Description Mostrar descripcion Show Description Show Description Show Description Show Description Show Description Show Description Show Description Exibir descrição Show Description
152 config_receipt_show_serialnumber Show Serial Number Show Serial Number Show Serial Number Mostra numero de serie Show Serial Number Show Serial Number Show Serial Number Show Serial Number Show Serial Number Show Serial Number Show Serial Number Exibir número serial Show Serial Number
153 config_receipt_template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template Receipt Template
154 config_receipt_default Default Default Default Default Default Default Default Default Default Default Default Default Default
155 config_receipt_short Short Short Short Short Short Short Short Short Short Short Short Short Short
156 config_receiving_calculate_average_price Átl. Ár számitása (visszáru) Berechne Durchschnittseinkaufspreis Calc avg. Price (Receiving) Calc precio promedio (Recepción) Calc avg. Price (Receiving) Calc avg. Price (Receiving) Calc avg. Price (Receiving) Calc avg. Price (Receiving) Calc avg. Price (Receiving) Calc avg. Price (Receiving) Calc avg. Price (Receiving) Calc Médio de Preço (Recebimento) Računaj prosječnu cijenu (primke)
157 config_recv_invoice_format Visszatérítési számla formátum Format Eingangsrechnung Formattering Order # Formato de Factura de Recepción Receivings Invoice Format Receivings Invoice Format Receivings Invoice Format Receivings Invoice Format ใบส่งของ Receivings Invoice Format Format Nota Formato da fatura de recebimento Oblik ulaznog računa(primke)
158 config_return_policy_required Return policy is a required field Rücknahmepolitik erforderlich De retourvoorwaarden moeten ingevuld worden Política de Devolución es requerida Return policy is a required field Le Message est un champ requis 退換貨政策為必填 Возвратний полис обязательный пробел ต้องกรอกเงื่อนไขการคืนสินค้า İade Politikası zorunlu alandır Kebijakan retur wajib diisi A política de devolução é um campo obrigatório Polje za povratne obavijesti je potrebno