Missing checks for customer/branch selection.
[fa-stable.git] / sales / sales_order_entry.php
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');