From f48f7c67ee23c35ab0c40a66779ec60450202c94 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 2 Feb 2010 01:09:35 +0000 Subject: [PATCH] Bug in direct invoice when cash sales and no cash account defined in sales pos. --- CHANGELOG.txt | 4 ++++ sales/sales_order_entry.php | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a00ca66a..6b6315c2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +02-Feb-2010 Joe Hunt +# Bug in direct invoice when cash sales and no cash account defined in sales pos. +$ /sales/sales_order_entry.php + 01-Feb-2010 Janusz Dobrowolski # Fixed error display hidden during ajax call in some situations $ /includes/errors.inc diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 5d0ea722..690b16e8 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -335,6 +335,7 @@ function can_process() { return false; } + if (strlen($_POST['delivery_address']) <= 1) { display_error( _("You should enter the street address in the box provided. Orders cannot be accepted without a valid street address.")); set_focus('delivery_address'); @@ -367,6 +368,14 @@ function can_process() { return false; } } + else + { + if (!db_has_cash_accounts()) + { + display_error(_("You need to define a cash account for your Sales Point.")); + return false; + } + } if (!$Refs->is_valid($_POST['ref'])) { display_error(_("You must enter a reference.")); set_focus('ref'); -- 2.30.2