X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_invoice.php;h=24aff0759561ccbbad6fc1b57a5119ece3e2d2b2;hb=205935c5416cca6417c06ba77b300752de1753f5;hp=b4a83c48a3948506d95c3b63363a07535c372d41;hpb=431531eebf3ba494002cfbf7ea36f9e82d4975c0;p=fa-stable.git diff --git a/purchasing/supplier_invoice.php b/purchasing/supplier_invoice.php index b4a83c48..24aff075 100644 --- a/purchasing/supplier_invoice.php +++ b/purchasing/supplier_invoice.php @@ -23,6 +23,18 @@ page(_("Enter Supplier Invoice"), false, false, "", $js); check_db_has_suppliers(_("There are no suppliers defined in the system.")); +//--------------------------------------------------------------------------------------------------------------- +if ($ret = context_restore()) { + // return from supplier editor + copy_from_trans($_SESSION['supp_trans']); + if(isset($ret['supplier_id'])) + $_POST['supplier_id'] = $ret['supplier_id']; +} +if (isset($_POST['_supplier_id_editor'])) { + copy_to_trans($_SESSION['supp_trans']); + context_call($path_to_root.'/purchasing/manage/suppliers.php?supplier_id='.$_POST['supplier_id'], 'supp_trans'); +} + //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) @@ -72,34 +84,40 @@ function check_data() if (!references::is_valid($_SESSION['supp_trans']->reference)) { display_error(_("You must enter an invoice reference.")); + set_focus('reference'); return false; } if (!is_new_reference($_SESSION['supp_trans']->reference, 20)) { 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 invoice reference.")); + set_focus('supp_reference'); return false; } if (!is_date( $_SESSION['supp_trans']->tran_date)) { display_error(_("The invoice as entered cannot be processed because the invoice date is in an incorrect format.")); + set_focus('trans_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('trans_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; } @@ -150,25 +168,27 @@ echo ""; // outer table echo "
"; invoice_header($_SESSION['supp_trans']); +if ($_POST['supplier_id']=='') + display_error('No supplier found for entered search text'); +else { + echo ""; // outer table -echo ""; // outer table + echo "
"; -echo "
"; - -display_grn_items($_SESSION['supp_trans']); + display_grn_items($_SESSION['supp_trans']); -display_gl_items($_SESSION['supp_trans']); - -//echo ""; // outer table -echo "
"; -invoice_totals($_SESSION['supp_trans']); + display_gl_items($_SESSION['supp_trans']); + //echo ""; // outer table + echo "
"; + invoice_totals($_SESSION['supp_trans']); +} echo ""; end_table(); // outer table echo "
"; -submit_center('PostInvoice', _("Enter Invoice")); +submit_center('PostInvoice', _("Enter Invoice"), true, '', true); echo "
"; end_form();