Пример #1
0
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();
}
Пример #2
0
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();
}
Пример #3
0
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();
}
Пример #4
0
    hyperlink_no_params("{$path_to_root}/purchasing/supplier_credit.php", tr("Back to Credit Note Entry"));
}
echo "<hr>";
//------------------------------------------------------------------------------------------------
/*Set up a form to allow input of new GL entries */
start_form(false, true);
display_heading2(tr("Enter a GL Line"));
start_table($table_style2);
$accs = get_supplier_accounts($_SESSION['supp_trans']->supplier_id);
$_POST['AcctSelection'] = $accs['purchase_account'];
gl_all_accounts_list_row(tr("GL Account Selection:"), 'AcctSelection', $_POST['AcctSelection']);
$dim = get_company_pref('use_dimension');
if ($dim >= 1) {
    dimensions_list_row(tr("Dimension") . " 1", 'dimension_id', null, true, " ", false, 1);
}
if ($dim > 1) {
    dimensions_list_row(tr("Dimension") . " 2", 'dimension2_id', null, true, " ", false, 2);
}
if ($dim < 1) {
    hidden('dimension_id', 0);
}
if ($dim < 2) {
    hidden('dimension2_id', 0);
}
amount_row(tr("Amount:"), 'amount');
textarea_row(tr("Memo:"), "memo_", null, 40, 2);
end_table();
submit_center('AddGLCodeToTrans', tr("Add GL Line"));
end_form();
//------------------------------------------------------------------------------------------------
end_page();
    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();
