From b8ca787d4997e98d29af963f9e23534796381c44 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sun, 24 Mar 2019 18:02:00 +0100 Subject: [PATCH] Fixing bug in Sales Invoice and Sales Delivery when Cash Sales and document date is earlier then todays date. Due date should be the same. --- sales/sales_order_entry.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 07f51d3b..9d87d935 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -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; } -- 2.30.2