Add navigation buttons to invoice, receipt and takings + enable jsPrint (#394)

This commit is contained in:
FrancescoUK
2016-03-14 17:13:06 +00:00
committed by jekkos
parent bc53f544f4
commit 91041bd7a9
22 changed files with 345 additions and 269 deletions

3
.gitignore vendored
View File

@@ -17,4 +17,5 @@ git-svn-diff.py
*~
*.~
*.log
application/sessions/*
dist/*_bower.*
application/sessions/*

View File

@@ -297,8 +297,6 @@ class Sales extends Secure_area
$data['warning'] = $this->sale_lib->out_of_stock($item_id_or_number_or_item_kit_or_receipt,$item_location);
$this->_reload($data);
}
@@ -448,6 +446,7 @@ class Sales extends Secure_area
{
$this->load->view("sales/receipt", $data);
}
$this->sale_lib->clear_all();
}
@@ -615,7 +614,7 @@ class Sales extends Secure_area
function receipt($sale_id)
{
$data = $this->_load_sale_data($sale_id);
$this->load->view("sales/receipt",$data);
$this->load->view("sales/receipt", $data);
$this->sale_lib->clear_all();
}
@@ -708,7 +707,7 @@ class Sales extends Secure_area
{
$person_info = $this->Employee->get_logged_in_employee_info();
$data['cart'] = $this->sale_lib->get_cart();
$data['modes'] = array('sale'=>$this->lang->line('sales_sale'),'return'=>$this->lang->line('sales_return'));
$data['modes'] = array('sale'=>$this->lang->line('sales_sale'), 'return'=>$this->lang->line('sales_return'));
$data['mode'] = $this->sale_lib->get_mode();
$data['stock_locations'] = $this->Stock_location->get_allowed_locations('sales');

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Lagerort";
$lang["config_stock_location_duplicate"] = "Bitte verwenden Sie einen eindeutigen Lagerort";
$lang["config_stock_location_invalid_chars"] = "Der Lagerort kann keine Unterstriche enthalten";
$lang["config_stock_location_required"] = "Lagerort Nummer ist erforderlich";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "MWSt inbegriffen";
$lang["config_thousands_separator"] = "Tausendertrennzeichen";
$lang["config_timezone"] = "Zeitzone";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Stock location";
$lang["config_stock_location_duplicate"] = "Please use an unique location name";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "Stock location number is a required field";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Tax Included";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Timezone";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Ubicación de Inventario";
$lang["config_stock_location_duplicate"] = "Por favor use un nombre de inventario único";
$lang["config_stock_location_invalid_chars"] = "Nombre de la Ubicación de Inventario no debe contener '_'";
$lang["config_stock_location_required"] = "Número de Ubicación de Inventario es requerido";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Impuestos incluidos";
$lang["config_thousands_separator"] = "Separador de miles";
$lang["config_timezone"] = "Zona Horaria";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Stock location";
$lang["config_stock_location_duplicate"] = "Please use an unique location name";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "Stock location number is a required field";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Tax Included";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Fuseau Horaire";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Lokasi Stock";
$lang["config_stock_location_duplicate"] = "Please use an unique location name";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "Stock location number is a required field";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Dikenakan Pajak";
$lang["config_thousands_separator"] = "Pemisah Ribuan";
$lang["config_timezone"] = "Zona Waktu";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Stock locatie";
$lang["config_stock_location_duplicate"] = "Vul een unieke naam in";
$lang["config_stock_location_invalid_chars"] = "De bedrijfsnaam moet ingevuld worden";
$lang["config_stock_location_required"] = "Naam van de stock locatie is een verplicht veld";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "VAT Inbegrepen";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Tijdzone";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Stock location";
$lang["config_stock_location_duplicate"] = "Please use an unique location name";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "Stock location number is a required field";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Tax Included";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Часовой пояс";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "สถานที่เก็บ";
$lang["config_stock_location_duplicate"] = "";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "จำเป็นต้องระบุสถานที่เก็บ";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "รวมภาษีแล้ว";
$lang["config_thousands_separator"] = "ตัวคั่นหลักพัน";
$lang["config_timezone"] = "โซนเวลา";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Mağaza Yeri";
$lang["config_stock_location_duplicate"] = "Please use an unique location name";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "Mağaza Yeri numarası zorunlu alandır";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Tax Included";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Saat Dilimi";

View File

@@ -111,6 +111,7 @@ $lang["config_stock_location"] = "Stock location";
$lang["config_stock_location_duplicate"] = "Please use an unique location name";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "Stock location number is a required field";
$lang["config_takings_printer"] = "Takings Printer";
$lang["config_tax_included"] = "Tax Included";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "時區";

View File

@@ -101,32 +101,37 @@ echo form_open('config/save_receipt/',array('id'=>'receipt_config_form'));
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('config_receipt_printer').':', 'config_receipt_printer',array('class'=>'wide')); ?>
<div class='form_field'>
<?php echo form_dropdown(
'receipt_printer',
array(),
'','id="receipt_printer"');?>
<?php echo form_dropdown('receipt_printer', array(), ' ', 'id="receipt_printer" class="form-control"');?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('config_invoice_printer').':', 'config_invoice_printer',array('class'=>'wide')); ?>
<div class='form_field'>
<?php echo form_dropdown('invoice_printer', array(), ' ','id="invoice_printer"');?>
<?php echo form_dropdown('invoice_printer', array(), ' ', 'id="invoice_printer" class="form-control"');?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('config_takings_printer'), 'config_takings_printer', array('class'=>'wide required')); ?>
<div class='form_field'>
<?php echo form_dropdown('takings_printer', array(), ' ', 'id="takings_printer" class="form-control"');?>
</div>
</div>
<div class="field_row clearfix">
<?php echo form_label($this->lang->line('config_print_top_margin').':', 'print_top_margin',array('class'=>'wide required')); ?>
<div class='form_field'>
<?php echo form_input(array(
'type'=>'number',
'min'=>'0',
'max'=>'20',
'name'=>'print_top_margin',
'id'=>'print_top_margin',
'value'=>$this->config->item('print_top_margin')));?>
px
</div>
<?php echo form_label($this->lang->line('config_print_top_margin').':', 'print_top_margin',array('class'=>'wide required')); ?>
<div class='form_field'>
<?php echo form_input(array(
'type'=>'number',
'min'=>'0',
'max'=>'20',
'name'=>'print_top_margin',
'id'=>'print_top_margin',
'value'=>$this->config->item('print_top_margin')));?>
px
</div>
</div>
<div class="field_row clearfix">
@@ -202,7 +207,7 @@ $(document).ready(function()
if (window.localStorage && window.jsPrintSetup)
{
var printers = (jsPrintSetup.getPrintersList() && jsPrintSetup.getPrintersList().split(',')) || [];
$('#receipt_printer, #invoice_printer').each(function()
$('#receipt_printer, #invoice_printer, #takings_printer').each(function()
{
var $this = $(this)
$(printers).each(function(key, value)
@@ -218,8 +223,8 @@ $(document).ready(function()
}
else
{
$("input[id*='margin'], #print_footer, #print_header, #receipt_printer, #invoice_printer, #print_silently").prop('disabled', true);
$("#receipt_printer, #invoice_printer").each(function()
$("input[id*='margin'], #print_footer, #print_header, #receipt_printer, #invoice_printer, #takings_printer, #print_silently").prop('disabled', true);
$("#receipt_printer, #invoice_printer, #takings_printer").each(function()
{
$(this).append($('<option>', {value : 'na'}).text('N/A'));
});

View File

@@ -35,7 +35,7 @@
<!-- end js template tags -->
<?php else : ?>
<!-- start minjs template tags -->
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=140db8dad4" language="javascript"></script>
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=57439a28c7" language="javascript"></script>
<!-- end minjs template tags -->
<?php endif; ?>

View File

@@ -1,11 +1,8 @@
<?php if ($print_after_sale)
{
?>
<script type="text/javascript">
$(window).load(function()
function printdoc()
{
// receipt layout sanity check
if ( $("#receipt_items, #items").length > 0)
if ( $("#receipt_items, #items, #table_holder").length > 0)
{
// install firefox addon in order to use this plugin
if (window.jsPrintSetup)
@@ -19,19 +16,19 @@ $(window).load(function()
<?php if (!$this->Appconfig->get('print_header'))
{
?>
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
<?php
}
if (!$this->Appconfig->get('print_footer'))
{
?>
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
<?php
}
?>
@@ -50,8 +47,8 @@ $(window).load(function()
<?php if (!$this->Appconfig->get('print_silently'))
{
?>
// Suppress print dialog (for this context only)
jsPrintSetup.setOption('printSilent', 1);
// Suppress print dialog (for this context only)
jsPrintSetup.setOption('printSilent', 1);
<?php
}
?>
@@ -61,15 +58,24 @@ $(window).load(function()
jsPrintSetup.print();
}
}
}
else
{
window.print();
}
}
});
</script>
}
<?php
if($print_after_sale)
{
?>
$(window).load(function()
{
// executes when complete page is fully loaded, including all frames, objects and images
printdoc();
});
<?php
}
?>
?>
</script>

View File

@@ -2,36 +2,48 @@
<?php
if (isset($error_message))
{
echo '<h1 style="text-align: center;">'.$error_message.'</h1>';
echo "<div class='alert alert-dismissible alert-danger'>".$error_message."</div>";
exit;
}
?>
<?php $this->load->view('partial/print_receipt', array('print_after_sale', $print_after_sale,
'selected_printer' => 'invoice_printer')); ?>
<?php $this->load->view('partial/print_receipt', array('print_after_sale'=>$print_after_sale, 'selected_printer'=>'invoice_printer')); ?>
<div class="print_hide" id="control_buttons" style="height: 40px; margin-right: -150px; margin-top: 10px;">
<?php echo anchor("javascript:printdoc();", "<div class='big_button float_right'><span>".$this->lang->line('common_print')."</span></div>",
array('id'=>'show_print_button')); ?>
<?php /* this line will allow to print and go back to sales automatically.... echo anchor("sales", $this->lang->line('common_print'), array('class'=>'big_button', 'id'=>'show_print_button', 'onclick'=>'window.print();')); */ ?>
<?php echo anchor("sales", "<div class='big_button float_right'><span>".$this->lang->line('sales_register')."</span></div>",
array('id'=>'show_sales_button')); ?>
<?php echo anchor("sales/manage", "<div class='big_button float_right'><span>".$this->lang->line('sales_takings')."</span></div>",
array('id'=>'show_takings_button')); ?>
</div>
<div id="page-wrap">
<div id="header"><?php echo $this->lang->line('sales_invoice'); ?></div>
<div id="block1">
<div id="customer-title"><?php if(isset($customer))
{
?>
<textarea id="customer" rows="5" cols="6"><?=$customer_info ?></textarea>
<?php
}
?></div>
<div id="customer-title">
<?php
if(isset($customer))
{
?>
<textarea id="customer" rows="5" cols="6"><?php echo $customer_info ?></textarea>
<?php
}
?>
</div>
<div id="logo">
<?php if ($this->Appconfig->get('company_logo') == '')
{
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<?php
}
else
{
?>
<img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" />
<img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" />
<?php
}
?>
@@ -39,6 +51,7 @@ if (isset($error_message))
</div>
<div class="clearfix"></div>
<div id="block2">
<textarea id="company-title" rows="5" cols="35"><?php echo $company_info ?></textarea>
<table id="meta">
@@ -50,26 +63,23 @@ if (isset($error_message))
<td class="meta-head"><?php echo $this->lang->line('common_date'); ?></td>
<td><textarea rows="5" cols="6"><?php echo $transaction_date; ?></textarea></td>
</tr>
<tr>
<td class="meta-head"><?php echo $this->lang->line('sales_amount_due'); ?></td>
<td><textarea rows="5" cols="6"><?php echo to_currency($total); ?></textarea></td>
</tr>
</table>
</div>
<table id="items">
<tr>
<th><?php echo $this->lang->line('sales_item_number'); ?></th>
<th><?php echo $this->lang->line('sales_item_name'); ?></th>
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
<th><?php echo $this->lang->line('sales_price'); ?></th>
<th><?php echo $this->lang->line('sales_discount'); ?></th>
<th><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
<tr>
<th><?php echo $this->lang->line('sales_item_number'); ?></th>
<th><?php echo $this->lang->line('sales_item_name'); ?></th>
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
<th><?php echo $this->lang->line('sales_price'); ?></th>
<th><?php echo $this->lang->line('sales_discount'); ?></th>
<th><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
foreach($cart as $line=>$item)
{
?>
@@ -87,24 +97,28 @@ if (isset($error_message))
<tr>
<td class="blank" colspan="6" align="center"><?php echo '&nbsp;'; ?></td>
</tr>
<tr>
<td colspan="3" class="blank-bottom"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $this->lang->line('sales_sub_total'); ?></textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="subtotal"><?php echo to_currency($tax_exclusive_subtotal); ?></textarea></td>
</tr>
<?php foreach($taxes as $name=>$value) { ?>
<tr>
<td colspan="3" class="blank"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $name; ?>:</textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="taxes"><?php echo to_currency($value); ?></textarea></td>
</tr>
<?php }; ?>
<tr>
<td colspan="3" class="blank"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $this->lang->line('sales_total'); ?></textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="total"><?php echo to_currency($total); ?></textarea></td>
</tr>
<tr>
<td colspan="3" class="blank-bottom"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $this->lang->line('sales_sub_total'); ?></textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="subtotal"><?php echo to_currency($tax_exclusive_subtotal); ?></textarea></td>
</tr>
<?php
foreach($taxes as $name=>$value)
{
?>
<tr>
<td colspan="3" class="blank"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $name; ?>:</textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="taxes"><?php echo to_currency($value); ?></textarea></td>
</tr>
<?php
}
?>
<tr>
<td colspan="3" class="blank"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $this->lang->line('sales_total'); ?></textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="total"><?php echo to_currency($total); ?></textarea></td>
</tr>
</table>
<div id="terms">
@@ -131,19 +145,19 @@ $(window).load(function()
<?php if (!$this->Appconfig->get('print_header'))
{
?>
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
<?php
}
if (!$this->Appconfig->get('print_footer'))
{
?>
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
<?php
}
?>

View File

@@ -1,15 +1,15 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/invoice_email.css"/>
</head>
<body>
<?php
if (isset($error_message))
{
echo '<h1 style="text-align: center;">'.$error_message.'</h1>';
echo "<div class='alert alert-dismissible alert-danger'>".$error_message."</div>";
exit;
}
?>
@@ -22,13 +22,13 @@ if (isset($error_message))
<?php if ($this->Appconfig->get('company_logo') == '')
{
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<?php
}
else
{
?>
<img id="image" src="<?php echo $image_prefix. 'uploads/' . $this->config->item('company_logo'); ?>" alt="company_logo" />
<img id="image" src="<?php echo $image_prefix. 'uploads/' . $this->config->item('company_logo'); ?>" alt="company_logo" />
<?php
}
?>

View File

@@ -167,15 +167,17 @@ function init_table_sorting()
}
</script>
<?php $this->load->view('partial/print_receipt', array('print_after_sale'=>false, 'selected_printer'=>'takings_printer')); ?>
<div id="title_bar">
<div id="title" class="float_left"><?php echo $this->lang->line('common_list_of').' '.$this->lang->line('sales_receipt_number'); ?></div>
<div id="print_button" class="print_hide">
<a href="javascript:window.print()"><div class='big_button' style='float: left;'><span><?php echo $this->lang->line('common_print'); ?></span></div></a>
</div>
<div id="new_button"><a href="javascript:printdoc()"><div class="big_button print_hide float_right" ><span><?php echo $this->lang->line('common_print'); ?></span></div></a></div>
</div>
<div id="pagination"><?= $links ?></div>
<div class="print_hide" id="titleTextImg" style="background-color:#EEEEEE;height:30px;position:relative;">
<div style="float:left;vertical-align:text-top;"><?php echo $this->lang->line('common_search_options'). ': '; ?></div>
<div class="print_hide" id="pagination"><?php echo $links; ?></div>
<div class="print_hide" id="titleTextImg">
<div style="float:left; vertical-align:text-top;"><?php echo $this->lang->line('common_search_options') . ': '; ?></div>
<a id="imageDivLink" href="javascript:show_hide_search_filter('search_filter_section', 'imageDivLink');" style="outline:none;">
<img src="<?php echo base_url().'images/plus.png'; ?>" style="border:0;outline:none;padding:0px;margin:0px;position:relative;top:-5px;"></a>
</div>
@@ -213,4 +215,4 @@ function init_table_sorting()
</div>
<div id="feedback_bar"></div>
<?php $this->load->view("partial/footer"); ?>
<?php $this->load->view("partial/footer"); ?>

View File

@@ -1,27 +1,38 @@
<?php $this->load->view("partial/header"); ?>
<?php $this->load->view('partial/print_receipt', array('print_after_sale', $print_after_sale,
'selected_printer' => 'receipt_printer')); ?>
<?php
if (isset($error_message))
{
echo '<h1 style="text-align: center;">'.$error_message.'</h1>';
echo "<div class='alert alert-dismissible alert-danger'>".$error_message."</div>";
exit;
}
?>
<?php $this->load->view('partial/print_receipt', array('print_after_sale'=>$print_after_sale, 'selected_printer'=>'receipt_printer')); ?>
<div class="print_hide" id="control_buttons" style="height: 60px; margin-right: -150px; margin-top: 10px;">
<?php echo anchor("javascript:printdoc();", "<div class='big_button float_right'><span>".$this->lang->line('common_print')."</span></div>",
array('id'=>'show_print_button')); ?>
<?php /* this line will allow to print and go back to sales automatically.... echo anchor("sales", $this->lang->line('common_print'), array('class'=>'big_button', 'id'=>'show_print_button', 'onclick'=>'window.print();')); */ ?>
<?php echo anchor("sales", "<div class='big_button float_right'><span>".$this->lang->line('sales_register')."</span></div>",
array('id'=>'show_sales_button')); ?>
<?php echo anchor("sales/manage", "<div class='big_button float_right'><span>".$this->lang->line('sales_takings')."</span></div>",
array('id'=>'show_takings_button')); ?>
</div>
<div id="receipt_wrapper">
<div id="receipt_header">
<?php if ($this->Appconfig->get('company_logo') == '')
<?php
if ($this->Appconfig->get('company_logo') == '')
{
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<?php
}
else
{
?>
<div id="company_name"><img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" /></div>
<div id="company_name"><img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" /></div>
<?php
}
?>
@@ -31,135 +42,162 @@ if (isset($error_message))
<div id="sale_time"><?php echo $transaction_time ?></div>
</div>
<div id="receipt_general_info">
<?php if(isset($customer))
<?php
if(isset($customer))
{
?>
<div id="customer"><?php echo $this->lang->line('customers_customer').": ".$customer; ?></div>
<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))
<?php
if (!empty($invoice_number))
{
?>
<div id="invoice_number"><?php echo $this->lang->line('recvs_invoice_number').": ".$invoice_number; ?></div>
<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: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><span class='long_name'> <?php echo ucfirst($item['name']); ?></span></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php
echo $item['quantity'] . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : "");
?></td>
<td><div class="total-value"><?php echo to_currency($item[($this->Appconfig->get('show_total_discount') ? 'total' : 'discounted_total')]); ?></div></td>
<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>
<tr>
<td colspan="2"><?php echo $item['description']; ?></td>
<td ><?php echo $item['serialnumber']; ?></td>
</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 endif; ?>
<?php
}
?>
<?php
foreach(array_reverse($cart, true) as $line=>$item)
{
?>
<tr>
<td><span class='long_name'><?php echo ucfirst($item['name']); ?></span></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo $item['quantity'] . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : ""); ?></td>
<td><div class="total-value"><?php echo to_currency($item[($this->Appconfig->get('show_total_discount') ? 'total' : 'discounted_total')]); ?></div></td>
</tr>
<tr>
<td colspan="2"><?php echo $item['description']; ?></td>
<td><?php echo $item['serialnumber']; ?></td>
</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('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 endif; ?>
<?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) { ?>
<?php
if ($this->Appconfig->get('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>
<td colspan="3" class="total-value"><?php echo $name; ?>:</td>
<td class="total-value"><?php echo to_currency($value); ?></td>
</tr>
<?php }; ?>
<?php endif; ?>
<tr>
</tr>
<?php $border = (!$this->Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('show_total_discount') && $discount > 0)); ?>
<tr>
<td colspan="3" style='<?php echo $border? 'border-top: 2px solid black;' :''; ?>text-align:right;'><?php echo $this->lang->line('sales_total'); ?></td>
<td style='<?php echo $border? 'border-top: 2px solid black;' :''; ?>text-align:right'><?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');
?>
<?php $border = (!$this->Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('show_total_discount') && $discount > 0)); ?>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $splitpayment[0]; ?> </td>
<td><div class="total-value"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?></div></td>
</tr>
<?php
}
?>
<td colspan="3" style='<?php echo $border? 'border-top: 2px solid black;' :''; ?>text-align:right;'><?php echo $this->lang->line('sales_total'); ?></td>
<td style='<?php echo $border? 'border-top: 2px solid black;' :''; ?>text-align:right'><?php echo to_currency($total); ?></td>
</tr>
<tr><td colspan="4">&nbsp;</td></tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<?php
if (isset($cur_giftcard_value) && $show_giftcard_remainder)
{
?>
<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><div class="total-value"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?></div></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 style='text-align:right'><?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 style='text-align:right'><?php echo to_currency($amount_change); ?></td>
</tr>
<td style='text-align:right'><?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 style='text-align:right'><?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"); ?>

View File

@@ -6,6 +6,7 @@
<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))
{
@@ -19,74 +20,73 @@
</div>
<table id="receipt_items">
<tr>
<th style="width:25%;"><?php echo $this->lang->line('sales_item_number'); ?></th>
<th style="width:25%;"><?php echo $this->lang->line('items_item'); ?></th>
<th style="width:17%;"><?php echo $this->lang->line('common_price'); ?></th>
<th style="width:16%;text-align:center;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th style="width:16%;text-align:center;"><?php echo $this->lang->line('sales_discount'); ?></th>
<th style="width:17%;text-align:right;"><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
foreach(array_reverse($cart, true) as $line=>$item)
{
?>
<tr>
<td><?php echo $item['item_number']; ?></td>
<td><span class='long_name'><?php echo $item['name']; ?></span><span class='short_name'><?php echo character_limiter($item['name'],10); ?></span></td>
<td><?php echo to_currency($item['price']); ?></td>
<td style='text-align:center;'><?php echo $item['quantity']; ?></td>
<td style='text-align:center;'><?php echo $item['discount']; ?></td>
<td style='text-align:right;'><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
<th style="width:25%;"><?php echo $this->lang->line('sales_item_number'); ?></th>
<th style="width:25%;"><?php echo $this->lang->line('items_item'); ?></th>
<th style="width:17%;"><?php echo $this->lang->line('common_price'); ?></th>
<th style="width:16%;text-align:center;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th style="width:16%;text-align:center;"><?php echo $this->lang->line('sales_discount'); ?></th>
<th style="width:17%;text-align:right;"><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
<?php
foreach(array_reverse($cart, true) as $line=>$item)
{
?>
<tr>
<td><?php echo $item['item_number']; ?></td>
<td><span class='long_name'><?php echo $item['name']; ?></span><span class='short_name'><?php echo character_limiter($item['name'],10); ?></span></td>
<td><?php echo to_currency($item['price']); ?></td>
<td style='text-align:center;'><?php echo $item['quantity']; ?></td>
<td style='text-align:center;'><?php echo $item['discount']; ?></td>
<td style='text-align:right;'><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
</tr>
<tr>
<td colspan="2" align="center"><?php echo $item['description']; ?></td>
<td colspan="2" ><?php echo $item['serialnumber']; ?></td>
<td colspan="2"><?php echo '&nbsp;'; ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td colspan="2" style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($subtotal); ?></td>
</tr>
<tr>
<td colspan="2" align="center"><?php echo $item['description']; ?></td>
<td colspan="2" ><?php echo $item['serialnumber']; ?></td>
<td colspan="2"><?php echo '&nbsp;'; ?></td>
</tr>
<?php foreach($taxes as $name=>$value) { ?>
<tr>
<td colspan="4" style='text-align:right;'><?php echo $name; ?>:</td>
<td colspan="2" style='text-align:right;'><?php echo to_currency($value); ?></td>
</tr>
<?php }; ?>
<?php
}
?>
<tr>
<td colspan="4" style='text-align:right;border-top:2px solid #000000;'><?php echo $this->lang->line('sales_sub_total'); ?></td>
<td colspan="2" style='text-align:right;border-top:2px solid #000000;'><?php echo to_currency($subtotal); ?></td>
</tr>
<?php foreach($taxes as $name=>$value) { ?>
<tr>
<td colspan="4" style='text-align:right;'><?php echo $name; ?>:</td>
<td colspan="2" style='text-align:right;'><?php echo to_currency($value); ?></td>
<td colspan="4" style='text-align:right;'><?php echo $this->lang->line('sales_total'); ?></td>
<td colspan="2" style='text-align:right'><?php echo to_currency($total); ?></td>
</tr>
<?php }; ?>
<tr>
<td colspan="4" style='text-align:right;'><?php echo $this->lang->line('sales_total'); ?></td>
<td colspan="2" style='text-align:right'><?php echo to_currency($total); ?></td>
</tr>
<tr><td colspan="6">&nbsp;</td></tr>
<tr><td colspan="6">&nbsp;</td></tr>
<?php
<?php
foreach($payments as $payment_id=>$payment)
{ ?>
{ ?>
<tr>
<td colspan="2" style="text-align:right;"><?php echo $this->lang->line('sales_payment'); ?></td>
<td colspan="2" style="text-align:right;"><?php $splitpayment=explode(':',$payment['payment_type']); echo $splitpayment[0]; ?> </td>
<td colspan="2" style="text-align:right"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?> </td>
</tr>
<?php
}
?>
<tr><td colspan="6">&nbsp;</td></tr>
<tr>
<td colspan="2" style="text-align:right;"><?php echo $this->lang->line('sales_payment'); ?></td>
<td colspan="2" style="text-align:right;"><?php $splitpayment=explode(':',$payment['payment_type']); echo $splitpayment[0]; ?> </td>
<td colspan="2" style="text-align:right"><?php echo to_currency( $payment['payment_amount'] * -1 ); ?> </td>
</tr>
<?php
}
?>
<tr><td colspan="6">&nbsp;</td></tr>
<tr>
<td colspan="4" style='text-align:right;'><?php echo $this->lang->line('sales_change_due'); ?></td>
<td colspan="2" style='text-align:right'><?php echo $amount_change; ?></td>
</tr>
<td colspan="4" style='text-align:right;'><?php echo $this->lang->line('sales_change_due'); ?></td>
<td colspan="2" style='text-align:right'><?php echo $amount_change; ?></td>
</tr>
</table>
<div id="sale_return_policy">

View File

File diff suppressed because one or more lines are too long

View File

@@ -110,6 +110,7 @@ config_stock_location,Lagerort,Stock locatie,Ubicación de Inventario,Stock loca
config_stock_location_duplicate,Bitte verwenden Sie einen eindeutigen Lagerort,Vul een unieke naam in,Por favor use un nombre de inventario único,Please use an unique location name,Please use an unique location name,Please use an unique location name,Please use an unique location name,,Please use an unique location name,Please use an unique location name
config_stock_location_invalid_chars,Der Lagerort kann keine Unterstriche enthalten,De bedrijfsnaam moet ingevuld worden,Nombre de la Ubicación de Inventario no debe contener '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_'
config_stock_location_required,Lagerort Nummer ist erforderlich,Naam van de stock locatie is een verplicht veld,Número de Ubicación de Inventario es requerido,Stock location number is a required field,Stock location number is a required field,Stock location number is a required field,Stock location number is a required field,จำเป็นต้องระบุสถานที่เก็บ,Mağaza Yeri numarası zorunlu alandır,Stock location number is a required field
config_takings_printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer
config_tax_included,MWSt inbegriffen,VAT Inbegrepen,Impuestos incluidos,Tax Included,Tax Included,Tax Included,Tax Included,รวมภาษีแล้ว,Tax Included,Dikenakan Pajak
config_thousands_separator,Tausendertrennzeichen,Thousands Separator,Separador de miles,Thousands Separator,Thousands Separator,Thousands Separator,Thousands Separator,ตัวคั่นหลักพัน,Thousands Separator,Pemisah Ribuan
config_timezone,Zeitzone,Tijdzone,Zona Horaria,Timezone,Fuseau Horaire,時區,Часовой пояс,โซนเวลา,Saat Dilimi,Zona Waktu
1 label de-CH nl-BE es en fr zh ru th tr id
110 config_stock_location_duplicate Bitte verwenden Sie einen eindeutigen Lagerort Vul een unieke naam in Por favor use un nombre de inventario único Please use an unique location name Please use an unique location name Please use an unique location name Please use an unique location name Please use an unique location name Please use an unique location name
111 config_stock_location_invalid_chars Der Lagerort kann keine Unterstriche enthalten De bedrijfsnaam moet ingevuld worden Nombre de la Ubicación de Inventario no debe contener '_' The stock location name can not contain '_' The stock location name can not contain '_' The stock location name can not contain '_' The stock location name can not contain '_' The stock location name can not contain '_' The stock location name can not contain '_' The stock location name can not contain '_'
112 config_stock_location_required Lagerort Nummer ist erforderlich Naam van de stock locatie is een verplicht veld Número de Ubicación de Inventario es requerido Stock location number is a required field Stock location number is a required field Stock location number is a required field Stock location number is a required field จำเป็นต้องระบุสถานที่เก็บ Mağaza Yeri numarası zorunlu alandır Stock location number is a required field
113 config_takings_printer Takings Printer Takings Printer Takings Printer Takings Printer Takings Printer Takings Printer Takings Printer Takings Printer Takings Printer Takings Printer
114 config_tax_included MWSt inbegriffen VAT Inbegrepen Impuestos incluidos Tax Included Tax Included Tax Included Tax Included รวมภาษีแล้ว Tax Included Dikenakan Pajak
115 config_thousands_separator Tausendertrennzeichen Thousands Separator Separador de miles Thousands Separator Thousands Separator Thousands Separator Thousands Separator ตัวคั่นหลักพัน Thousands Separator Pemisah Ribuan
116 config_timezone Zeitzone Tijdzone Zona Horaria Timezone Fuseau Horaire 時區 Часовой пояс โซนเวลา Saat Dilimi Zona Waktu