- if (!is_numeric($_POST['freight_cost'])) {
- display_error(_("The shipping cost entered is expected to be numeric."));
- return false;
- }
- if (!is_date($_POST['delivery_date'])) {
- display_error(_("The delivery date is invalid."));
- return false;
- }
- if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) {
- display_error(_("The requested delivery date is before the date of the order."));
- return false;
+ if (strlen($_POST['delivery_address']) <= 1) {
+ display_error( _("You should enter the street address in the box provided. Orders cannot be accepted without a valid street address."));
+ set_focus('delivery_address');
+ return false;
+ }
+
+ if ($_POST['freight_cost'] == "")
+ $_POST['freight_cost'] = price_format(0);
+
+ if (!check_num('freight_cost',0)) {
+ display_error(_("The shipping cost entered is expected to be numeric."));
+ set_focus('freight_cost');
+ return false;
+ }
+ if (!is_date($_POST['delivery_date'])) {
+ if ($_SESSION['Items']->trans_type==ST_SALESQUOTE)
+ display_error(_("The Valid date is invalid."));
+ else
+ display_error(_("The delivery date is invalid."));
+ set_focus('delivery_date');
+ return false;
+ }
+ //if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) {
+ if (date1_greater_date2($_POST['OrderDate'], $_POST['delivery_date'])) {
+ if ($_SESSION['Items']->trans_type==ST_SALESQUOTE)
+ display_error(_("The requested valid date is before the date of the quotation."));
+ else
+ display_error(_("The requested delivery date is before the date of the order."));
+ set_focus('delivery_date');
+ return false;
+ }