Пример #6
0
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();
}
Пример #7
0
    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');
    gl_all_accounts_list_row(_("Credit Overhead Account"), 'cr_acc', null);
}
if (get_post('released')) {
    label_row(_("Released On:"), $_POST['released_date']);
}
textarea_row(_("Memo:"), 'memo_', null, 40, 5);
end_table(1);
if (isset($selected_id)) {
    echo "<table align=center><tr>";
    submit_cells('UPDATE_ITEM', _("Update"), '', _('Save changes to work order'), 'default');
    if (get_post('released')) {
        submit_cells('close', _("Close This Work Order"), '', '', true);
    }
    submit_cells('delete', _("Delete This Work Order"), '', '', true);
    echo "</tr></table>";
Пример #8
0
    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)) {
    alt_table_row_color($k);
Пример #9
0
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>";
}
Пример #10
0
start_table("class='tablestyle_noborder'");
sales_types_list_row(tr("Sales Type/Price List:"), 'sales_type', $_POST['sales_type']);
$dim = get_company_pref('use_dimension');
if ($dim >= 1) {
    dimensions_list_row(tr("Dimension") . " 1:", 'dimension_id', $_POST['dimension_id'], true, " ", false, 1);
}
if ($dim > 1) {
    dimensions_list_row(tr("Dimension") . " 2:", 'dimension2_id', $_POST['dimension2_id'], true, " ", false, 2);
}
if ($dim < 1) {
    hidden('dimension_id', 0);
}
if ($dim < 2) {
    hidden('dimension2_id', 0);
}
percent_row(tr("Discount Percent:"), 'discount', $_POST['discount']);
percent_row(tr("Prompt Payment Discount Percent:"), 'pymt_discount', $_POST['pymt_discount']);
amount_row(tr("Credit Limit:"), 'credit_limit', $_POST['credit_limit']);
payment_terms_list_row(tr("Payment Terms:"), 'payment_terms', $_POST['payment_terms']);
credit_status_list_row(tr("Credit Status:"), 'credit_status', $_POST['credit_status']);
end_table();
end_table(1);
// outer table
if (isset($_POST['New'])) {
    submit_center('submit', tr("Add New Customer"));
} else {
    submit_center_first('submit', tr("Update Customer"));
    submit_center_last('delete', tr("Delete Customer"));
}
end_form();
end_page();
Пример #11
0
    end_row();
}
inactive_control_row($th);
end_table();
display_note(_("Marked sales type is the company base pricelist for prices calculations."), 0, 0, "class='overduefg'");
//----------------------------------------------------------------------------------------------------
if (!isset($_POST['tax_included'])) {
    $_POST['tax_included'] = 0;
}
if (!isset($_POST['base'])) {
    $_POST['base'] = 0;
}
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        $myrow = get_sales_type($selected_id);
        $_POST['sales_type'] = $myrow["sales_type"];
        $_POST['tax_included'] = $myrow["tax_included"];
        $_POST['factor'] = number_format2($myrow["factor"], 4);
    }
    hidden('selected_id', $selected_id);
} else {
    $_POST['factor'] = number_format2(1, 4);
}
text_row_ex(_("Sales Type Name") . ':', 'sales_type', 20);
amount_row(_("Calculation factor") . ':', 'factor', null, null, null, 4);
check_row(_("Tax included") . ':', 'tax_included', $_POST['tax_included']);
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();
Пример #12
0
    echo "</center><hr>";
} else {
    br(2);
}
set_global_stock_item($_POST['stock_id']);
$myrow = get_item($_POST['stock_id']);
div_start('cost_table');
start_table(TABLESTYLE2);
$dec1 = $dec2 = $dec3 = 0;
$_POST['material_cost'] = price_decimal_format($myrow["material_cost"], $dec1);
$_POST['labour_cost'] = price_decimal_format($myrow["labour_cost"], $dec2);
$_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3);
amount_row(_("Standard Material Cost Per Unit"), "material_cost", null, "class='tableheader2'", null, $dec1);
if (@$_GET['popup']) {
    hidden('_tabs_sel', get_post('_tabs_sel'));
    hidden('popup', @$_GET['popup']);
}
if ($myrow["mb_flag"] == 'M') {
    amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2);
    amount_row(_("Standard Overhead Cost Per Unit"), "overhead_cost", null, "class='tableheader2'", null, $dec3);
} else {
    hidden("labour_cost", 0);
    hidden("overhead_cost", 0);
}
end_table(1);
div_end();
submit_center('UpdateData', _("Update"), true, false, 'default');
end_form();
if (!@$_GET['popup']) {
    end_page(@$_GET['popup'], false, false);
}
Пример #13
0
}
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'])) {
        submit_cells('close', tr("Close This Work Order"));
    }
    submit_cells('delete', tr("Delete This Work Order"));
    echo "</tr></table>";
}
Пример #14
0
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["sales_type"]);
    label_cell($myrow["tax_included"] ? tr('Yes') : tr('No'), 'align=center');
    qty_cell($myrow["price_factor"], null, 2);
    edit_link_cell("selected_id=" . $myrow["id"]);
    delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1");
    end_row();
}
end_table();
//----------------------------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Sales type"));
start_form();
if (!isset($_POST['tax_included'])) {
    $_POST['tax_included'] = 0;
}
start_table("{$table_style2} width=30%");
if ($selected_id != -1) {
    $myrow = get_sales_type($selected_id);
    $_POST['sales_type'] = $myrow["sales_type"];
    $_POST['tax_included'] = $myrow["tax_included"];
    $_POST['price_factor'] = number_format2($myrow["price_factor"], 2);
    hidden('selected_id', $selected_id);
}
text_row_ex(tr("Sales Type Name:"), 'sales_type', 20);
check_row("Tax  included", 'tax_included', $_POST['tax_included']);
amount_row("Price factor", 'price_factor', $_POST['price_factor']);
end_table(1);
submit_add_or_update_center($selected_id == -1);
end_form();
end_page();
Пример #15
0
    $myrow = db_fetch($result);
    $supp_name = $myrow["supp_name"];
    $_POST['price'] = price_format($myrow["price"]);
    $_POST['suppliers_uom'] = $myrow["suppliers_uom"];
    $_POST['supplier_description'] = $myrow["supplier_description"];
    $_POST['conversion_factor'] = exrate_format($myrow["conversion_factor"]);
}
echo "<br>";
start_table($table_style2);
if (isset($_GET['Edit'])) {
    hidden('supplier_id', $supplier_id);
    label_row(tr("Supplier:"), $supp_name);
} else {
    supplier_list_row(tr("Supplier:"), 'supplier_id', null, false, true);
    $supplier_id = $_POST['supplier_id'];
}
amount_row(tr("Price:"), 'price', null, '', get_supplier_currency($supplier_id));
text_row(tr("Suppliers Unit of Measure:"), 'suppliers_uom', null, 50, 51);
if (!isset($_POST['conversion_factor']) || $_POST['conversion_factor'] == "") {
    $_POST['conversion_factor'] = exrate_format(1);
}
amount_row(tr("Conversion Factor (to our UOM):"), 'conversion_factor', exrate_format($_POST['conversion_factor']), null, null, user_exrate_dec());
text_row(tr("Supplier's Code or Description:"), 'supplier_description', null, 50, 51);
end_table(1);
if (isset($_GET['Edit'])) {
    submit_center('UpdateRecord', tr("Update Purchasing Data"));
} else {
    submit_center('AddRecord', tr("Add Purchasing Data"));
}
end_form();
end_page();
Пример #16
0
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();
}
Пример #17
0
}
bank_accounts_list_row(_("From Bank Account:"), 'bank_account', null, true);
bank_balance_row($_POST['bank_account']);
table_section(2);
ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_SUPPAYMENT));
date_row(_("Date Paid") . ":", 'DatePaid', '', true, 0, 0, 0, null, true);
table_section(3);
$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'], true);
}
amount_row(_("Bank Charge:"), 'charge');
end_outer_table(1);
// outer table
if ($bank_currency == $supplier_currency) {
    div_start('alloc_tbl');
    show_allocatable(false);
    div_end();
}
start_table(TABLESTYLE, "width=60%");
amount_row(_("Amount of Discount:"), 'discount');
amount_row(_("Amount of Payment:"), 'amount');
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
end_table(1);
if ($bank_currency != $supplier_currency) {
    display_note(_("The amount and discount are in the bank account's currency."), 0, 1);
}
submit_center('ProcessSuppPayment', _("Enter Payment"), true, '', 'default');
end_form();
end_page();
Пример #18
0
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);
}
Пример #19
0
    label_cell($myrow["shipper_defcost"]);
    edit_link_cell("selected_id=" . $myrow[0]);
    delete_link_cell("selected_id=" . $myrow[0] . "&delete=1");
    end_row();
}
end_table();
//----------------------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Shipping Company"));
start_form();
start_table($table_style2);
if (isset($selected_id)) {
    //editing an existing Shipper
    $sql = "SELECT * FROM shippers WHERE shipper_id={$selected_id}";
    $result = db_query($sql, "could not get shipper");
    $myrow = db_fetch($result);
    $_POST['shipper_name'] = $myrow["shipper_name"];
    $_POST['contact'] = $myrow["contact"];
    $_POST['phone'] = $myrow["phone"];
    $_POST['address'] = $myrow["address"];
    $_POST['shipper_defcost'] = $myrow["shipper_defcost"];
    hidden('selected_id', $selected_id);
}
text_row_ex(tr("Name:"), 'shipper_name', 40);
text_row_ex(tr("Contact Person:"), 'contact', 30);
text_row_ex(tr("Phone Number:"), 'phone', 20);
text_row_ex(tr("Address:"), 'address', 50);
amount_row(tr("Shipping Charge:"), 'shipper_defcost');
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
end_page();
Пример #20
0
    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);
