function handle_void_transaction() { if (check_valid_entries() == true) { $void_entry = get_voided_entry($_POST['filterType'], $_POST['trans_no']); if ($void_entry != null) { display_error(tr("The selected transaction has already been voided."), true); unset($_POST['trans_no']); unset($_POST['memo_']); unset($_POST['date_']); set_focus('trans_no'); return; } $ret = void_transaction($_POST['filterType'], $_POST['trans_no'], $_POST['date_'], $_POST['memo_']); if ($ret) { display_notification_centered(tr("Selected transaction has been voided.")); unset($_POST['trans_no']); unset($_POST['memo_']); unset($_POST['date_']); } else { display_error(tr("The entered transaction does not exist or cannot be voided.")); set_focus('trans_no'); } } }
if ($use_popup_windows) { $js .= get_js_open_window(800, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } set_focus('CodeID2'); page(tr("Bank Account Deposit Entry"), false, false, '', $js); //----------------------------------------------------------------------------------------------- check_db_has_bank_accounts(tr("There are no bank accounts defined in the system.")); check_db_has_bank_trans_types(tr("There are no bank payment types defined in the system.")); //----------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $trans_type = systypes::bank_deposit(); display_notification_centered(tr("Deposit has been entered")); display_note(get_gl_view_str($trans_type, $trans_no, tr("View the GL Postings for this Deposit"))); hyperlink_no_params($_SERVER['PHP_SELF'], tr("Enter Another Deposit")); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- function copy_to_py() { $_SESSION['deposit_items']->from_loc = $_POST['bank_account']; $_SESSION['deposit_items']->tran_date = $_POST['date_']; $_SESSION['deposit_items']->transfer_type = $_POST['type']; $_SESSION['deposit_items']->increase = $_POST['PayType']; if (!isset($_POST['person_id'])) { $_POST['person_id'] = ""; } $_SESSION['deposit_items']->person_id = $_POST['person_id'];
$js = ""; if ($use_popup_windows) { $js .= get_js_open_window(900, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(tr("Enter Supplier Invoice"), false, false, "", $js); //---------------------------------------------------------------------------------------- check_db_has_suppliers(tr("There are no suppliers defined in the system.")); //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $invoice_no = $_GET['AddedID']; $trans_type = 20; echo "<center>"; display_notification_centered(tr("Supplier invoice has been processed.")); display_note(get_trans_view_str($trans_type, $invoice_no, tr("View this Invoice"))); display_note(get_gl_view_str($trans_type, $invoice_no, tr("View the GL Journal Entries for this Invoice")), 1); hyperlink_params($_SERVER['PHP_SELF'], tr("Enter Another Invoice"), "New=1"); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- if (isset($_GET['New'])) { if (isset($_SESSION['supp_trans'])) { unset($_SESSION['supp_trans']->grn_items); unset($_SESSION['supp_trans']->gl_codes); unset($_SESSION['supp_trans']); } //session_register("SuppInv"); session_register("supp_trans"); $_SESSION['supp_trans'] = new supp_trans();
//------------------------------------------------------------------------------------- if (isset($_POST['add']) || isset($_POST['delete'])) { begin_transaction(); for ($i = 0, $da = $_POST['begin']; date1_greater_date2($_POST['end'], $da); $i++) { if (isset($_POST['add'])) { add_update_gl_budget_trans($da, $_POST['account'], $_POST['dim1'], $_POST['dim2'], input_num('amount' . $i)); } else { delete_gl_budget_trans($da, $_POST['account'], $_POST['dim1'], $_POST['dim2']); } $da = add_months($da, 1); } commit_transaction(); if (isset($_POST['add'])) { display_notification_centered(tr("The Budget has been saved.")); } else { display_notification_centered(tr("The Budget has been deleted.")); } //meta_forward($_SERVER['PHP_SELF']); } //------------------------------------------------------------------------------------- start_form(); if (db_has_gl_accounts()) { $dim = get_company_pref('use_dimension'); start_table($table_style2); fiscalyears_list_row(tr("Fiscal Year:"), 'fyear', null); gl_all_accounts_list_row(tr("Account Code:"), 'account', null); if (!isset($_POST['dim1'])) { $_POST['dim1'] = 0; } if (!isset($_POST['dim2'])) { $_POST['dim2'] = 0;
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'); 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_allocation_inquiry.php?customer_id=", _("Select Another &Customer Transaction for Payment")); hyperlink_no_params($path_to_root . "/sales/customer_payments.php", _("Enter Another &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() { global $Refs; if (!get_post('customer_id')) { display_error(_("There is no customer selected.")); set_focus('customer_id'); return false;
submenu_print(_("&Print Delivery Note"), ST_CUSTDELIVERY, $delivery, 'prtopt'); 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']; display_notification_centered(sprintf(_("Invoice # %d has been entered."), $invoice)); 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) { submenu_print(_("Print &Receipt"), $row['trans_type_from'], $row['trans_no_from'] . "-" . $row['trans_type_from'], 'prtopt'); } display_note(get_gl_view_str(ST_SALESINVOICE, $invoice, _("View the GL &Journal Entries for this Invoice")), 0, 1); if (isset($_GET['Type']) && $_GET['Type'] == 1) { submenu_option(_("Enter a &New Template Invoice"), "/sales/inquiry/sales_orders_view.php?InvoiceTemplates=Yes"); } else { submenu_option(_("Enter a &New Direct Invoice"), "/sales/sales_order_entry.php?NewInvoice=0");
if ($trans->type == ST_SUPPINVOICE && $trans->type_no == $_GET['PInvoice']) { $un_allocated = abs($trans->amount) - $trans->amount_allocated; $_SESSION['alloc']->amount = $_SESSION['alloc']->allocs[$line]->current_allocated = $un_allocated; $_POST['amount'] = $_POST['amount' . $line] = price_format($un_allocated); break; } } unset($inv); } else { display_error(_("Invalid purchase invoice number.")); } } } if (isset($_GET['AddedID'])) { $payment_id = $_GET['AddedID']; display_notification_centered(_("Payment has been sucessfully entered")); submenu_print(_("&Print This Remittance"), ST_SUPPAYMENT, $payment_id . "-" . ST_SUPPAYMENT, 'prtopt'); submenu_print(_("&Email This Remittance"), ST_SUPPAYMENT, $payment_id . "-" . ST_SUPPAYMENT, null, 1); submenu_view(_("View this Payment"), ST_SUPPAYMENT, $payment_id); display_note(get_gl_view_str(ST_SUPPAYMENT, $payment_id, _("View the GL &Journal Entries for this Payment")), 0, 1); submenu_option(_("Enter another supplier &payment"), "/purchasing/supplier_payment.php?supplier_id=" . $_POST['supplier_id']); submenu_option(_("Enter Other &Payment"), "/gl/gl_bank.php?NewPayment=Yes"); submenu_option(_("Enter &Customer Payment"), "/sales/customer_payments.php"); submenu_option(_("Enter Other &Deposit"), "/gl/gl_bank.php?NewDeposit=Yes"); submenu_option(_("Bank Account &Transfer"), "/gl/bank_transfer.php"); display_footer_exit(); } //---------------------------------------------------------------------------------------- function check_inputs() { global $Refs;
display_notification_centered(_("Direct GRN has been entered")); display_note(get_trans_view_str($trans_type, $trans_no, _("&View this GRN")), 0); $clearing_act = get_company_pref('grn_clearing_act'); if ($clearing_act) { display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL Journal Entries for this Delivery")), 1); } // not yet // display_note(print_document_link($trans_no, _("&Print This GRN"), true, $trans_type), 0, 1); hyperlink_params("{$path_to_root}/purchasing/supplier_invoice.php", _("Entry purchase &invoice for this receival"), "New=1"); hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}"); hyperlink_params($_SERVER['PHP_SELF'], _("Enter &Another GRN"), "NewGRN=Yes"); display_footer_exit(); } elseif (isset($_GET['AddedPI'])) { $trans_no = $_GET['AddedPI']; $trans_type = ST_SUPPINVOICE; display_notification_centered(_("Direct Purchase Invoice has been entered")); display_note(get_trans_view_str($trans_type, $trans_no, _("&View this Invoice")), 0); // not yet // display_note(print_document_link($trans_no, _("&Print This Invoice"), true, $trans_type), 0, 1); display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL Journal Entries for this Invoice")), 1); hyperlink_params("{$path_to_root}/purchasing/supplier_payment.php", _("Entry supplier &payment for this invoice"), "PInvoice=" . $trans_no); hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}"); hyperlink_params($_SERVER['PHP_SELF'], _("Enter &Another Direct Invoice"), "NewInvoice=Yes"); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- function line_start_focus() { global $Ajax; $Ajax->activate('items_table'); set_focus('_stock_id_edit');
<?php $page_security = 10; $path_to_root = ".."; include $path_to_root . "/includes/session.inc"; page(tr("Forms Setup")); include $path_to_root . "/includes/ui.inc"; //------------------------------------------------------------------------------------------------- if (isset($_POST['setprefs'])) { $systypes = get_systypes(); begin_transaction(); while ($type = db_fetch($systypes)) { save_next_reference($type["type_id"], $_POST['id' . $type["type_id"]]); } commit_transaction(); display_notification_centered(tr("Forms settings have been updated.")); } start_form(); start_table("class='tablestyle'"); $systypes = get_systypes(); $th = array(tr("Form"), tr("Next Reference")); table_header($th); while ($type = db_fetch($systypes)) { ref_row(systypes::name($type["type_id"]), 'id' . $type["type_id"], $type["next_reference"]); } end_table(1); submit_center('setprefs', tr("Update")); end_form(2); //------------------------------------------------------------------------------------------------- end_page();
if ($Mode == 'ADD_ITEM' || $Mode == 'UPDATE_ITEM') { $error = 0; if (empty($_POST['name'])) { $error = 1; display_error(_("Printer name cannot be empty.")); set_focus('name'); } elseif (empty($_POST['host'])) { display_notification_centered(_("You have selected printing to server at user IP.")); } elseif (!check_num('tout', 0, 60)) { $error = 1; display_error(_("Timeout cannot be less than zero nor longer than 60 (sec).")); set_focus('tout'); } if ($error != 1) { write_printer_def($selected_id, get_post('name'), get_post('descr'), get_post('queue'), get_post('host'), input_num('port', 0), input_num('tout', 0)); display_notification_centered($selected_id == -1 ? _('New printer definition has been created') : _('Selected printer definition has been updated')); $Mode = 'RESET'; } } if ($Mode == 'Delete') { // PREVENT DELETES IF DEPENDENT RECORDS IN print_profiles if (key_in_foreign_table($selected_id, 'print_profiles', 'printer')) { display_error(_("Cannot delete this printer definition, because print profile have been created using it.")); } else { delete_printer($selected_id); display_notification(_('Selected printer definition has been deleted')); } $Mode = 'RESET'; } if ($Mode == 'RESET') { $selected_id = -1;
if (!$error) { $prof = array('' => get_post('Prn')); // store default value/profile name foreach (get_reports() as $rep => $descr) { $val = get_post('Prn' . $rep); $prof[$rep] = $val; } if ($_POST['profile_id'] == '') { $_POST['profile_id'] = get_post('name'); } update_printer_profile($_POST['profile_id'], $prof); if ($selected_id == '') { display_notification_centered(_('New printing profile has been created')); clear_form(); } else { display_notification_centered(_('Printing profile has been updated')); } } } if (get_post('delete')) { if (!check_delete(get_post('name'))) { delete_printer_profile($selected_id); display_notification(_('Selected printing profile has been deleted')); clear_form(); } } if (get_post('_profile_id_update')) { $Ajax->activate('_page_body'); } start_form(); start_table();
display_error(_('The existing image could not be removed')); $input_error = 1; } } $_POST['coy_logo'] = ""; } if ($_POST['add_pct'] == "") { $_POST['add_pct'] = -1; } if ($_POST['round_to'] <= 0) { $_POST['round_to'] = 1; } if ($input_error != 1) { update_company_prefs(get_post(array('coy_name', 'coy_no', 'gst_no', 'tax_prd', 'tax_last', 'postal_address', 'phone', 'fax', 'email', 'coy_logo', 'domicile', 'use_dimension', 'curr_default', 'f_year', 'no_item_list' => 0, 'no_customer_list' => 0, 'no_supplier_list' => 0, 'base_sales', 'time_zone' => 0, 'add_pct', 'round_to', 'login_tout', 'auto_curr_reval', 'bcc_email'))); $_SESSION['wa_current_user']->timeout = $_POST['login_tout']; display_notification_centered(_("Company setup has been updated.")); } set_focus('coy_name'); $Ajax->activate('_page_body'); } /* end of if submit */ //--------------------------------------------------------------------------------------------- if (get_company_pref('bcc_email') === null) { // available from 2.3.14, can be not defined on pre-2.4 installations set_company_pref('bcc_email', 'setup.company', 'varchar', 100, ''); refresh_sys_prefs(); } start_form(true); $myrow = get_company_prefs(); $_POST['coy_name'] = $myrow["coy_name"]; $_POST['gst_no'] = $myrow["gst_no"];
label_cell(get_dimension_string($_POST['dimension_id'], true)); } if ($dim > 1) { label_cell(get_dimension_string($_POST['dimension2_id'], true)); } display_debit_or_credit_cells($am0); label_cell($memo); } } if (isset($_POST['go'])) { commit_transaction(); display_notification_centered(_("Revenue / Cost Accruals have been processed.")); $_POST['date_'] = $_POST['amount'] = $_POST['periods'] = ""; } else { end_table(1); display_notification_centered(_("Showing GL Transactions.")); } } } } function frequency_list_row($label, $name, $selected = null) { echo "<tr>\n"; label_cell($label, "class='label'"); echo "<td>\n"; $freq = array('1' => _("Weekly"), '2' => _("Bi-weekly"), '3' => _("Monthly"), '4' => _("Quarterly")); echo array_selector($name, $selected, $freq); echo "</td>\n"; echo "</tr\n"; } $dim = get_company_pref('use_dimension');
if ($use_date_picker) { $js .= get_js_date_picker(); } page(_($help_context = "Revaluation of Currency Accounts"), false, false, "", $js); if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $JE = $_GET['JE']; $trans_type = ST_JOURNAL; if ($trans_no == 0) { display_notification_centered(_("No Revaluation was needed")); } else { display_notification_centered(_("Transfer has been entered")); display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Journal Entries for this Transfer"))); } if ($JE > 0) { display_notification_centered(sprintf(_("%d Journal Entries for AR/AP accounts have been added"), $JE)); } //display_footer_exit(); } //--------------------------------------------------------------------------------------------- function check_data() { global $Refs; if (!is_date($_POST['date'])) { display_error(_("The entered date is invalid.")); set_focus('date'); return false; } if (!is_date_in_fiscalyear($_POST['date'])) { display_error(_("The entered date is not in fiscal year.")); set_focus('date');
} @fclose($fp); // Commit import to database if (!$errCnt) { commit_transaction(); } if ($type == ST_JOURNAL) { $typeString = "journal entries"; } elseif ($type == ST_BANKDEPOSIT) { $typeString = "deposits"; } elseif ($type == ST_BANKPAYMENT) { $typeString = "payments"; } if (!$errCnt) { if ($entryCount > 0) { display_notification_centered("{$entryCount} {$typeString} have been imported."); } else { display_error("Import file contained no {$typeString}."); } } } } else { display_error("No import file selected"); } } start_form(true); start_table(TABLESTYLE2); if (!isset($_POST['type'])) { $_POST['type'] = ST_JOURNAL; } if (!isset($_POST['sep'])) {
$js = ""; if ($use_popup_windows) { $js .= get_js_open_window(800, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(_($help_context = "Item Adjustments Note"), false, false, "", $js); //----------------------------------------------------------------------------------------------- check_db_has_costable_items(_("There are no inventory items defined in the system which can be adjusted (Purchased or Manufactured).")); check_db_has_movement_types(_("There are no inventory movement types defined in the system. Please define at least one inventory adjustment type.")); //----------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $trans_type = ST_INVADJUST; display_notification_centered(_("Items adjustment has been processed")); display_note(get_trans_view_str($trans_type, $trans_no, _("&View this adjustment"))); display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL &Postings for this Adjustment")), 1, 0); hyperlink_no_params($_SERVER['PHP_SELF'], _("Enter &Another Adjustment")); hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}"); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- function line_start_focus() { global $Ajax; $Ajax->activate('items_table'); set_focus('_stock_id_edit'); } //----------------------------------------------------------------------------------------------- function handle_new_order()
//--------------------------------------------------------------------------------------- if (isset($_GET['UpdatedID'])) { $id = $_GET['UpdatedID']; display_notification_centered(_("The work order been updated.")); safe_exit(); } //--------------------------------------------------------------------------------------- if (isset($_GET['DeletedID'])) { $id = $_GET['DeletedID']; display_notification_centered(_("Work order has been deleted.")); safe_exit(); } //--------------------------------------------------------------------------------------- if (isset($_GET['ClosedID'])) { $id = $_GET['ClosedID']; display_notification_centered(_("This work order has been closed. There can be no more issues against it.") . " #{$id}"); safe_exit(); } //--------------------------------------------------------------------------------------- function safe_exit() { global $path_to_root; hyperlink_no_params("", _("Enter a new work order")); hyperlink_no_params("search_work_orders.php", _("Select an existing work order")); display_footer_exit(); } //------------------------------------------------------------------------------------- if (!isset($_POST['date_'])) { $_POST['date_'] = new_doc_date(); if (!is_date_in_fiscalyear($_POST['date_'])) { $_POST['date_'] = end_fiscalyear();
display_note(print_document_link($invoice_no . "-" . $trans_type, _("&Email This Invoice"), true, ST_SALESINVOICE, false, "printlink", "", 1), 1); display_note(get_gl_view_str($trans_type, $invoice_no, _("View the GL &Journal Entries for this Invoice")), 1); hyperlink_params("{$path_to_root}/sales/inquiry/sales_deliveries_view.php", _("Select Another &Delivery For Invoicing"), "OutstandingOnly=1"); hyperlink_no_params("{$path_to_root}/sales/inquiry/customer_allocation_inquiry.php?customer_id=", _("Go to Allocation Inquiry")); $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_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(); } elseif (isset($_GET['UpdatedID'])) { $invoice_no = $_GET['UpdatedID']; $trans_type = ST_SALESINVOICE; display_notification_centered(sprintf(_('Sales Invoice # %d has been updated.'), $invoice_no)); display_note(get_trans_view_str(ST_SALESINVOICE, $invoice_no, _("&View This Invoice"))); echo '<br>'; display_note(print_document_link($invoice_no . "-" . $trans_type, _("&Print This Invoice"), true, ST_SALESINVOICE)); display_note(print_document_link($invoice_no . "-" . $trans_type, _("&Email This Invoice"), true, ST_SALESINVOICE, false, "printlink", "", 1), 1); hyperlink_no_params($path_to_root . "/sales/inquiry/customer_inquiry.php", _("Select Another &Invoice to Modify")); display_footer_exit(); } elseif (isset($_GET['RemoveDN'])) { for ($line_no = 0; $line_no < count($_SESSION['Items']->line_items); $line_no++) { $line =& $_SESSION['Items']->line_items[$line_no]; if ($line->src_no == $_GET['RemoveDN']) { $line->quantity = $line->qty_done; $line->qty_dispatched = 0; } } unset($line);
include_once $path_to_root . "/includes/session.inc"; include_once $path_to_root . "/purchasing/includes/purchasing_db.inc"; include_once $path_to_root . "/purchasing/includes/purchasing_ui.inc"; $js = ""; if ($use_popup_windows) { $js .= get_js_open_window(900, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(tr("Receive Purchase Order Items"), false, false, "", $js); //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $grn = $_GET['AddedID']; $trans_type = 25; display_notification_centered(tr("Purchase Order Delivery has been processed")); display_note(get_trans_view_str($trans_type, $grn, tr("View this Delivery"))); //echo "<BR>"; //echo get_gl_view_str(25, $grn, tr("View the GL Journal Entries for this Delivery")); // echo "<br>"; hyperlink_no_params("{$path_to_root}/purchasing/inquiry/po_search.php", tr("Select a different purchase order for receiving items against")); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- if ((!isset($_GET['PONumber']) || $_GET['PONumber'] == 0) && !isset($_SESSION['PO'])) { die(tr("This page can only be opened if a purchase order has been selected. Please select a purchase order first.")); } //-------------------------------------------------------------------------------------------------- function display_po_receive_items() { global $table_style;
update_user_prefs($id, array_merge($prefs, get_post(array('print_profile', 'rep_popup' => 0, 'language')))); display_notification_centered(_("A new user has been added.")); } $Mode = 'RESET'; } } //------------------------------------------------------------------------------------------------- if ($Mode == 'Delete' && check_csrf_token()) { $cancel_delete = 0; if (key_in_foreign_table($selected_id, 'audit_trail', 'user')) { $cancel_delete = 1; display_error(_("Cannot delete this user because entries are associated with this user.")); } if ($cancel_delete == 0) { delete_user($selected_id); display_notification_centered(_("User has been deleted.")); } //end if Delete group $Mode = 'RESET'; } //------------------------------------------------------------------------------------------------- if ($Mode == 'RESET') { $selected_id = -1; $sav = get_post('show_inactive', null); unset($_POST); // clean all input fields $_POST['show_inactive'] = $sav; } $result = get_users(check_value('show_inactive')); start_form(); start_table(TABLESTYLE);
include_once $path_to_root . "/gl/includes/gl_db.inc"; include_once $path_to_root . "/gl/includes/gl_ui.inc"; $js = ""; if ($use_popup_windows) { $js .= get_js_open_window(800, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(_($help_context = "Transfer between Bank Accounts"), false, false, "", $js); check_db_has_bank_accounts(_("There are no bank accounts defined in the system.")); //---------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $trans_type = ST_BANKTRANSFER; display_notification_centered(_("Transfer has been entered")); display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Journal Entries for this Transfer"))); hyperlink_no_params($_SERVER['PHP_SELF'], _("Enter &Another Transfer")); display_footer_exit(); } if (isset($_POST['_DatePaid_changed'])) { $Ajax->activate('_ex_rate'); } //---------------------------------------------------------------------------------------- function gl_payment_controls() { global $Refs; $home_currency = get_company_currency(); start_form(); start_outer_table(TABLESTYLE2); table_section(1);
set_user_prefs(get_post(array('prices_dec', 'qty_dec', 'rates_dec', 'percent_dec', 'date_format', 'date_sep', 'tho_sep', 'dec_sep', 'print_profile', 'theme', 'page_size', 'language', 'startup_tab', 'show_gl' => 0, 'show_codes' => 0, 'show_hints' => 0, 'rep_popup' => 0, 'graphic_links' => 0, 'sticky_doc_date' => 0, 'query_size' => 10.0))); if ($chg_lang) { $_SESSION['language']->set_language($_POST['language']); } // refresh main menu flush_dir(company_path() . '/js_cache'); if ($chg_theme && $allow_demo_mode) { $_SESSION["wa_current_user"]->prefs->theme = $_POST['theme']; } if ($chg_theme || $chg_lang || $chg_date_format || $chg_date_sep) { meta_forward($_SERVER['PHP_SELF']); } if ($allow_demo_mode) { display_warning(_("Display settings have been updated. Keep in mind that changed settings are restored on every login in demo mode.")); } else { display_notification_centered(_("Display settings have been updated.")); } } } start_form(); start_outer_table(TABLESTYLE2); table_section(1); table_section_title(_("Decimal Places")); number_list_row(_("Prices/Amounts:"), 'prices_dec', user_price_dec(), 0, 10); number_list_row(_("Quantities:"), 'qty_dec', user_qty_dec(), 0, 10); number_list_row(_("Exchange Rates:"), 'rates_dec', user_exrate_dec(), 0, 10); number_list_row(_("Percentages:"), 'percent_dec', user_percent_dec(), 0, 10); table_section_title(_("Dateformat and Separators")); dateformats_list_row(_("Dateformat:"), "date_format", user_date_format()); dateseps_list_row(_("Date Separator:"), "date_sep", user_date_sep()); /* The array $dateseps is set up in config.php for modifications
$js = ""; if ($use_popup_windows) { $js .= get_js_open_window(800, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(_($help_context = "Inventory Location Transfers"), false, false, "", $js); //----------------------------------------------------------------------------------------------- check_db_has_costable_items(_("There are no inventory items defined in the system (Purchased or manufactured items).")); check_db_has_movement_types(_("There are no inventory movement types defined in the system. Please define at least one inventory adjustment type.")); //----------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $trans_type = ST_LOCTRANSFER; display_notification_centered(_("Inventory transfer has been processed")); display_note(get_trans_view_str($trans_type, $trans_no, _("&View this transfer"))); hyperlink_no_params($_SERVER['PHP_SELF'], _("Enter &Another Inventory Transfer")); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- function line_start_focus() { global $Ajax; $Ajax->activate('items_table'); set_focus('_stock_id_edit'); } //----------------------------------------------------------------------------------------------- function handle_new_order() { if (isset($_SESSION['transfer_items'])) {
page($_SESSION['page_title'], false, false, "", $js); //----------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $credit_no = $_GET['AddedID']; $trans_type = ST_CUSTCREDIT; display_notification_centered(_("Credit Note has been processed")); display_note(get_customer_trans_view_str($trans_type, $credit_no, _("&View This Credit Note")), 0, 0); display_note(print_document_link($credit_no . "-" . $trans_type, _("&Print This Credit Note"), true, $trans_type), 1); display_note(print_document_link($credit_no . "-" . $trans_type, _("&Email This Credit Note"), true, $trans_type, false, "printlink", "", 1), 1); display_note(get_gl_view_str($trans_type, $credit_no, _("View the GL &Journal Entries for this Credit Note")), 1); hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$credit_no}"); display_footer_exit(); } elseif (isset($_GET['UpdatedID'])) { $credit_no = $_GET['UpdatedID']; $trans_type = ST_CUSTCREDIT; display_notification_centered(_("Credit Note has been updated")); display_note(get_customer_trans_view_str($trans_type, $credit_no, _("&View This Credit Note")), 0, 0); display_note(print_document_link($credit_no . "-" . $trans_type, _("&Print This Credit Note"), true, $trans_type), 1); display_note(print_document_link($credit_no . "-" . $trans_type, _("&Email This Credit Note"), true, $trans_type, false, "printlink", "", 1), 1); display_note(get_gl_view_str($trans_type, $credit_no, _("View the GL &Journal Entries for this Credit Note")), 1); display_footer_exit(); } else { check_edit_conflicts(); } //----------------------------------------------------------------------------- function can_process() { global $Refs; /*===================MOODLEARNING===========================*/ if (!get_post('custom_num')) { display_error(_("You must enter a Credit Memo No."));
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'])) { $delivery_no = $_GET['UpdatedID']; display_notification_centered(sprintf(_('Delivery Note # %d has been updated.'), $delivery_no)); display_note(get_trans_view_str(ST_CUSTDELIVERY, $delivery_no, _("View this delivery")), 0, 1); display_note(print_document_link($delivery_no, _("&Print Delivery Note"), true, ST_CUSTDELIVERY)); display_note(print_document_link($delivery_no, _("&Email Delivery Note"), true, ST_CUSTDELIVERY, false, "printlink", "", 1), 1, 1); display_note(print_document_link($delivery_no, _("P&rint as Packing Slip"), true, ST_CUSTDELIVERY, false, "printlink", "", 0, 1)); display_note(print_document_link($delivery_no, _("E&mail as Packing Slip"), true, ST_CUSTDELIVERY, false, "printlink", "", 1, 1), 1); hyperlink_params($path_to_root . "/sales/customer_invoice.php", _("Confirm Delivery and Invoice"), "DeliveryNumber={$delivery_no}"); hyperlink_params($path_to_root . "/sales/inquiry/sales_deliveries_view.php", _("Select A Different Delivery"), "OutstandingOnly=1"); display_footer_exit(); } //----------------------------------------------------------------------------- if (isset($_GET['OrderNumber']) && $_GET['OrderNumber'] > 0) { $ord = new Cart(ST_SALESORDER, $_GET['OrderNumber'], true); if ($ord->count_items() == 0) { hyperlink_params($path_to_root . "/sales/inquiry/sales_orders_view.php", _("Select a different sales order to delivery"), "OutstandingOnly=1"); die("<br><b>" . _("This order has no items. There is nothing to delivery.") . "</b>");
$js = ""; if ($use_popup_windows) { $js .= get_js_open_window(900, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(tr("Supplier Credit Note"), false, false, "", $js); //---------------------------------------------------------------------------------------- check_db_has_suppliers(tr("There are no suppliers defined in the system.")); //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $invoice_no = $_GET['AddedID']; $trans_type = 21; echo "<center>"; display_notification_centered(tr("Supplier credit note has been processed.")); display_note(get_trans_view_str($trans_type, $invoice_no, tr("View this Credit Note"))); display_note(get_gl_view_str($trans_type, $invoice_no, tr("View the GL Journal Entries for this Credit Note")), 1); hyperlink_params($_SERVER['PHP_SELF'], tr("Enter Another Credit Note"), "New=1"); display_footer_exit(); } //--------------------------------------------------------------------------------------------------- if (isset($_GET['New'])) { if (isset($_SESSION['supp_trans'])) { unset($_SESSION['supp_trans']->grn_items); unset($_SESSION['supp_trans']->gl_codes); unset($_SESSION['supp_trans']); } $_SESSION['supp_trans'] = new supp_trans(); $_SESSION['supp_trans']->is_invoice = false; }
hyperlink_params($_SERVER['PHP_SELF'], _("Enter A &Deposit"), "NewDeposit=yes"); display_footer_exit(); } if (isset($_GET['AddedDep'])) { $trans_no = $_GET['AddedDep']; $trans_type = ST_BANKDEPOSIT; display_notification_centered(sprintf(_("Deposit %d has been entered"), $trans_no)); display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL Postings for this Deposit"))); hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another Deposit"), "NewDeposit=yes"); hyperlink_params($_SERVER['PHP_SELF'], _("Enter A Payment"), "NewPayment=yes"); display_footer_exit(); } if (isset($_GET['UpdatedDep'])) { $trans_no = $_GET['UpdatedDep']; $trans_type = ST_BANKDEPOSIT; display_notification_centered(sprintf(_("Deposit %d has been modified"), $trans_no)); display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Postings for this Deposit"))); hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another &Deposit"), "NewDeposit=yes"); hyperlink_params($_SERVER['PHP_SELF'], _("Enter A &Payment"), "NewPayment=yes"); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- function create_cart($type, $trans_no) { global $Refs; if (isset($_SESSION['pay_items'])) { unset($_SESSION['pay_items']); } $cart = new items_cart($type); $cart->order_id = $trans_no; if ($trans_no) {
set_focus('_code_id_edit'); } //----------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $trans_no = $_GET['AddedID']; $trans_type = ST_JOURNAL; display_notification_centered(_("Journal entry has been entered") . " #{$trans_no}"); display_note(get_gl_view_str($trans_type, $trans_no, _("&View this Journal Entry"))); reset_focus(); hyperlink_params($_SERVER['PHP_SELF'], _("Enter &New Journal Entry"), "NewJournal=Yes"); hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}"); display_footer_exit(); } elseif (isset($_GET['UpdatedID'])) { $trans_no = $_GET['UpdatedID']; $trans_type = ST_JOURNAL; display_notification_centered(_("Journal entry has been updated") . " #{$trans_no}"); display_note(get_gl_view_str($trans_type, $trans_no, _("&View this Journal Entry"))); hyperlink_no_params($path_to_root . "/gl/inquiry/journal_inquiry.php", _("Return to Journal &Inquiry")); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- if (isset($_GET['NewJournal'])) { create_cart(0, 0); } elseif (isset($_GET['ModifyGL'])) { if (!isset($_GET['trans_type']) || $_GET['trans_type'] != 0) { display_error(_("You can edit directly only journal entries created via Journal Entry page.")); hyperlink_params("{$path_to_root}/gl/gl_journal.php", _("Entry &New Journal Entry"), "NewJournal=Yes"); display_footer_exit(); } create_cart($_GET['trans_type'], $_GET['trans_no']); }
if (isset($_GET['ModifyOrderNumber'])) { page(tr("Modify Purchase Order #") . $_GET['ModifyOrderNumber'], false, false, "", $js); } else { page(tr("Purchase Order Entry"), false, false, "", $js); } //--------------------------------------------------------------------------------------------------- check_db_has_suppliers(tr("There are no suppliers defined in the system.")); check_db_has_purchasable_items(tr("There are no purchasable inventory items defined in the system.")); //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $order_no = $_GET['AddedID']; $trans_type = systypes::po(); if (!isset($_GET['Updated'])) { display_notification_centered(tr("Purchase Order has been entered")); } else { display_notification_centered(tr("Purchase Order has been updated") . " #{$order_no}"); } display_note(get_trans_view_str($trans_type, $order_no, tr("View this order"))); hyperlink_params($path_to_root . "/purchasing/po_receive_items.php", tr("Receive Items on this Purchase Order"), "PONumber={$order_no}"); hyperlink_params($_SERVER['PHP_SELF'], tr("Enter Another Purchase Order"), "NewOrder=yes"); hyperlink_no_params($path_to_root . "/purchasing/inquiry/po_search.php", tr("Select An Outstanding Purchase Order")); display_footer_exit(); } //-------------------------------------------------------------------------------------------------- function copy_to_po() { $_SESSION['PO']->supplier_id = $_POST['supplier_id']; $_SESSION['PO']->orig_order_date = $_POST['OrderDate']; $_SESSION['PO']->reference = $_POST['ref']; $_SESSION['PO']->requisition_no = $_POST['Requisition']; $_SESSION['PO']->Comments = $_POST['Comments'];
$_SESSION['page_title'] = tr("Customer Credit Note"); handle_new_credit(0); } elseif (isset($_GET['ModifyCredit'])) { $_SESSION['page_title'] = sprintf(tr("Modifying Customer Credit Note #%d"), $_GET['ModifyCredit']); handle_new_credit($_GET['ModifyCredit']); $help_page_title = tr("Modifying Customer Credit Note"); } page($_SESSION['page_title'], false, false, "", $js); //----------------------------------------------------------------------------- check_db_has_stock_items(tr("There are no items defined in the system.")); check_db_has_customer_branches(tr("There are no customers, or there are no customers with branches. Please define customers and customer branches.")); //----------------------------------------------------------------------------- if (isset($_GET['AddedID'])) { $credit_no = $_GET['AddedID']; $trans_type = 11; display_notification_centered(sprintf(tr("Credit Note # %d has been processed"), $credit_no)); display_note(get_customer_trans_view_str($trans_type, $credit_no, tr("View this credit note")), 0, 1); display_note(get_gl_view_str($trans_type, $credit_no, tr("View the GL Journal Entries for this Credit Note"))); hyperlink_params($_SERVER['PHP_SELF'], tr("Enter Another Credit Note"), "NewCredit=yes"); display_footer_exit(); } //-------------------------------------------------------------------------------- function line_start_focus() { set_focus(get_company_pref('no_supplier_list') ? 'stock_id_edit' : 'StockID2'); } //----------------------------------------------------------------------------- function copy_to_cn() { $_SESSION['Items']->Comments = $_POST['CreditText']; $_SESSION['Items']->document_date = $_POST['OrderDate'];