Fixed cust_trans update on bank trans change.
[fa-stable.git] / gl / gl_bank.php
index 0b973784df34839aa13df3f6e6d5f689a3fe0570..5ed202e7c2c43814556ce38e039e3ec051300633 100644 (file)
@@ -249,6 +249,16 @@ if (isset($_POST['Process']))
                $input_error = 1;
        }
 
+       if (get_post('PayType')==PT_CUSTOMER && (!get_post('person_id') || !get_post('PersonDetailID'))) {
+               display_error(_("You have to select customer and customer branch."));
+               set_focus('person_id');
+               $input_error = 1;
+       } elseif (get_post('PayType')==PT_SUPPLIER && (!get_post('person_id'))) {
+               display_error(_("You have to select supplier."));
+               set_focus('person_id');
+               $input_error = 1;
+       }
+
        if ($input_error == 1)
                unset($_POST['Process']);
 }