Missing checks for customer/branch selection.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 15 Mar 2010 18:04:38 +0000 (18:04 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 15 Mar 2010 18:04:38 +0000 (18:04 +0000)
sales/customer_payments.php
sales/sales_order_entry.php

index 7300450e29286299c9f9904d63c09bb2cd2905ca..939799f7dd2f46d8b148f73410fdcf25a773ce30 100644 (file)
@@ -78,6 +78,20 @@ function can_process()
 {
        global $Refs;
 
+       if (!get_post('customer_id')) 
+       {
+               display_error(_("There is no customer selected."));
+               set_focus('customer_id');
+               return false;
+       } 
+       
+       if (!get_post('BranchID')) 
+       {
+               display_error(_("This customer has no branch defined."));
+               set_focus('BranchID');
+               return false;
+       } 
+       
        if (!isset($_POST['DateBanked']) || !is_date($_POST['DateBanked'])) {
                display_error(_("The entered date is invalid. Please enter a valid date for the payment."));
                set_focus('DateBanked');
index 690b16e8c849be131365f796eba867d88b5ef471..6ca955d40ae9c7b0d38b10b3f81a793125338da7 100644 (file)
@@ -313,6 +313,20 @@ function line_start_focus() {
 function can_process() {
        global $Refs;
 
+       if (!get_post('customer_id')) 
+       {
+               display_error(_("There is no customer selected."));
+               set_focus('customer_id');
+               return false;
+       } 
+       
+       if (!get_post('branch_id')) 
+       {
+               display_error(_("This customer has no branch defined."));
+               set_focus('branch_id');
+               return false;
+       } 
+       
        if (!is_date($_POST['OrderDate'])) {
                display_error(_("The entered date is invalid."));
                set_focus('OrderDate');