[0004212] Work Order Entry: fixed error when voided WO refence is reused.
[fa-stable.git] / purchasing / supplier_invoice.php
index 73a3dfbcb5ff3980f2710bef0c8812227d8d0288..080e8fc36f3d52fadf8e22becda73dc00b3db55c 100644 (file)
@@ -27,10 +27,6 @@ if (user_use_date_picker())
        $js .= get_js_date_picker();
 //----------------------------------------------------------------------------------------
 
-check_db_has_suppliers(_("There are no suppliers defined in the system."));
-
-//--------------------------------------------------------------------------------------------------
-
 if (isset($_GET['New']))
 {
        if (isset( $_SESSION['supp_trans']))
@@ -54,6 +50,8 @@ page($_SESSION['page_title'], false, false, "", $js);
 if (isset($_GET['ModifyInvoice']))
        check_is_editable(ST_SUPPINVOICE, $_GET['ModifyInvoice']);
 
+check_db_has_suppliers(_("There are no suppliers defined in the system."));
+
 //---------------------------------------------------------------------------------------------------------------
 
 if (isset($_GET['AddedID'])) 
@@ -69,7 +67,7 @@ if (isset($_GET['AddedID']))
        display_note(get_gl_view_str($trans_type, $invoice_no, _("View the GL Journal Entries for this Invoice")), 1);
 
        hyperlink_params("$path_to_root/purchasing/supplier_payment.php", _("Entry supplier &payment for this invoice"),
-               "PInvoice=".$invoice_no);
+               "PInvoice=".$invoice_no."&trans_type=".$trans_type);
 
        hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another Invoice"), "New=1");