mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-18 22:41:46 -04:00
Regenerate invoice number on sale unsuspend if no custom format is used (#423)
This commit is contained in:
1 parent
7f44d379f5
commit
d996ff29cb
1 file changed
+11
@@ -511,6 +511,13 @@ class Sales extends Secure_area
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
private function _is_custom_invoice_number($cust_info)
|
||||
{
|
||||
$invoice_number = $this->config->config['sales_invoice_format'];
|
||||
$invoice_number = $this->_substitute_variables($invoice_number, $cust_info);
|
||||
return $this->sale_lib->get_invoice_number() != $invoice_number;
|
||||
}
|
||||
|
||||
private function _substitute_variables($text, $cust_info)
|
||||
{
|
||||
@@ -791,6 +798,7 @@ class Sales extends Secure_area
|
||||
$data['amount_change'] = to_currency($this->sale_lib->get_amount_due() * -1);
|
||||
$data['employee'] = $emp_info->first_name.' '.$emp_info->last_name;
|
||||
|
||||
$cust_info = '';
|
||||
if($customer_id != -1)
|
||||
{
|
||||
$cust_info = $this->Customer->get_info($customer_id);
|
||||
@@ -804,6 +812,9 @@ class Sales extends Secure_area
|
||||
}
|
||||
}
|
||||
|
||||
$is_set = $this->_is_custom_invoice_number($cust_info);
|
||||
$invoice_number = $is_set ? $invoice_number : NULL;
|
||||
|
||||
$total_payments = 0;
|
||||
|
||||
foreach($data['payments'] as $payment)
|
||||
|
||||
Reference in new issue
Block a user