예제 #1
0
include_once $path_to_root . "/reporting/includes/reporting.inc";
include_once $path_to_root . "/taxes/tax_calc.inc";
$js = "";
if ($use_popup_windows) {
    $js .= get_js_open_window(900, 500);
}
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
if (isset($_GET['ModifyDelivery'])) {
    $_SESSION['page_title'] = sprintf(_("Modifying Delivery Note # %d."), $_GET['ModifyDelivery']);
    $help_context = "Modifying Delivery Note";
    processing_start();
} elseif (isset($_GET['OrderNumber'])) {
    $_SESSION['page_title'] = _($help_context = "Deliver Items for a Sales Order");
    processing_start();
}
page($_SESSION['page_title'], false, false, "", $js);
if (isset($_GET['AddedID'])) {
    $dispatch_no = $_GET['AddedID'];
    display_notification_centered(sprintf(_("Delivery # %d has been entered."), $dispatch_no));
    display_note(get_customer_trans_view_str(ST_CUSTDELIVERY, $dispatch_no, _("&View This Delivery")), 0, 1);
    display_note(print_document_link($dispatch_no, _("&Print Delivery Note"), true, ST_CUSTDELIVERY));
    display_note(print_document_link($dispatch_no, _("&Email Delivery Note"), true, ST_CUSTDELIVERY, false, "printlink", "", 1), 1, 1);
    display_note(print_document_link($dispatch_no, _("P&rint as Packing Slip"), true, ST_CUSTDELIVERY, false, "printlink", "", 0, 1));
    display_note(print_document_link($dispatch_no, _("E&mail as Packing Slip"), true, ST_CUSTDELIVERY, false, "printlink", "", 1, 1), 1);
    display_note(get_gl_view_str(13, $dispatch_no, _("View the GL Journal Entries for this Dispatch")), 1);
    hyperlink_params("{$path_to_root}/sales/customer_invoice.php", _("Invoice This Delivery"), "DeliveryNumber={$dispatch_no}");
    hyperlink_params("{$path_to_root}/sales/inquiry/sales_orders_view.php", _("Select Another Order For Dispatch"), "OutstandingOnly=1");
    display_footer_exit();
} elseif (isset($_GET['UpdatedID'])) {
예제 #2
0
function handle_new_credit($trans_no)
{
    processing_start();
    $_SESSION['Items'] = new Cart(11, $trans_no);
    copy_from_cn();
}
예제 #3
0
function create_cart($type, $trans_no)
{
    global $Refs;
    if (!$_SESSION['SysPrefs']->db_ok) {
        // create_cart is called before page() where the check is done
        return;
    }
    processing_start();
    if (isset($_GET['NewQuoteToSalesOrder'])) {
        $trans_no = $_GET['NewQuoteToSalesOrder'];
        $doc = new Cart(ST_SALESQUOTE, $trans_no, true);
        $doc->Comments = _("Sales Quotation") . " # " . $trans_no;
        $_SESSION['Items'] = $doc;
    } elseif ($type != ST_SALESORDER && $type != ST_SALESQUOTE && $trans_no != 0) {
        // this is template
        $doc = new Cart(ST_SALESORDER, array($trans_no));
        $doc->trans_type = $type;
        $doc->trans_no = 0;
        $doc->document_date = new_doc_date();
        if ($type == ST_SALESINVOICE) {
            $doc->due_date = get_invoice_duedate($doc->payment, $doc->document_date);
            $doc->pos = get_sales_point(user_pos());
        } else {
            $doc->due_date = $doc->document_date;
        }
        $doc->reference = $Refs->get_next($doc->trans_type);
        //$doc->Comments='';
        foreach ($doc->line_items as $line_no => $line) {
            $doc->line_items[$line_no]->qty_done = 0;
        }
        $_SESSION['Items'] = $doc;
    } else {
        $_SESSION['Items'] = new Cart($type, array($trans_no));
    }
    copy_from_cart();
}
예제 #4
0
function create_cart($type, $trans_no)
{
    processing_start();
    $doc_type = $type;
    if ($type != 30 && $trans_no != 0) {
        // this is template
        $doc_type = 30;
        $doc = new Cart(30, array($trans_no));
        $doc->trans_type = $type;
        $doc->trans_no = 0;
        if ($type == 10) {
            $doc->due_date = get_invoice_duedate($doc->customer_id, $doc->document_date);
        } else {
            $doc->due_date = $doc->document_date = Today();
        }
        $doc->reference = references::get_next($doc->trans_type);
        $doc->Comments = '';
        foreach ($doc->line_items as $line_no => $line) {
            $doc->line_items[$line_no]->qty_done = 0;
        }
        $_SESSION['Items'] = $doc;
    } else {
        $_SESSION['Items'] = new Cart($type, array($trans_no));
    }
    copy_from_cart();
}