function input_num($postname = null, $dflt = 0)
 {
     if (!isset($_POST[$postname]) || $_POST[$postname] == "") {
         return $dflt;
     }
     return user_numeric($_POST[$postname]);
 }
Esempio n. 2
0
    submenu_print(_("&Email Delivery Note"), ST_CUSTDELIVERY, $delivery, null, 1);
    submenu_print(_("P&rint as Packing Slip"), ST_CUSTDELIVERY, $delivery, 'prtopt', null, 1);
    submenu_print(_("E&mail as Packing Slip"), ST_CUSTDELIVERY, $delivery, null, 1, 1);
    set_focus('prtopt');
    display_note(get_gl_view_str(ST_CUSTDELIVERY, $delivery, _("View the GL Journal Entries for this Dispatch")), 0, 1);
    submenu_option(_("Make &Invoice Against This Delivery"), "/sales/customer_invoice.php?DeliveryNumber={$delivery}");
    if (isset($_GET['Type']) && $_GET['Type'] == 1) {
        submenu_option(_("Enter a New Template &Delivery"), "/sales/inquiry/sales_orders_view.php?DeliveryTemplates=Yes");
    } else {
        submenu_option(_("Enter a &New Delivery"), "/sales/sales_order_entry.php?NewDelivery=0");
    }
    display_footer_exit();
} elseif (isset($_GET['AddedDI'])) {
    $invoice = $_GET['AddedDI'];
    $amnt = user_numeric($_GET['paid']);
    $dis = user_numeric($_GET['discount']);
    //display_notification_centered(sprintf(_("Invoice # %d has been entered."), $invoice));
    //        if(!isset($_GET['theinvoice']))
    fa_popup($path_to_root . "/sales/customer_payments_1.php?SInvoice=" . $invoice . "&customer_id=" . $_GET['customer_id'] . "&AddPaymentItem=1&amount=" . $amnt . "&discount=" . $dis . "&bug=1");
    //        else
    //        $invoice=$_GET['theinvoice'];
    //        http://localhost/fadev/sales/customer_payments.php?SInvoice=17&customer_id=2&AddPaymentItem=1&amount=2&discount=1
    //meta_forward($path_to_root.'/reporting/prn_redirect.php?PARAM_0=20-10&PARAM_1=20-10&PARAM_2=&PARAM_3=0&PARAM_4=&PARAM_5=&PARAM_6=0&REP_ID=107');
    submenu_view(_("&View This Invoice"), ST_SALESINVOICE, $invoice);
    submenu_print(_("&Print Sales Invoice"), ST_SALESINVOICE, $invoice . "-" . ST_SALESINVOICE, 'prtopt');
    submenu_print(_("&Email Sales Invoice"), ST_SALESINVOICE, $invoice . "-" . ST_SALESINVOICE, null, 1);
    set_focus('prtopt');
    $sql = "SELECT trans_type_from, trans_no_from FROM " . TB_PREF . "cust_allocations\n\t\t\tWHERE trans_type_to=" . ST_SALESINVOICE . " AND trans_no_to=" . db_escape($invoice);
    $result = db_query($sql, "could not retrieve customer allocation");
    $row = db_fetch($result);
    if ($row !== false) {