function gl_payment_controls() { global $table_style2; $home_currency = get_company_currency(); start_form(false, true); start_table($table_style2, 5, 7); echo "<tr><td valign=top>"; // outer table echo "<table>"; bank_accounts_list_row(tr("From Account:"), 'FromBankAccount', null, true); bank_accounts_list_row(tr("To Account:"), 'ToBankAccount', null, true); date_row(tr("Transfer Date:"), 'DatePaid'); $from_currency = get_bank_account_currency($_POST['FromBankAccount']); $to_currency = get_bank_account_currency($_POST['ToBankAccount']); if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) { amount_row(tr("Amount:"), 'amount', null, null, $from_currency); exchange_rate_display($from_currency, $to_currency, $_POST['DatePaid']); } else { amount_row(tr("Amount:"), 'amount'); } echo "</table>"; echo "</td><td valign=top class='tableseparator'>"; // outer table echo "<table>"; bank_trans_types_list_row(tr("Transfer Type:"), 'TransferType', null); ref_row(tr("Reference:"), 'ref', references::get_next(systypes::bank_transfer())); textarea_row(tr("Memo:"), 'memo_', null, 40, 4); end_table(1); echo "</td></tr>"; end_table(1); // outer table submit_center('AddPayment', tr("Enter Transfer")); end_form(); }
function display_reval() { global $Refs; start_form(); start_table(TABLESTYLE2); if (!isset($_POST['date'])) { $_POST['date'] = Today(); } date_row(_("Date for Revaluation:"), 'date', '', null, 0, 0, 0, null, true); ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_JOURNAL)); textarea_row(_("Memo:"), 'memo_', null, 40, 4); end_table(1); submit_center('submit', _("Revaluate Currencies"), true, false); end_form(); }
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(); }
function gl_payment_controls() { global $Refs; $home_currency = get_company_currency(); start_form(); start_outer_table(TABLESTYLE2); table_section(1); bank_accounts_list_row(_("From Account:"), 'FromBankAccount', null, true); bank_balance_row($_POST['FromBankAccount']); bank_accounts_list_row(_("To Account:"), 'ToBankAccount', null, true); if (!isset($_POST['DatePaid'])) { // init page $_POST['DatePaid'] = new_doc_date(); if (!is_date_in_fiscalyear($_POST['DatePaid'])) { $_POST['DatePaid'] = end_fiscalyear(); } } date_row(_("Transfer Date:"), 'DatePaid', '', true, 0, 0, 0, null, true); ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_BANKTRANSFER)); table_section(2); $from_currency = get_bank_account_currency($_POST['FromBankAccount']); $to_currency = get_bank_account_currency($_POST['ToBankAccount']); if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) { amount_row(_("Amount:"), 'amount', null, null, $from_currency); amount_row(_("Bank Charge:"), 'charge', null, null, $from_currency); amount_row(_("Incoming Amount:"), 'target_amount', null, '', $to_currency, 2); } else { amount_row(_("Amount:"), 'amount'); amount_row(_("Bank Charge:"), 'charge'); } textarea_row(_("Memo:"), 'memo_', null, 40, 4); end_outer_table(1); // outer table submit_center('AddPayment', _("Enter Transfer"), true, '', 'default'); end_form(); }
function voiding_controls() { global $selected_id; $not_implemented = array(ST_PURCHORDER, ST_SALESORDER, ST_SALESQUOTE, ST_COSTUPDATE); start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); systypes_list_cells(_("Type:"), 'filterType', null, true, $not_implemented); if (list_updated('filterType')) { $selected_id = -1; } if (!isset($_POST['FromTransNo'])) { $_POST['FromTransNo'] = "1"; } if (!isset($_POST['ToTransNo'])) { $_POST['ToTransNo'] = "999999"; } ref_cells(_("from #:"), 'FromTransNo'); ref_cells(_("to #:"), 'ToTransNo'); submit_cells('ProcessSearch', _("Search"), '', '', 'default'); end_row(); end_table(1); $trans_ref = false; $sql = get_sql_for_view_transactions($_POST['filterType'], $_POST['FromTransNo'], $_POST['ToTransNo'], $trans_ref); if ($sql == "") { return; } $cols = array(_("#") => array('insert' => true, 'fun' => 'view_link'), _("Reference") => array('fun' => 'ref_view'), _("Date") => array('type' => 'date', 'fun' => 'date_view'), _("GL") => array('insert' => true, 'fun' => 'gl_view'), _("Select") => array('insert' => true, 'fun' => 'select_link')); $table =& new_db_pager('transactions', $sql, $cols); $table->width = "40%"; display_db_pager($table); start_table(TABLESTYLE2); if ($selected_id != -1) { hidden('trans_no', $selected_id); hidden('selected_id', $selected_id); } else { hidden('trans_no', ''); $_POST['memo_'] = ''; } label_row(_("Transaction #:"), $selected_id == -1 ? '' : $selected_id); date_row(_("Voiding Date:"), 'date_'); textarea_row(_("Memo:"), 'memo_', null, 30, 4); end_table(1); if (!isset($_POST['ProcessVoiding'])) { submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default'); } else { if (!exist_transaction($_POST['filterType'], $_POST['trans_no'])) { display_error(_("The entered transaction does not exist or cannot be voided.")); unset($_POST['trans_no']); unset($_POST['memo_']); unset($_POST['date_']); submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default'); } else { display_warning(_("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1); br(); submit_center_first('ConfirmVoiding', _("Proceed"), '', true); submit_center_last('CancelVoiding', _("Cancel"), '', 'cancel'); } } end_form(); }
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'); } else { submit_center('AddPaymentItem', _("Update Payment"), true, '', 'default');
function display_fiscalyear_edit($selected_id) { global $Mode; start_form(); start_table(TABLESTYLE2); $company_year = get_company_pref('f_year'); $result = get_all_fiscalyears(); $row_cnt = db_num_rows($result); if ($selected_id != -1) { if ($Mode == 'Edit') { $myrow = get_fiscalyear($selected_id); $_POST['from_date'] = sql2date($myrow["begin"]); $_POST['to_date'] = sql2date($myrow["end"]); $_POST['closed'] = $myrow["closed"]; } if ($row_cnt == 1) { date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001); } else { hidden('from_date'); label_row(_("Fiscal Year Begin:"), $_POST['from_date']); } hidden('to_date'); label_row(_("Fiscal Year End:"), $_POST['to_date']); if ($myrow["id"] != $company_year) { yesno_list_row(_("Is Closed:"), 'closed', null, "", "", false); } else { hidden('closed'); label_row(_("Is Closed:"), yesno_value($_POST['closed'])); } } else { $begin = next_begin_date(); if ($begin && $Mode != 'ADD_ITEM') { $_POST['from_date'] = $begin; $_POST['to_date'] = end_month(add_months($begin, 11)); $_POST['closed'] = 0; } hidden('from_date'); hidden('to_date'); hidden('closed'); } hidden('selected_id', $selected_id); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); }
set_focus('stock_id'); return false; } return true; } //------------------------------------------------------------------------------------ if (isset($_POST['release'])) { release_work_order($selected_id, $_POST['released_date'], $_POST['memo_']); display_note(tr("The work order has been released to manufacturing.")); hyperlink_no_params("search_work_orders.php", tr("Select another work order")); end_page(); exit; } //------------------------------------------------------------------------------------ start_form(); $myrow = get_work_order($selected_id); $_POST['released'] = $myrow["released"]; $_POST['memo_'] = ""; if (can_process($myrow)) { start_table($table_style2); label_row(tr("Work Order #:"), $selected_id); label_row(tr("Work Order Reference:"), $myrow["wo_ref"]); date_row(tr("Released Date") . ":", 'released_date'); textarea_row(tr("Memo:"), 'memo_', $_POST['memo_'], 40, 5); end_table(1); submit_center('release', tr("Release Work Order")); hidden('selected_id', $selected_id); hidden('stock_id', $myrow['stock_id']); } end_form(); end_page();
} else { hidden('selected_id', get_post('selected_id')); } //$_POST['leave_days'] = $_POST['monthly_loan'] = 0; 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'];
function display_fiscalyear_edit($selected_id) { global $table_style2; start_form(); start_table($table_style2); if ($selected_id) { $myrow = get_fiscalyear($selected_id); $_POST['from_date'] = sql2date($myrow["begin"]); $_POST['to_date'] = sql2date($myrow["end"]); $_POST['closed'] = $myrow["closed"]; hidden('selected_id', $selected_id); hidden('from_date', $_POST['from_date']); hidden('to_date', $_POST['to_date']); label_row(tr("Fiscal Year Begin:"), $_POST['from_date']); label_row(tr("Fiscal Year End:"), $_POST['to_date']); } else { date_row(tr("Fiscal Year Begin:"), 'from_date', null, 0, 0, 1001); date_row(tr("Fiscal Year End:"), 'to_date', null, 0, 0, 1001); } yesno_list_row(tr("Is Closed:"), 'closed', null, "", "", false); end_table(1); submit_add_or_update_center(!isset($selected_id)); end_form(); }
supplier_list_row(_("Payment To:"), 'supplier_id', null, false, true); if (list_updated('supplier_id') || list_updated('bank_account')) { $_SESSION['alloc']->read(); $_POST['memo_'] = $_POST['amount'] = ''; $Ajax->activate('alloc_tbl'); } set_global_supplier($_POST['supplier_id']); if (!list_updated('bank_account') && !get_post('__ex_rate_changed')) { $_POST['bank_account'] = get_default_supplier_bank_account($_POST['supplier_id']); } else { $_POST['amount'] = price_format(0); } bank_accounts_list_row(_("From Bank Account:"), 'bank_account', null, true); bank_balance_row($_POST['bank_account']); table_section(2); date_row(_("Date Paid") . ":", 'DatePaid', '', true, 0, 0, 0, null, true); ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_SUPPAYMENT)); table_section(3); $comp_currency = get_company_currency(); $supplier_currency = $_SESSION['alloc']->set_person($_POST['supplier_id'], PT_SUPPLIER); if (!$supplier_currency) { $supplier_currency = $comp_currency; } $_SESSION['alloc']->currency = $bank_currency = get_bank_account_currency($_POST['bank_account']); if ($bank_currency != $supplier_currency) { amount_row(_("Bank Amount:"), 'bank_amount', null, '', $bank_currency); } amount_row(_("Bank Charge:"), 'charge', null, '', $bank_currency); end_outer_table(1); div_start('alloc_tbl'); show_allocatable(false);
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(); } start_table(TABLESTYLE, "width=60%"); label_row(_("Customer prompt payment discount :"), $display_discount_percent);
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 (!isset($_POST['quantity'])) { $_POST['quantity'] = qty_format(1, $_POST['stock_id'], $dec); } else { $_POST['quantity'] = qty_format($_POST['quantity'], $_POST['stock_id'], $dec); } if (get_post('type') == WO_ADVANCED) { qty_row(_("Quantity Required:"), 'quantity', null, null, null, $dec); if ($_POST['released']) { label_row(_("Quantity Manufactured:"), number_format($_POST['units_issued'], get_qty_dec($_POST['stock_id']))); } date_row(_("Date") . ":", 'date_', '', true); date_row(_("Date Required By") . ":", 'RequDate', '', null, $SysPrefs->default_wo_required_by()); } else { qty_row(_("Quantity:"), 'quantity', null, null, null, $dec); date_row(_("Date") . ":", 'date_', '', true); hidden('RequDate', ''); $sql = "SELECT DISTINCT account_code FROM " . TB_PREF . "bank_accounts"; $rs = db_query($sql, "could not get bank accounts"); $r = db_fetch_row($rs); if (!isset($_POST['Labour'])) { $_POST['Labour'] = price_format(0); $_POST['cr_lab_acc'] = $r[0]; } amount_row($wo_cost_types[WO_LABOUR], 'Labour'); gl_all_accounts_list_row(_("Credit Labour Account"), 'cr_lab_acc', null); if (!isset($_POST['Costs'])) { $_POST['Costs'] = price_format(0); $_POST['cr_acc'] = $r[0]; } amount_row($wo_cost_types[WO_OVERHEAD], 'Costs');
exit; } $_POST['ref'] = $myrow["reference"]; $_POST['closed'] = $myrow["closed"]; $_POST['name'] = $myrow["name"]; $_POST['type_'] = $myrow["type_"]; $_POST['date_'] = sql2date($myrow["date_"]); $_POST['due_date'] = sql2date($myrow["due_date"]); $_POST['memo_'] = get_comments_string(systypes::dimension(), $selected_id); hidden('ref', $_POST['ref']); label_row(tr("Dimension Reference:"), $_POST['ref']); hidden('selected_id', $selected_id); } else { ref_row(tr("Dimension Reference:"), 'ref', references::get_next(systypes::dimension())); } text_row_ex(tr("Name") . ":", 'name', 50, 75); $dim = get_company_pref('use_dimension'); number_list_row(tr("Type"), 'type_', null, 1, $dim); date_row(tr("Start Date") . ":", 'date_'); date_row(tr("Date Required By") . ":", 'due_date', null, sys_prefs::default_dimension_required_by()); textarea_row(tr("Memo:"), 'memo_', null, 40, 5); end_table(1); submit_add_or_update_center($selected_id == -1); if ($selected_id != -1) { echo "<br>"; submit_center_first('close', tr("Close This Dimension")); submit_center_last('delete', tr("Delete This Dimension")); } end_form(); //-------------------------------------------------------------------------------------------- end_page();
function display_rate_edit() { global $selected_id, $Ajax, $xr_providers, $dflt_xr_provider; $xchg_rate_provider = isset($xr_providers) && isset($dflt_xr_provider) ? $xr_providers[$dflt_xr_provider] : 'ECB'; start_table(TABLESTYLE2); if ($selected_id != "") { //editing an existing exchange rate $myrow = get_exchange_rate($selected_id); $_POST['date_'] = sql2date($myrow["date_"]); $_POST['BuyRate'] = maxprec_format($myrow["rate_buy"]); hidden('selected_id', $selected_id); hidden('date_', $_POST['date_']); label_row(_("Date to Use From:"), $_POST['date_']); } else { $_POST['date_'] = Today(); $_POST['BuyRate'] = ''; date_row(_("Date to Use From:"), 'date_'); } if (isset($_POST['get_rate'])) { $_POST['BuyRate'] = maxprec_format(retrieve_exrate($_POST['curr_abrev'], $_POST['date_'])); $Ajax->activate('BuyRate'); } amount_row(_("Exchange Rate:"), 'BuyRate', null, '', submit('get_rate', _("Get"), false, _('Get current rate from') . ' ' . $xchg_rate_provider, true), 'max'); end_table(1); submit_add_or_update_center($selected_id == '', '', 'both'); display_note(_("Exchange rates are entered against the company currency."), 1); }
stock_manufactured_items_list_row(tr("Item:"), 'stock_id', null); locations_list_row(tr("Destination Location:"), 'StockLocation', null); } if (!isset($_POST['quantity'])) { $_POST['quantity'] = qty_format(1); } if ($_POST['type'] == wo_types::advanced()) { qty_row(tr("Quantity Required:"), 'quantity', 12); if ($_POST['released']) { label_row(tr("Quantity Manufactured:"), qty_format($_POST['units_issued'])); } date_row(tr("Date") . ":", 'date_'); date_row(tr("Date Required By") . ":", 'RequDate', null, sys_prefs::default_wo_required_by()); } else { qty_row(tr("Quantity:"), 'quantity', 12); date_row(tr("Date") . ":", 'date_'); hidden('RequDate', ''); if (!isset($_POST['Costs'])) { $_POST['Costs'] = price_format(0); } amount_row(tr("Total Additional Costs:"), 'Costs'); } if ($_POST['released']) { label_row(tr("Released On:"), $_POST['released_date']); } textarea_row(tr("Memo:"), 'memo_', null, 40, 5); end_table(1); submit_add_or_update_center(!isset($selected_id)); if (isset($selected_id)) { echo "<br><br><table align=center><tr>"; if (isset($_POST['released'])) {
function display_credit_items() { global $table_style, $table_style2; start_form(false, true); start_table("{$table_style2} width=80%", 5); echo "<tr><td>"; // outer table start_table("{$table_style} width=100%"); start_row(); label_cells(tr("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'"); label_cells(tr("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'"); label_cells(tr("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'"); end_row(); start_row(); // if (!isset($_POST['ref'])) // $_POST['ref'] = references::get_next(11); if ($_SESSION['Items']->trans_no == 0) { ref_cells(tr("Reference"), 'ref', $_SESSION['Items']->reference, "class='tableheader2'"); } else { label_cells(tr("Reference"), $_SESSION['Items']->reference, "class='tableheader2'"); } // label_cells(tr("Crediting Invoice"), get_customer_trans_view_str(10, $_SESSION['InvoiceToCredit']), "class='tableheader2'"); label_cells(tr("Crediting Invoice"), get_customer_trans_view_str(10, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'"); if (!isset($_POST['ShipperID'])) { $_POST['ShipperID'] = $_SESSION['Items']->ship_via; } label_cell(tr("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(tr("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("{$table_style} width=100%"); label_row(tr("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'"); date_row(tr("Credit Note Date"), 'CreditDate', null, 0, 0, 0, "class='tableheader2'"); end_table(); echo "</td></tr>"; end_table(1); // outer table start_table("{$table_style} width=80%"); $th = array(tr("Item Code"), tr("Item Description"), tr("Invoiced Quantity"), tr("Units"), tr("Credit Quantity"), tr("Price"), tr("Discount %"), tr("Total")); 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 } 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); qty_cell($ln_itm->quantity); label_cell($ln_itm->units); amount_cells(null, 'Line' . $line_no, qty_format($ln_itm->qty_dispatched)); $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); } start_row(); label_cell(tr("Credit Shipping Cost"), "colspan=7 align=right"); amount_cells(null, "ChargeFreightCost", $_POST['ChargeFreightCost'], 6, 6); end_row(); $inv_items_total = $_SESSION['Items']->get_items_total_dispatch(); $display_sub_total = price_format($inv_items_total + input_num($_POST['ChargeFreightCost'])); label_row(tr("Sub-total"), $display_sub_total, "colspan=7 align=right", "align=right"); $taxes = $_SESSION['Items']->get_taxes(input_num($_POST['ChargeFreightCost'])); $tax_total = display_edit_tax_items($taxes, 7, $_SESSION['Items']->tax_included); $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total); label_row(tr("Credit Note Total"), $display_total, "colspan=7 align=right", "align=right"); end_table(); }
while ($tag = db_fetch($tags_result)) { $tagids[] = $tag['id']; } $_POST['dimension_tags'] = $tagids; hidden('ref', $_POST['ref']); label_row(_("Dimension Reference:"), $_POST['ref']); hidden('selected_id', $selected_id); } else { $_POST['dimension_tags'] = array(); ref_row(_("Dimension Reference:"), 'ref', '', $Refs->get_next(ST_DIMENSION)); } text_row_ex(_("Name") . ":", 'name', 50, 75); $dim = get_company_pref('use_dimension'); number_list_row(_("Type"), 'type_', null, 1, $dim); date_row(_("Start Date") . ":", 'date_'); date_row(_("Date Required By") . ":", 'due_date', '', null, $SysPrefs->default_dimension_required_by()); tag_list_row(_("Tags:"), 'dimension_tags', 5, TAG_DIMENSION, true); textarea_row(_("Memo:"), 'memo_', null, 40, 5); end_table(1); if (isset($_POST['closed']) && $_POST['closed'] == 1) { display_note(_("This Dimension is closed."), 0, 0, "class='currentfg'"); } if ($selected_id != -1) { echo "<br>"; submit_center_first('UPDATE_ITEM', _("Update"), _('Save changes to dimension'), 'default'); if ($_POST['closed'] == 1) { submit('reopen', _("Re-open This Dimension"), true, _('Mark this dimension as re-opened'), true); } else { submit('close', _("Close This Dimension"), true, _('Mark this dimension as closed'), true); } submit_center_last('delete', _("Delete This Dimension"), _('Delete unused dimension'), true);
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(); }
} } 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'); start_form(false, false, "", "accrual"); start_table(TABLESTYLE2); date_row(_("Date"), 'date_', _('First date of Accruals'), true, 0, 0, 0, null, true); start_row(); label_cell(_("Accrued Balance Account"), "class='label'"); gl_all_accounts_list_cells(null, 'acc_act', null, true, false, false, true); end_row(); gl_all_accounts_list_row(_("Revenue / Cost Account"), 'res_act', null, true); if ($dim >= 1) { dimensions_list_row(_("Dimension"), 'dimension_id', null, true, " ", false, 1); } if ($dim > 1) { dimensions_list_row(_("Dimension") . " 2", 'dimension2_id', null, true, " ", false, 2); } $url = "gl/view/accrual_trans.php?act=" . get_post('acc_act') . "&date=" . get_post('date_'); amount_row(_("Amount"), 'amount', null, null, viewer_link(_("Search Amount"), $url, "", "", ICON_VIEW)); frequency_list_row(_("Frequency"), 'freq', null); text_row(_("Periods"), 'periods', null, 3, 3);
if ($_POST['ProductionType'] == 0) { $_POST['quantity'] = -$_POST['quantity']; } $id = work_order_produce($_POST['selected_id'], $_POST['ref'], input_num('quantity'), $_POST['date_'], $_POST['memo_'], $close_wo); meta_forward($_SERVER['PHP_SELF'], "AddedID=" . $_POST['selected_id'] . "&date=" . $_POST['date_']); } //------------------------------------------------------------------------------------- display_wo_details($_POST['selected_id']); //------------------------------------------------------------------------------------- start_form(); hidden('selected_id', $_POST['selected_id']); //hidden('WOReqQuantity', $_POST['WOReqQuantity']); $dec = get_qty_dec($wo_details["stock_id"]); if (!isset($_POST['quantity']) || $_POST['quantity'] == '') { $_POST['quantity'] = qty_format(max($wo_details["units_reqd"] - $wo_details["units_issued"], 0), $wo_details["stock_id"], $dec); } start_table(TABLESTYLE2); br(); ref_row(_("Reference:"), 'ref', '', $Refs->get_next(29)); if (!isset($_POST['ProductionType'])) { $_POST['ProductionType'] = 1; } yesno_list_row(_("Type:"), 'ProductionType', $_POST['ProductionType'], _("Produce Finished Items"), _("Return Items to Work Order")); small_qty_row(_("Quantity:"), 'quantity', null, null, null, $dec); date_row(_("Date:"), 'date_'); textarea_row(_("Memo:"), 'memo_', null, 40, 3); end_table(1); submit_center_first('Process', _("Process"), '', 'default'); submit_center_last('ProcessAndClose', _("Process And Close Order"), '', true); end_form(); end_page();
end_row(); } end_table(1); start_table(TABLESTYLE2); if ($selected_id != -1) { if ($Mode == 'Edit') { $result = fetchAuthors($selected_id); while ($myrow = db_fetch($result)) { $_POST['fname'] = $myrow['author_fname']; $_POST['mname'] = $myrow['author_mname']; $_POST['lname'] = $myrow['author_lname']; $_POST['bdate'] = sql2date($myrow["author_birthdate"]); $_POST['address'] = $myrow['author_address']; $_POST['contact_number'] = $myrow['author_contact_number']; $_POST['email_address'] = $myrow['author_email']; $_POST['selected_id'] = $myrow['id']; } } hidden('selected_id', $selected_id); } text_row_ex(_("First Name:"), 'fname', 25); text_row_ex(_("Middle Name:"), 'mname', 25); text_row_ex(_("Last Name:"), 'lname', 25); date_row(_("Birth Date:"), 'bdate'); text_row_ex(_("Address:"), 'address', 25); text_row_ex(_("Contact Number:"), 'contact_number', 25); text_row_ex(_("Email Address:"), 'email_address', 25); 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();
function display_rate_edit() { global $selected_id, $table_style2; start_table($table_style2); if (isset($_POST['get_rate'])) { $_POST['BuyRate'] = exrate_format(get_ecb_rate($_POST['curr_abrev'])); } if ($selected_id != "") { //editing an existing exchange rate $myrow = get_exchange_rate($selected_id); $_POST['date_'] = sql2date($myrow["date_"]); $_POST['BuyRate'] = exrate_format($myrow["rate_buy"]); hidden('selected_id', $selected_id); hidden('date_', $_POST['date_']); hidden('curr_abrev', $_POST['curr_abrev']); label_row(tr("Date to Use From:"), $_POST['date_']); } else { date_row(tr("Date to Use From:"), 'date_'); } small_amount_row(tr("Exchange Rate:"), 'BuyRate', null, '', submit('get_rate', tr("Get")), user_exrate_dec()); end_table(1); submit_add_or_update_center($selected_id == ""); display_note(tr("Exchange rates are entered against the company currency."), 1); }
$_POST['description'] = $myrow["description"]; $_POST['order_no'] = $myrow["order_no"]; $_POST['debtor_no'] = $myrow["debtor_no"]; $_POST['group_no'] = $myrow["group_no"]; $_POST['days'] = $myrow["days"]; $_POST['monthly'] = $myrow["monthly"]; $_POST['begin'] = sql2date($myrow["begin"]); $_POST['end'] = sql2date($myrow["end"]); $_POST['last_sent'] = $myrow['last_sent'] == "0000-00-00" ? "" : sql2date($myrow["last_sent"]); } hidden("selected_id", $selected_id); } text_row_ex(_("Description:"), 'description', 50); templates_list_row(_("Template:"), 'order_no'); customer_list_row(_("Customer:"), 'debtor_no', null, " ", true); if ($_POST['debtor_no'] > 0) { customer_branches_list_row(_("Branch:"), $_POST['debtor_no'], 'group_no', null, false); } else { sales_groups_list_row(_("Sales Group:"), 'group_no', null, " "); } small_amount_row(_("Days:"), 'days', 0, null, null, 0); small_amount_row(_("Monthly:"), 'monthly', 0, null, null, 0); date_row(_("Begin:"), 'begin'); date_row(_("End:"), 'end', null, null, 0, 0, 5); if ($selected_id != -1 && $_POST['last_sent'] != "") { date_row(_("Last Created"), 'last_sent'); } end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page();
function display_fiscalyear_edit($selected_id) { global $Mode; start_form(); start_table(TABLESTYLE2); if ($selected_id != -1) { if ($Mode == 'Edit') { $myrow = get_fiscalyear($selected_id); $_POST['from_date'] = sql2date($myrow["begin"]); $_POST['to_date'] = sql2date($myrow["end"]); $_POST['closed'] = $myrow["closed"]; } hidden('from_date'); hidden('to_date'); label_row(_("Fiscal Year Begin:"), $_POST['from_date']); label_row(_("Fiscal Year End:"), $_POST['to_date']); } else { $begin = next_begin_date(); if ($begin && $Mode != 'ADD_ITEM') { $_POST['from_date'] = $begin; $_POST['to_date'] = end_month(add_months($begin, 11)); } date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001); date_row(_("Fiscal Year End:"), 'to_date', '', null, 0, 0, 1001); } hidden('selected_id', $selected_id); yesno_list_row(_("Is Closed:"), 'closed', null, "", "", false); end_table(1); submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); }
} // 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();
if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) { $_POST['DispatchDate'] = Today(); if (!is_date_in_fiscalyear($_POST['DispatchDate'])) { $_POST['DispatchDate'] = end_fiscalyear(); } } date_cells(tr("Date"), 'DispatchDate', $_POST['DispatchDate'], 0, 0, 0, "class='tableheader2'"); end_row(); end_table(); echo "</td><td>"; // outer table start_table("{$table_style} width=90%"); if (!isset($_POST['due_date']) || !is_date($_POST['due_date'])) { $_POST['due_date'] = get_invoice_duedate($_SESSION['Items']->customer_id, $_POST['DispatchDate']); } date_row(tr("Invoice Dead-line"), 'due_date', $_POST['due_date'], 0, 0, 0, "class='tableheader2'"); end_table(); echo "</td></tr>"; end_table(1); // outer table display_heading(tr("Delivery Items")); start_table("{$table_style} width=80%"); $th = array(tr("Item Code"), tr("Item Description"), tr("Date"), tr("Description"), tr("Ordered"), tr("Units"), tr("Delivered"), tr("This Delivery"), tr("Price"), tr("Tax Type"), tr("Discount"), tr("Total")); table_header($th); $k = 0; $has_marked = false; $show_qoh = true; foreach ($_SESSION['Items']->line_items as $line => $ln_itm) { if ($ln_itm->quantity == $ln_itm->qty_done) { continue; //this line is fully delivered