display_note(get_gl_view_str($trans_type, $invoice_no, _("View the GL Journal Entries for this Invoice")), 1);
- hyperlink_no_params("$path_to_root/purchasing/supplier_payment.php", _("Entry supplier &payment for this invoice"));
+ hyperlink_params("$path_to_root/purchasing/supplier_payment.php", _("Entry supplier &payment for this invoice"),
+ "PInvoice=".$invoice_no);
hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another Invoice"), "New=1");
hyperlink_params("$path_to_root/sales/inquiry/sales_deliveries_view.php", _("Select Another &Delivery For Invoicing"), "OutstandingOnly=1");
+ $sql = "SELECT trans_type_from, trans_no_from FROM ".TB_PREF."cust_allocations
+ WHERE trans_type_to=".ST_SALESINVOICE." AND trans_no_to=".db_escape($invoice_no);
+ $result = db_query($sql, "could not retrieve customer allocation");
+ $row = db_fetch($result);
+
+ if ($row === false)
+ hyperlink_params("$path_to_root/sales/customer_payments.php", _("Entry &customer payment for this invoice"),
+ "SInvoice=".$invoice_no);
+
hyperlink_params("$path_to_root/admin/attachments.php", _("Add an Attachment"), "filterType=$trans_type&trans_no=$invoice_no");
display_footer_exit();
submenu_option(_("Enter a &New Direct Invoice"),
"/sales/sales_order_entry.php?NewInvoice=0");
+ if ($row === false)
+ submenu_option(_("Entry &customer payment for this invoice"), "/sales/customer_payments.php?SInvoice=".$invoice);
+
submenu_option(_("Add an Attachment"), "/admin/attachments.php?filterType=".ST_SALESINVOICE."&trans_no=$invoice");
display_footer_exit();