Made an improment to the date picker. Shows the week number as well. Many delivery...
[fa-stable.git] / sales / customer_delivery.php
index eca3446868a64aa6cda2b774f445016d6a117204..db8a51b848de253c3e8e345adcffea5ff3a262cd 100644 (file)
@@ -121,6 +121,7 @@ if (isset($_GET['OrderNumber']) && $_GET['OrderNumber'] > 0) {
 
 } elseif(!check_num('ChargeFreightCost', 0))
        display_error(_("Freight cost cannot be less than zero"));
+       set_focus('ChargeFreightCost');
 
 
 //-----------------------------------------------------------------------------
@@ -129,27 +130,32 @@ function check_data()
 {
        if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) {
                display_error(_("The entered date of delivery is invalid."));
+               set_focus('DispatchDate');
                return false;
        }
 
        if (!is_date_in_fiscalyear($_POST['DispatchDate'])) {
                display_error(_("The entered date of delivery is not in fiscal year."));
+               set_focus('DispatchDate');
                return false;
        }
 
        if (!isset($_POST['due_date']) || !is_date($_POST['due_date'])) {
                display_error(_("The entered dead-line for invoice is invalid."));
+               set_focus('due_date');
                return false;
        }
 
        if ($_SESSION['Items']->trans_no==0) {
                if (!references::is_valid($_POST['ref'])) {
                        display_error(_("You must enter a reference."));
+                       set_focus('ref');
                        return false;
                }
 
                if ($_SESSION['Items']->trans_no==0 && !is_new_reference($_POST['ref'], 13)) {
                        display_error(_("The entered reference is already in use."));
+                       set_focus('ref');
                        return false;
                }
        }
@@ -159,6 +165,7 @@ function check_data()
 
        if (!check_num('ChargeFreightCost',0)) {
                display_error(_("The entered shipping value is not numeric."));
+               set_focus('ChargeFreightCost');
                return false;
        }
 
@@ -378,7 +385,7 @@ foreach ($_SESSION['Items']->line_items as $line=>$ln_itm) {
        label_cell($ln_itm->units);
        qty_cell($ln_itm->qty_done);
 
-       small_amount_cells(null, 'Line'.$line, qty_format($ln_itm->qty_dispatched));
+       small_qty_cells(null, 'Line'.$line, qty_format($ln_itm->qty_dispatched));
 
        $display_discount_percent = percent_format($ln_itm->discount_percent*100) . "%";