textarea_row(_("Memo"), 'memo_', null, 35, 3);
end_table(1);
submit_center_first('show', _("Show GL Rows"));
//,true,false,'process',ICON_SUBMIT);
submit_center_last('go', _("Process Accruals"));
//,true,false,'process',ICON_SUBMIT);
submit_js_confirm('go', _("Are you sure you want to post accruals?"));
end_form();
end_page();
Пример #21
0
    $_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);
}
Пример #22
0
    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']);
//-------------------------------------------------------------------------------------
start_form();
hidden('selected_id', $_POST['selected_id']);
//hidden('WOReqQuantity', $_POST['WOReqQuantity']);
start_table(TABLESTYLE2);
br();
yesno_list_row(_("Type:"), 'PaymentType', null, $wo_cost_types[WO_OVERHEAD], $wo_cost_types[WO_LABOUR]);
date_row(_("Date:"), 'date_');
$item_accounts = get_stock_gl_code($wo_details['stock_id']);
$_POST['db_acc'] = $item_accounts['assembly_account'];
$r = get_default_bank_account(get_company_pref('curr_default'));
$_POST['cr_acc'] = $r[0];
amount_row(_("Additional Costs:"), 'costs');
gl_all_accounts_list_row(_("Debit Account"), 'db_acc', null);
gl_all_accounts_list_row(_("Credit Account"), 'cr_acc', null);
end_table(1);
hidden('dim1', $item_accounts["dimension_id"]);
hidden('dim2', $item_accounts["dimension2_id"]);
submit_center('process', _("Process Additional Cost"), true, '', true);
end_form();
end_page();
Пример #23
0
} 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);
div_end();
start_table(TABLESTYLE, "width='60%'");
amount_row(_("Amount of Discount:"), 'discount', null, '', $supplier_currency);
amount_row(_("Amount of Payment:"), 'amount', null, '', $supplier_currency);
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
end_table(1);
submit_center('ProcessSuppPayment', _("Enter Payment"), true, '', 'default');
end_form();
end_page();
Пример #24
0
        hidden('dimension_id', 0);
    }
    if ($dim < 2) {
        hidden('dimension2_id', 0);
    }
    global $SysPrefs;
    $credit_limit = price_format($SysPrefs->default_credit_limit());
    table_section_title("Location, Tax Type, Sales Type, Sales Person and Payment Terms");
    locations_list_row("Location:", 'default_location', null);
    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', get_company_pref("curr_default"));
    payment_terms_list_row("Payment Terms:", 'payment_terms', null);
    amount_row(_("Credit Limit:"), 'credit_limit', $credit_limit);
    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);
    }
    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') {
