projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged changes from stable branch up to 2.3.12
[fa-stable.git]
/
sales
/
customer_invoice.php
diff --git
a/sales/customer_invoice.php
b/sales/customer_invoice.php
index 1a4959d9182e0236c37fc01e8c6ca2d4e95074ea..155120dfe19e36dc7788ebe42da1b08dc3f53217 100644
(file)
--- a/
sales/customer_invoice.php
+++ b/
sales/customer_invoice.php
@@
-333,12
+333,6
@@
function check_data()
set_focus('ref');
return false;
}
set_focus('ref');
return false;
}
-
- if (!is_new_reference($_POST['ref'], 10)) {
- display_error(_("The entered reference is already in use."));
- set_focus('ref');
- return false;
- }
}
if(!$prepaid)
}
if(!$prepaid)
@@
-374,19
+368,27
@@
function check_data()
//-----------------------------------------------------------------------------
if (isset($_POST['process_invoice']) && check_data()) {
//-----------------------------------------------------------------------------
if (isset($_POST['process_invoice']) && check_data()) {
-
$newinvoice= $_SESSION['Items']->trans_no == 0;
copy_to_cart();
$newinvoice= $_SESSION['Items']->trans_no == 0;
copy_to_cart();
- if ($newinvoice) new_doc_date($_SESSION['Items']->document_date);
+ if ($newinvoice)
+ new_doc_date($_SESSION['Items']->document_date);
$invoice_no = $_SESSION['Items']->write();
$invoice_no = $_SESSION['Items']->write();
- processing_end();
-
- if ($newinvoice) {
- meta_forward($_SERVER['PHP_SELF'], "AddedID=$invoice_no");
- } else {
- meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$invoice_no");
+ if ($invoice_no == -1)
+ {
+ display_error(_("The entered reference is already in use."));
+ set_focus('ref');
}
}
+ else
+ {
+ processing_end();
+
+ if ($newinvoice) {
+ meta_forward($_SERVER['PHP_SELF'], "AddedID=$invoice_no");
+ } else {
+ meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$invoice_no");
+ }
+ }
}
if(list_updated('payment')) {
}
if(list_updated('payment')) {