Item refresh fix for issue #42

Invoice number in email message are denoted with $INV
Sale id's in email message are denoted with POS $sale_id
This commit is contained in:
jekkos
2015-03-17 17:41:12 +01:00
parent cae9d3b67e
commit ca2c9a6ae4
4 changed files with 14 additions and 9 deletions

View File

@@ -36,6 +36,7 @@ class Items extends Secure_area implements iData_controller
function search()
{
$search = $this->input->post('search');
$this->item_lib->set_item_location($this->input->post('stock_location'));
$stock_location=$this->item_lib->get_item_location();
$data['search_section_state'] = $this->input->post('search_section_state');
$low_inventory=$this->input->post('low_inventory');

View File

@@ -354,9 +354,11 @@ class Sales extends Secure_area
$data['image_prefix']="";
$filename = $this->_invoice_email_pdf($data);
$this->email->attach($filename);
$message = $this->config->item('invoice_email_message');
$message = $this->_substitute_variables($message, $cust_info);
$this->email->message($message);
$text = $this->config->item('invoice_email_message');
$text = str_replace('$INV', $sale_data['invoice_number'], $text);
$text = str_replace('$CO', $sale_data['sale_id'], $text);
$text = $this->_substitute_customer($text, $cust_info);
$this->email->message($text);
}
else
{
@@ -404,7 +406,8 @@ class Sales extends Secure_area
function send_invoice($sale_id) {
$sale_data = $this->_load_sale_data($sale_id);
$text = $this->config->item('invoice_email_message');
$text = str_replace('$CO', $sale_data['invoice_number'], $text);
$text = str_replace('$INV', $sale_data['invoice_number'], $text);
$text = str_replace('$CO', $sale_data['sale_id'], $text);
$text = $this->_substitute_customer($text,(object) $sale_data);
$result = FALSE;
$message = $this->lang->line('sales_invoice_no_email');

View File

@@ -161,10 +161,11 @@ function show_hide_search_filter(search_filter_section, switchImgTag) {
<li class="float_left"><span><?php echo anchor("$controller_name/bulk_edit/width:$form_width",$this->lang->line("items_bulk_edit"),array('id'=>'bulk_edit','title'=>$this->lang->line('items_edit_multiple_items'))); ?></span></li>
<li class="float_left"><span><?php echo anchor("$controller_name/generate_barcodes",$this->lang->line("items_generate_barcodes"),array('id'=>'generate_barcodes', 'target' =>'_blank','title'=>$this->lang->line('items_generate_barcodes'))); ?></span></li>
<?php if (count($stock_locations) > 1): ?>
<li class="float_left"><span>
<?php echo form_open("$controller_name/refresh",array('id'=>'stock_filter_form')); ?>
<?php echo form_dropdown('stock_location',$stock_locations,$stock_location,'id="stock_location" onchange="$(\'#stock_filter_form\').submit();"'); ?>
</form></span></li>
<li class="float_left">
<span>
<?php echo form_dropdown('stock_location',$stock_locations,$stock_location,'id="stock_location" onchange="$(\'#search_form\').submit();"'); ?>
</span>
</li>
<?php endif; ?>
<li class="float_right">
<img src='<?php echo base_url()?>images/spinner_small.gif' alt='spinner' id='spinner' />

View File

@@ -57,7 +57,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('barcode_page_cellspacing', '20'),
('receipt_show_taxes', '0'),
('use_invoice_template', '1'),
('invoice_email_message', 'Dear $CU, In attachment the receipt for sale $CO'),
('invoice_email_message', 'Dear $CU, In attachment the receipt for sale $INV'),
('print_silently', '1'),
('print_header', '0'),
('print_footer', '0'),