+if (isset($_GET['ModifyCredit']))
+ check_is_editable(ST_SUPPINVOICE, $_GET['ModifyCredit']);
+
+//---------------------------------------------------------------------------------------------------
+
+if (isset($_GET['New']))
+{
+ if (isset( $_SESSION['supp_trans']))
+ {
+ unset ($_SESSION['supp_trans']->grn_items);
+ unset ($_SESSION['supp_trans']->gl_codes);
+ unset ($_SESSION['supp_trans']);
+ }
+
+ if (isset($_GET['invoice_no']))
+ {
+ $_SESSION['supp_trans'] = new supp_trans(ST_SUPPINVOICE, $_GET['invoice_no']);
+ $_SESSION['supp_trans']->src_docs = array( $_GET['invoice_no'] => $_SESSION['supp_trans']->supp_reference);
+
+
+ $_SESSION['supp_trans']->trans_type = ST_SUPPCREDIT;
+ $_SESSION['supp_trans']->trans_no = 0;
+ $_SESSION['supp_trans']->supp_reference = '';
+ $help_context = "Supplier Credit Note";
+ $_SESSION['page_title'] = _("Supplier Credit Note");
+
+ } else {
+ $help_context = "Supplier Credit Note";
+ $_SESSION['page_title'] = _("Supplier Credit Note");
+ $_SESSION['supp_trans'] = new supp_trans(ST_SUPPCREDIT);
+ }
+}
+page($_SESSION['page_title'], false, false, "", $js);
+