X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sales%2Fsales_order_entry.php;h=ef35d2ba5019a1bb52f1d0bc7d408e790f0bb3ef;hb=6f354d9b19615a82d948e0f6e5ef003cd1859c31;hp=32e5c3b5f021862b96d7ac3911b11b22735cc1e5;hpb=5f06887dedd4d14701864fb72994d7e20352086d;p=fa-stable.git diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 32e5c3b5..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; } @@ -431,7 +451,7 @@ function check_item_data() global $SysPrefs; if(!get_post('stock_id_text', true)) { - display_error( _("Item description cnnot be empty.")); + display_error( _("Item description cannot be empty.")); set_focus('stock_id_edit'); return false; } @@ -653,7 +673,7 @@ $customer_error = display_order_header($_SESSION['Items'], ($_SESSION['Items']->any_already_delivered() == 0), $idate); if ($customer_error == "") { - start_table("$table_style width=80%", 10); + start_table(TABLESTYLE, "width=80%", 10); echo ""; display_order_summary($orderitems, $_SESSION['Items'], true); echo "";