<?php $page_security = 3; $path_to_root = "../.."; include $path_to_root . "/includes/session.inc"; page(tr("Customer Branches")); include $path_to_root . "/includes/ui.inc"; //------------------------------------------------------------------ check_db_has_customers(tr("There are no customers defined in the system. Please define a customer to add customer branches.")); check_db_has_sales_people(tr("There are no sales people defined in the system. At least one sales person is required before proceeding.")); check_db_has_sales_areas(tr("There are no sales areas defined in the system. At least one sales area is required before proceeding.")); check_db_has_shippers(tr("There are no shipping companies defined in the system. At least one shipping company is required before proceeding.")); check_db_has_tax_groups(tr("There are no tax groups defined in the system. At least one tax group is required before proceeding.")); //------------------------------------------------------------------ if (isset($_GET['debtor_no'])) { $_POST['customer_id'] = strtoupper($_GET['debtor_no']); $_POST['New'] = "1"; } if (isset($_GET['SelectedBranch'])) { $_POST['branch_code'] = strtoupper($_GET['SelectedBranch']); unset($_POST['New']); } if (!isset($_GET['SelectedBranch']) && !isset($_POST['AddUpdate'])) { $_POST['New'] = "1"; } check_branches(); // we always want to have a branch (if possible) //--------------------------------------------------------------------- if (isset($_POST['ADD_ITEM']) || isset($_POST['UPDATE_ITEM'])) { //initialise no input errors assumed initially before we test $input_error = 0;
include_once $path_to_root . "/includes/banking.inc"; include_once $path_to_root . "/includes/data_checks.inc"; include_once $path_to_root . "/sales/includes/sales_db.inc"; //include_once($path_to_root . "/sales/includes/ui/cust_alloc_ui.inc"); include_once $path_to_root . "/reporting/includes/reporting.inc"; $js = ""; if ($use_popup_windows) { $js .= get_js_open_window(900, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } add_js_file('payalloc.js'); page(_($help_context = "Customer Payment Entry"), false, false, "", $js); //---------------------------------------------------------------------------------------------- check_db_has_customers(_("There are no customers defined in the system.")); check_db_has_bank_accounts(_("There are no bank accounts defined in the system.")); //---------------------------------------------------------------------------------------- if (isset($_GET['customer_id'])) { $_POST['customer_id'] = $_GET['customer_id']; } if (!isset($_POST['bank_account'])) { // first page call $_SESSION['alloc'] = new allocation(ST_CUSTPAYMENT, 0); if (isset($_GET['SInvoice'])) { // get date and supplier $inv = get_customer_trans($_GET['SInvoice'], ST_SALESINVOICE); if ($inv) { $_POST['customer_id'] = $inv['debtor_no']; $_POST['DateBanked'] = sql2date($inv['tran_date']); foreach ($_SESSION['alloc']->allocs as $line => $trans) {