Пример #25
0
date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true);
ref_row(_("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);
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');
}
br();
end_form();
end_page();
Пример #26
0
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']);
} else {
Пример #27
0
$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);
amount_row(_("Amount of Discount:"), 'discount');
amount_row(_("Amount:"), 'amount');
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
end_table(1);
if ($cust_currency != $bank_currency) {
    display_note(_("Amount and discount are in customer's currency."));
}
br();
if ($new) {
    submit_center('AddPaymentItem', _("Update Payment"), true, '', 'default');
} else {
    submit_center('AddPaymentItem', _("Add Payment"), true, '', 'default');
}
br();
end_form();
end_page();
Пример #28
0
 }
 quick_actions_list_row(_("Posted") . ":", 'actn', null, true);
 if (list_updated('actn')) {
     $Ajax->activate('edit_line');
 }
 $actn = strtolower(substr($_POST['actn'], 0, 1));
 if ($actn == 't') {
     //item_tax_types_list_row(_("Item Tax Type").":",'dest_id', null);
     tax_types_list_row(_("Tax Type") . ":", 'dest_id', null);
 } else {
     gl_all_accounts_list_row(_("Account") . ":", 'dest_id', null, $_POST['type'] == QE_DEPOSIT || $_POST['type'] == QE_PAYMENT);
     if ($actn != '=') {
         if ($actn == '%') {
             small_amount_row(_("Part") . ":", 'amount', price_format(0), null, "%", user_exrate_dec());
         } else {
             amount_row(_("Amount") . ":", 'amount', price_format(0));
         }
     }
 }
 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);
 }
 end_table(1);
 if ($dim < 2) {
     hidden('dimension2_id', 0);
 }
 if ($dim < 1) {
     hidden('dimension_id', 0);
Пример #29
0
end_table();
//------------------------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Sales Person"));
//------------------------------------------------------------------------------------------------
start_form();
if (isset($selected_id)) {
    //editing an existing Sales-person
    $sql = "SELECT *  FROM salesman WHERE salesman_code='{$selected_id}'";
    $result = db_query($sql, "could not get sales person");
    $myrow = db_fetch($result);
    $_POST['salesman_name'] = $myrow["salesman_name"];
    $_POST['salesman_phone'] = $myrow["salesman_phone"];
    $_POST['salesman_fax'] = $myrow["salesman_fax"];
    $_POST['salesman_email'] = $myrow["salesman_email"];
    $_POST['provision'] = percent_format($myrow["provision"]);
    $_POST['break_pt'] = price_format($myrow["break_pt"]);
    $_POST['provision2'] = percent_format($myrow["provision2"]);
    hidden('selected_id', $selected_id);
}
start_table("{$table_style2} width=60%");
text_row_ex(tr("Sales person name:"), 'salesman_name', 30);
text_row_ex(tr("Telephone number:"), 'salesman_phone', 20);
text_row_ex(tr("Fax number:"), 'salesman_fax', 20);
text_row_ex(tr("Email:"), 'salesman_email', 40);
percent_row(tr("Provision"), 'provision');
amount_row(tr("Break Pt.:"), 'break_pt');
percent_row(tr("Provision") . " 2", 'provision2');
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
end_page();
    amount_cell($myrow["price"]);
    label_cell($myrow["supp_name"]);
    edit_button_cell("Edit" . $myrow['requisition_detail_id'], _("Edit"));
    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['supplier_id'] = $myrow["supplier_id"];
        $_POST['item_code'] = $myrow["item_code"];
        $_POST['quantity'] = $myrow["quantity"];
        $_POST['price'] = $myrow["price"];
    }
    hidden('selected_id', $selected_id);
}
supplier_list_row(_("Supplier : "), 'supplier_id', null, true, false);
$res = get_item_edit_info(get_post('item_code'));
$dec = $res["decimals"] == '' ? 0 : $res["decimals"];
$units = $res["units"] == '' ? _('kits') : $res["units"];
qty_row(_("Order Quantity:"), 'quantity', number_format2(1, $dec), '', $units, $dec);
amount_row(_("Order Price :"), 'price', null, null, null, 2);
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
echo "<div align='center'><a href='requisition_allocations.php?po=yes'>" . _("Generate Purchase Orders") . "</a></div>\n";
//------------------------------------------------------------------------------------
end_page();