Changed layout of Direct GRN/Invoice form and check for supp ref in invoice
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 5 Sep 2010 15:48:12 +0000 (15:48 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 5 Sep 2010 15:48:12 +0000 (15:48 +0000)
CHANGELOG.txt
purchasing/po_entry_items.php

index e034b70816eda8b4102a682cd90eed2cee56600e..a15ec6c719b1dfba84c8ee8a4160f1df3ac1c09d 100644 (file)
@@ -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
index 278c5199507b2ca00b98f730663545954afb05e7..ce1d77973d43c3d4d59e34f03f81ac9df0ad298c 100644 (file)
@@ -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();
 //---------------------------------------------------------------------------------------------------