X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_credit.php;h=c16211be0771282ba03f4710d367cc7c96739e19;hb=6183e9450dcd7e4c747889c10903f6ff1b0add33;hp=af63044b64f211062dc3caba03c7a1cc966fcba3;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/purchasing/supplier_credit.php b/purchasing/supplier_credit.php index af63044b..c16211be 100644 --- a/purchasing/supplier_credit.php +++ b/purchasing/supplier_credit.php @@ -2,11 +2,11 @@ $path_to_root=".."; -include($path_to_root . "/purchasing/includes/supp_trans_class.inc"); +include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc"); $page_security=5; -include($path_to_root . "/includes/session.inc"); +include_once($path_to_root . "/includes/session.inc"); include_once($path_to_root . "/includes/data_checks.inc"); @@ -15,6 +15,8 @@ include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc"); $js = ""; if ($use_popup_windows) $js .= get_js_open_window(900, 500); +if ($use_date_picker) + $js .= get_js_date_picker(); page(_("Supplier Credit Note"), false, false, "", $js); //---------------------------------------------------------------------------------------- @@ -64,40 +66,47 @@ function check_data() if (!$_SESSION['supp_trans']->is_valid_trans_to_post()) { display_error(_("The credit note cannot be processed because the there are no items or values on the invoice. Credit notes are expected to have a charge.")); + set_focus(''); return false; } if (!references::is_valid($_SESSION['supp_trans']->reference)) { display_error(_("You must enter an credit note reference.")); + set_focus('reference'); return false; } if (!is_new_reference($_SESSION['supp_trans']->reference, 21)) { display_error(_("The entered reference is already in use.")); + set_focus('reference'); return false; } if (!references::is_valid($_SESSION['supp_trans']->supp_reference)) { display_error(_("You must enter a supplier's credit note reference.")); + set_focus('supp_reference'); return false; } if (!is_date($_SESSION['supp_trans']->tran_date)) { display_error(_("The credit note as entered cannot be processed because the date entered is not valid.")); + set_focus('tran_date'); return false; } elseif (!is_date_in_fiscalyear($_SESSION['supp_trans']->tran_date)) { display_error(_("The entered date is not in fiscal year.")); + set_focus('tran_date'); return false; } if (!is_date( $_SESSION['supp_trans']->due_date)) { display_error(_("The invoice as entered cannot be processed because the due date is in an incorrect format.")); + set_focus('due_date'); return false; }