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 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(); }
$path_to_root = "../.."; include $path_to_root . "/includes/session.inc"; page(_($help_context = "View Bank Deposit"), true); include_once $path_to_root . "/includes/date_functions.inc"; include_once $path_to_root . "/includes/ui.inc"; include_once $path_to_root . "/gl/includes/gl_db.inc"; if (isset($_GET["trans_no"])) { $trans_no = $_GET["trans_no"]; } // get the pay-to bank payment info $result = get_bank_trans(ST_BANKDEPOSIT, $trans_no); if (db_num_rows($result) != 1) { display_db_error("duplicate payment bank transaction found", ""); } $to_trans = db_fetch($result); $company_currency = get_company_currency(); $show_currencies = false; if ($to_trans['bank_curr_code'] != $to_trans['settle_curr']) { $show_currencies = true; } echo "<center>"; display_heading(_("GL Deposit") . " #{$trans_no}"); echo "<br>"; start_table(TABLESTYLE, "width=80%"); if ($show_currencies) { $colspan1 = 1; $colspan2 = 7; } else { $colspan1 = 3; $colspan2 = 5; }
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(); }
of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here <http://www.gnu.org/licenses/gpl-3.0.html>. ***********************************************************************/ $page_security = 'SA_WORKORDERCOST'; $path_to_root = "../.."; include_once $path_to_root . "/includes/session.inc"; page(_($help_context = "Costed Bill Of Material Inquiry")); include_once $path_to_root . "/manufacturing/includes/manufacturing_ui.inc"; include_once $path_to_root . "/includes/manufacturing.inc"; include_once $path_to_root . "/includes/ui.inc"; include_once $path_to_root . "/includes/banking.inc"; include_once $path_to_root . "/includes/data_checks.inc"; check_db_has_bom_stock_items(_("There are no manufactured or kit items defined in the system.")); if (isset($_GET['stock_id'])) { $_POST['stock_id'] = $_GET['stock_id']; } if (list_updated('stock_id')) { $Ajax->activate('_page_body'); } start_form(false, true); start_table(TABLESTYLE_NOBORDER); stock_manufactured_items_list_row(_("Select a manufacturable item:"), 'stock_id', null, false, true); end_table(); br(); display_heading(_("All Costs Are In:") . " " . get_company_currency()); display_bom($_POST['stock_id']); end_form(); end_page();
function handle_add_payment() { $supp_currency = get_supplier_currency($_POST['supplier_id']); $bank_currency = get_bank_account_currency($_POST['bank_account']); $comp_currency = get_company_currency(); if ($comp_currency != $bank_currency && $bank_currency != $supp_currency) { $rate = 0; } else { $rate = input_num('_ex_rate'); } $payment_id = add_supp_payment($_POST['supplier_id'], $_POST['DatePaid'], $_POST['bank_account'], input_num('amount'), input_num('discount'), $_POST['ref'], $_POST['memo_'], $rate, input_num('charge')); new_doc_date($_POST['DatePaid']); $_SESSION['alloc']->trans_no = $payment_id; $_SESSION['alloc']->write(); //unset($_POST['supplier_id']); unset($_POST['bank_account']); unset($_POST['DatePaid']); unset($_POST['currency']); unset($_POST['memo_']); unset($_POST['amount']); unset($_POST['discount']); unset($_POST['ProcessSuppPayment']); meta_forward($_SERVER['PHP_SELF'], "AddedID={$payment_id}&supplier_id=" . $_POST['supplier_id']); }
function display_currencies() { $company_currency = get_company_currency(); $result = get_currencies(check_value('show_inactive')); start_table(TABLESTYLE); $th = array(_("Abbreviation"), _("Symbol"), _("Currency Name"), _("Hundredths name"), _("Country"), _("Auto update"), "", ""); inactive_control_column($th); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { if ($myrow[1] == $company_currency) { start_row("class='currencybg'"); } else { alt_table_row_color($k); } label_cell($myrow["curr_abrev"]); label_cell($myrow["curr_symbol"]); label_cell($myrow["currency"]); label_cell($myrow["hundreds_name"]); label_cell($myrow["country"]); label_cell($myrow[1] == $company_currency ? '-' : ($myrow["auto_update"] ? _('Yes') : _('No')), "align='center'"); inactive_control_cell($myrow["curr_abrev"], $myrow["inactive"], 'currencies', 'curr_abrev'); edit_button_cell("Edit" . $myrow["curr_abrev"], _("Edit")); if ($myrow["curr_abrev"] != $company_currency) { delete_button_cell("Delete" . $myrow["curr_abrev"], _("Delete")); } else { label_cell(''); } end_row(); } //END WHILE LIST LOOP inactive_control_row($th); end_table(); display_note(_("The marked currency is the home currency which cannot be deleted."), 0, 0, "class='currentfg'"); }
} if (date_diff2(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) { display_error(_("The additional cost date cannot be before the release date of the work order.")); set_focus('date_'); return false; } return true; } //-------------------------------------------------------------------------------------------------- if (isset($_POST['process']) && can_process() == true) { $date = $_POST['date_']; begin_transaction(); add_gl_trans_std_cost(ST_WORKORDER, $_POST['selected_id'], $_POST['date_'], $_POST['cr_acc'], 0, 0, $date . ": " . $wo_cost_types[$_POST['PaymentType']], -input_num('costs'), PT_WORKORDER, $_POST['PaymentType']); $is_bank_to = is_bank_account($_POST['cr_acc']); if ($is_bank_to) { add_bank_trans(ST_WORKORDER, $_POST['selected_id'], $is_bank_to, "", $_POST['date_'], -input_num('costs'), PT_WORKORDER, $_POST['PaymentType'], get_company_currency(), "Cannot insert a destination bank transaction"); } add_gl_trans_std_cost(ST_WORKORDER, $_POST['selected_id'], $_POST['date_'], $_POST['db_acc'], $_POST['dim1'], $_POST['dim2'], $date . ": " . $wo_cost_types[$_POST['PaymentType']], input_num('costs'), PT_WORKORDER, $_POST['PaymentType']); //Chaitanya : Apply the costs to manfuctured stock item as adjustement $wo = get_work_order($_POST['selected_id']); if ($_POST['PaymentType'] == 0) { add_labour_cost($wo['stock_id'], 0, $_POST['date_'], input_num('costs'), true); } else { add_overhead_cost($wo['stock_id'], 0, $_POST['date_'], input_num('costs'), true); } commit_transaction(); meta_forward($_SERVER['PHP_SELF'], "AddedID=" . $_POST['selected_id']); } //------------------------------------------------------------------------------------- display_wo_details($_POST['selected_id']); //-------------------------------------------------------------------------------------
} else { hidden('customer_id', $_POST['customer_id']); } hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a new customer"), "New=1"); echo "<br>"; start_table($table_style2, 7, 6); echo "<tr valign=top><td>"; // outer table start_table("class='tablestyle_noborder'"); if (isset($_POST['New'])) { hidden('New', 'Yes'); $_POST['CustName'] = $_POST['address'] = $_POST['tax_id'] = ''; $_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['discount'] = $_POST['pymt_discount'] = percent_format(0); $_POST['credit_limit'] = price_format(sys_prefs::default_credit_limit()); } else { $sql = "SELECT * FROM debtors_master WHERE debtor_no = '" . $_POST['customer_id'] . "'"; $result = db_query($sql, "check failed"); $myrow = db_fetch($result); $_POST['CustName'] = $myrow["name"]; $_POST['address'] = $myrow["address"]; $_POST['tax_id'] = $myrow["tax_id"]; $_POST['email'] = $myrow["email"]; $_POST['dimension_id'] = $myrow["dimension_id"]; $_POST['dimension2_id'] = $myrow["dimension2_id"]; $_POST['sales_type'] = $myrow["sales_type"];
include_once $path_to_root . "/includes/ui.inc"; include_once $path_to_root . "/includes/data_checks.inc"; include_once $path_to_root . "/inventory/includes/inventory_db.inc"; //--------------------------------------------------------------------------------------------------- check_db_has_stock_items(tr("There are no items defined in the system.")); check_db_has_sales_types(tr("There are no sales types in the system. Please set up sales types befor entering pricing.")); //--------------------------------------------------------------------------------------------------- $input_error = 0; if (isset($_GET['stock_id'])) { $_POST['stock_id'] = $_GET['stock_id']; } if (isset($_GET['Item'])) { $_POST['stock_id'] = $_GET['Item']; } if (!isset($_POST['curr_abrev'])) { $_POST['curr_abrev'] = get_company_currency(); } //--------------------------------------------------------------------------------------------------- start_form(false, true); if (!isset($_POST['stock_id'])) { $_POST['stock_id'] = get_global_stock_item(); } echo "<center>" . tr("Item:") . " "; stock_items_list('stock_id', $_POST['stock_id'], false, true); echo "<hr>"; // if stock sel has changed, clear the form if ($_POST['stock_id'] != get_global_stock_item()) { clear_data(); } set_global_stock_item($_POST['stock_id']); //----------------------------------------------------------------------------------------------------
function display_currencies() { global $table_style; $company_currency = get_company_currency(); $result = get_currencies(); start_table($table_style); $th = array(tr("Abbreviation"), tr("Symbol"), tr("Currency Name"), tr("Hundredths name"), tr("Country"), "", ""); table_header($th); $k = 0; //row colour counter while ($myrow = db_fetch($result)) { if ($myrow[1] == $company_currency) { start_row("class='currencybg'"); } else { alt_table_row_color($k); } label_cell($myrow["curr_abrev"]); label_cell($myrow["curr_symbol"]); label_cell($myrow["currency"]); label_cell($myrow["hundreds_name"]); label_cell($myrow["country"]); edit_link_cell("selected_id=" . $myrow["curr_abrev"]); if ($myrow["curr_abrev"] != $company_currency) { delete_link_cell("selected_id=" . $myrow["curr_abrev"] . "&delete=1"); } end_row(); } //END WHILE LIST LOOP end_table(); display_note(tr("The marked currency is the home currency which cannot be deleted."), 0, 0, "class='currentfg'"); }
function currencies_list($name, $selected_id = null, $submit_on_change = false) { $sql = "SELECT curr_abrev, currency, inactive FROM " . TB_PREF . "currencies"; // default to the company currency return combo_input($name, $selected_id, $sql, 'curr_abrev', 'currency', array('select_submit' => $submit_on_change, 'default' => get_company_currency(), 'async' => false)); }