Skip to content

Commit 31fe885

Browse files
committed
Fixes a problem editing invoices.
1 parent d376ae8 commit 31fe885

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

bamboo_system_files/application/controllers/invoices.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ function _tax_info($data)
10001000
function _validation()
10011001
{
10021002
$rules['client_id'] = 'required|numeric';
1003-
$rules['invoice_number'] = 'trim|required|htmlspecialchars|max_length[12]|callback_validateInvoice';
1003+
$rules['invoice_number'] = 'trim|required|htmlspecialchars|max_length[12]|callback_validateUniqueInvoice';
10041004
$rules['dateIssued'] = 'trim|htmlspecialchars|callback_dateIssued';
10051005
$rules['invoice_note'] = 'trim|htmlspecialchars|max_length[2000]';
10061006
$rules['tax1_description'] = 'trim|htmlspecialchars|max_length[50]';
@@ -1049,13 +1049,20 @@ function _validation_edit()
10491049
$this->validation->set_error_delimiters('<span class="error">', '</span>');
10501050
}
10511051

1052-
function validateInvoice()
1052+
function validateUniqueInvoice()
10531053
{
10541054
$re = $this->uniqueInvoice();
10551055
if (! $re) {
10561056
return $re;
10571057
}
10581058

1059+
$re = $this->validateInvoice();
1060+
1061+
return $re;
1062+
}
1063+
1064+
function validateInvoice()
1065+
{
10591066
switch ($this->config->item('invoice_number_format')) {
10601067
case 'year_number':
10611068
$re = $this->validateInvoiceYearNumber();
@@ -1071,7 +1078,7 @@ function validateInvoice()
10711078

10721079
function uniqueInvoice()
10731080
{
1074-
$this->validation->set_message('validateInvoice', $this->lang->line('invoice_not_unique'));
1081+
$this->validation->set_message('validateUniqueInvoice', $this->lang->line('invoice_not_unique'));
10751082

10761083
return $this->invoices_model->uniqueInvoiceNumber($this->input->post('invoice_number'));
10771084
}

0 commit comments

Comments
 (0)