コード例 #1
0
ファイル: customers.php プロジェクト: pthdnq/ivalley-svn
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();
}
コード例 #2
0
text_row_ex(_("Phone Number:"), 'phone', 25, 55);
text_row_ex(_("Fax Number:"), 'fax', 25);
email_row_ex(_("Email Address:"), 'email', 25, 55);
email_row_ex(_("BCC Address for all outgoing mails:"), 'bcc_email', 25, 55);
text_row_ex(_("Official Company Number:"), 'coy_no', 25);
text_row_ex(_("GSTNo:"), 'gst_no', 25);
currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, '', null, null, _('Months.'));
text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, '', null, null, _('Months back.'));
table_section(2);
label_row(_("Company Logo:"), $_POST['coy_logo']);
file_row(_("New Company Logo (.jpg)") . ":", 'pic', 'pic');
check_row(_("Delete Company Logo:"), 'del_coy_logo', $_POST['del_coy_logo']);
number_list_row(_("Use Dimensions:"), 'use_dimension', null, 0, 2);
sales_types_list_row(_("Base for auto price calculations:"), 'base_sales', $_POST['base_sales'], false, _('No base price list'));
text_row_ex(_("Add Price from Std Cost:"), 'add_pct', 10, 10, '', null, null, "%");
$curr = get_currency($_POST['curr_default']);
text_row_ex(_("Round to nearest:"), 'round_to', 10, 10, '', null, null, $curr['hundreds_name']);
label_row("", "&nbsp;");
check_row(_("Search Item List"), 'no_item_list', null);
check_row(_("Search Customer List"), 'no_customer_list', null);
check_row(_("Search Supplier List"), 'no_supplier_list', null);
label_row("", "&nbsp;");
check_row(_("Automatic Revaluation Currency Accounts"), 'auto_curr_reval', $_POST['auto_curr_reval']);
check_row(_("Time Zone on Reports"), 'time_zone', $_POST['time_zone']);
text_row_ex(_("Login Timeout:"), 'login_tout', 10, 10, '', null, null, _('seconds'));
label_row(_("Version Id"), $_POST['version_id']);
end_outer_table(1);
hidden('coy_logo', $_POST['coy_logo']);
submit_center('update', _("Update"), true, '', 'default');
コード例 #3
0
ファイル: zencart.php プロジェクト: blestab/frontaccounting
        $_POST['sales_discount_account'] = $company_record["default_sales_discount_act"];
    }
    if (!isset($_POST['receivables_account']) || $_POST['receivables_account'] == "") {
        $_POST['receivables_account'] = $company_record["debtors_act"];
    }
    if (!isset($_POST['payment_discount_account']) || $_POST['payment_discount_account'] == "") {
        $_POST['payment_discount_account'] = $company_record["default_prompt_payment_act"];
    }
    gl_all_accounts_list_row("Sales Account:", 'sales_account', $_POST['sales_account']);
    gl_all_accounts_list_row("Sales Discount Account:", 'sales_discount_account', $_POST['sales_discount_account']);
    gl_all_accounts_list_row("Receivables Account:", 'receivables_account', $_POST['receivables_account']);
    gl_all_accounts_list_row("Payment Discount Account:", 'payment_discount_account', $_POST['payment_discount_account']);
    table_section_title("Location, Tax Type, Sales Type, Sales Person and Payment Terms");
    locations_list_row("Location:", 'default_location', 'DEF');
    tax_groups_list_row(_("Default Tax Group:"), 'tax_group_id', $default_TaxGroup);
    sales_types_list_row("Sales Type:", 'sales_type', null);
    sales_persons_list_row("Sales Person:", 'salesman', null);
    sales_areas_list_row("Sales Area:", 'area');
    currencies_list_row("Customer Currency:", 'currency', $default_Currency);
    payment_terms_list_row("Payment Terms:", 'payment_terms', null);
    text_row("Starting Zen Cart Customer ID:", 'min_cid', $min_cid, 10, 10);
    text_row("Ending Zen Cart Customer ID:", 'max_cid', $max_cid, 10, 10);
    end_table(1);
    hidden('action', 'c_import');
    submit_center('cimport', "Import Zen Cart Customers");
    end_form();
    end_page();
}
if ($action == 'oimport') {
    start_form(true);
    start_table(TABLESTYLE2, "width=40%");
コード例 #4
0
ファイル: customers.php プロジェクト: ravenii/guardocs
text_row(tr("Customer Name:"), 'CustName', $_POST['CustName'], 40, 40);
textarea_row(tr("Address:"), 'address', $_POST['address'], 35, 5);
text_row(tr("Email:"), 'email', null, 40, 40);
text_row(tr("GSTNo:"), 'tax_id', null, 40, 40);
// Sherifoz 23.09.03 currency can't be changed if editing
if (isset($_POST['New'])) {
    currencies_list_row(tr("Customer's Currency:"), 'curr_code', $_POST['curr_code']);
} else {
    label_row(tr("Customer's Currency:"), $_POST['curr_code']);
    hidden('curr_code', $_POST['curr_code']);
}
end_table();
echo "</td><td class='tableseparator'>";
// outer table
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']);
コード例 #5
0
$_POST['paypal_tax_included'] = $myrow['paypal_tax_included'];
$_POST['paypal_name_col'] = $myrow['paypal_name_col'];
$_POST['paypal_salesman'] = $myrow['paypal_salesman'];
$_POST['paypal_area'] = $myrow['paypal_area'];
$_POST['paypal_location'] = $myrow['paypal_location'];
$_POST['paypal_shipper'] = $myrow['paypal_shipper'];
$_POST['paypal_credit_status'] = $myrow['paypal_credit_status'];
//---------------
table_section_title(_("Options"));
check_row(_("Create Customers/Invoices:"), 'paypal_create_invoices', null);
check_row(_("Use Paypal Transaction Id:"), 'use_paypal_trn_id', null);
check_row(_("Receipts Date Today:"), 'paypal_recpt_today', null);
table_section_title(_("PayPal File"));
text_row_ex(_("Company Name Column:"), 'paypal_name_col', 25, 55);
table_section_title(_("Customers"));
sales_types_list_row("Sales Type:", 'paypal_sales_type_id', null);
sales_persons_list_row(_("Sales Person:"), 'paypal_salesman', null);
sales_areas_list_row(_("Sales Area:"), 'paypal_area', null);
credit_status_list_row(_("Credit Status:"), 'paypal_credit_status', null);
locations_list_row(_("Default Location:"), 'paypal_location', null);
shippers_list_row(_("Default Shipper:"), 'paypal_shipper', null);
table_section(2);
table_section_title(_("Accounts"));
bank_accounts_list_row(_("Bank Account:"), 'paypal_bank_id', $_POST['paypal_bank_id'], false);
gl_all_accounts_list_row(_("Sales Account:"), 'paypal_sales_act', $_POST['paypal_sales_act']);
gl_all_accounts_list_row(_("Sales Tax Account:"), 'paypal_sales_tax_act', $_POST['paypal_sales_tax_act']);
gl_all_accounts_list_row(_("Shipping Account:"), 'paypal_shipping_act', $_POST['paypal_shipping_act']);
gl_all_accounts_list_row(_("Fee Account:"), 'paypal_fee_act', $_POST['paypal_fee_act']);
gl_all_accounts_list_row(_("Insurance Account:"), 'paypal_insurance_act', $_POST['paypal_insurance_act']);
bank_accounts_list_row(_("Withdrawal Account:"), 'paypal_withdraw_id', $_POST['paypal_withdraw_id'], false);
table_section_title(_("Tax"));
コード例 #6
0
ファイル: prices.php プロジェクト: ravenii/guardocs
    label_cell($myrow["curr_abrev"]);
    label_cell($myrow["sales_type"]);
    amount_cell($myrow["price"]);
    amount_cell($myrow["factor"]);
    edit_link_cell("PriceID=" . $myrow["id"] . "&Edit=1");
    delete_link_cell("PriceID=" . $myrow["id"] . "&delete=yes");
    end_row();
}
end_table();
//------------------------------------------------------------------------------------------------
if (db_num_rows($prices_list) == 0) {
    display_note(tr("There are no prices set up for this part."));
}
echo "<br>";
if (isset($_GET['Edit'])) {
    $myrow = get_stock_price($_GET['PriceID']);
    hidden('PriceID', $_GET['PriceID']);
    $_POST['curr_abrev'] = $myrow["curr_abrev"];
    $_POST['sales_type_id'] = $myrow["sales_type_id"];
    $_POST['price'] = price_format($myrow["price"]);
    $_POST['factor'] = price_format($myrow["factor"]);
}
start_table($table_style2);
currencies_list_row(tr("Currency:"), 'curr_abrev', null);
sales_types_list_row(tr("Sales Type:"), 'sales_type_id', null);
small_amount_row(tr("Price:"), 'price', null);
small_amount_row(tr("Factor:"), 'factor', null);
end_table(1);
submit_center('updatePrice', tr("Add/Update Price"));
end_form();
end_page();
コード例 #7
0
ファイル: prices.php プロジェクト: knjy24/FrontAccounting
echo "<br>";
if ($Mode == 'Edit') {
    $myrow = get_stock_price($selected_id);
    $_POST['curr_abrev'] = $myrow["curr_abrev"];
    $_POST['sales_type_id'] = $myrow["sales_type_id"];
    $_POST['price'] = price_format($myrow["price"]);
}
hidden('selected_id', $selected_id);
if (@$_GET['popup']) {
    hidden('_tabs_sel', get_post('_tabs_sel'));
    hidden('popup', @$_GET['popup']);
}
div_start('price_details');
start_table(TABLESTYLE2);
currencies_list_row(_("Currency:"), 'curr_abrev', null, true);
sales_types_list_row(_("Sales Type:"), 'sales_type_id', null, true);
if (!isset($_POST['price'])) {
    $_POST['price'] = price_format(get_kit_price(get_post('stock_id'), get_post('curr_abrev'), get_post('sales_type_id')));
}
$kit = get_item_code_dflts($_POST['stock_id']);
small_amount_row(_("Price:"), 'price', null, '', _('per') . ' ' . $kit["units"]);
end_table(1);
if ($calculated) {
    display_note(_("The price is calculated."), 0, 1);
}
submit_add_or_update_center($selected_id == -1, '', 'both');
div_end();
if (!@$_GET['popup']) {
    end_form();
    end_page(@$_GET['popup'], false, false);
}
コード例 #8
0
    end_form();
}
if ($action == 'export') {
    start_form(true);
    start_table(TABLESTYLE2, "width=40%");
    $company_record = get_company_prefs();
    $currency = $company_record["curr_default"];
    hidden('currency', $currency);
    table_section_title("Export Selection");
    ?>
<tr>
<td>Export Type:</td>
<td><select  name='export_type' class='combo' title='' >
<option value='1'>Item</option>
<option value='2'>Price List</option>
<option value='3'>Purchase Price</option>
<option value='4'>Units of Measure</option>
<option value='5'>Kit</option>
<option value='6'>Bill of Materials</option>
<option value='7'>Foreign Item Codes</option>
</select>
</td>
</tr>
<?php 
    sales_types_list_row("Sales Type (for Price Lists):", 'sales_type_id', null);
    end_table(1);
    hidden('action', 'export');
    submit_center('export', "Export CSV File");
    end_form();
}
end_page();