Fixing bug in Sales Invoice and Sales Delivery when Cash Sales and document date...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 24 Mar 2019 17:02:00 +0000 (18:02 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 24 Mar 2019 17:02:00 +0000 (18:02 +0100)
sales/sales_order_entry.php

index 07f51d3bacaeb4890c7da93eea8b70ec9f5437e5..9d87d93558b59985ccdb8ab20c5b3a136f7a9036 100644 (file)
@@ -453,6 +453,9 @@ function can_process() {
                display_error("Invoice total amount cannot be less than zero.");
                return false;
        }
+
+       if ($_SESSION['Items']->payment_terms['cash_sale']) 
+               $_SESSION['Items']->due_date = $_SESSION['Items']->document_date;
        return true;
 }