X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fsales_order_entry.php;h=ef35d2ba5019a1bb52f1d0bc7d408e790f0bb3ef;hb=c356acfd88575bc518efdb9fb77e0a6b6c645eec;hp=5f6da084bc25864f55c9c75bd71f95cf9fb70530;hpb=d9b4de9d7e9d3ba77f6ece752fd6cc988effd8f1;p=fa-stable.git diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 5f6da084..ef35d2ba 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -317,6 +317,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'); @@ -385,6 +399,12 @@ function can_process() { set_focus('ref'); return false; } + if ($_SESSION['Items']->trans_no==0 && !is_new_reference($_POST['ref'], + $_SESSION['Items']->trans_type)) { + display_error(_("The entered reference is already in use.")); + set_focus('ref'); + return false; + } return true; }