From 660ba794f9fa27cf078dd70b7caab2d47211ae88 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sun, 5 Sep 2010 15:48:12 +0000 Subject: [PATCH] Changed layout of Direct GRN/Invoice form and check for supp ref in invoice --- CHANGELOG.txt | 2 ++ purchasing/po_entry_items.php | 27 +++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e034b708..a15ec6c7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,8 @@ $ -> Affected files $ version.php # Wrong stock item code when processing supplier invoice $ /purchasing/includes/db/invoice_db.inc +! Changed layout of Direct GRN/Invoice form and check for supp ref in invoice. +$ /purchasing/po_entry_items.php 04-Sep-2010 Joe Hunt # Fixed installed_extensions.php creation diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index 278c5199..ce1d7797 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -349,6 +349,12 @@ function can_commit() } } + if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE && !$Refs->is_valid(get_post('supp_ref'))) + { + display_error(_("You must enter a supplier's invoice reference.")); + set_focus('supp_ref'); + return false; + } if ($_SESSION['PO']->trans_type == ST_PURCHORDER && get_post('delivery_address') == '') { display_error(_("There is no delivery address specified.")); @@ -491,16 +497,29 @@ textarea_row(_("Memo:"), 'Comments', null, 70, 4); end_table(1); div_start('controls', 'items_table'); +$process_txt = _("Place Order"); +$update_txt = _("Update Order"); +$cancel_txt = _("Cancel Order"); +if ($_SESSION['PO']->trans_type == ST_SUPPRECEIVE) { + $process_txt = _("Process GRN"); + $update_txt = _("Update GRN"); + $cancel_txt = _("Cancel GRN"); +} +elseif ($_SESSION['PO']->trans_type == ST_SUPPINVOICE) { + $process_txt = _("Process Invoice"); + $update_txt = _("Update Invoice"); + $cancel_txt = _("Cancel Invoice"); +} if ($_SESSION['PO']->order_has_items()) { if ($_SESSION['PO']->order_no) - submit_center_first('Commit', _("Update Order"), '', 'default'); + submit_center_first('Commit', $update_txt, '', 'default'); else - submit_center_first('Commit', _("Place Order"), '', 'default'); - submit_center_last('CancelOrder', _("Cancel Order")); + submit_center_first('Commit', $process_txt, '', 'default'); + submit_center_last('CancelOrder', $cancel_txt); } else - submit_center('CancelOrder', _("Cancel Order"), true, false, 'cancel'); + submit_center('CancelOrder', $cancel_txt, true, false, 'cancel'); div_end(); //--------------------------------------------------------------------------------------------------- -- 2.30.2