X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_invoice.php;fp=sales%2Fcustomer_invoice.php;h=6a8e82bf041a1674f6f4afb2772613e769892e0a;hb=247a958cc67f9479eb746984b23a660ff9334563;hp=6f38b64d718b9ef7f0472af845839c0287a8738f;hpb=3539962a4e524de683d8c5e851c482ad99a97267;p=fa-stable.git diff --git a/sales/customer_invoice.php b/sales/customer_invoice.php index 6f38b64d..6a8e82bf 100644 --- a/sales/customer_invoice.php +++ b/sales/customer_invoice.php @@ -342,7 +342,7 @@ function check_data() return false; } } else { - if (($_SESSION['Items']->payment_terms['days_before_due'] < 0) && !count($_SESSION['Items']->prepayments)) { + if (($_SESSION['Items']->payment_terms['days_before_due'] == -1) && !count($_SESSION['Items']->prepayments)) { display_error(_("There is no non-invoiced payments for this order. If you want to issue final invoice, select delayed or cash payment terms.")); return false; } @@ -355,6 +355,7 @@ function check_data() if (isset($_POST['process_invoice']) && check_data()) { $newinvoice= $_SESSION['Items']->trans_no == 0; copy_to_cart(); + if ($newinvoice) new_doc_date($_SESSION['Items']->document_date);