projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed confirmation on ajax reloaded buttons (small fix for Gecko like browsers).
[fa-stable.git]
/
sales
/
customer_invoice.php
diff --git
a/sales/customer_invoice.php
b/sales/customer_invoice.php
index 9c9e171bddd11612f00a90a3add294bb0939bd6b..b249948559332441319a3085620f5c5e09e20e90 100644
(file)
--- a/
sales/customer_invoice.php
+++ b/
sales/customer_invoice.php
@@
-281,12
+281,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 ($_POST['ChargeFreightCost'] == "") {
}
if ($_POST['ChargeFreightCost'] == "") {
@@
-314,19
+308,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')) {