Bug in direct invoice when cash sales and no cash account defined in sales pos.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 2 Feb 2010 01:09:35 +0000 (01:09 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 2 Feb 2010 01:09:35 +0000 (01:09 +0000)
CHANGELOG.txt
sales/sales_order_entry.php

index a00ca66a9ed3aabfcd59f962d503f09d47428423..6b6315c22abaea7a4862a4a9e5a3f39364fcc9cb 100644 (file)
@@ -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
index 5d0ea722364c71465b7c4c726660b983dbff850f..690b16e8c849be131365f796eba867d88b5ef471 100644 (file)
@@ -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');