X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fsales_order_entry.php;h=ef35d2ba5019a1bb52f1d0bc7d408e790f0bb3ef;hb=29e68a1b8dcbe7c7ecb797396945e0cccf2d6cd8;hp=9e5a04adadd6e100a5f5084fb9a6ffc2fc3008ec;hpb=d41acb96ebe5af239746f7aedd917740564f8b3c;p=fa-stable.git diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 9e5a04ad..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; } @@ -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 "";