Exemple #1
0
function display_currency_edit($selected_id)
{
    global $Mode;
    start_table(TABLESTYLE2);
    if ($selected_id != '') {
        if ($Mode == 'Edit') {
            //editing an existing currency
            $myrow = get_currency($selected_id);
            $_POST['Abbreviation'] = $myrow["curr_abrev"];
            $_POST['Symbol'] = $myrow["curr_symbol"];
            $_POST['CurrencyName'] = $myrow["currency"];
            $_POST['country'] = $myrow["country"];
            $_POST['hundreds_name'] = $myrow["hundreds_name"];
            $_POST['auto_update'] = $myrow["auto_update"];
        }
        hidden('Abbreviation');
        hidden('selected_id', $selected_id);
        label_row(_("Currency Abbreviation:"), $_POST['Abbreviation']);
    } else {
        $_POST['auto_update'] = 1;
        text_row_ex(_("Currency Abbreviation:"), 'Abbreviation', 4, 3);
    }
    text_row_ex(_("Currency Symbol:"), 'Symbol', 10);
    text_row_ex(_("Currency Name:"), 'CurrencyName', 20);
    text_row_ex(_("Hundredths Name:"), 'hundreds_name', 15);
    text_row_ex(_("Country:"), 'country', 40);
    check_row(_("Automatic exchange rate update:"), 'auto_update', get_post('auto_update'));
    end_table(1);
    submit_add_or_update_center($selected_id == '', '', 'both');
}
Exemple #2
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();
}
//-----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != "") {
    if ($Mode == 'Edit') {
        //editing an existing status code
        $myrow = get_account_class($selected_id);
        $_POST['id'] = $myrow["cid"];
        $_POST['name'] = $myrow["class_name"];
        if (isset($use_oldstyle_convert) && $use_oldstyle_convert == 1) {
            $_POST['ctype'] = $myrow["ctype"] >= CL_ASSETS && $myrow["ctype"] < CL_INCOME ? 1 : 0;
        } else {
            $_POST['ctype'] = $myrow["ctype"];
        }
        hidden('selected_id', $selected_id);
    }
    hidden('id');
    label_row(_("Class ID:"), $_POST['id']);
} else {
    text_row_ex(_("Class ID:"), 'id', 3);
}
text_row_ex(_("Class Name:"), 'name', 50, 60);
if (isset($use_oldstyle_convert) && $use_oldstyle_convert == 1) {
    check_row(_("Balance Sheet"), 'ctype', null);
} else {
    class_types_list_row(_("Class Type:"), 'ctype', null);
}
end_table(1);
submit_add_or_update_center($selected_id == "", '', 'both');
end_form();
//------------------------------------------------------------------------------------
end_page();
Exemple #4
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();
Exemple #5
0
// Add image upload for New Item  - by Joe
start_row();
label_cells(tr("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
if ($id != "") {
    $fileimg = $path_to_root . "/image.php?id=" . $id;
    $stock_img_link = "<img src='{$fileimg}' width='100px' border='0'>";
    $stock_img_link .= "<br>" . tr("Delete") . "<input type='checkbox' name='deleteImage' value='1'>";
    label_cell($stock_img_link, "valign=top align=center rowspan=1");
}
end_row();
stock_categories_list_row(tr("Category:"), 'category_id', null);
item_tax_types_list_row(tr("Item Tax Type:"), 'tax_type_id', null);
stock_item_types_list_row(tr("Item Type:"), 'mb_flag', null, !isset($_POST['NewStockID']) || isset($_POST['New']));
stock_units_list_row(tr('Units of Measure:'), 'units', null, 1);
//	(!isset($_POST['NewStockID']) || isset($_POST['New'])));
check_row(tr("Selling:"), 'selling');
text_row(tr("Depending:"), 'depending', null, 20, 20);
text_row(tr("Barcode:"), 'barcode', null, 20, 64);
amount_row(tr("Weight:"), 'weight', null);
end_table();
start_table("{$table_style2} width=40%");
table_section_title(tr("GL Accounts"));
gl_all_accounts_list_row(tr("Sales Account:"), 'sales_account', $_POST['sales_account']);
gl_all_accounts_list_row(tr("Inventory Account:"), 'inventory_account', $_POST['inventory_account']);
if (!is_service($_POST['mb_flag'])) {
    gl_all_accounts_list_row(tr("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']);
    gl_all_accounts_list_row(tr("Inventory Adjustments Account:"), 'adjustment_account', $_POST['adjustment_account']);
} else {
    hidden('cogs_account', $_POST['cogs_account']);
    hidden('adjustment_account', $_POST['adjustment_account']);
}
Exemple #6
0
gl_all_accounts_list_row(_("Prompt Payment Discount Account:"), 'default_prompt_payment_act');
text_row(_("Delivery Required By:"), 'default_delivery_required', $_POST['default_delivery_required'], 6, 6, '', "", _("days"));
//----------------
table_section(2);
table_section_title(_("Dimension Defaults"));
text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days"));
//---------------
table_section_title(_("Suppliers and Purchasing"));
percent_row(_("Delivery Over-Receive Allowance:"), 'po_over_receive');
percent_row(_("Invoice Over-Charge Allowance:"), 'po_over_charge');
table_section_title(_("Suppliers and Purchasing Defaults"));
gl_all_accounts_list_row(_("Payable Account:"), 'creditors_act', $_POST['creditors_act']);
gl_all_accounts_list_row(_("Purchase Discount Account:"), 'pyt_discount_act', $_POST['pyt_discount_act']);
gl_all_accounts_list_row(_("GRN Clearing Account:"), 'grn_clearing_act', get_post('grn_clearing_act'), true, false, _("No postings on GRN"));
table_section_title(_("Inventory"));
check_row(_("Allow Negative Inventory:"), 'allow_negative_stock', null);
label_row(null, _("Warning:  This may cause a delay in GL postings"), "", "class='stockmankofg' colspan=2");
table_section_title(_("Items Defaults"));
gl_all_accounts_list_row(_("Sales Account:"), 'default_inv_sales_act', $_POST['default_inv_sales_act']);
gl_all_accounts_list_row(_("Inventory Account:"), 'default_inventory_act', $_POST['default_inventory_act']);
// this one is default for items and suppliers (purchase account)
gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'default_cogs_act', $_POST['default_cogs_act']);
gl_all_accounts_list_row(_("Inventory Adjustments Account:"), 'default_adj_act', $_POST['default_adj_act']);
gl_all_accounts_list_row(_("Item Assembly Costs Account:"), 'default_assembly_act', $_POST['default_assembly_act']);
//----------------
table_section_title(_("Manufacturing Defaults"));
text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days"));
//----------------
end_outer_table(1);
submit_center('submit', _("Update"), true, '', 'default');
end_form(2);
Exemple #7
0
     break;
 case '2':
     if (!isset($_POST['host'])) {
         foreach ($_SESSION['inst_set'] as $name => $val) {
             $_POST[$name] = $val;
         }
     }
     subpage_title(_('Database Server Settings'));
     start_table(TABLESTYLE);
     text_row_ex(_("Server Host:"), 'host', 30, 60);
     text_row_ex(_("Database User:"******"Database Password:"******"Database Name:"), 'dbname', 30);
     yesno_list_row(_("Use '0_' Table Prefix:"), 'tbpref', 1, _('Yes'), _('No'), false);
     check_row(_("Install Additional Language Packs from FA Repository:"), 'sel_langs');
     check_row(_("Install Additional COAs from FA Repository:"), 'sel_coas');
     end_table(1);
     display_note(_('Use table prefix if you share selected database for more than one FA company.'));
     display_note(_("Do not select additional langs nor COAs if you have no working internet connection right now. You can install them later."));
     submit_center_first('back', _('<< Back'));
     submit_center_last('db_test', _('Continue >>'));
     break;
 case '3':
     // select langauges
     subpage_title(_('User Interface Languages Selection'));
     display_langs();
     submit_center_first('back', _('<< Back'));
     submit_center_last('install_langs', _('Continue >>'));
     break;
 case '4':
     // select COA
Exemple #8
0
function item_settings(&$stock_id)
{
    global $SysPrefs, $path_to_root, $new_item, $pic_height;
    start_outer_table(TABLESTYLE2);
    table_section(1);
    table_section_title(_("Item"));
    //------------------------------------------------------------------------------------
    if ($new_item) {
        text_row(_("Item Code/ISBN:"), 'NewStockID', null, 21, 20);
        $_POST['inactive'] = 0;
    } else {
        // Must be modifying an existing item
        if (get_post('NewStockID') != get_post('stock_id') || get_post('addupdate')) {
            // first item display
            $_POST['NewStockID'] = $_POST['stock_id'];
            $myrow = get_item($_POST['NewStockID']);
            $_POST['long_description'] = $myrow["long_description"];
            $_POST['description'] = $myrow["description"];
            $_POST['category_id'] = $myrow["category_id"];
            /*==============MOODLEARNING=============*/
            $_POST['level_id'] = $myrow["level_id"];
            /*=======================================*/
            $_POST['tax_type_id'] = $myrow["tax_type_id"];
            $_POST['units'] = $myrow["units"];
            $_POST['mb_flag'] = $myrow["mb_flag"];
            $_POST['sales_account'] = $myrow['sales_account'];
            $_POST['inventory_account'] = $myrow['inventory_account'];
            $_POST['cogs_account'] = $myrow['cogs_account'];
            $_POST['adjustment_account'] = $myrow['adjustment_account'];
            $_POST['assembly_account'] = $myrow['assembly_account'];
            $_POST['dimension_id'] = $myrow['dimension_id'];
            $_POST['dimension2_id'] = $myrow['dimension2_id'];
            $_POST['no_sale'] = $myrow['no_sale'];
            $_POST['del_image'] = 0;
            $_POST['inactive'] = $myrow["inactive"];
            $_POST['editable'] = $myrow["editable"];
        }
        label_row(_("Item Code/ISBN:"), $_POST['NewStockID']);
        hidden('NewStockID', $_POST['NewStockID']);
        set_focus('description');
    }
    /*=================MOODLEARNING====================*/
    level_list_row(_("Level:"), 'level_id', null);
    /*=================================================*/
    text_row(_("Name:"), 'description', null, 52, 200);
    textarea_row(_('Description:'), 'long_description', null, 42, 3);
    stock_categories_list_row(_("Category/Subject:"), 'category_id', null, false, $new_item);
    if ($new_item && (list_updated('category_id') || !isset($_POST['units']))) {
        $category_record = get_item_category($_POST['category_id']);
        $_POST['level_id'] = $category_record["level_id"];
        // moodlearning edit
        $_POST['subject_id'] = $category_record["level_id"];
        $_POST['tax_type_id'] = $category_record["dflt_tax_type"];
        $_POST['units'] = $category_record["dflt_units"];
        $_POST['mb_flag'] = $category_record["dflt_mb_flag"];
        $_POST['inventory_account'] = $category_record["dflt_inventory_act"];
        $_POST['cogs_account'] = $category_record["dflt_cogs_act"];
        $_POST['sales_account'] = $category_record["dflt_sales_act"];
        $_POST['adjustment_account'] = $category_record["dflt_adjustment_act"];
        $_POST['assembly_account'] = $category_record["dflt_assembly_act"];
        $_POST['dimension_id'] = $category_record["dflt_dim1"];
        $_POST['dimension2_id'] = $category_record["dflt_dim2"];
        $_POST['no_sale'] = $category_record["dflt_no_sale"];
        $_POST['editable'] = 0;
    }
    $fresh_item = !isset($_POST['NewStockID']) || $new_item || check_usage($_POST['stock_id'], false);
    item_tax_types_list_row(_("Item Tax Type:"), 'tax_type_id', null);
    stock_item_types_list_row(_("Item Type:"), 'mb_flag', null, $fresh_item);
    stock_units_list_row(_('Units of Measure:'), 'units', null, $fresh_item);
    check_row(_("Editable description:"), 'editable');
    check_row(_("Exclude from sales:"), 'no_sale');
    table_section(2);
    $dim = get_company_pref('use_dimension');
    if ($dim >= 1) {
        table_section_title(_("Dimensions"));
        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(_("GL Accounts"));
    gl_all_accounts_list_row(_("Sales Account:"), 'sales_account', $_POST['sales_account']);
    if (!is_service($_POST['mb_flag'])) {
        gl_all_accounts_list_row(_("Inventory Account:"), 'inventory_account', $_POST['inventory_account']);
        gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']);
        gl_all_accounts_list_row(_("Inventory Adjustments Account:"), 'adjustment_account', $_POST['adjustment_account']);
    } else {
        gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']);
        hidden('inventory_account', $_POST['inventory_account']);
        hidden('adjustment_account', $_POST['adjustment_account']);
    }
    if (is_manufactured($_POST['mb_flag'])) {
        gl_all_accounts_list_row(_("Item Assembly Costs Account:"), 'assembly_account', $_POST['assembly_account']);
    } else {
        hidden('assembly_account', $_POST['assembly_account']);
    }
    table_section_title(_("Other"));
    // Add image upload for New Item  - by Joe
    file_row(_("Image File (.jpg)") . ":", 'pic', 'pic');
    // Add Image upload for New Item  - by Joe
    $stock_img_link = "";
    $check_remove_image = false;
    if (isset($_POST['NewStockID']) && file_exists(company_path() . '/images/' . item_img_name($_POST['NewStockID']) . ".jpg")) {
        // 31/08/08 - rand() call is necessary here to avoid caching problems. Thanks to Peter D.
        $stock_img_link .= "<img id='item_img' alt = '[" . $_POST['NewStockID'] . ".jpg" . "]' src='" . company_path() . '/images/' . item_img_name($_POST['NewStockID']) . ".jpg?nocache=" . rand() . "'" . " height='{$pic_height}' border='0'>";
        $check_remove_image = true;
    } else {
        $stock_img_link .= _("No image");
    }
    label_row("&nbsp;", $stock_img_link);
    if ($check_remove_image) {
        check_row(_("Delete Image:"), 'del_image');
    }
    record_status_list_row(_("Item status:"), 'inactive');
    end_outer_table(1);
    div_start('controls');
    if (!isset($_POST['NewStockID']) || $new_item) {
        submit_center('addupdate', _("Insert New Item"), true, '', 'default');
    } else {
        submit_center_first('addupdate', _("Update Item"), '', @$_REQUEST['popup'] ? true : 'default');
        submit_return('select', get_post('stock_id'), _("Select this items and return to document entry."), 'default');
        submit('clone', _("Clone This Item"), true, '', true);
        submit('delete', _("Delete This Item"), true, '', true);
        submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel');
    }
    div_end();
}
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"));
check_row(_("Add Tax to Receipts:"), 'paypal_add_tax', null);
check_row(_("Tax Included in Paypal Amount:"), 'paypal_tax_included', null);
tax_types_list_row("Default Tax Type:", 'paypal_tax_type_id', null);
tax_groups_list_row("Default Tax Group:", 'paypal_tax_group_id', null);
item_tax_types_list_row("Default Item Tax Group:", 'paypal_item_tax_id', null);
end_outer_table(1);
submit_center('submit', _("Update"), true, '', 'default');
end_form();
//-------------------------------------------------------------------------------------------------
end_page();
Exemple #10
0
}
inactive_control_row($th);
end_table(1);
//-----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    //editing an existing status code
    if ($Mode == 'Edit') {
        $group = get_tax_group($selected_id);
        $_POST['name'] = $group["name"];
        $_POST['tax_shipping'] = $group["tax_shipping"];
    }
    hidden('selected_id', $selected_id);
}
text_row_ex(_("Description:"), 'name', 40);
yesno_list_row(_("Tax applied to Shipping:"), 'tax_shipping', null, "", "", true);
end_table();
display_note(_("Select the taxes that are included in this group."), 1, 1);
// null means transport tax group, but for new we do not use real rates
$items = get_tax_group_rates($selected_id != -1 ? $selected_id : null);
$th = array(_("Tax"), "");
start_table(TABLESTYLE2);
table_header($th);
while ($item = db_fetch_assoc($items)) {
    check_row($item['tax_type_name'], 'tax_type_id' . $item['tax_type_id'], $selected_id != -1 && isset($item['rate']), "align='center'");
}
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
//------------------------------------------------------------------------------------
end_page();
text_row_ex(tr("Telephone Number:"), 'phone', 25, 55);
text_row_ex(tr("Facsimile Number:"), 'fax', 25);
text_row_ex(tr("Email Address:"), 'email', 25, 55);
//text_row_ex(tr("Company Logo:"), 'coy_logo', 25, 55);
start_row();
label_cells(tr("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
$fileimg = $path_to_root . "/image.php?id=1&table=company";
$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=6");
end_row();
text_row_ex(tr("Domicile:"), 'domicile', 25, 55);
number_list_row(tr("Use Dimensions:"), 'use_dimension', null, 0, 2);
check_row(tr("No Item List"), 'no_item_list', $_POST['no_item_list']);
check_row(tr("No Customer List"), 'no_customer_list', $_POST['no_customer_list']);
check_row(tr("No Supplier List"), 'no_supplier_list', $_POST['no_supplier_list']);
start_row();
end_row();
label_row(tr("Custom Field Name"), tr("Custom Field Value"));
start_row();
text_cells(null, 'custom1_name', $_POST['custom1_name'], 25, 25);
text_cells(null, 'custom1_value', $_POST['custom1_value'], 30, 30);
end_row();
start_row();
text_cells(null, 'custom2_name', $_POST['custom2_name'], 25, 25);
text_cells(null, 'custom2_value', $_POST['custom2_value'], 30, 30);
end_row();
start_row();
text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25);
text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30);
end_row();
$_POST['param'] = '';
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing payment widget
        $myrow = get_dashboard_widget($selected_id);
        $_POST['widget_app'] = $myrow["app"];
        $_POST['column_id'] = $myrow["column_id"];
        $_POST['sort_no'] = $myrow["sort_no"];
        $_POST['description'] = $myrow["description"];
        $_POST['widget'] = $myrow["widget"];
        $_POST['sort_no'] = $myrow["sort_no"];
        $_POST['param'] = $myrow["param"];
    }
    hidden('selected_id', $selected_id);
}
$widget = $app->get_widget(isset($_POST['widget']) ? $_POST['widget'] : $app->widgets[0]->name);
widget_list_row($app->get_widget_list(), _("Widget:"), 'widget', null, true);
text_row_ex(_("Title:"), 'description', 40);
select_row(_("Application Tab:"), "widget_app", null, $app->apps, null);
text_row_ex(_("Column:"), 'column_id', 1);
text_row_ex(_("Sequence:"), 'sort_no', 1);
check_row(_("Collapsed:"), 'collapsed');
include_once $path_to_root . $widget->path;
$className = $widget->name;
$widgetObject = new $className($_POST['param']);
$widgetObject->edit_param();
end_table(1);
div_end();
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();
Exemple #13
0
     ////////////////////////////////////////////////\\\
     $num = (double) $_POST['delete'];
     $_POST['delete'] = null;
     mysql_query("DELETE FROM nmb_save WHERE num = {$num}");
     //删除功能占坑
     ///////////////////////////////////////
 }
 if (isset($_POST['newmsg'])) {
     $date1 = date("Y/m/d h:i:s a");
     mysql_select_db("app_chwdywp1", $con);
     if (isset($_COOKIE['id'])) {
         $time_plus = time() + 36000;
         $time_plus = (int) $time_plus;
         setcookie('id', $_COOKIE['id'], $time_plus, '/../');
         setcookie('name', $_COOKIE['name'], $time_plus, '/../');
         $index = check_row() + 1;
         $index = (int) $index;
         if (get_status() == 1) {
             if (isset($_POST['time'])) {
                 if ($_POST["time"] != $_SESSION["time"]) {
                     mysql_query("INSERT INTO nmb_save  VALUES({$index},1,'{$_COOKIE['id']}','{$date1}','{$_POST['newmsg']}')");
                     mysql_query("UPDATE nmb_set SET value = '{$index}' WHERE item = 'index'");
                     $_SESSION["time"] = $_POST['time'];
                 } else {
                 }
             }
             $_POST['msg'] = null;
         } else {
             br();
             br();
             br();
Exemple #14
0
text_row_ex(tr("Exchange Rates:"), 'Rates', 5, 5, user_exrate_dec());
text_row_ex(tr("Percentages:"), 'Percent', 5, 5, user_percent_dec());
table_section_title(tr("Dateformat and Separators"));
dateformats_list_row(tr("Dateformat:"), "date_format", user_date_format());
dateseps_list_row(tr("Date Separator:"), "date_sep", user_date_sep());
/* The array $dateseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
thoseps_list_row(tr("Thousand Separator:"), "tho_sep", user_tho_sep());
/* The array $thoseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
decseps_list_row(tr("Decimal Separator:"), "dec_sep", user_dec_sep());
/* The array $decseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
table_section_title(tr("Miscellaneous"));
check_row(tr("Show GL Information:"), 'show_gl', user_show_gl_info());
check_row(tr("Show Item Codes:"), 'show_codes', user_show_codes());
themes_list_row(tr("Theme:"), "theme", user_theme());
/* The array $themes is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
pagesizes_list_row(tr("Page Size:"), "page_size", user_pagesize());
/* The array $pagesizes is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
table_section_title(tr("Language"));
if (!isset($_POST['language'])) {
    $_POST['language'] = $_SESSION['language']->code;
}
languages_list_row(tr("Language:"), 'language', $_POST['language']);
end_table(1);
submit_center('setprefs', tr("Update"));
end_form(2);
//-------------------------------------------------------------------------------------------------
Exemple #15
0
        $_POST['pos'] = $myrow["pos"];
    }
    hidden('selected_id', $selected_id);
    hidden('user_id');
    start_row();
    label_row(_("User login:"******"User Login:"******"user_id", null, 22, 20);
    $_POST['language'] = user_language();
    $_POST['print_profile'] = user_print_profile();
    $_POST['rep_popup'] = user_rep_popup();
    $_POST['pos'] = user_pos();
}
$_POST['password'] = "";
password_row(_("Password:"******"Enter a new password to change, leave empty to keep current."));
}
text_row_ex(_("Full Name") . ":", 'real_name', 50);
text_row_ex(_("Telephone No.:"), 'phone', 30);
email_row_ex(_("Email Address:"), 'email', 50);
security_roles_list_row(_("Access Level:"), 'role_id', null);
languages_list_row(_("Language:"), 'language', null);
pos_list_row(_("User's POS") . ':', 'pos', null);
print_profiles_list_row(_("Printing profile") . ':', 'print_profile', null, _('Browser printing support'));
check_row(_("Use popup window for reports:"), 'rep_popup', $_POST['rep_popup'], false, _('Set this option to on if your browser directly supports pdf files'));
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();
Exemple #16
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();
possible separators can be added by modifying the array definition by editing that file */
if (!isset($_POST['language'])) {
    $_POST['language'] = $_SESSION['language']->code;
}
table_section_title(_("Language"));
languages_list_row(_("Language:"), 'language', $_POST['language']);
table_section(2);
table_section_title(_("Miscellaneous"));
check_row(_("Show hints for new users:"), 'show_hints', user_hints());
check_row(_("Show GL Information:"), 'show_gl', user_show_gl_info());
check_row(_("Show Item Codes:"), 'show_codes', user_show_codes());
themes_list_row(_("Theme:"), "theme", user_theme());
/* The array $themes is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
pagesizes_list_row(_("Page Size:"), "page_size", user_pagesize());
tab_list_row(_("Start-up Tab"), 'startup_tab', user_startup_tab());
/* The array $pagesizes is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
if (!isset($_POST['print_profile'])) {
    $_POST['print_profile'] = user_print_profile();
}
print_profiles_list_row(_("Printing profile") . ':', 'print_profile', null, _('Browser printing support'));
check_row(_("Use popup window to display reports:"), 'rep_popup', user_rep_popup(), false, _('Set this option to on if your browser directly supports pdf files'));
check_row(_("Use icons instead of text links:"), 'graphic_links', user_graphic_links(), false, _('Set this option to on for using icons instead of text links'));
text_row_ex(_("Query page size:"), 'query_size', 5, 5, '', user_query_size());
check_row(_("Remember last document date:"), 'sticky_doc_date', sticky_doc_date(), false, _('If set document date is remembered on subsequent documents, otherwise default is current date'));
end_outer_table(1);
submit_center('setprefs', _("Update"), true, '', 'default');
end_form(2);
//-------------------------------------------------------------------------------------------------
end_page();
Exemple #18
0
function display_languages()
{
    global $table_style, $installed_languages, $dflt_lang, $GetText;
    $th = array(_("Language"), _("Name"), _("Encoding"), _("Right To Left"), _("Installed"), _("Available"), _("Default"), "", "");
    $currlang = $_SESSION["language"]->code;
    div_start('lang_tbl');
    start_form();
    //
    // select/display system locales support for sites using native gettext
    //
    if (function_exists('gettext')) {
        if (check_value('DisplayAll')) {
            array_insert($th, 7, _("Supported"));
        }
        start_table();
        check_row(_('Display also languages not supported by server locales'), 'DisplayAll', null, true);
        end_table();
    }
    start_table(TABLESTYLE);
    table_header($th);
    $k = 0;
    // get list of all (available and installed) langauges
    $langs = get_languages_list();
    foreach ($langs as $pkg_name => $lng) {
        if ($lng == 'C') {
            // skip default locale (aka no translation)
            continue;
        }
        $lang = $lng['code'];
        $lang_name = $lng['name'];
        $charset = $lng['encoding'];
        $rtl = @$lng['rtl'] == 'yes' || @$lng['rtl'] === true;
        $available = @$lng['available'];
        $installed = @$lng['version'];
        $id = @$lng['local_id'];
        if ($lang == $currlang) {
            start_row("class='stockmankobg'");
        } else {
            alt_table_row_color($k);
        }
        $support = $GetText->check_support($lang, $charset);
        if (function_exists('gettext') && !$support && !get_post('DisplayAll')) {
            continue;
        }
        label_cell($lang);
        label_cell($available ? get_package_view_str($lang, $lang_name) : $lang_name);
        label_cell($charset);
        label_cell($rtl ? _("Yes") : _("No"));
        label_cell($id === null ? _("None") : ($available && $installed ? $installed : _("Unknown")));
        label_cell($available ? $available : _("None"));
        label_cell($id === null ? '' : radio(null, 'CurDflt', $id, $dflt_lang == $lang, true), "align='center'");
        if (function_exists('gettext') && check_value('DisplayAll')) {
            label_cell($support ? _("Yes") : _("No"));
        }
        if (!$available && $lang != 'C') {
            // manually installed language
            button_cell('Edit' . $id, _("Edit"), _('Edit non standard language configuration'), ICON_EDIT);
        } elseif (check_pkg_upgrade($installed, $available)) {
            // outdated or not installed language in repo
            button_cell('Update' . $pkg_name, $installed ? _("Update") : _("Install"), _('Upload and install latest language package'), ICON_DOWN);
        } else {
            label_cell('');
        }
        if ($id !== null && $lang != $currlang && $lang != 'C') {
            delete_button_cell('Delete' . $id, _('Delete'));
            submit_js_confirm('Delete' . $id, sprintf(_("You are about to remove language \\'%s\\'.\nDo you want to continue ?"), $lang_name));
        } else {
            label_cell('');
        }
        end_row();
    }
    end_table();
    display_note(_("The marked language is the current language which cannot be deleted."), 0, 0, "class='currentfg'");
    br();
    submit_center_first('Refresh', _("Update default"), '', null);
    submit_center_last('Add', _("Add new language manually"), '', false);
    end_form();
    div_end();
}
Exemple #19
0
//END WHILE LIST LOOP
end_table();
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Payment Term"));
//-------------------------------------------------------------------------------------------------
start_form();
start_table($table_style2);
$day_in_following_month = $days_before_due = 0;
if (isset($selected_id)) {
    //editing an existing payment terms
    $sql = "SELECT * FROM payment_terms\n\t\tWHERE terms_indicator='{$selected_id}'";
    $result = db_query($sql, "could not get payment term");
    $myrow = db_fetch($result);
    $_POST['terms'] = $myrow["terms"];
    $days_before_due = $myrow["days_before_due"];
    $day_in_following_month = $myrow["day_in_following_month"];
    hidden('selected_id', $selected_id);
}
text_row(tr("Terms Description:"), 'terms', null, 40, 40);
check_row(tr("Due After A Given No. Of Days:"), 'DaysOrFoll', $day_in_following_month == 0);
if (!isset($_POST['DayNumber'])) {
    if ($days_before_due != 0) {
        $_POST['DayNumber'] = $days_before_due;
    } else {
        $_POST['DayNumber'] = $day_in_following_month;
    }
}
text_row_ex(tr("Days (Or Day In Following Month):"), 'DayNumber', 3);
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
end_page();
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');
end_form(2);
//-------------------------------------------------------------------------------------------------
end_page();
            $_POST['sales_account'] = $company_record["default_inv_sales_act"];
        }
        if (get_post('adjustment_account') == "") {
            $_POST['adjustment_account'] = $company_record["default_adj_act"];
        }
        if (get_post('assembly_account') == "") {
            $_POST['assembly_account'] = $company_record["default_assembly_act"];
        }
    }
}
text_row(_("Category Name:"), 'description', null, 30, 30);
table_section_title(_("Default values for new items"));
item_tax_types_list_row(_("Item Tax Type:"), 'tax_type_id', null);
stock_item_types_list_row(_("Item Type:"), 'mb_flag', null, true);
stock_units_list_row(_("Units of Measure:"), 'units', null);
check_row(_("Exclude from sales:"), 'no_sale');
gl_all_accounts_list_row(_("Sales Account:"), 'sales_account', $_POST['sales_account']);
if (is_service($_POST['mb_flag'])) {
    gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']);
    hidden('inventory_account', $_POST['inventory_account']);
    hidden('adjustment_account', $_POST['adjustment_account']);
} else {
    gl_all_accounts_list_row(_("Inventory Account:"), 'inventory_account', $_POST['inventory_account']);
    gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'cogs_account', $_POST['cogs_account']);
    gl_all_accounts_list_row(_("Inventory Adjustments Account:"), 'adjustment_account', $_POST['adjustment_account']);
}
if (is_manufactured($_POST['mb_flag'])) {
    gl_all_accounts_list_row(_("Item Assembly Costs Account:"), 'assembly_account', $_POST['assembly_account']);
} else {
    hidden('assembly_account', $_POST['assembly_account']);
}
}
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        $myrow = get_sales_point($selected_id);
        $_POST['name'] = $myrow["pos_name"];
        $_POST['location'] = $myrow["pos_location"];
        $_POST['account'] = $myrow["pos_account"];
        if ($myrow["credit_sale"]) {
            $_POST['credit_sale'] = 1;
        }
        if ($myrow["cash_sale"]) {
            $_POST['cash_sale'] = 1;
        }
    }
    hidden('selected_id', $selected_id);
}
text_row_ex(_("Point of Sale Name") . ':', 'name', 20, 30);
if ($cash) {
    check_row(_('Allowed credit sale terms selection:'), 'credit', check_value('credit_sale'));
    check_row(_('Allowed cash sale terms selection:'), 'cash', check_value('cash_sale'));
    cash_accounts_list_row(_("Default cash account") . ':', 'account');
} else {
    hidden('credit', 1);
    hidden('account', 0);
}
locations_list_row(_("POS location") . ':', 'location');
end_table(1);
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();