function display_controls() { global $table_style2; start_form(false, true); if (!isset($_POST['supplier_id'])) { $_POST['supplier_id'] = get_global_supplier(false); } if (!isset($_POST['DatePaid'])) { $_POST['DatePaid'] = Today(); if (!is_date_in_fiscalyear($_POST['DatePaid'])) { $_POST['DatePaid'] = end_fiscalyear(); } } start_table($table_style2, 5, 7); echo "<tr><td valign=top>"; // outer table echo "<table>"; bank_accounts_list_row(tr("From Bank Account:"), 'bank_account', null, true); amount_row(tr("Amount of Payment:"), 'amount'); amount_row(tr("Amount of Discount:"), 'discount'); date_row(tr("Date Paid") . ":", 'DatePaid'); echo "</table>"; echo "</td><td valign=top class='tableseparator'>"; // outer table echo "<table>"; supplier_list_row(tr("Payment To:"), 'supplier_id', null, false, true); set_global_supplier($_POST['supplier_id']); $supplier_currency = get_supplier_currency($_POST['supplier_id']); $bank_currency = get_bank_account_currency($_POST['bank_account']); if ($bank_currency != $supplier_currency) { exchange_rate_display($bank_currency, $supplier_currency, $_POST['DatePaid']); } bank_trans_types_list_row(tr("Payment Type:"), 'PaymentType', null); ref_row(tr("Reference:"), 'ref', references::get_next(22)); text_row(tr("Memo:"), 'memo_', null, 52, 50); echo "</table>"; echo "</td></tr>"; end_table(1); // outer table submit_center('ProcessSuppPayment', tr("Enter Payment")); if ($bank_currency != $supplier_currency) { display_note(tr("The amount and discount are in the bank account's currency."), 2, 0); } end_form(); }
function voiding_controls() { global $table_style2; start_form(false, true); start_table($table_style2); systypes_list_row(tr("Transaction Type:"), "filterType", null, true); text_row(tr("Transaction #:"), 'trans_no', null, 12, 12); date_row(tr("Voiding Date:"), 'date_'); textarea_row(tr("Memo:"), 'memo_', null, 30, 4); end_table(1); if (!isset($_POST['ProcessVoiding'])) { submit_center('ProcessVoiding', tr("Void Transaction")); } else { display_note(tr("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1); submit_center_first('ConfirmVoiding', tr("Proceed")); submit_center_last('CancelVoiding', tr("Cancel")); } end_form(); }
div_start('details'); if (isset($selected_id) && $selected_id != '') { $_POST['empl_id'] = $_POST['selected_id']; $myrow = get_employee($_POST['empl_id']); $_POST['empl_id'] = $myrow["empl_id"]; $_POST['empl_name'] = $myrow["empl_name"]; $gross = $_POST['gross_salary'] = $myrow["gross_salary"]; start_table(TABLESTYLE2, "width=30%"); table_section_title(_("Employee Informations")); hidden('empl_id', $_POST['empl_id']); label_row(_("Employee Name:"), $_POST['empl_id'] . '-' . $_POST['empl_name']); date_row(_("Date of Pay") . ":", 'date_of_pay'); label_row(_("Gross Pay:"), $_POST['gross_salary']); hidden('gross_pay', $_POST['gross_salary']); text_row(_("Number of Leave days :"), 'leave_days', null, 2, 40); text_row(_("Monthly loan Amount:"), 'monthly_loan', null, 2, 40); //submit_cells('RefreshInquiry', _("Show"),'',_('Show Results'), 'default'); end_table(); br(); submit_center('RefreshInquiry', _("Calculate Pay"), true, '', 'default'); br(); br(); } div_end(); if (isset($selected_id) && $selected_id != '') { div_start('totals_tbl'); $gross = $_POST['gross_salary']; //display_notification( $_POST['leave_days'].$_POST['monthly_loan']); $employee_leave_record = isset($_POST['leave_days']) ? $_POST['leave_days'] : 0; $staff_loan = isset($_POST['monthly_loan']) ? $_POST['monthly_loan'] : 0; if (db_has_employee_payslip($_POST['year'], $_POST['month'], $_POST['empl_id'])) {
$_POST['sales_account'] = $myrow["sales_account"]; $_POST['sales_discount_account'] = $myrow['sales_discount_account']; $_POST['receivables_account'] = $myrow['receivables_account']; $_POST['payment_discount_account'] = $myrow['payment_discount_account']; if (!isset($_POST['New']) && $num_branches) { // nothing to do } else { hidden('New', 'Yes'); } hidden('branch_code', $_POST['branch_code']); table_section_title(tr("Name and Contact")); text_row(tr("Branch Name:"), 'br_name', $_POST['br_name'], 35, 40); text_row(tr("Contact Person:"), 'contact_name', $_POST['contact_name'], 35, 40); text_row(tr("Phone Number:"), 'phone', null, 20, 20); text_row(tr("Fax Number:"), 'fax', null, 20, 20); text_row("<a href='Mailto:'>" . tr("E-mail:") . "</a>", 'email', $_POST['email'], 35, 55); table_section_title(tr("Sales")); sales_persons_list_row(tr("Sales Person:"), 'salesman', null); sales_areas_list_row(tr("Sales Area:"), 'area', null); locations_list_row(tr("Default Inventory Location:"), 'default_location', null); shippers_list_row(tr("Default Shipping Company:"), 'default_ship_via', null); tax_groups_list_row(tr("Tax Group:"), 'tax_group_id', null, 31, 30); language_list_row(tr("Language"), 'lang_code', null, 31, 30); yesno_list_row(tr("Disable this Branch:"), 'disable_trans', null); echo "</table>"; echo "</td><td class='tableseparator'>"; // outer table echo "<table>"; table_section_title(tr("GL Accounts")); gl_all_accounts_list_row(tr("Sales Account:"), 'sales_account', $_POST['sales_account']); gl_all_accounts_list_row(tr("Sales Discount Account:"), 'sales_discount_account', $_POST['sales_discount_account']);
$_POST['tax_group_id'] = $myrow["tax_group_id"]; $_POST['payable_account'] = $myrow["payable_account"]; $_POST['purchase_account'] = $myrow["purchase_account"]; $_POST['payment_discount_account'] = $myrow["payment_discount_account"]; } else { // its a new supplier being added hidden('New', 'Yes'); $company_record = get_company_prefs(); $_POST['payable_account'] = $company_record["creditors_act"]; $_POST['purchase_account'] = $company_record["default_cogs_act"]; $_POST['payment_discount_account'] = $company_record['pyt_discount_act']; } text_row(tr("Supplier Name:"), 'supp_name', null, 42, 40); textarea_row(tr("Address:"), 'address', null, 35, 5); text_row(tr("Email:"), 'email', null, 42, 40); text_row(tr("Bank Account:"), 'bank_account', null, 42, 40); // Sherifoz 23.09.03 currency can't be changed if editing if (isset($_POST['supplier_id']) && !isset($_POST['New'])) { label_row(tr("Supplier's Currency:"), $_POST['curr_code']); hidden('curr_code', $_POST['curr_code']); } else { currencies_list_row(tr("Supplier's Currency:"), 'curr_code', null); } tax_groups_list_row(tr("Tax Group:"), 'tax_group_id', null); payment_terms_list_row(tr("Payment Terms:"), 'payment_terms', null); table_section_title(tr("Accounts")); gl_all_accounts_list_row(tr("Accounts Payable Account:"), 'payable_account', $_POST['payable_account']); gl_all_accounts_list_row(tr("Purchase Account:"), 'purchase_account', $_POST['purchase_account']); gl_all_accounts_list_row(tr("Purchase Discount Account:"), 'payment_discount_account', $_POST['payment_discount_account']); $dim = get_company_pref('use_dimension'); if ($dim >= 1) {
function customer_settings($selected_id) { global $SysPrefs, $path_to_root, $auto_create_branch; if (!$selected_id) { if (list_updated('customer_id') || !isset($_POST['CustName'])) { $_POST['CustName'] = $_POST['cust_ref'] = $_POST['address'] = $_POST['tax_id'] = ''; $_POST['dimension_id'] = 0; $_POST['dimension2_id'] = 0; $_POST['sales_type'] = -1; $_POST['curr_code'] = get_company_currency(); $_POST['credit_status'] = -1; $_POST['payment_terms'] = $_POST['notes'] = ''; $_POST['discount'] = $_POST['pymt_discount'] = percent_format(0); $_POST['credit_limit'] = price_format($SysPrefs->default_credit_limit()); } } else { $myrow = get_customer($selected_id); $_POST['CustName'] = $myrow["name"]; $_POST['cust_ref'] = $myrow["debtor_ref"]; $_POST['address'] = $myrow["address"]; $_POST['tax_id'] = $myrow["tax_id"]; $_POST['dimension_id'] = $myrow["dimension_id"]; $_POST['dimension2_id'] = $myrow["dimension2_id"]; $_POST['sales_type'] = $myrow["sales_type"]; $_POST['curr_code'] = $myrow["curr_code"]; $_POST['credit_status'] = $myrow["credit_status"]; $_POST['payment_terms'] = $myrow["payment_terms"]; $_POST['discount'] = percent_format($myrow["discount"] * 100); $_POST['pymt_discount'] = percent_format($myrow["pymt_discount"] * 100); $_POST['credit_limit'] = price_format($myrow["credit_limit"]); $_POST['notes'] = $myrow["notes"]; $_POST['inactive'] = $myrow["inactive"]; } start_outer_table(TABLESTYLE2); table_section(1); table_section_title(_("Name and Address")); text_row(_("Customer Name:"), 'CustName', $_POST['CustName'], 40, 80); text_row(_("Customer Short Name:"), 'cust_ref', null, 30, 30); textarea_row(_("Address:"), 'address', $_POST['address'], 35, 5); text_row(_("GSTNo:"), 'tax_id', null, 40, 40); if (!$selected_id || is_new_customer($selected_id)) { currencies_list_row(_("Customer's Currency:"), 'curr_code', $_POST['curr_code']); } else { label_row(_("Customer's Currency:"), $_POST['curr_code']); hidden('curr_code', $_POST['curr_code']); } sales_types_list_row(_("Sales Type/Price List:"), 'sales_type', $_POST['sales_type']); if ($selected_id) { record_status_list_row(_("Customer status:"), 'inactive'); } elseif (isset($auto_create_branch) && $auto_create_branch == 1) { table_section_title(_("Branch")); text_row(_("Phone:"), 'phone', null, 32, 30); text_row(_("Secondary Phone Number:"), 'phone2', null, 32, 30); text_row(_("Fax Number:"), 'fax', null, 32, 30); email_row(_("E-mail:"), 'email', null, 35, 55); sales_persons_list_row(_("Sales Person:"), 'salesman', null); } table_section(2); table_section_title(_("Sales")); percent_row(_("Discount Percent:"), 'discount', $_POST['discount']); percent_row(_("Prompt Payment Discount Percent:"), 'pymt_discount', $_POST['pymt_discount']); amount_row(_("Credit Limit:"), 'credit_limit', $_POST['credit_limit']); payment_terms_list_row(_("Payment Terms:"), 'payment_terms', $_POST['payment_terms']); credit_status_list_row(_("Credit Status:"), 'credit_status', $_POST['credit_status']); $dim = get_company_pref('use_dimension'); if ($dim >= 1) { dimensions_list_row(_("Dimension") . " 1:", 'dimension_id', $_POST['dimension_id'], true, " ", false, 1); } if ($dim > 1) { dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', $_POST['dimension2_id'], true, " ", false, 2); } if ($dim < 1) { hidden('dimension_id', 0); } if ($dim < 2) { hidden('dimension2_id', 0); } if ($selected_id) { start_row(); echo '<td class="label">' . _('Customer branches') . ':</td>'; hyperlink_params_td($path_to_root . "/sales/manage/customer_branches.php", '<b>' . (@$_REQUEST['popup'] ? _("Select or &Add") : _("&Add or Edit ")) . '</b>', "debtor_no=" . $selected_id . (@$_REQUEST['popup'] ? '&popup=1' : '')); end_row(); } textarea_row(_("General Notes:"), 'notes', null, 35, 5); if (!$selected_id && isset($auto_create_branch) && $auto_create_branch == 1) { table_section_title(_("Branch")); locations_list_row(_("Default Inventory Location:"), 'location'); shippers_list_row(_("Default Shipping Company:"), 'ship_via'); sales_areas_list_row(_("Sales Area:"), 'area', null); tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null); } end_outer_table(1); div_start('controls'); 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(); }
//---------------- table_section(2); table_section_title(_("Dimension Defaults")); text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days")); //--------------- table_section_title(_("Suppliers and Purchasing")); percent_row(_("Delivery Over-Receive Allowance:"), 'po_over_receive'); percent_row(_("Invoice Over-Charge Allowance:"), 'po_over_charge'); table_section_title(_("Suppliers and Purchasing Defaults")); gl_all_accounts_list_row(_("Payable Account:"), 'creditors_act', $_POST['creditors_act']); gl_all_accounts_list_row(_("Purchase Discount Account:"), 'pyt_discount_act', $_POST['pyt_discount_act']); gl_all_accounts_list_row(_("GRN Clearing Account:"), 'grn_clearing_act', get_post('grn_clearing_act'), true, false, _("No postings on GRN")); table_section_title(_("Inventory")); check_row(_("Allow Negative Inventory:"), 'allow_negative_stock', null); label_row(null, _("Warning: This may cause a delay in GL postings"), "", "class='stockmankofg' colspan=2"); table_section_title(_("Items Defaults")); gl_all_accounts_list_row(_("Sales Account:"), 'default_inv_sales_act', $_POST['default_inv_sales_act']); gl_all_accounts_list_row(_("Inventory Account:"), 'default_inventory_act', $_POST['default_inventory_act']); // this one is default for items and suppliers (purchase account) gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'default_cogs_act', $_POST['default_cogs_act']); gl_all_accounts_list_row(_("Inventory Adjustments Account:"), 'default_adj_act', $_POST['default_adj_act']); gl_all_accounts_list_row(_("Item Assembly Costs Account:"), 'default_assembly_act', $_POST['default_assembly_act']); //---------------- table_section_title(_("Manufacturing Defaults")); text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days")); //---------------- end_outer_table(1); submit_center('submit', _("Update"), true, '', 'default'); end_form(2); //------------------------------------------------------------------------------------------------- end_page();
amount_cell($myrow["value_change"]); delete_button_cell("Delete" . $myrow['asset_valuation_id'], _("Delete")); end_row(); } end_table(1); start_table(TABLESTYLE2); if ($selected_id != -1) { if ($Mode == 'Edit') { //editing an existing status code $myrow = get_asset_valuation($selected_id); $_POST['valuationyear'] = $myrow["valuation_year"]; $_POST['assetvalue'] = number_format2($myrow["asset_value"], 2); } hidden('selected_id', $selected_id); } text_row(_("Year of Valuation :"), 'valuationyear', null, 50, 50); amount_row(_("Asset Value :"), 'assetvalue', null, null, null, 2); echo "<input type='hidden' id='assetid' name='assetid' value='" . $_POST['assetid'] . "'/>"; end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); // --------------------------------------------------------------------------------------------- echo "<hr/>\n"; $aresult = get_all_amortisation($_POST['assetid']); start_form(); start_table(TABLESTYLE, "width=50%"); $th = array(_("Year"), _("Asset Value"), _("Depreciation")); inactive_control_column($th); table_header($th); $k = 0; while ($myrow = db_fetch($aresult)) {
label_cells(tr("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>"); if ($id != "") { $fileimg = $path_to_root . "/image.php?id=" . $id; $stock_img_link = "<img src='{$fileimg}' width='100px' border='0'>"; $stock_img_link .= "<br>" . tr("Delete") . "<input type='checkbox' name='deleteImage' value='1'>"; label_cell($stock_img_link, "valign=top align=center rowspan=1"); } end_row(); stock_categories_list_row(tr("Category:"), 'category_id', null); item_tax_types_list_row(tr("Item Tax Type:"), 'tax_type_id', null); stock_item_types_list_row(tr("Item Type:"), 'mb_flag', null, !isset($_POST['NewStockID']) || isset($_POST['New'])); stock_units_list_row(tr('Units of Measure:'), 'units', null, 1); // (!isset($_POST['NewStockID']) || isset($_POST['New']))); check_row(tr("Selling:"), 'selling'); text_row(tr("Depending:"), 'depending', null, 20, 20); text_row(tr("Barcode:"), 'barcode', null, 20, 64); amount_row(tr("Weight:"), 'weight', null); end_table(); start_table("{$table_style2} width=40%"); table_section_title(tr("GL Accounts")); gl_all_accounts_list_row(tr("Sales Account:"), 'sales_account', $_POST['sales_account']); gl_all_accounts_list_row(tr("Inventory Account:"), 'inventory_account', $_POST['inventory_account']); if (!is_service($_POST['mb_flag'])) { gl_all_accounts_list_row(tr("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']); gl_all_accounts_list_row(tr("Inventory Adjustments Account:"), 'adjustment_account', $_POST['adjustment_account']); } else { hidden('cogs_account', $_POST['cogs_account']); hidden('adjustment_account', $_POST['adjustment_account']); } if (is_manufactured($_POST['mb_flag'])) { gl_all_accounts_list_row(tr("Item Assembly Costs Account:"), 'assembly_account', $_POST['assembly_account']);
label_cell($myrow["name"]); label_cell($myrow["decimals"]); edit_link_cell(SID . "selected_id={$myrow['0']}"); delete_link_cell(SID . "selected_id={$myrow['0']}&delete=yes"); end_row(); } end_table(); //---------------------------------------------------------------------------------- hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Unit of Measure")); start_form(); start_table("class='tablestyle_noborder'"); if (isset($selected_id)) { //editing an existing item category $myrow = get_item_unit($selected_id); $_POST['abbr'] = $myrow["abbr"]; $_POST['description'] = $myrow["name"]; $_POST['decimals'] = $myrow["decimals"]; hidden('selected_id', $selected_id); } if (isset($selected_id) && item_unit_used($selected_id)) { label_row(tr("Unit Abbreviation:"), $_POST['abbr']); hidden('abbr', $_POST['abbr']); } else { text_row(tr("Unit Abbreviation:"), 'abbr', null, 20, 20); } text_row(tr("Descriptive Name:"), 'description', null, 40, 40); text_row(tr("Decimal Places:"), 'decimals', null, 3, 3); end_table(1); submit_add_or_update_center(!isset($selected_id)); end_form(); end_page();
dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', $_POST['dimension2_id'], true, " ", false, 2); } text_row("Starting osC Customer ID:", 'min_cid', $min_cid, 6, 6); text_row("Ending osC Customer ID:", 'max_cid', $max_cid, 6, 6); end_table(1); hidden('action', 'c_import'); submit_center('cimport', "Import osC Customers"); end_form(); end_page(); } if ($action == 'oimport') { start_form(true); start_table("{$table_style2} width=40%"); table_section_title("Order Import Options"); text_row("Starting Order Number:", 'first_oid', $min_oid, 8, 8); text_row("Last Order Number:", 'last_oid', $max_oid, 8, 8); end_table(1); hidden('action', 'o_import'); submit_center('oimport', "Import osC Orders"); end_form(); end_page(); } if ($action == 'pcheck') { start_form(true); start_table("{$table_style2} width=40%"); table_section_title("Price Check Options"); $company_record = get_company_prefs(); currencies_list_row("Customer Currency:", 'currency', get_company_pref("curr_default")); sales_types_list_row("Sales Type:", 'sales_type', null); end_table(1); hidden('action', 'p_check');
start_form(); start_table(TABLESTYLE2); if ($selected_id != -1) { if ($Mode == 'Edit') { $myrow = get_printer($selected_id); $_POST['name'] = $myrow['name']; $_POST['descr'] = $myrow['description']; $_POST['queue'] = $myrow['queue']; $_POST['tout'] = $myrow['timeout']; $_POST['host'] = $myrow['host']; $_POST['port'] = $myrow['port']; } hidden('selected_id', $selected_id); } else { if (!isset($_POST['host'])) { $_POST['host'] = 'localhost'; } if (!isset($_POST['port'])) { $_POST['port'] = '515'; } } text_row(_("Printer Name") . ':', 'name', null, 20, 20); text_row(_("Printer Description") . ':', 'descr', null, 40, 60); text_row(_("Host name or IP") . ':', 'host', null, 30, 40); text_row(_("Port") . ':', 'port', null, 5, 5); text_row(_("Printer Queue") . ':', 'queue', null, 20, 20); text_row(_("Timeout") . ':', 'tout', null, 5, 5); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page();
} hidden('selected_id', $selected_id); hidden('account_code'); hidden('account_type'); hidden('BankAccountCurrency', $_POST['BankAccountCurrency']); set_focus('bank_account_name'); } text_row(_("Bank Account Name:"), 'bank_account_name', null, 50, 100); if ($is_used) { label_row(_("Account Type:"), $bank_account_types[$_POST['account_type']]); } else { bank_account_types_list_row(_("Account Type:"), 'account_type', null); } if ($is_used) { label_row(_("Bank Account Currency:"), $_POST['BankAccountCurrency']); } else { currencies_list_row(_("Bank Account Currency:"), 'BankAccountCurrency', null); } yesno_list_row(_("Default currency account:"), 'dflt_curr_act'); if ($is_used) { label_row(_("Bank Account GL Code:"), $_POST['account_code']); } else { gl_all_accounts_list_row(_("Bank Account GL Code:"), 'account_code', null); } text_row(_("Bank Name:"), 'bank_name', null, 50, 60); text_row(_("Bank Account Number:"), 'bank_account_number', null, 30, 60); textarea_row(_("Bank Address:"), 'bank_address', null, 40, 5); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page();
table_section_title(_("Employee Informations")); if (isset($selected_id) && $selected_id != '') { label_row(_("Employee ID:"), $_POST['empl_id']); hidden('empl_id', $_POST['empl_id']); } text_row(_("Employee Name *:"), 'empl_name', null, 28, 80); textarea_row(_("Present Address:"), 'pre_address', null, 25, 2); textarea_row(_("Permanent Address:"), 'per_address', null, 25, 2); date_row(_("Date of Birth") . ":", 'date_of_birth'); text_row(_("Age:"), 'age', null, 3, 10); text_row(_("Mobile Phone *:"), 'mobile_phone', null, 28, 40); text_row(_("Email *:"), 'email', null, 28, 40); table_section(2); table_section_title(_("Employee Job Info")); text_row(_("Grade:"), 'grade', null, 28, 10); text_row(_("Department:"), 'department', null, 28, 40); text_row(_("Designation:"), 'designation', null, 28, 40); text_row(_("Gross Salary Per Month *:"), 'gross_salary', null, 28, 40); text_row(_("Basic Salary Per Month *:"), 'basic_salary', null, 28, 40); date_row(_("Date of Join") . ":", 'date_of_join'); end_outer_table(1); if (isset($selected_id) && $selected_id != '') { submit_center_first('submit', _("Update Employee"), '', @$_REQUEST['popup'] ? true : 'default'); submit('delete', _("Delete employee"), true, '', true); submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel'); } else { submit_center('submit', _("Add New Employee"), true, '', 'default'); } div_end(); end_form(); end_page();
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(); print_profiles_list_row(_('Select printing profile') . ':', 'profile_id', null, _('New printing profile'), true); end_table(); echo '<hr>'; start_table(); if (get_post('profile_id') == '') { text_row(_("Printing Profile Name") . ':', 'name', null, 30, 30); } else { label_cells(_("Printing Profile Name") . ':', get_post('profile_id')); } end_table(1); $result = get_print_profile(get_post('profile_id')); $prints = array(); while ($myrow = db_fetch($result)) { $prints[$myrow['report']] = $myrow['printer']; } start_table(TABLESTYLE); $th = array(_("Report Id"), _("Description"), _("Printer")); table_header($th); $k = 0; $unkn = 0; foreach (get_reports() as $rep => $descr) {
function display_credit_items() { start_form(); hidden('cart_id'); start_table(TABLESTYLE2, "width=80%", 5); echo "<tr><td>"; // outer table start_table(TABLESTYLE, "width=100%"); start_row(); label_cells(_("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'"); label_cells(_("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'"); label_cells(_("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'"); end_row(); start_row(); // if (!isset($_POST['ref'])) // $_POST['ref'] = $Refs->get_next(11); if ($_SESSION['Items']->trans_no == 0) { ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'"); } else { label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'"); } label_cells(_("Crediting Invoice"), get_customer_trans_view_str(ST_SALESINVOICE, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'"); if (!isset($_POST['ShipperID'])) { $_POST['ShipperID'] = $_SESSION['Items']->ship_via; } label_cell(_("Shipping Company"), "class='tableheader2'"); shippers_list_cells(null, 'ShipperID', $_POST['ShipperID']); // if (!isset($_POST['sales_type_id'])) // $_POST['sales_type_id'] = $_SESSION['Items']->sales_type; // label_cell(_("Sales Type"), "class='tableheader2'"); // sales_types_list_cells(null, 'sales_type_id', $_POST['sales_type_id']); end_row(); end_table(); echo "</td><td>"; // outer table start_table(TABLESTYLE, "width=100%"); if ($_SESSION['Items']->custom_num != '') { text_row(_("Credit Memo No."), 'custom_num', $_SESSION['Items']->custom_num, null, "class='tableheader2'"); } else { text_row(_("Credit Memo No."), 'custom_num', '', null, "class='tableheader2'"); } //moodlearning label_row(_("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'"); date_row(_("Credit Note Date"), 'CreditDate', '', $_SESSION['Items']->trans_no == 0, 0, 0, 0, "class='tableheader2'"); end_table(); echo "</td></tr>"; end_table(1); // outer table div_start('credit_items'); start_table(TABLESTYLE, "width=80%"); $th = array(_("Item Code"), _("Item Description"), _("Invoiced Quantity"), _("Units"), _("Credited"), _("Credit Quantity"), _("Price"), _("Discount %"), _("Total")); //Karen edited Credited table_header($th); $k = 0; //row colour counter foreach ($_SESSION['Items']->line_items as $line_no => $ln_itm) { if ($ln_itm->quantity == $ln_itm->qty_done) { continue; // this line was fully credited/removed } alt_table_row_color($k); // view_stock_status_cell($ln_itm->stock_id); alternative view label_cell($ln_itm->stock_id); text_cells(null, 'Line' . $line_no . 'Desc', $ln_itm->item_description, 30, 50); $dec = get_qty_dec($ln_itm->stock_id); qty_cell($ln_itm->quantity, false, $dec); label_cell($ln_itm->units); label_cell($ln_itm->qty_done); //Karen edited amount_cells(null, 'Line' . $line_no, number_format2($ln_itm->qty_dispatched, $dec), null, null, $dec); $line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent); amount_cell($ln_itm->price); percent_cell($ln_itm->discount_percent * 100); amount_cell($line_total); end_row(); } if (!check_num('ChargeFreightCost')) { $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost); } $colspan = 8; //Karen edited 7 start_row(); label_cell(_("Credit Shipping Cost"), "colspan={$colspan} align=right"); small_amount_cells(null, "ChargeFreightCost", price_format(get_post('ChargeFreightCost', 0))); end_row(); /*moodlearning*/ start_row(); label_cell(_("Bulk Discount"), "colspan={$colspan} align=right"); small_amount_cells(null, "bulk_dis", $_SESSION['Items']->bulk_discount); end_row(); /* */ $inv_items_total = $_SESSION['Items']->get_items_total_dispatch(); $discount = input_num('bulk_dis') / 100; $display_sub_total = price_format($inv_items_total + input_num($_POST['ChargeFreightCost'])); label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right"); $taxes = $_SESSION['Items']->get_taxes(input_num($_POST['ChargeFreightCost'])); $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included); /*moodlearning*/ $total = $inv_items_total + input_num('ChargeFreightCost') + $tax_total; $tot = price_format($total - $total * $discount); /* */ $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total); label_row(_("Credit Note Total"), $tot, "colspan={$colspan} align=right", "align=right"); //moodlearning edit $tot end_table(); div_end(); }
//end of page full new headings } //end of while loop end_table(); div_end(); //----------------------------------------------------------------------------------------------- if ($selected_id != '') { if ($Mode == 'Edit') { $myrow = get_item_code($selected_id); $_POST['item_code'] = $myrow["item_code"]; $_POST['quantity'] = $myrow["quantity"]; $_POST['description'] = $myrow["description"]; $_POST['category_id'] = $myrow["category_id"]; } hidden('selected_id', $selected_id); } else { $_POST['quantity'] = 1; $_POST['description'] = $dflt_desc; $_POST['category_id'] = $dflt_cat; } echo "<br>"; start_table(TABLESTYLE2); hidden('code_id', $selected_id); text_row(_("UPC/EAN code:"), 'item_code', null, 20, 21); qty_row(_("Quantity:"), 'quantity', null, '', $units, $dec); text_row(_("Description:"), 'description', null, 50, 200); stock_categories_list_row(_("Category:"), 'category_id', null); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page();
label_cell($myrow["point_of_use"]); label_cell($myrow["narrative"]); label_cell(sql2date($myrow["application_date"])); edit_button_cell("Edit" . $myrow['requisition_id'], _("Edit")); inactive_control_cell($myrow["requisition_id"], $myrow["inactive"], 'requisitions', 'requisition_id'); delete_button_cell("Delete" . $myrow['requisition_id'], _("Delete")); echo "<td><a href='requisition_details.php?requisitionid=" . $myrow['requisition_id'] . "'>" . _("Details") . "</a></td>\n"; end_row(); } inactive_control_row($th); end_table(1); //----------------------------------------------------------------------------------- start_table(TABLESTYLE2); if ($selected_id != -1) { if ($Mode == 'Edit') { //editing an existing status code $myrow = get_requisition($selected_id); $_POST['point_of_use'] = $myrow["point_of_use"]; $_POST['narrative'] = $myrow["narrative"]; $_POST['details'] = $myrow["details"]; } hidden('selected_id', $selected_id); } text_row(_("Point of use :"), 'point_of_use', null, 50, 50); text_row(_("Narrative :"), 'narrative', null, 50, 50); textarea_row(_("Details :"), 'details', null, 50, 5); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); //------------------------------------------------------------------------------------ end_page();
$_POST['suppliers_uom'] = $myrow["suppliers_uom"]; $_POST['supplier_description'] = $myrow["supplier_description"]; $_POST['conversion_factor'] = maxprec_format($myrow["conversion_factor"]); } br(); hidden('selected_id', $selected_id); if (@$_GET['popup']) { hidden('_tabs_sel', get_post('_tabs_sel')); hidden('popup', @$_GET['popup']); } start_table(TABLESTYLE2); if ($Mode == 'Edit') { hidden('supplier_id'); label_row(_("Supplier:"), $supp_name); } else { supplier_list_row(_("Supplier:"), 'supplier_id', null, false, true); $_POST['price'] = $_POST['suppliers_uom'] = $_POST['conversion_factor'] = $_POST['supplier_description'] = ""; } amount_row(_("Price:"), 'price', null, '', get_supplier_currency($selected_id), $dec2); text_row(_("Suppliers Unit of Measure:"), 'suppliers_uom', null, 50, 51); if (!isset($_POST['conversion_factor']) || $_POST['conversion_factor'] == "") { $_POST['conversion_factor'] = maxprec_format(1); } amount_row(_("Conversion Factor (to our UOM):"), 'conversion_factor', maxprec_format($_POST['conversion_factor']), null, null, 'max'); text_row(_("Supplier's Code or Description:"), 'supplier_description', null, 50, 51); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); if (!@$_GET['popup']) { end_form(); end_page(@$_GET['popup'], false, false); }
function supplier_settings(&$supplier_id) { start_outer_table(TABLESTYLE2); table_section(1); if ($supplier_id) { //SupplierID exists - either passed when calling the form or from the form itself $myrow = get_supplier($_POST['supplier_id']); $_POST['supp_name'] = $myrow["supp_name"]; $_POST['supp_ref'] = $myrow["supp_ref"]; $_POST['address'] = $myrow["address"]; $_POST['supp_address'] = $myrow["supp_address"]; $_POST['gst_no'] = $myrow["gst_no"]; $_POST['website'] = $myrow["website"]; $_POST['supp_account_no'] = $myrow["supp_account_no"]; $_POST['bank_account'] = $myrow["bank_account"]; $_POST['dimension_id'] = $myrow["dimension_id"]; $_POST['dimension2_id'] = $myrow["dimension2_id"]; $_POST['curr_code'] = $myrow["curr_code"]; $_POST['payment_terms'] = $myrow["payment_terms"]; $_POST['credit_limit'] = price_format($myrow["credit_limit"]); $_POST['tax_group_id'] = $myrow["tax_group_id"]; $_POST['tax_included'] = $myrow["tax_included"]; $_POST['payable_account'] = $myrow["payable_account"]; $_POST['purchase_account'] = $myrow["purchase_account"]; $_POST['payment_discount_account'] = $myrow["payment_discount_account"]; $_POST['notes'] = $myrow["notes"]; $_POST['inactive'] = $myrow["inactive"]; } else { $_POST['supp_name'] = $_POST['supp_ref'] = $_POST['address'] = $_POST['supp_address'] = $_POST['tax_group_id'] = $_POST['website'] = $_POST['supp_account_no'] = $_POST['notes'] = ''; $_POST['dimension_id'] = 0; $_POST['dimension2_id'] = 0; $_POST['tax_included'] = 0; $_POST['sales_type'] = -1; $_POST['gst_no'] = $_POST['bank_account'] = ''; $_POST['payment_terms'] = ''; $_POST['credit_limit'] = price_format(0); $company_record = get_company_prefs(); $_POST['curr_code'] = $company_record["curr_default"]; $_POST['payable_account'] = $company_record["creditors_act"]; $_POST['purchase_account'] = ''; // default/item's cogs account $_POST['payment_discount_account'] = $company_record['pyt_discount_act']; } table_section_title(_("Basic Data")); text_row(_("Supplier Name:"), 'supp_name', null, 42, 40); text_row(_("Supplier Short Name:"), 'supp_ref', null, 30, 30); text_row(_("GSTNo:"), 'gst_no', null, 42, 40); link_row(_("Website:"), 'website', null, 35, 55); if ($supplier_id && !is_new_supplier($supplier_id) && (key_in_foreign_table($_POST['supplier_id'], 'supp_trans', 'supplier_id') || key_in_foreign_table($_POST['supplier_id'], 'purch_orders', 'supplier_id'))) { label_row(_("Supplier's Currency:"), $_POST['curr_code']); hidden('curr_code', $_POST['curr_code']); } else { currencies_list_row(_("Supplier's Currency:"), 'curr_code', null); } tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null); text_row(_("Our Customer No:"), 'supp_account_no', null, 42, 40); table_section_title(_("Purchasing")); text_row(_("Bank Name/Account:"), 'bank_account', null, 42, 40); amount_row(_("Credit Limit:"), 'credit_limit', null); payment_terms_list_row(_("Payment Terms:"), 'payment_terms', null); // // tax_included option from supplier record is used directly in update_average_cost() function, // therefore we can't edit the option after any transaction waas done for the supplier. // if (is_new_supplier($supplier_id)) { check_row(_("Prices contain tax included:"), 'tax_included'); } else { hidden('tax_included'); label_row(_("Prices contain tax included:"), $_POST['tax_included'] ? _('Yes') : _('No')); } table_section_title(_("Accounts")); gl_all_accounts_list_row(_("Accounts Payable Account:"), 'payable_account', $_POST['payable_account']); gl_all_accounts_list_row(_("Purchase Account:"), 'purchase_account', $_POST['purchase_account'], false, false, _("Use Item Inventory/COGS Account")); gl_all_accounts_list_row(_("Purchase Discount Account:"), 'payment_discount_account', $_POST['payment_discount_account']); if (!$supplier_id) { table_section_title(_("Contact Data")); text_row(_("Phone Number:"), 'phone', null, 32, 30); text_row(_("Secondary Phone Number:"), 'phone2', null, 32, 30); } table_section(2); $dim = get_company_pref('use_dimension'); if ($dim >= 1) { table_section_title(_("Dimension")); dimensions_list_row(_("Dimension") . " 1:", 'dimension_id', null, true, " ", false, 1); if ($dim > 1) { dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', null, true, " ", false, 2); } } if ($dim < 1) { hidden('dimension_id', 0); } if ($dim < 2) { hidden('dimension2_id', 0); } table_section_title(_("Addresses")); textarea_row(_("Mailing Address:"), 'address', null, 35, 5); textarea_row(_("Physical Address:"), 'supp_address', null, 35, 5); table_section_title(_("General")); textarea_row(_("General Notes:"), 'notes', null, 35, 5); if ($supplier_id) { record_status_list_row(_("Supplier status:"), 'inactive'); } else { table_section_title(_("Contact Data")); text_row(_("Contact Person:"), 'contact', null, 42, 40); text_row(_("Fax Number:"), 'fax', null, 32, 30); email_row(_("E-mail:"), 'email', null, 35, 55); languages_list_row(_("Document Language:"), 'rep_lang', null, _('System default')); } end_outer_table(1); div_start('controls'); if ($supplier_id) { submit_center_first('submit', _("Update Supplier"), _('Update supplier data'), @$_REQUEST['popup'] ? true : 'default'); submit_return('select', get_post('supplier_id'), _("Select this supplier and return to document entry.")); submit_center_last('delete', _("Delete Supplier"), _('Delete supplier data if have been never used'), true); } else { submit_center('submit', _("Add New Supplier Details"), true, '', 'default'); } div_end(); }
//END WHILE LIST LOOP end_table(); hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Payment Term")); //------------------------------------------------------------------------------------------------- start_form(); start_table($table_style2); $day_in_following_month = $days_before_due = 0; if (isset($selected_id)) { //editing an existing payment terms $sql = "SELECT * FROM payment_terms\n\t\tWHERE terms_indicator='{$selected_id}'"; $result = db_query($sql, "could not get payment term"); $myrow = db_fetch($result); $_POST['terms'] = $myrow["terms"]; $days_before_due = $myrow["days_before_due"]; $day_in_following_month = $myrow["day_in_following_month"]; hidden('selected_id', $selected_id); } text_row(tr("Terms Description:"), 'terms', null, 40, 40); check_row(tr("Due After A Given No. Of Days:"), 'DaysOrFoll', $day_in_following_month == 0); if (!isset($_POST['DayNumber'])) { if ($days_before_due != 0) { $_POST['DayNumber'] = $days_before_due; } else { $_POST['DayNumber'] = $day_in_following_month; } } text_row_ex(tr("Days (Or Day In Following Month):"), 'DayNumber', 3); end_table(1); submit_add_or_update_center(!isset($selected_id)); end_form(); end_page();
gl_all_accounts_list_row("Sales Discount Account:", 'sales_discount_account', $_POST['sales_discount_account']); gl_all_accounts_list_row("Receivables Account:", 'receivables_account', $_POST['receivables_account']); gl_all_accounts_list_row("Payment Discount Account:", 'payment_discount_account', $_POST['payment_discount_account']); table_section_title("Location, Tax Type, Sales Type, Sales Person and Payment Terms"); locations_list_row("Location:", 'default_location', 'DEF'); tax_groups_list_row(_("Default Tax Group:"), 'tax_group_id', $default_TaxGroup); sales_types_list_row("Sales Type:", 'sales_type', null); sales_persons_list_row("Sales Person:", 'salesman', null); sales_areas_list_row("Sales Area:", 'area'); currencies_list_row("Customer Currency:", 'currency', $default_Currency); payment_terms_list_row("Payment Terms:", 'payment_terms', null); text_row("Starting Zen Cart Customer ID:", 'min_cid', $min_cid, 10, 10); text_row("Ending Zen Cart Customer ID:", 'max_cid', $max_cid, 10, 10); end_table(1); hidden('action', 'c_import'); submit_center('cimport', "Import Zen Cart Customers"); end_form(); end_page(); } if ($action == 'oimport') { start_form(true); start_table(TABLESTYLE2, "width=40%"); table_section_title("Order Import Options"); text_row("Starting Order Number:", 'first_oid', $min_oid, 10, 10); text_row("Last Order Number:", 'last_oid', $max_oid, 10, 10); end_table(1); hidden('action', 'o_import'); submit_center('oimport', "Import Zen Cart Orders"); end_form(); end_page(); }
hidden('BranchID', ANY_NUMERIC); } read_customer_data(); set_global_customer($_POST['customer_id']); if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) { display_warning(_("This customer account is on hold.")); } $display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%"; table_section(2); if (!list_updated('bank_account')) { $_POST['bank_account'] = get_default_customer_bank_account($_POST['customer_id']); } //Chaitanya : 13-OCT-2011 - Is AJAX call really needed ??? //bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true); bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, false); text_row(_("Reference:"), 'ref', null, 20, 40); table_section(3); date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true); $comp_currency = get_company_currency(); $cust_currency = get_customer_currency($_POST['customer_id']); $bank_currency = get_bank_account_currency($_POST['bank_account']); if ($cust_currency != $bank_currency) { exchange_rate_display($bank_currency, $cust_currency, $_POST['DateBanked'], $bank_currency == $comp_currency); } amount_row(_("Bank Charge:"), 'charge'); end_outer_table(1); if ($cust_currency == $bank_currency) { div_start('alloc_tbl'); show_allocatable(false); div_end(); }
$display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%"; table_section(2); date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true); ref_row(_("PR #/Reference:"), 'ref', '', null, '', ST_CUSTPAYMENT); table_section(3); $comp_currency = get_company_currency(); $cust_currency = $_SESSION['alloc']->set_person($_POST['customer_id'], PT_CUSTOMER); if (!$cust_currency) { $cust_currency = $comp_currency; } $_SESSION['alloc']->currency = $bank_currency = get_bank_account_currency($_POST['bank_account']); if ($cust_currency != $bank_currency) { amount_row(_("Payment Amount:"), 'bank_amount', null, '', $bank_currency); } amount_row(_("Bank Charge:"), 'charge', null, '', $bank_currency); text_row(_("OR #:"), 'or_num', null, ''); //moodlearning date_row(_("Date of OR:"), 'or_date', '', true, 0, 0, 0, null, true); //moodlearning end_outer_table(1); div_start('alloc_tbl'); show_allocatable(false); div_end(); start_table(TABLESTYLE, "width=60%"); label_row(_("Customer prompt payment discount :"), $display_discount_percent); amount_row(_("Amount of Discount:"), 'discount', null, '', $cust_currency); amount_row(_("Amount:"), 'amount', null, '', $cust_currency); textarea_row(_("Memo:"), 'memo_', null, 22, 4); end_table(1); if ($new) { submit_center('AddPaymentItem', _("Add Payment"), true, '', 'default');
edit_button_cell("Edit" . $myrow['requisition_detail_id'], _("Edit")); delete_button_cell("Delete" . $myrow['requisition_detail_id'], _("Delete")); end_row(); } end_table(1); //----------------------------------------------------------------------------------- start_table(TABLESTYLE2); if ($selected_id != -1) { if ($Mode == 'Edit') { //editing an existing status code $myrow = get_requisition_detail($selected_id); $_POST['item_code'] = $myrow["item_code"]; $_POST['purpose'] = $myrow["purpose"]; $_POST['order_quantity'] = $myrow["order_quantity"]; $_POST['estimate_price'] = $myrow["estimate_price"]; } hidden('selected_id', $selected_id); } sales_local_items_list_row(_("Item :"), 'item_code', null, false, false); text_row(_("Purpose :"), 'purpose', null, 50, 50); $res = get_item_edit_info(get_post('item_code')); $dec = $res["decimals"] == '' ? 0 : $res["decimals"]; $units = $res["units"] == '' ? _('kits') : $res["units"]; qty_row(_("Requisition Quantity:"), 'order_quantity', number_format2(1, $dec), '', $units, $dec); amount_row(_("Estimate Price :"), 'estimate_price', null, null, null, 2); hidden('requisitionid'); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); //------------------------------------------------------------------------------------ end_page();
function display_item_form() { global $table_style2; start_table($table_style2, 5, 7); echo "<tr><td valign=top>"; // outer table echo "<table>"; if (!isset($_POST['customer_id'])) { $_POST['customer_id'] = get_global_customer(false); } if (!isset($_POST['DateBanked'])) { $_POST['DateBanked'] = Today(); if (!is_date_in_fiscalyear($_POST['DateBanked'])) { $_POST['DateBanked'] = end_fiscalyear(); } } customer_list_row(tr("From Customer:"), 'customer_id', null, false, true); if (db_customer_has_branches($_POST['customer_id'])) { customer_branches_list_row(tr("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true); } else { hidden('BranchID', reserved_words::get_any_numeric()); } read_customer_data(); set_global_customer($_POST['customer_id']); if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) { echo "</table></table>"; display_note(tr("This customer account is on hold."), 0, 0, "class='redfb'"); } else { $display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%"; amount_row(tr("Amount:"), 'amount'); amount_row(tr("Amount of Discount:"), 'discount'); label_row(tr("Customer prompt payment discount :"), $display_discount_percent); date_row(tr("Date of Deposit:"), 'DateBanked'); echo "</table>"; echo "</td><td valign=top class='tableseparator'>"; // outer table echo "<table>"; bank_accounts_list_row(tr("Into Bank Account:"), 'bank_account', null, true); $cust_currency = get_customer_currency($_POST['customer_id']); $bank_currency = get_bank_account_currency($_POST['bank_account']); if ($cust_currency != $bank_currency) { exchange_rate_display($cust_currency, $bank_currency, $_POST['DateBanked']); } bank_trans_types_list_row(tr("Type:"), 'ReceiptType', null); text_row(tr("Reference:"), 'ref', null, 20, 40); textarea_row(tr("Memo:"), 'memo_', null, 22, 4); echo "</table>"; echo "</td></tr>"; end_table(); // outer table if ($cust_currency != $bank_currency) { display_note(tr("Amount and discount are in customer's currency.")); } echo "<br>"; submit_center('AddPaymentItem', tr("Add Payment")); } echo "<br>"; }
} if (get_post('cogs_account') == "") { $_POST['cogs_account'] = $company_record["default_cogs_act"]; } if (get_post('sales_account') == "") { $_POST['sales_account'] = $company_record["default_inv_sales_act"]; } if (get_post('adjustment_account') == "") { $_POST['adjustment_account'] = $company_record["default_adj_act"]; } if (get_post('assembly_account') == "") { $_POST['assembly_account'] = $company_record["default_assembly_act"]; } } } text_row(_("Category Name:"), 'description', null, 30, 30); table_section_title(_("Default values for new items")); item_tax_types_list_row(_("Item Tax Type:"), 'tax_type_id', null); stock_item_types_list_row(_("Item Type:"), 'mb_flag', null, true); stock_units_list_row(_("Units of Measure:"), 'units', null); check_row(_("Exclude from sales:"), 'no_sale'); gl_all_accounts_list_row(_("Sales Account:"), 'sales_account', $_POST['sales_account']); if (is_service($_POST['mb_flag'])) { gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']); hidden('inventory_account', $_POST['inventory_account']); hidden('adjustment_account', $_POST['adjustment_account']); } else { gl_all_accounts_list_row(_("Inventory Account:"), 'inventory_account', $_POST['inventory_account']); gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']); gl_all_accounts_list_row(_("Inventory Adjustments Account:"), 'adjustment_account', $_POST['adjustment_account']); }
if ($selected_id != -1) { //editing an existing Location if ($Mode == 'Edit') { $myrow = get_item_location($selected_id); $_POST['loc_code'] = $myrow["loc_code"]; $_POST['location_name'] = $myrow["location_name"]; $_POST['delivery_address'] = $myrow["delivery_address"]; $_POST['contact'] = $myrow["contact"]; $_POST['phone'] = $myrow["phone"]; $_POST['phone2'] = $myrow["phone2"]; $_POST['fax'] = $myrow["fax"]; $_POST['email'] = $myrow["email"]; } hidden("selected_id", $selected_id); hidden("loc_code"); label_row(_("Location Code:"), $_POST['loc_code']); } else { //end of if $selected_id only do the else when a new record is being entered text_row(_("Location Code:"), 'loc_code', null, 5, 5); } text_row_ex(_("Location Name:"), 'location_name', 50, 50); text_row_ex(_("Contact for deliveries:"), 'contact', 30, 30); textarea_row(_("Address:"), 'delivery_address', null, 35, 5); text_row_ex(_("Telephone No:"), 'phone', 32, 30); text_row_ex(_("Secondary Phone Number:"), 'phone2', 32, 30); text_row_ex(_("Facsimile No:"), 'fax', 32, 30); email_row_ex(_("E-mail:"), 'email', 30); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page();
} // if unassembling, negate quantity if ($_POST['ProductionType'] == 0) { $_POST['quantity'] = -$_POST['quantity']; } $id = work_order_produce($_POST['selected_id'], $_POST['ref'], $_POST['quantity'], $_POST['date_'], $_POST['memo_'], $close_wo); meta_forward($_SERVER['PHP_SELF'], "AddedID={$id}"); } //------------------------------------------------------------------------------------- display_wo_details($_POST['selected_id']); //------------------------------------------------------------------------------------- start_form(); hidden('selected_id', $_POST['selected_id']); //hidden('WOReqQuantity', $_POST['WOReqQuantity']); if (!isset($_POST['quantity']) || $_POST['quantity'] == '') { $_POST['quantity'] = max($wo_details["units_reqd"] - $wo_details["units_issued"], 0); } start_table(); ref_row(tr("Reference:"), 'ref', references::get_next(29)); if (!isset($_POST['ProductionType'])) { $_POST['ProductionType'] = 1; } yesno_list_row(tr("Type:"), 'ProductionType', $_POST['ProductionType'], tr("Produce Finished Items"), tr("Return Items to Work Order")); text_row(tr("Quantity:"), 'quantity', $_POST['quantity'], 13, 15); date_row(tr("Date:"), 'date_'); textarea_row(tr("Memo:"), 'memo_', null, 40, 3); end_table(1); submit_center_first('Process', tr("Process")); submit_center_last('ProcessAndClose', tr("Process And Close Order")); end_form(); end_page();
$_POST['real_name'] = $myrow["real_name"]; $_POST['phone'] = $myrow["phone"]; $_POST['email'] = $myrow["email"]; $_POST['role_id'] = $myrow["role_id"]; $_POST['language'] = $myrow["language"]; $_POST['print_profile'] = $myrow["print_profile"]; $_POST['rep_popup'] = $myrow["rep_popup"]; $_POST['pos'] = $myrow["pos"]; } hidden('selected_id', $selected_id); hidden('user_id'); start_row(); label_row(_("User login:"******"User Login:"******"user_id", null, 22, 20); $_POST['language'] = user_language(); $_POST['print_profile'] = user_print_profile(); $_POST['rep_popup'] = user_rep_popup(); $_POST['pos'] = user_pos(); } $_POST['password'] = ""; password_row(_("Password:"******"Enter a new password to change, leave empty to keep current.")); } text_row_ex(_("Full Name") . ":", 'real_name', 50); text_row_ex(_("Telephone No.:"), 'phone', 30); email_row_ex(_("Email Address:"), 'email', 50); security_roles_list_row(_("Access Level:"), 'role_id', null); languages_list_row(_("Language:"), 'language', null);