include_once $path_to_root . "/modules/requisitions/includes/modules_db.inc"; include_once $path_to_root . "/includes/ui.inc"; include_once $path_to_root . "/includes/ui/ui_lists.inc"; simple_page_mode(true); //----------------------------------------------------------------------------------- if (isset($_GET['requisitionid'])) { $req = get_requisition($_GET['requisitionid']); if (!$req || $req['completed']) { display_error(sprintf(_("Requisition #%d is already completed or does not exists."), $_GET['requisitionid'])); submenu_option(_("Entry &New Requisition."), '/modules/requisitions/requisitions.php'); display_footer_exit(); } if (isset($_GET['complete']) && $_GET['complete'] == 'yes') { complete_requisition($_GET['requisitionid']); display_notification(sprintf(_("Requisition #%d has been completed."), $_GET['requisitionid'])); submenu_option(_("Entry &New Requisition."), '/modules/requisitions/requisitions.php'); display_footer_exit(); } else { $_POST['requisitionid'] = $_GET['requisitionid']; } } if ($Mode == 'ADD_ITEM' || $Mode == 'UPDATE_ITEM') { //initialise no input errors assumed initially before we test $input_error = 0; if (strlen($_POST['item_code']) == 0) { $input_error = 1; display_error(_("The item of use cannot be empty.")); set_focus('name'); } if (strlen($_POST['estimate_price']) == 0) { $input_error = 1;
function handle_cancel_order() { global $path_to_root, $Ajax; if ($_SESSION['Items']->trans_type == ST_CUSTDELIVERY) { display_notification(_("Direct delivery entry has been cancelled as requested."), 1); submenu_option(_("Enter a New Sales Delivery"), "/sales/sales_order_entry.php?NewDelivery=1"); } elseif ($_SESSION['Items']->trans_type == ST_SALESINVOICE) { display_notification(_("Direct invoice entry has been cancelled as requested."), 1); submenu_option(_("Enter a New Sales Invoice"), "/sales/sales_order_entry.php?NewInvoice=1"); } elseif ($_SESSION['Items']->trans_type == ST_SALESQUOTE) { if ($_SESSION['Items']->trans_no != 0) { delete_sales_order(key($_SESSION['Items']->trans_no), $_SESSION['Items']->trans_type); } display_notification(_("This sales quotation has been cancelled as requested."), 1); submenu_option(_("Enter a New Sales Quotation"), "/sales/sales_order_entry.php?NewQuotation=Yes"); } else { // sales order if ($_SESSION['Items']->trans_no != 0) { $order_no = key($_SESSION['Items']->trans_no); if (sales_order_has_deliveries($order_no)) { close_sales_order($order_no); display_notification(_("Undelivered part of order has been cancelled as requested."), 1); submenu_option(_("Select Another Sales Order for Edition"), "/sales/inquiry/sales_orders_view.php?type=" . ST_SALESORDER); } else { delete_sales_order(key($_SESSION['Items']->trans_no), $_SESSION['Items']->trans_type); display_notification(_("This sales order has been cancelled as requested."), 1); submenu_option(_("Enter a New Sales Order"), "/sales/sales_order_entry.php?NewOrder=Yes"); } } else { processing_end(); meta_forward($path_to_root . '/index.php', 'application=orders'); } } processing_end(); display_footer_exit(); }
if (!isset($_POST['DateBanked'])) { $_POST['DateBanked'] = new_doc_date(); if (!is_date_in_fiscalyear($_POST['DateBanked'])) { $_POST['DateBanked'] = end_fiscalyear(); } } if (isset($_GET['AddedID'])) { $payment_no = $_GET['AddedID']; display_notification_centered(_("The customer payment has been successfully entered.")); submenu_print(_("&Print This Receipt"), ST_CUSTPAYMENT, $payment_no . "-" . ST_CUSTPAYMENT, 'prtopt'); submenu_view(_("&View this Customer Payment"), ST_CUSTPAYMENT, $payment_no); submenu_option(_("Enter Another &Customer Payment"), "/sales/customer_payments.php"); submenu_option(_("Enter Other &Deposit"), "/gl/gl_bank.php?NewDeposit=Yes"); submenu_option(_("Enter Payment to &Supplier"), "/purchasing/supplier_payment.php"); submenu_option(_("Enter Other &Payment"), "/gl/gl_bank.php?NewPayment=Yes"); submenu_option(_("Bank Account &Transfer"), "/gl/bank_transfer.php"); display_note(get_gl_view_str(ST_CUSTPAYMENT, $payment_no, _("&View the GL Journal Entries for this Customer Payment"))); display_footer_exit(); } elseif (isset($_GET['UpdatedID'])) { $payment_no = $_GET['UpdatedID']; display_notification_centered(_("The customer payment has been successfully updated.")); submenu_print(_("&Print This Receipt"), ST_CUSTPAYMENT, $payment_no . "-" . ST_CUSTPAYMENT, 'prtopt'); display_note(get_gl_view_str(ST_CUSTPAYMENT, $payment_no, _("&View the GL Journal Entries for this Customer Payment"))); // hyperlink_params($path_to_root . "/sales/allocations/customer_allocate.php", _("&Allocate this Customer Payment"), "trans_no=$payment_no&trans_type=12"); hyperlink_no_params($path_to_root . "/sales/inquiry/customer_inquiry.php?", _("Select Another Customer Payment for &Edition")); hyperlink_no_params($path_to_root . "/sales/customer_payments.php", _("Enter Another &Customer Payment")); display_footer_exit(); } //---------------------------------------------------------------------------------------------- function can_process() {
include_once $path_to_root . "/reporting/includes/reporting.inc"; $js = ''; if ($use_popup_windows) { $js .= get_js_open_window(800, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } /*========================================START OF PAGE=========================================*/ page(_($help_context = "Manage Commission"), @$_REQUEST['popup'], false, "", $js); global $imc; if (isset($_GET['AddedID'])) { $id = $_GET['AddedID']; $trans_type = ST_VOUCHER; display_notification_centered(sprintf(_("Commission Voucher for Invoice # %d has been entered."), $id)); submenu_option(_("Create New Commission Voucher"), "/sales/ml/commission_voucher.php"); display_note(print_document_link($id, _("&Print Voucher"), true, $trans_type)); display_footer_exit(); } function clear_data() { unset($_POST['commission']); } function computation_1($gross, $tax, $commission) { $sub1 = $gross * ($commission / 100); $sub2 = $sub1 * ($tax / 100); $totalcommission = $sub1 - $sub2; $_POST['total'] = $totalcommission; $_POST['tax'] = $sub2; }