-function copy_from_so()
-{
- if ($_SESSION['Items']->direct_invoice)
- $_POST['InvoiceText'] = $_SESSION['Items']->memo_;
-
- $_POST['OrderDate'] = $_SESSION['Items']->orig_order_date;
- $_POST['delivery_date'] = $_SESSION['Items']->delivery_date;
- $_POST['cust_ref'] = $_SESSION['Items']->cust_ref;
- $_POST['freight_cost'] = $_SESSION['Items']->freight_cost;
- $_POST['Comments'] = $_SESSION['Items']->Comments;
-
- $_POST['deliver_to'] = $_SESSION['Items']->deliver_to;
- $_POST["delivery_address"] = $_SESSION['Items']->delivery_address;
- $_POST["phone"] = $_SESSION['Items']->phone;
- $_POST["Location"] = $_SESSION['Items']->Location;
- $_POST["ship_via"] = $_SESSION['Items']->ship_via;
+ hyperlink_params($path_to_root . "/sales/customer_invoice.php",
+ _("Make Invoice Against This Delivery"), "DeliveryNumber=$delivery");
+
+ if ((isset($_GET['Type']) && $_GET['Type'] == 1))
+ hyperlink_params("inquiry/sales_orders_view.php",
+ _("Enter a New Template Delivery"), "DeliveryTemplates=Yes");
+ else
+ hyperlink_params($_SERVER['PHP_SELF'], _("Enter a New Delivery"), "NewDelivery=0");
+
+ display_footer_exit();
+
+} elseif (isset($_GET['AddedDI'])) {
+ $invoice = $_GET['AddedDI'];
+ print_hidden_script(10);
+
+ display_notification_centered(sprintf(_("Invoice # %d has been entered."),$invoice));
+
+ display_note(get_trans_view_str(10, $invoice, _("View This Invoice")));
+ echo '<br>';
+ display_note(print_document_link($invoice, _("Print Sales Invoice"), true, 10));
+
+ if ((isset($_GET['Type']) && $_GET['Type'] == 1))
+ hyperlink_params("inquiry/sales_orders_view.php",
+ _("Enter a New Template Invoice"), "InvoiceTemplates=Yes");
+ else
+ hyperlink_params($_SERVER['PHP_SELF'], _("Enter a New Direct Invoice"), "NewInvoice=0");
+
+ display_footer_exit();