} if ($use_date_picker) { $js .= get_js_date_picker(); } page(_($help_context = "Customer Allocation Inquiry"), false, false, "", $js); if (isset($_GET['customer_id'])) { $_POST['customer_id'] = $_GET['customer_id']; } //------------------------------------------------------------------------------------------------ if (!isset($_POST['customer_id'])) { $_POST['customer_id'] = get_global_customer(); } start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true); date_cells(_("from:"), 'TransAfterDate', '', null, -30); date_cells(_("to:"), 'TransToDate', '', null, 1); cust_allocations_list_cells(_("Type:"), 'filterType', null); check_cells(" " . _("show settled:"), 'showSettled', null); submit_cells('RefreshInquiry', _("Search"), '', _('Refresh Inquiry'), 'default'); set_global_customer($_POST['customer_id']); end_row(); end_table(); //------------------------------------------------------------------------------------------------ function check_overdue($row) { return $row['OverDue'] == 1 && abs($row["TotalAmount"]) - $row["Allocated"] != 0; } function order_link($row) {
page(_($help_context = "Customer Transactions"), isset($_GET['customer_id']), false, "", $js); } if (isset($_GET['customer_id'])) { $_POST['customer_id'] = $_GET['customer_id']; } //------------------------------------------------------------------------------------------------ if (!@$_GET['popup']) { start_form(); } if (!isset($_POST['customer_id'])) { $_POST['customer_id'] = get_global_customer(); } start_table(TABLESTYLE_NOBORDER); start_row(); if (!@$_GET['popup']) { customer_list_cells(_("Select a customer: "), 'customer_id', null, true, false, false, !@$_GET['popup']); } date_cells(_("From:"), 'TransAfterDate', '', null, -30); date_cells(_("To:"), 'TransToDate', '', null, 1); if (!isset($_POST['filterType'])) { $_POST['filterType'] = 0; } cust_allocations_list_cells(null, 'filterType', $_POST['filterType'], true); submit_cells('RefreshInquiry', _("Search"), '', _('Refresh Inquiry'), 'default'); end_row(); end_table(); set_global_customer($_POST['customer_id']); //------------------------------------------------------------------------------------------------ function display_customer_summary($customer_record) { $past1 = get_company_pref('past_due_days');
$Ajax->activate('deliveries_tbl'); } //----------------------------------------------------------------------------------- start_form(false, false, $_SERVER['PHP_SELF'] . "?OutstandingOnly=" . $_POST['OutstandingOnly']); start_table(TABLESTYLE_NOBORDER); start_row(); ref_cells(_("#:"), 'DeliveryNumber', '', null, '', true); date_cells(_("from:"), 'DeliveryAfterDate', '', null, -30); date_cells(_("to:"), 'DeliveryToDate', '', null, 1); locations_list_cells(_("Location:"), 'StockLocation', null, true); end_row(); end_table(); start_table(TABLESTYLE_NOBORDER); start_row(); stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true); customer_list_cells(_("Select a customer: "), 'customer_id', null, true, true); submit_cells('SearchOrders', _("Search"), '', _('Select documents'), 'default'); hidden('OutstandingOnly', $_POST['OutstandingOnly']); end_row(); end_table(1); //--------------------------------------------------------------------------------------------- if (isset($_POST['SelectStockFromList']) && $_POST['SelectStockFromList'] != "" && $_POST['SelectStockFromList'] != ALL_TEXT) { $selected_stock_item = $_POST['SelectStockFromList']; } else { $selected_stock_item = null; } //--------------------------------------------------------------------------------------------- function trans_view($trans, $trans_no) { return get_customer_trans_view_str(ST_CUSTDELIVERY, $trans['trans_no']); }
if (!$selected_id) { submit_center('submit', _("Add New Customer"), true, '', 'default'); } else { submit_center_first('submit', _("Update Customer"), _('Update customer data'), @$_REQUEST['popup'] ? true : 'default'); submit_return('select', $selected_id, _("Select this customer and return to document entry.")); submit_center_last('delete', _("Delete Customer"), _('Delete customer data if have been never used'), true); } div_end(); } //-------------------------------------------------------------------------------------------- check_db_has_sales_types(_("There are no sales types defined. Please define at least one sales type before adding a customer.")); start_form(); if (db_has_customers()) { start_table(TABLESTYLE_NOBORDER); start_row(); customer_list_cells(_("Select a customer: "), 'customer_id', null, _('New customer'), true, check_value('show_inactive')); check_cells(_("Show inactive:"), 'show_inactive', null, true); end_row(); end_table(); if (get_post('_show_inactive_update')) { $Ajax->activate('customer_id'); set_focus('customer_id'); } } else { hidden('customer_id'); } if (!$selected_id) { unset($_POST['_tabs_sel']); } // force settings tab for new customer tabbed_content_start('tabs', array('settings' => array(_('&General settings'), $selected_id), 'contacts' => array(_('&Contacts'), $selected_id), 'transactions' => array(_('&Transactions'), $selected_id), 'orders' => array(_('Sales &Orders'), $selected_id)));
unset($_POST['dimension2_id']); unset($_POST['credit_status']); unset($_POST['payment_terms']); unset($_POST['discount']); unset($_POST['pymt_discount']); unset($_POST['credit_limit']); unset($_POST['sales_type']); unset($_POST['customer_id']); $_POST['New'] = 1; } check_db_has_sales_types(tr("There are no sales types defined. Please define at least one sales type before adding a customer.")); start_form(); if (db_has_customers()) { start_table("class = 'tablestyle_noborder'"); start_row(); customer_list_cells(tr("Select a customer: "), 'customer_id', null); submit_cells('SelectCustomer', tr("Edit Customer")); end_row(); end_table(); } else { hidden('customer_id', $_POST['customer_id']); } hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a new customer"), "New=1"); echo "<br>"; start_table($table_style2, 7, 6); echo "<tr valign=top><td>"; // outer table start_table("class='tablestyle_noborder'"); if (isset($_POST['New'])) { hidden('New', 'Yes'); $_POST['CustName'] = $_POST['address'] = $_POST['tax_id'] = '';