File tree 1 file changed +10
-3
lines changed
bamboo_system_files/application/controllers
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1000,7 +1000,7 @@ function _tax_info($data)
1000
1000
function _validation ()
1001
1001
{
1002
1002
$ 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 ' ;
1004
1004
$ rules ['dateIssued ' ] = 'trim|htmlspecialchars|callback_dateIssued ' ;
1005
1005
$ rules ['invoice_note ' ] = 'trim|htmlspecialchars|max_length[2000] ' ;
1006
1006
$ rules ['tax1_description ' ] = 'trim|htmlspecialchars|max_length[50] ' ;
@@ -1049,13 +1049,20 @@ function _validation_edit()
1049
1049
$ this ->validation ->set_error_delimiters ('<span class="error"> ' , '</span> ' );
1050
1050
}
1051
1051
1052
- function validateInvoice ()
1052
+ function validateUniqueInvoice ()
1053
1053
{
1054
1054
$ re = $ this ->uniqueInvoice ();
1055
1055
if (! $ re ) {
1056
1056
return $ re ;
1057
1057
}
1058
1058
1059
+ $ re = $ this ->validateInvoice ();
1060
+
1061
+ return $ re ;
1062
+ }
1063
+
1064
+ function validateInvoice ()
1065
+ {
1059
1066
switch ($ this ->config ->item ('invoice_number_format ' )) {
1060
1067
case 'year_number ' :
1061
1068
$ re = $ this ->validateInvoiceYearNumber ();
@@ -1071,7 +1078,7 @@ function validateInvoice()
1071
1078
1072
1079
function uniqueInvoice ()
1073
1080
{
1074
- $ this ->validation ->set_message ('validateInvoice ' , $ this ->lang ->line ('invoice_not_unique ' ));
1081
+ $ this ->validation ->set_message ('validateUniqueInvoice ' , $ this ->lang ->line ('invoice_not_unique ' ));
1075
1082
1076
1083
return $ this ->invoices_model ->uniqueInvoiceNumber ($ this ->input ->post ('invoice_number ' ));
1077
1084
}
You can’t perform that action at this time.
0 commit comments