diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 8083670d8bc..02671f9b802 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '6.16.2' +__version__ = '6.16.3' diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index cc6157f36cf..a8ebbeaada4 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -23,6 +23,8 @@ class Account(Document): frappe.db.get_value("Company", self.company, "abbr") def validate(self): + if frappe.local.flags.allow_unverified_charts: + return self.validate_parent() self.validate_root_details() self.set_root_and_report_type() diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py index e1f9f1ce9c6..91469d90c8f 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py @@ -8,7 +8,7 @@ from unidecode import unidecode def create_charts(chart_name, company): chart = get_chart(chart_name) - + if chart: accounts = [] @@ -40,9 +40,9 @@ def create_charts(chart_name, company): "account_currency": frappe.db.get_value("Company", company, "default_currency") }) - if root_account: + if root_account or frappe.local.flags.allow_unverified_charts: account.flags.ignore_mandatory = True - + account.insert() accounts.append(account_name_in_db) @@ -67,13 +67,17 @@ def get_chart(chart_name): from erpnext.accounts.doctype.account.chart_of_accounts.verified import standard_chart_of_accounts return standard_chart_of_accounts.get() else: - path = os.path.join(os.path.dirname(__file__), "verified") - for fname in os.listdir(path): - if fname.endswith(".json"): - with open(os.path.join(path, fname), "r") as f: - chart = f.read() - if chart and json.loads(chart).get("name") == chart_name: - return json.loads(chart).get("tree") + folders = ("verified",) + if frappe.local.flags.allow_unverified_charts: + folders = ("verified", "unverified") + for folder in folders: + path = os.path.join(os.path.dirname(__file__), folder) + for fname in os.listdir(path): + if fname.endswith(".json"): + with open(os.path.join(path, fname), "r") as f: + chart = f.read() + if chart and json.loads(chart).get("name") == chart_name: + return json.loads(chart).get("tree") @frappe.whitelist() def get_charts_for_country(country): @@ -82,11 +86,7 @@ def get_charts_for_country(country): def _get_chart_name(content): if content: content = json.loads(content) - - if frappe.local.flags.allow_unverified_charts: - charts.append(content["name"]) - - elif content and content.get("is_active", "No") == "Yes" and content.get("disabled", "No") == "No": + if content and content.get("disabled", "No") == "No": charts.append(content["name"]) country_code = frappe.db.get_value("Country", country, "code") diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json index 489bba701a2..3b07d5181ef 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/at_austria_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "at", "name": "Austria - Chart of Accounts", - "is_active": "Yes", "tree": { "Summe Abschreibungen und Aufwendungen": { "7010 bis 7080 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {}, diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json index c7e7db87a89..051e554a48b 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/be_l10nbe_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "be", "name": "Belgian PCMN", - "disabled": "Yes", "tree": { "CLASSE 1": { "BENEFICE (PERTE) REPORTE(E)": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json index 3942871e554..65f5f3be9e0 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/br_l10n_br_account_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "br", "name": "Planilha de Contas Brasileira", - "is_active": "No", "tree": { "ATIVO": { "CIRCULANTE": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json index 3b2e7ffcaee..ed4cd40e852 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_en_chart_template_en.json @@ -1,7 +1,6 @@ { "country_code": "ca", "name": "Chart of Accounts for english-speaking provinces", - "is_active": "Yes", "tree": { "ASSETS": { "CURRENT ASSETS": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json index 676e3ec3ce2..41fe453cb4c 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ca_ca_fr_chart_template_fr.json @@ -1,7 +1,6 @@ { "country_code": "ca", "name": "Plan comptable pour les provinces francophones", - "is_active": "Yes", "tree": { "ACTIF": { "ACTIFS COURANTS": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json index a6c144005db..f8d467c2cb0 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ch_l10nch_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "ch", "name": "Plan comptable STERCHI", - "is_active": "Yes", "disabled": "Yes", "tree": { "Actif": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json index f2e973fec80..4ac3465bdb1 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/co_vauxoo_mx_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "co", "name": "Unique Account Chart - PUC", - "is_active": "Yes", "tree": { "ACTIVO": { "DEUDORES": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json index cb1f54d0261..f81d1e3410d 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_0.json @@ -1,7 +1,6 @@ { "country_code": "cr", "name": "Costa Rica - Company 0", - "is_active": "Yes", "tree": { "0-Activo": { "0-Activo circulante": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json index 0257d05e2a9..a36586e5252 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/cr_account_chart_template_x.json @@ -1,7 +1,6 @@ { "country_code": "cr", "name": "Costa Rica - Company 1", - "is_active": "Yes", "tree": { "xActivo": { "root_type": "Asset", diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json index f4d1fccc64e..c8ed2ee6886 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_chart_de_skr04.json @@ -1,7 +1,7 @@ { "country_code": "de", "name": "Deutscher Kontenplan SKR04", - "is_active": "Yes", + "disabled": "Yes", "tree": { "Bilanz - Aktiva": { "Anlageverm\u00f6gen": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json index 4b16c86ee1e..2f9782a5ca7 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/de_l10n_de_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "de", "name": "Deutscher Kontenplan SKR03", - "is_active": "No", "disabled": "Yes", "tree": { "Aktiva": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json index 5c70ee2d61a..122edaa53e9 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/es_account_chart_template_common.json @@ -1,6 +1,7 @@ { "country_code": "es", "name": "PGCE com\u00fan", + "disabled": "Yes", "tree": { "Acreedores y deudores por operaciones comerciales": { "Acreedores varios": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json index 71a39df562a..d7b1964f5e0 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/et_l10n_et.json @@ -1,7 +1,6 @@ { "country_code": "et", "name": "Ethiopia Tax and Account Chart Template", - "is_active": "Yes", "tree": { "ASSETS": { "Cash and Cash Equivalents": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json index 8f8e7778f93..5b4f35237f7 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/gt_cuentas_plantilla.json @@ -1,7 +1,6 @@ { "country_code": "gt", "name": "Plantilla de cuentas de Guatemala (sencilla)", - "is_active": "Yes", "tree": { "Activo": { "Activo Corriente": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json index 34caff6e5b6..1c06a2e5099 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/hn_cuentas_plantilla.json @@ -1,7 +1,6 @@ { "country_code": "hn", "name": "Plantilla de cuentas de Honduras (sencilla)", - "is_active": "Yes", "tree": { "Activo": { "Activo Corriente": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json index 1dc52933042..c304684aa64 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/lu_lu_2011_chart_1.json @@ -1,6 +1,7 @@ { "country_code": "lu", "name": "PCMN Luxembourg", + "disabled": "Yes", "tree": { "TOTAL CLASSES 1 A 5": { "CLASSE 1 - COMPTES DE CAPITAUX, DE PROVISIONS ET DE DETTES FINANCIERES": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json index 59809c919d6..de1604468a2 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/pa_l10npa_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "pa", "name": "Plan de Cuentas", - "is_active": "Yes", "tree": { "ACTIVOS": { "Activo Fijo": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json index 64f54125e64..ef43897eb32 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/ro_ro_chart_template.json @@ -1,6 +1,7 @@ { "country_code": "ro", "name": "Romania - Chart of Accounts", + "disabled": "Yes", "tree": { "CONTURI FINANCIARE": { "CONTURI DE BILANT": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/sg_sg_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/sg_sg_chart_template.json deleted file mode 100644 index e46f317e5dd..00000000000 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/sg_sg_chart_template.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "country_code": "sg", - "name": "Singapore Chart of Accounts", - "is_active": "Yes", - "tree": { - "Assets": { - "Cash and cash equivalents": { - "Cash on hand": { - "account_type": "Cash" - }, - "Client trust account": { - "account_type": "Cash" - }, - "Current": { - "account_type": "Bank" - }, - "Money market": { - "account_type": "Cash" - }, - "Rents held in trust": { - "account_type": "Cash" - }, - "Savings": { - "account_type": "Cash" - }, - "account_type": "Cash" - }, - "Current assets": { - "Allowance for bad debts": {}, - "Development costs": {}, - "Employee cash advances": {}, - "Inventory": {}, - "Investments - other": {}, - "Loans to officers": {}, - "Loans to others": {}, - "Loans to shareholders": {}, - "Other Current Assets": {}, - "Prepaid expenses": {}, - "Retainage": {}, - "Undeposited funds": {} - }, - "Non-current assets": { - "Accumulated amortization of non-current assets": {}, - "Available-for-sale financial assets": {}, - "Deferred tax": {}, - "Goodwill": {}, - "Intangible Assets": {}, - "Investments": {}, - "Lease Buyout": {}, - "Licences": {}, - "Organisational costs": {}, - "Other intangible assets": {}, - "Other non-current assets": {}, - "Prepayments and accrued income": {}, - "Security Deposits": {} - }, - "Property, plant and equipment": { - "Accumulated amortisation": {}, - "Accumulated depletion": {}, - "Accumulated depreciation": {}, - "Buildings": {}, - "Depletable assets": {}, - "Furniture and fixtures": {}, - "Leasehold improvements": {}, - "Machinery and equipment": {}, - "Other Assets": {}, - "Vehicles": {} - }, - "Purchase Tax Receivable": { - "Purchase Tax Account 0% EP": {}, - "Purchase Tax Account 0% ME": {}, - "Purchase Tax Account 0% NR": {}, - "Purchase Tax Account 0% OP": {}, - "Purchase Tax Account 0% ZP": {}, - "Purchase Tax Account 7% BL": {}, - "Purchase Tax Account 7% IM": {}, - "Purchase Tax Account 7% TX-E33": {}, - "Purchase Tax Account 7% TX-N33": {}, - "Purchase Tax Account 7% TX-RE": {}, - "Purchase Tax Account 7% TX7": {}, - "Purchase Tax Account MES": {} - }, - "Trade and other receivable": { - "Other Receivable Account": { - "account_type": "Receivable" - }, - "Trade Receivable Account": { - "account_type": "Receivable" - }, - "account_type": "Receivable" - }, - "root_type": "Asset" - }, - "Liabilities": { - "Current liabilities": { - "Client Trust Accounts - Liabilities": {}, - "Current Tax Liability": {}, - "Current portion of employee benefits obligations": {}, - "Current portion of obligations under finance leases": {}, - "GST Payable": {}, - "Insurance Payable": {}, - "Interest payables": {}, - "Line of Credit": {}, - "Loan Payable": {}, - "Payroll Clearing": {}, - "Payroll liabilities": {}, - "Prepaid Expenses Payable": {}, - "Provision for warranty obligations": {}, - "Rents in trust - Liability": {}, - "Short term borrowings": {} - }, - "Equity": { - "Accumulated Adjustment": {}, - "Opening Balance Equity": {}, - "Ordinary shares": {}, - "Owner's Equity": {}, - "Paid-in capital or surplus": {}, - "Partner's Equity": {}, - "Preferred shares": {}, - "Retained Earnings": {}, - "Share capital": {}, - "Treasury Shares": {} - }, - "Non-current liabilities": { - "Accruals and Deferred Income": {}, - "Bank loans": {}, - "Long term borrowings": {}, - "Long term employee benefit obligations": {}, - "Notes Payable": {}, - "Obligations under finance leases": {}, - "Other non-current liabilities": {}, - "Shareholder Notes Payable": {} - }, - "Sale Tax Payables": { - " Sales Tax Account 0% ES33": {}, - "Sales Tax Account 0% ESN33": {}, - "Sales Tax Account 0% OS": {}, - "Sales Tax Account 0% ZR": {}, - "Sales Tax Account 7% DS": {}, - "Sales Tax Account 7% SR": {} - }, - "Trade and other payables": { - "Other Payable Account": { - "account_type": "Payable" - }, - "Trade Payable Account": { - "account_type": "Payable" - }, - "account_type": "Payable" - }, - "root_type": "Liability" - }, - "Cost of sales": { - "Cost of Good Sold": { - "Cost of Labour - COS": {}, - "Equipment rental - COS": {}, - "Freight and delivery - COS": {}, - "Other costs of sales - COS": {}, - "Supplies and materials - COS": {} - }, - "root_type": "Expense" - }, - "Income": { - "Other revenue": { - "Dividend revenue": {}, - "Gain/loss on sale of fixed assets or investments": {}, - "Interest earned": {}, - "Other investment revenue": {}, - "Other miscellaneous revenue": {}, - "Tax-exempt interest": {} - }, - "Revenue": { - "Discounts/refunds given": {}, - "Non-profit revenue": {}, - "Other primary revenue": {}, - "Sales of product revenue": {}, - "Service/fee revenue": {}, - "Unapplied cash payment income": {} - }, - "root_type": "Income" - }, - "Indirect Expenses": { - "Expenses": { - "Administrative expenses": {}, - "Advertising/promotional": {}, - "Auto": {}, - "Bad debts": {}, - "Bank charges": {}, - "Charitable contributions": {}, - "Cost of labour": {}, - "Distribution costs": {}, - "Dues and subscriptions": {}, - "Entertainment": {}, - "Equipment rental": {}, - "Finance costs": {}, - "Insurance": {}, - "Interest paid": {}, - "Legal and professional fees": {}, - "Meals and entertainment": {}, - "Other miscellaneous service cost": {}, - "Payroll expenses": {}, - "Promotional meals": {}, - "Rent or lease of buildings": {}, - "Repair and maintenance": {}, - "Shipping, freight, and delivery": {}, - "Supplies": {}, - "Taxes paid": {}, - "Travel": {}, - "Travel meals": {}, - "Unapplied cash bill payment expense": {}, - "Utilities": {} - }, - "Other Expenses": { - "Amortisation": {}, - "Depreciation": {}, - "Exchange Gain or Loss": {}, - "Other Expense": {}, - "Penalties and settlements": {} - }, - "root_type": "Expense" - } - } -} diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json index 443054e1541..3f687dc6839 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/si_gd_chart.json @@ -1,6 +1,7 @@ { "country_code": "si", "name": "Kontni na\u010drt za gospodarske dru\u017ebe", + "disabled": "Yes", "tree": { "DOLGORO\u010cNA SREDSTVA": { "DANA DOLGORO\u010cNA POSOJILA IN TERJATVE ZA NEVPLA\u010cANI VPOKLICANI KAPITAL": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json index 6e8ff71b9c4..dffcf3560aa 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/th_chart.json @@ -1,7 +1,6 @@ { "country_code": "th", "name": "Thailand Chart of Accounts", - "is_active": "Yes", "tree": { "Assets": { "Account Receivable": {}, diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json index 326fa6518ff..04633ccb79c 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/unverified/uy_uy_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "uy", "name": "Plan de Cuentas", - "is_active": "Yes", "tree": { "ACTIVO": { "ACTIVO CORRIENTE": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json index 1ba0931b590..734e4d0f9ea 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json @@ -1,7 +1,6 @@ { "country_code": "ae", "name": "U.A.E Chart of Accounts", - "is_active": "Yes", "tree": { "Assets": { "Current Assets": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json index ceb37cc6381..81c4fdf30d2 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/gt_cuentas_plantilla.json @@ -1,7 +1,6 @@ { "country_code": "gt", "name": "Cuentas de Guatemala", - "is_active": "Yes", "tree": { "Activos": { "Activo Corriente": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json index 254e2b717ba..c300894e001 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/in_standard_chart_of_accounts.json @@ -1,7 +1,6 @@ { "country_code": "in", "name": "Chart of Accounts - India", - "is_active": "Yes", "tree": { "Application of Funds (Assets)": { "Current Assets": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json index bea2c6dbf2a..d55b77e2326 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ni_ni_chart_template.json @@ -1,7 +1,6 @@ { "country_code": "ni", "name": "Catalogo de Cuentas Nicaragua", - "is_active": "Yes", "tree": { "Activo": { "Activo Corriente": { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json new file mode 100644 index 00000000000..a62be37bf99 --- /dev/null +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_default_coa.json @@ -0,0 +1,273 @@ +{ + "country_code": "sg", + "name": "Singapore Default Chart of Accounts", + "tree": { + "Assets": { + "Current assets": { + "Accounts Receivable": { + "Credit Cards": { + "AMEX Receivable": {}, + "CUP Receivale": {}, + "MC Receivable": {}, + "NETS Receivable": {}, + "VISA Receivable": {} + }, + "Debtors": { + "account_type": "Receivable" + } + }, + "Bank Accounts": { + "Paypal Account": { + "account_type": "Bank" + }, + "account_type": "Bank" + }, + "Cash in Hand": { + "Cash in Transit": { + "account_type": "Cash" + }, + "Petty Cash": { + "account_type": "Cash" + } + }, + "Loans and Advances-Assets": { + "Prepayments": {} + }, + "Securities and Deposits": { + "Bank Guarantees": {}, + "Bank Deposits": {}, + "Rental Deposits": {} + }, + "Stock Assets": { + "account_type": "Stock", + "is_group": 1 + }, + "Tax Assets": { + "GST-Input": {} + } + }, + "Non-current assets": { + "Fixed Assets": { + "Accumulated Depreciation": { + "AccDep-Equipment-ICT": {}, + "AccDep-Furniture and Fixtures": {}, + "AccDep-Equipment-Office": {}, + "AccDep-Motor Vehicle": {}, + "AccDep-Plant and Machinery": {} + }, + "Equipment-ICT": {}, + "Furniture and Fixtures": {}, + "Equipment-Office": {}, + "Motor Vehicle": {}, + "Plant and Machinery": {} + }, + "Non-Fixed Assets": { + "Goodwill": {}, + "Investments": { + "Investments-Associated Company": {}, + "Investments-Subsidiary": {} + } + }, + "Shares": { + "Shares-Quoted": {}, + "Shares-Unquoted": {} + } + }, + "Temporary Accunts": { + "Temporary Opening": { + "account_type": "Temporary" + } + }, + "root_type": "Asset" + }, + "Liabilities": { + "Current liabilities": { + "Accounts Payable": { + "Creditors":{ + "account_type": "Payable" + } + }, + "Duties and Taxes": { + "account_type": "Tax", + "Deferred Tax Liabilities-Current": {}, + "GST-Output": {}, + "Income Tax Payable": {} + }, + "Loans-Current": { + "Amount Owing to Directors": {}, + "Bank Overdaft Account": {}, + "Secured Loans": {}, + "Unsecured Loans": {} + }, + "Provision and Accruals": { + "Accruals": { + "Accr-CPF": {}, + "Accr-Sundry": {}, + "Accr-Withholding Tax": {} + }, + "Provisions": { + "Prov-Audit Fee": {}, + "Prov-Others": {}, + "Prov-Tax Fee": {}, + "Prov-Bonus": { + "Prov-Bonus-Executive": {}, + "Prov-Bonus-Non Executive": {} + } + } + }, + "Sponsorship Funds": {}, + "Stock Liabilities": { + "Stock Received But Not Billed": { + "account_type": "Stock Received But Not Billed" + } + } + }, + "Non-current liabilities": { + "Deferred Tax Liabilities": {}, + "Loans-Non Current": {} + }, + "Capital Account": { + "Reserves and Surplus": {}, + "Shareholder Funds": {} + }, + "root_type": "Liability" + }, + "Equity": { + "Share Capital": {}, + "Current Year Earnings": {}, + "Proposed Dividends": {}, + "Retained Earnings": {}, + "root_type": "Equity" + }, + "Income": { + "Direct Income": { + "Management Income": {}, + "Sales Income": {} + }, + "Indirect Income": { + "Government Grants": {}, + "Interest Income": { + "Current Account Interest Earned": {}, + "Fixed Deposit Interest Earned": {} + }, + "Other Income": {}, + "Service Charges": {} + }, + "root_type": "Income" + }, + "Expenses": { + "Expenses-Administrative": { + "Audit Fees": {}, + "Bank charges and interest": {}, + "Currency Exchange Differences": {}, + "Insurance": {}, + "Interest on Loan": {}, + "Legal and Professional Fees": {}, + "Loss on Disposal of FA": {}, + "Postal and Courier Charges": {}, + "Printing and Stationery": {}, + "Secretarial Fees": {}, + "Tax Agent Fees": {} + }, + "Expenses-Direct": { + "Cost of Goods Sold": { + "account_type": "Cost of Goods Sold" + }, + "Cost of Sales": {}, + "Expenses Included in Valuation": { + "account_type": "Expenses Included In Valuation" + }, + "Stock Adjustment": { + "account_type": "Stock Adjustment" + } + }, + "Expenses-Marketing": { + "Advertising and Promotion": {}, + "Graphic Design Fees": {}, + "Internet Marketing": {} + }, + "Expenses-Operating": { + "Cleaning Costs": {}, + "Commission Charges": { + "Comm-Credit Card": {}, + "Comm-NETS": {}, + "Comm-Paypal": {} + }, + "Communication Costs": { + "Internet Connection": {}, + "Telephone Costs": {} + }, + "Entertainment Expenses": {}, + "General Expenses": {}, + "Licence Fees": {}, + "Rental Costs": { + "Rental-Premises": {}, + "Rental-Equipment": {}, + "Rental-Storage": {} + }, + "Repairs and Maintenance": { + "R&M-ICT": {}, + "R&M-Building": {}, + "R&M-Fixtures & Furniture": {}, + "R&M-Office": {}, + "R&M-Plant & Machinery": {} + }, + "Service Fees": {}, + "Subscription Fees": { + "Publication Subscriptions": {}, + "TV Subscriptions": {} + }, + "Travel Expenses": {}, + "Utilities": { + "Utility-Electricity": {}, + "Utility-Gas": {}, + "Utility-Refuse Removal": {}, + "Utility-Water": {} + } + }, + "Expenses-Other": { + "Bad Debts Written Off": {}, + "Depreciation": { + "Dep-ICT Equipment": {}, + "Dep-Fixtures & Furniture": {}, + "Dep-Motor Vehicle": {}, + "Dep-Office Equipment": {}, + "Dep-Plant & Machinery": {}, + "Dep-Renovation": {} + }, + "Donations": {}, + "Round Off": {}, + "Tax Expenses": { + "Tax Expenses": {} + } + }, + "Expenses-Staff": { + "Bonuses": { + "Bonus-Executive": {}, + "Bonus-Non Executive": {}, + "Bonus-Performance": {} + }, + "CPF": {}, + "Directors Fees": {}, + "FWL": {}, + "Incentives": {}, + "Medical Expenses": {}, + "Salaries": { + "Casual Labour": {}, + "Salary-Executive": {}, + "Salary-Non Executive-Full Time": {}, + "Salary-Non Executive-Part Time": {} + }, + "SDF": {}, + "Security Expenses": {}, + "Staff Advertising": {}, + "Staff Commission Paid": {}, + "Staff Meals": {}, + "Staff Training": {}, + "Staff Transport": {}, + "Staff Welfare": {} + }, + "root_type": "Expense" + } + } +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json new file mode 100644 index 00000000000..fb84f2051e4 --- /dev/null +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/sg_fnb_coa.json @@ -0,0 +1,343 @@ +{ + "country_code": "sg", + "name": "Singapore F&B Chart of Accounts", + "tree": { + "Assets": { + "Current assets": { + "Accounts Receivable": { + "Credit Cards": { + "AMEX Receivable": {}, + "CUP Receivale": {}, + "MC Receivable": {}, + "NETS Receivable": {}, + "VISA Receivable": {} + }, + "Debtors": { + "account_type": "Receivable" + } + }, + "Bank Accounts": { + "Paypal Account": { + "account_type": "Bank" + }, + "account_type": "Bank" + }, + "Cash in Hand": { + "Cash in Transit": { + "account_type": "Cash" + }, + "Petty Cash": { + "account_type": "Cash" + } + }, + "Loans and Advances-Assets": { + "Prepayments": {} + }, + "Securities and Deposits": { + "Bank Guarantees": {}, + "Bank Deposits": {}, + "Rental Deposits": {} + }, + "Stock Assets": { + "account_type": "Stock", + "is_group": 1 + }, + "Tax Assets": { + "GST-Input": {} + } + }, + "Non-current assets": { + "Fixed Assets": { + "Accumulated Depreciation": { + "AccDep-Equipment-AV": {}, + "AccDep-Equipment-Bar": {}, + "AccDep-Equipment-ICT": {}, + "AccDep-Equipment-Electrical": {}, + "AccDep-Furniture and Fixtures": {}, + "AccDep-Equipment-Kitchen": {}, + "AccDep-Equipment-Lighting": {}, + "AccDep-Equipment-Office": {}, + "AccDep-Motor Vehicle": {}, + "AccDep-Plant and Machinery": {}, + "AccDep-Renovation": {} + }, + "Equipment-AV": {}, + "Equipment-Bar": {}, + "Equipment-ICT": {}, + "Equipment-Electrical": {}, + "Furniture and Fixtures": {}, + "Equipment-Kitchen": {}, + "Equipment-Lighting": {}, + "Equipment-Office": {}, + "Motor Vehicle": {}, + "Plant and Machinery": {}, + "Renovation": {} + }, + "Non-Fixed Assets": { + "Goodwill": {}, + "Investments": { + "Investments-Associated Company": {}, + "Investments-Subsidiary": {} + } + }, + "Shares": { + "Shares-Quoted": {}, + "Shares-Unquoted": {} + } + }, + "Temporary Accunts": { + "Temporary Opening": { + "account_type": "Temporary" + } + }, + "root_type": "Asset" + }, + "Liabilities": { + "Current liabilities": { + "Accounts Payable": { + "Creditors":{ + "account_type": "Payable" + } + }, + "Duties and Taxes": { + "account_type": "Tax", + "Deferred Tax Liabilities-Current": {}, + "GST-Output": {}, + "Income Tax Payable": {} + }, + "Loans-Current": { + "Amount Owing to Directors": {}, + "Bank Overdaft Account": {}, + "Secured Loans": {}, + "Unsecured Loans": {} + }, + "Provision and Accruals": { + "Accruals": { + "Accr-CPF": {}, + "Accr-Incentives": {}, + "Accr-OCR Employee Card": {}, + "Accr-Paypal Credit": {}, + "Accr-Sundry": {}, + "Accr-Tips": {}, + "Accr-Withholding Tax": {} + }, + "Provisions": { + "Prov-Audit Fee": {}, + "Prov-Others": {}, + "Prov-Tax Fee": {}, + "Prov-Bonus": { + "Prov-Bonus-Executive": {}, + "Prov-Bonus-Non Executive": {} + } + } + }, + "Sponsorship Funds": {}, + "Stock Liabilities": { + "Stock Received But Not Billed": { + "account_type": "Stock Received But Not Billed" + } + } + }, + "Non-current liabilities": { + "Deferred Tax Liabilities": {}, + "Loans-Non Current": {} + }, + "Capital Account": { + "Reserves and Surplus": {}, + "Shareholder Funds": {} + }, + "root_type": "Liability" + }, + "Equity": { + "Share Capital": {}, + "Current Year Earnings": {}, + "Proposed Dividends": {}, + "Retained Earnings": {}, + "root_type": "Equity" + }, + "Income": { + "Direct Income": { + "Management Income": {}, + "Sales Income": { + "Sales-Food": {}, + "Sales-Beverage": {}, + "Sales-Events and Functions": {}, + "Sales-Merchandise": {}, + "Sales-Pool Tables": {}, + "Sales-Tobacco": {}, + "Sales-Rental": {} + } + }, + "Indirect Income": { + "Government Grants": {}, + "Interest Income": { + "Current Account Interest Earned": {}, + "Fixed Deposit Interest Earned": {} + }, + "Other Income": {}, + "Service Charges": {} + }, + "root_type": "Income" + }, + "Expenses": { + "Expenses-Administrative": { + "Admin Management Fees": {}, + "Audit Fees": {}, + "Auto": {}, + "Bank charges and interest": {}, + "Currency Exchange Differences": {}, + "Insurance": {}, + "Interest on Loan": {}, + "Legal and Professional Fees": {}, + "Loss on Disposal of FA": {}, + "Postal and Courier Charges": {}, + "Printing and Stationery": {}, + "Secretarial Fees": {}, + "Tax Agent Fees": {} + }, + "Expenses-Direct": { + "Cost of Goods Sold": { + "account_type": "Cost of Goods Sold" + }, + "Cost of Sales": { + "COS-Food": {}, + "COS-Beverage": {}, + "COS-Tobacco": {}, + "COS-Events and Functions": {}, + "COS-Merchandise": {} + }, + "Expenses Included in Valuation": { + "account_type": "Expenses Included In Valuation" + }, + "Stock Adjustment": { + "account_type": "Stock Adjustment" + } + }, + "Expenses-Marketing": { + "Advertising and Promotion": {}, + "Graphic Design Fees": {}, + "Internet Marketing": { + "Marketing-Social Media": {}, + "Marketing-Website": {} + } + }, + "Expenses-Operating": { + "Cleaning Costs": { + "Cleaning-Kitchen": {}, + "Cleaning-Laundry": {}, + "Cleaning-Outlet": {} + }, + "Commission Charges": { + "Comm-Credit Card": {}, + "Comm-NETS": {}, + "Comm-Paypal": {} + }, + "Communication Costs": { + "Internet Connection": {}, + "Telephone Costs": {} + }, + "Disposals": { + "Disposals-Food": {}, + "Disposals-Beverage": {}, + "Disposals-Merchandise": {}, + "Disposals-Others": {} + }, + "Entertainment Expenses": { + "DJ Costs": {}, + "Live Band Costs": {}, + "Recorded Music Costs": {} + }, + "FoC Accounts": { + "FoC-ENT": {}, + "FoC-OC": {} + }, + "General Expenses": {}, + "Landscaping Costs": {}, + "Licence Fees": {}, + "Operational Supplies": { + "Supplies-Bar": {}, + "Supplies-Guest": {}, + "Supplies-Kitchen": {}, + "Supplies-Restaurant": {}, + "Supplies-Stewarding": {} + }, + "Rental Costs": { + "Rental-Premises": {}, + "Rental-Equipment": {}, + "Rental-Storage": {} + }, + "Repairs and Maintenance": { + "R&M-ICT": {}, + "R&M-AV": {}, + "R&M-Building": {}, + "R&M-Electrical & Lighting": {}, + "R&M-Fixtures & Furniture": {}, + "R&M-Kitchen & Bar": {}, + "R&M-Office": {}, + "R&M-Plant & Machinery": {} + }, + "Service Fees": {}, + "Subscription Fees": { + "Publication Subscriptions": {}, + "TV Subscriptions": {} + }, + "Travel Expenses": {}, + "Utilities": { + "Utility-Electricity": {}, + "Utility-Gas": {}, + "Utility-Refuse Removal": {}, + "Utility-Water": {} + } + }, + "Expenses-Other": { + "Bad Debts Written Off": {}, + "Depreciation": { + "Dep-AV Equipment": {}, + "Dep-Bar Equipment": {}, + "Dep-ICT Equipment": {}, + "Dep-Electrical Equipment": {}, + "Dep-Fixtures & Furniture": {}, + "Dep-Kitchen Equipment": {}, + "Dep-Lighting Equipment": {}, + "Dep-Motor Vehicle": {}, + "Dep-Office Equipment": {}, + "Dep-Plant & Machinery": {}, + "Dep-Renovation": {} + }, + "Donations": {}, + "Round Off": {}, + "Tax Expenses": { + "Tax Expenses": {} + } + }, + "Expenses-Staff": { + "Bonuses": { + "Bonus-Executive": {}, + "Bonus-Non Executive": {}, + "Bonus-Performance": {} + }, + "CPF": {}, + "Directors Fees": {}, + "FWL": {}, + "Incentives": {}, + "Medical Expenses": {}, + "Salaries": { + "Casual Labour": {}, + "Salary-Executive": {}, + "Salary-Non Executive-Full Time": {}, + "Salary-Non Executive-Part Time": {} + }, + "SDF": {}, + "Security Expenses": {}, + "Staff Advertising": {}, + "Staff Commission Paid": {}, + "Staff Meals": {}, + "Staff Training": {}, + "Staff Transport": {}, + "Staff Uniforms": {}, + "Staff Welfare": {} + }, + "root_type": "Expense" + } + } +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index a6029561efd..670661c01fa 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -104,7 +104,7 @@ class JournalEntry(AccountsController): msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account)) elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes": frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx)) - + if d.is_advance == "Yes": if d.party_type == 'Customer' and flt(d.debit) > 0: frappe.throw(_("Row {0}: Advance against Customer must be credit").format(d.idx)) @@ -280,10 +280,14 @@ class JournalEntry(AccountsController): alternate_currency = [] for d in self.get("accounts"): account = frappe.db.get_value("Account", d.account, ["account_currency", "account_type"], as_dict=1) - d.account_currency = account.account_currency or self.company_currency - d.account_type = account.account_type + if account: + d.account_currency = account.account_currency + d.account_type = account.account_type - if d.account_currency!=self.company_currency and d.account_currency not in alternate_currency: + if not d.account_currency: + d.account_currency = self.company_currency + + if d.account_currency != self.company_currency and d.account_currency not in alternate_currency: alternate_currency.append(d.account_currency) if alternate_currency: diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index d916b61152a..b4c81df7c3b 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -11,6 +11,7 @@ import frappe.defaults from erpnext.controllers.buying_controller import BuyingController from erpnext.accounts.party import get_party_account, get_due_date from erpnext.accounts.utils import get_account_currency +from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_billed_amount_based_on_po form_grid_templates = { "items": "templates/form_grid/item_grid.html" @@ -150,14 +151,14 @@ class PurchaseInvoice(BuyingController): against_accounts = [] stock_items = self.get_stock_items() for item in self.get("items"): - # in case of auto inventory accounting, + # in case of auto inventory accounting, # against expense account is always "Stock Received But Not Billed" # for a stock item and if not epening entry and not drop-ship entry - + if auto_accounting_for_stock and item.item_code in stock_items \ - and self.is_opening == 'No' and (not item.po_detail or + and self.is_opening == 'No' and (not item.po_detail or not frappe.db.get_value("Purchase Order Item", item.po_detail, "delivered_by_supplier")): - + item.expense_account = stock_not_billed_account item.cost_center = None @@ -246,6 +247,7 @@ class PurchaseInvoice(BuyingController): self.update_against_document_in_jv() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") + self.update_billing_status_in_pr() self.update_project() @@ -407,6 +409,8 @@ class PurchaseInvoice(BuyingController): self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") + self.update_billing_status_in_pr() + self.make_gl_entries_on_cancel() self.update_project() @@ -431,6 +435,21 @@ class PurchaseInvoice(BuyingController): if pi: frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi)) + def update_billing_status_in_pr(self, update_modified=True): + updated_pr = [] + for d in self.get("items"): + if d.pr_detail: + billed_amt = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item` + where pr_detail=%s and docstatus=1""", d.pr_detail) + billed_amt = billed_amt and billed_amt[0][0] or 0 + frappe.db.set_value("Purchase Receipt Item", d.pr_detail, "billed_amt", billed_amt, update_modified=update_modified) + updated_pr.append(d.purchase_receipt) + elif d.po_detail: + updated_pr += update_billed_amount_based_on_po(d.po_detail, update_modified) + + for pr in set(updated_pr): + frappe.get_doc("Purchase Receipt", pr).update_billing_percentage(update_modified=update_modified) + @frappe.whitelist() def get_expense_account(doctype, txt, searchfield, start, page_len, filters): from erpnext.controllers.queries import get_match_cond diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 7ad50d50e58..c8ff232b5e1 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -12,6 +12,7 @@ from frappe.model.mapper import get_mapped_doc from erpnext.controllers.selling_controller import SellingController from erpnext.accounts.utils import get_account_currency +from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so form_grid_templates = { "items": "templates/form_grid/item_grid.html" @@ -98,6 +99,7 @@ class SalesInvoice(SellingController): self.update_status_updater_args() self.update_prevdoc_status() + self.update_billing_status_in_dn() # this sequence because outstanding may get -ve self.make_gl_entries() @@ -111,6 +113,7 @@ class SalesInvoice(SellingController): self.update_time_log_batch(self.name) + def before_cancel(self): self.update_time_log_batch(None) @@ -129,6 +132,7 @@ class SalesInvoice(SellingController): self.update_status_updater_args() self.update_prevdoc_status() + self.update_billing_status_in_dn() if not self.is_return: self.update_billing_status_for_zero_amount_refdoc("Sales Order") @@ -381,7 +385,7 @@ class SalesInvoice(SellingController): def validate_warehouse(self): super(SalesInvoice, self).validate_warehouse() - + for d in self.get('items'): if not d.warehouse: frappe.throw(_("Warehouse required at Row No {0}").format(d.idx)) @@ -410,7 +414,7 @@ class SalesInvoice(SellingController): if self.c_form_applicable == 'Yes' and self.c_form_no: msgprint(_("Please remove this Invoice {0} from C-Form {1}") .format(self.name, self.c_form_no), raise_exception = 1) - + def validate_dropship_item(self): for item in self.items: if item.sales_order: @@ -630,6 +634,21 @@ class SalesInvoice(SellingController): }, write_off_account_currency) ) + def update_billing_status_in_dn(self, update_modified=True): + updated_delivery_notes = [] + for d in self.get("items"): + if d.dn_detail: + billed_amt = frappe.db.sql("""select sum(amount) from `tabSales Invoice Item` + where dn_detail=%s and docstatus=1""", d.dn_detail) + billed_amt = billed_amt and billed_amt[0][0] or 0 + frappe.db.set_value("Delivery Note Item", d.dn_detail, "billed_amt", billed_amt, update_modified=update_modified) + updated_delivery_notes.append(d.delivery_note) + elif d.so_detail: + updated_delivery_notes += update_billed_amount_based_on_so(d.so_detail, update_modified) + + for dn in set(updated_delivery_notes): + frappe.get_doc("Delivery Note", dn).update_billing_percentage(update_modified=update_modified) + def get_list_context(context=None): from erpnext.controllers.website_list_for_contact import get_list_context list_context = get_list_context(context) diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index 51e2ebc8765..8e9be7ee150 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -23,6 +23,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -48,6 +49,7 @@ "options": "Item", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -69,6 +71,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -93,6 +96,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -115,6 +119,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -138,6 +143,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -162,6 +168,7 @@ "oldfieldtype": "Text", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "200px", "read_only": 0, "report_hide": 0, @@ -186,6 +193,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -210,6 +218,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -233,6 +242,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -255,6 +265,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -279,6 +290,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -304,6 +316,7 @@ "options": "currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -329,6 +342,7 @@ "oldfieldtype": "Float", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -350,6 +364,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -373,6 +388,7 @@ "options": "UOM", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -398,6 +414,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -419,6 +436,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -444,6 +462,7 @@ "options": "currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -469,6 +488,7 @@ "options": "currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 1, @@ -490,6 +510,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -515,6 +536,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 1, @@ -540,6 +562,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 1, @@ -563,6 +586,7 @@ "options": "Pricing Rule", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -585,6 +609,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -609,6 +634,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -633,6 +659,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -655,6 +682,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -679,6 +707,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -703,6 +732,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -727,6 +757,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -750,6 +781,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -772,6 +804,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -797,6 +830,7 @@ "options": "Account", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "120px", "read_only": 0, "report_hide": 0, @@ -822,6 +856,7 @@ "options": "Account", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -844,6 +879,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -870,6 +906,7 @@ "options": "Cost Center", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "120px", "read_only": 0, "report_hide": 0, @@ -895,6 +932,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -920,6 +958,7 @@ "options": "Warehouse", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -944,6 +983,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -968,6 +1008,7 @@ "oldfieldtype": "Small Text", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -991,6 +1032,7 @@ "options": "Batch", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1017,6 +1059,7 @@ "options": "Item Group", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1041,6 +1084,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1065,6 +1109,7 @@ "oldfieldtype": "Small Text", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1086,6 +1131,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1109,6 +1155,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "150px", "read_only": 1, "report_hide": 0, @@ -1135,6 +1182,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1158,6 +1206,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1181,6 +1230,7 @@ "options": "Time Log Batch", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1197,7 +1247,7 @@ "hidden": 0, "ignore_user_permissions": 0, "in_filter": 1, - "in_list_view": 1, + "in_list_view": 0, "label": "Sales Order", "length": 0, "no_copy": 1, @@ -1206,6 +1256,7 @@ "options": "Sales Order", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1230,6 +1281,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1252,6 +1304,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1277,6 +1330,7 @@ "options": "Delivery Note", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1301,6 +1355,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1325,6 +1380,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1347,6 +1403,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1369,6 +1426,7 @@ "no_copy": 1, "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 1, "reqd": 0, @@ -1386,7 +1444,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2015-11-16 06:29:56.335017", + "modified": "2016-01-06 02:23:06.432442", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index c0fc95c72ab..ba215c15727 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -56,6 +56,8 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( this.delivered_by_supplier).addClass("btn-primary"); } } else if(doc.docstatus===0) { + cur_frm.add_custom_button(__('Get Last Purchase Rate'), this.get_last_purchase_rate); + cur_frm.cscript.add_from_mappers(); } @@ -204,6 +206,16 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( delivered_by_supplier: function(){ cur_frm.cscript.update_status('Deliver', 'Delivered') + }, + + get_last_purchase_rate: function() { + frappe.call({ + "method": "get_last_purchase_rate", + "doc": cur_frm.doc, + callback: function(r, rt) { + cur_frm.cscript.calculate_taxes_and_totals(); + } + }) } }); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 2a6ab88a310..f68935f9dcd 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -8,6 +8,7 @@ from frappe.utils import cstr, flt from frappe import msgprint, _, throw from frappe.model.mapper import get_mapped_doc from erpnext.controllers.buying_controller import BuyingController +from erpnext.stock.doctype.item.item import get_last_purchase_details from erpnext.stock.stock_balance import update_bin_qty, get_ordered_qty from frappe.desk.notifications import clear_doctype_notifications @@ -83,6 +84,34 @@ class PurchaseOrder(BuyingController): if d.prevdoc_detail_docname and not d.schedule_date: d.schedule_date = frappe.db.get_value("Material Request Item", d.prevdoc_detail_docname, "schedule_date") + + + def get_last_purchase_rate(self): + """get last purchase rates for all items""" + + conversion_rate = flt(self.get('conversion_rate')) or 1.0 + + for d in self.get("items"): + if d.item_code: + last_purchase_details = get_last_purchase_details(d.item_code, self.name) + + if last_purchase_details: + d.base_price_list_rate = (last_purchase_details['base_price_list_rate'] * + (flt(d.conversion_factor) or 1.0)) + d.discount_percentage = last_purchase_details['discount_percentage'] + d.base_rate = last_purchase_details['base_rate'] * (flt(d.conversion_factor) or 1.0) + d.price_list_rate = d.base_price_list_rate / conversion_rate + d.rate = d.base_rate / conversion_rate + else: + # if no last purchase found, reset all values to 0 + for field in ("base_price_list_rate", "base_rate", + "price_list_rate", "rate", "discount_percentage"): + d.set(field, 0) + + item_last_purchase_rate = frappe.db.get_value("Item", d.item_code, "last_purchase_rate") + if item_last_purchase_rate: + d.base_price_list_rate = d.base_rate = d.price_list_rate \ + = d.rate = item_last_purchase_rate # Check for Stopped status def check_for_stopped_or_closed_status(self, pc_obj): diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json index 16e09b16a24..0d087968651 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -26,6 +26,7 @@ "options": "Item", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -49,6 +50,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -73,6 +75,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -95,6 +98,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -111,7 +115,7 @@ "hidden": 0, "ignore_user_permissions": 0, "in_filter": 1, - "in_list_view": 1, + "in_list_view": 0, "label": "Reqd By Date", "length": 0, "no_copy": 0, @@ -119,6 +123,7 @@ "oldfieldtype": "Date", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -142,6 +147,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -166,6 +172,7 @@ "oldfieldtype": "Small Text", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "300px", "read_only": 0, "report_hide": 0, @@ -189,6 +196,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -212,6 +220,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -236,6 +245,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -258,6 +268,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -282,6 +293,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "60px", "read_only": 0, "report_hide": 0, @@ -309,6 +321,7 @@ "options": "UOM", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -332,6 +345,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -357,6 +371,7 @@ "options": "UOM", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 0, "report_hide": 0, @@ -383,6 +398,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 0, "report_hide": 0, @@ -406,6 +422,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -429,6 +446,7 @@ "options": "currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -452,6 +470,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -473,6 +492,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -496,6 +516,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -517,6 +538,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -542,6 +564,7 @@ "options": "currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -567,6 +590,7 @@ "options": "currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -588,6 +612,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -613,6 +638,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -640,6 +666,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 1, @@ -663,6 +690,7 @@ "options": "Pricing Rule", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -685,6 +713,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -709,6 +738,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -733,6 +763,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -755,6 +786,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -779,6 +811,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -803,6 +836,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -825,6 +859,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -850,6 +885,7 @@ "options": "Warehouse", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -873,6 +909,7 @@ "options": "Project", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -898,6 +935,7 @@ "options": "DocType", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -923,6 +961,7 @@ "options": "prevdoc_doctype", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "120px", "read_only": 1, "report_hide": 0, @@ -949,6 +988,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -972,6 +1012,7 @@ "options": "Supplier Quotation", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -995,6 +1036,7 @@ "options": "Supplier Quotation Item", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1018,6 +1060,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1039,6 +1082,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1065,6 +1109,7 @@ "options": "Item Group", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1090,6 +1135,7 @@ "options": "Brand", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1114,6 +1160,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1138,6 +1185,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "print_width": "100px", "read_only": 1, "report_hide": 0, @@ -1164,6 +1212,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1188,6 +1237,7 @@ "permlevel": 0, "precision": "", "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1211,6 +1261,7 @@ "options": "currency", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -1236,6 +1287,7 @@ "oldfieldtype": "Small Text", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 1, "reqd": 0, @@ -1260,6 +1312,7 @@ "oldfieldtype": "Check", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -1277,7 +1330,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2015-11-19 02:53:19.301428", + "modified": "2016-01-06 02:21:10.407871", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 498154b69a9..9f78eab025e 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -473,30 +473,6 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Communications", - "length": 0, - "no_copy": 0, - "options": "Communication", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 } ], "hide_heading": 0, @@ -509,7 +485,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-12-08 12:52:56.827461", + "modified": "2016-01-06 02:35:18.285473", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", diff --git a/erpnext/change_log/v6/v6.16.3.md b/erpnext/change_log/v6/v6.16.3.md new file mode 100644 index 00000000000..7fe1ad55046 --- /dev/null +++ b/erpnext/change_log/v6/v6.16.3.md @@ -0,0 +1,6 @@ +- Track billed status of a Delivery Note (DN) or Purchase Receipt (PR) + - Added new status **To Bill** and **Completed** in Delivery Note and Purchase Receipt + - The system looks for Invoices directly created from Delivery Note / Purchase Receipt *(Workflow: Order -> DN/PR -> Invoice)* and allocates these amounts directly to the DN/PR + - Next, it looks for Invoices not created from Delivery Note / Purchase Receipt, but from an Order *(Workflow: Order -> Invoice, Order -> DN/PR)* and the DN/PR is selected based on FIFO for allocating the billed amount +- In Stock Entry, re-calculate Additional Costs and Amount on changing Quantity or Rate +- Chart of Accounts for Singapore diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 73e9d7f0ee8..32724a9f95a 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -52,13 +52,15 @@ status_map = { ], "Delivery Note": [ ["Draft", None], - ["Submitted", "eval:self.docstatus==1"], + ["To Bill", "eval:self.per_billed < 100 and self.docstatus == 1"], + ["Completed", "eval:self.per_billed == 100 and self.docstatus == 1"], ["Cancelled", "eval:self.docstatus==2"], ["Closed", "eval:self.status=='Closed'"], ], "Purchase Receipt": [ ["Draft", None], - ["Submitted", "eval:self.docstatus==1"], + ["To Bill", "eval:self.per_billed < 100 and self.docstatus == 1"], + ["Completed", "eval:self.per_billed == 100 and self.docstatus == 1"], ["Cancelled", "eval:self.docstatus==2"], ["Closed", "eval:self.status=='Closed'"], ] @@ -79,7 +81,7 @@ class StatusUpdater(Document): def set_status(self, update=False, status=None, update_modified=True): if self.is_new(): return - + if self.doctype in status_map: _status = self.status @@ -102,9 +104,9 @@ class StatusUpdater(Document): if self.status != _status and self.status not in ("Submitted", "Cancelled"): self.add_comment("Label", _(self.status)) - + if update: - frappe.db.set_value(self.doctype, self.name, "status", self.status, + frappe.db.set_value(self.doctype, self.name, "status", self.status, update_modified=update_modified) def validate_qty(self): @@ -153,7 +155,6 @@ class StatusUpdater(Document): # check if overflow is within tolerance tolerance, self.tolerance, self.global_tolerance = get_tolerance_for(item['item_code'], self.tolerance, self.global_tolerance) - overflow_percent = ((item[args['target_field']] - item[args['target_ref_field']]) / item[args['target_ref_field']]) * 100 @@ -166,10 +167,10 @@ class StatusUpdater(Document): throw(_("{0} must be reduced by {1} or you should increase overflow tolerance") .format(_(item["target_ref_field"].title()), item["reduce_by"])) - def update_qty(self, change_modified=True): + def update_qty(self, update_modified=True): """Updates qty or amount at row level - :param change_modified: If true, updates `modified` and `modified_by` for target parent doc + :param update_modified: If true, updates `modified` and `modified_by` for target parent doc """ for args in self.status_updater: # condition to include current record (if submit or no if cancel) @@ -178,22 +179,19 @@ class StatusUpdater(Document): else: args['cond'] = ' and parent!="%s"' % self.name.replace('"', '\"') - args['set_modified'] = '' - if change_modified: - args['set_modified'] = ', modified = now(), modified_by = "{0}"'\ - .format(frappe.db.escape(frappe.session.user)) - - self._update_children(args) + self._update_children(args, update_modified) if "percent_join_field" in args: - self._update_percent_field(args) + self._update_percent_field_in_targets(args, update_modified) - def _update_children(self, args): + def _update_children(self, args, update_modified): """Update quantities or amount in child table""" for d in self.get_all_children(): if d.doctype != args['source_dt']: continue + self._update_modified(args, update_modified) + # updates qty in the child table args['detail_id'] = d.get(args['join_field']) @@ -212,44 +210,58 @@ class StatusUpdater(Document): if not args.get("extra_cond"): args["extra_cond"] = "" frappe.db.sql("""update `tab%(target_dt)s` - set %(target_field)s = (select ifnull(sum(%(source_field)s), 0) - from `tab%(source_dt)s` where `%(join_field)s`="%(detail_id)s" - and (docstatus=1 %(cond)s) %(extra_cond)s) %(second_source_condition)s + set %(target_field)s = ( + (select ifnull(sum(%(source_field)s), 0) + from `tab%(source_dt)s` where `%(join_field)s`="%(detail_id)s" + and (docstatus=1 %(cond)s) %(extra_cond)s) + %(second_source_condition)s + ) + %(update_modified)s where name='%(detail_id)s'""" % args) - def _update_percent_field(self, args): + def _update_percent_field_in_targets(self, args, update_modified=True): """Update percent field in parent transaction""" - unique_transactions = set([d.get(args['percent_join_field']) for d in self.get_all_children(args['source_dt'])]) + distinct_transactions = set([d.get(args['percent_join_field']) + for d in self.get_all_children(args['source_dt'])]) - for name in unique_transactions: - if not name: - continue + for name in distinct_transactions: + if name: + args['name'] = name + self._update_percent_field(args, update_modified) - args['name'] = name + def _update_percent_field(self, args, update_modified=True): + """Update percent field in parent transaction""" - # update percent complete in the parent table - if args.get('target_parent_field'): - frappe.db.sql("""update `tab%(target_parent_dt)s` - set %(target_parent_field)s = round( - ifnull((select - ifnull(sum(if(%(target_ref_field)s > %(target_field)s, %(target_field)s, %(target_ref_field)s)), 0) - / sum(%(target_ref_field)s) * 100 - from `tab%(target_dt)s` where parent="%(name)s"), 0), 2) - %(set_modified)s - where name='%(name)s'""" % args) + self._update_modified(args, update_modified) - # update field - if args.get('status_field'): - frappe.db.sql("""update `tab%(target_parent_dt)s` - set %(status_field)s = if(%(target_parent_field)s<0.001, - 'Not %(keyword)s', if(%(target_parent_field)s>=99.99, - 'Fully %(keyword)s', 'Partly %(keyword)s')) - where name='%(name)s'""" % args) + if args.get('target_parent_field'): + frappe.db.sql("""update `tab%(target_parent_dt)s` + set %(target_parent_field)s = round( + ifnull((select + ifnull(sum(if(%(target_ref_field)s > %(target_field)s, %(target_field)s, %(target_ref_field)s)), 0) + / sum(%(target_ref_field)s) * 100 + from `tab%(target_dt)s` where parent="%(name)s"), 0), 2) + %(update_modified)s + where name='%(name)s'""" % args) - if args.get("set_modified"): - target = frappe.get_doc(args["target_parent_dt"], name) - target.set_status(update=True) - target.notify_update() + # update field + if args.get('status_field'): + frappe.db.sql("""update `tab%(target_parent_dt)s` + set %(status_field)s = if(%(target_parent_field)s<0.001, + 'Not %(keyword)s', if(%(target_parent_field)s>=99.99, + 'Fully %(keyword)s', 'Partly %(keyword)s')) + where name='%(name)s'""" % args) + + if update_modified: + target = frappe.get_doc(args["target_parent_dt"], args["name"]) + target.set_status(update=True) + target.notify_update() + + def _update_modified(self, args, update_modified): + args['update_modified'] = '' + if update_modified: + args['update_modified'] = ', modified = now(), modified_by = "{0}"'\ + .format(frappe.db.escape(frappe.session.user)) def update_billing_status_for_zero_amount_refdoc(self, ref_dt): ref_fieldname = ref_dt.lower().replace(" ", "_") diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 6e860c547d3..842faec0494 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -312,6 +312,16 @@ class StockController(AccountsController): for w in warehouses: validate_warehouse_company(w, self.company) + + def update_billing_percentage(self, update_modified=True): + self._update_percent_field({ + "target_dt": self.doctype + " Item", + "target_parent_dt": self.doctype, + "target_parent_field": "per_billed", + "target_ref_field": "amount", + "target_field": "billed_amt", + "name": self.name, + }, update_modified) def update_gl_entries_after(posting_date, posting_time, for_warehouses=None, for_items=None, warehouse_account=None): diff --git a/erpnext/docs/assets/img/accounts/recurring.gif b/erpnext/docs/assets/img/accounts/recurring.gif new file mode 100644 index 00000000000..39e23767c91 Binary files /dev/null and b/erpnext/docs/assets/img/accounts/recurring.gif differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.26.23 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.26.23 pm.png deleted file mode 100644 index d4efcf4006d..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.26.23 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.27.31 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.27.31 pm.png deleted file mode 100644 index 8b4f0897e2c..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.27.31 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.28.05 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.28.05 pm.png deleted file mode 100644 index dc52a732b64..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.28.05 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.30.27 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.30.27 pm.png deleted file mode 100644 index dab27501da6..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.30.27 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.31.01 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.31.01 pm.png deleted file mode 100644 index 3e14711e061..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.31.01 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.33.24 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.33.24 pm.png deleted file mode 100644 index 0dd14f6eb01..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.33.24 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.36.29 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.36.29 pm.png deleted file mode 100644 index b848b23b7c8..00000000000 Binary files a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-09 at 1.36.29 pm.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_001f1e2ff.png b/erpnext/docs/assets/img/articles/Selection_001f1e2ff.png deleted file mode 100644 index 43f9cebc456..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_001f1e2ff.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_0027e4d09.png b/erpnext/docs/assets/img/articles/Selection_0027e4d09.png deleted file mode 100644 index 488906dc6dc..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_0027e4d09.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_003bf981b.png b/erpnext/docs/assets/img/articles/Selection_003bf981b.png deleted file mode 100644 index 1595e1f33c1..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_003bf981b.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_005d73bc7.png b/erpnext/docs/assets/img/articles/Selection_005d73bc7.png deleted file mode 100644 index 13b68611e1a..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_005d73bc7.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_576.png b/erpnext/docs/assets/img/articles/Selection_576.png deleted file mode 100644 index 5bc4f70ff2a..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_576.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_577.png b/erpnext/docs/assets/img/articles/Selection_577.png deleted file mode 100644 index abf08a14491..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_577.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/Selection_578.png b/erpnext/docs/assets/img/articles/Selection_578.png deleted file mode 100644 index db33446a7a6..00000000000 Binary files a/erpnext/docs/assets/img/articles/Selection_578.png and /dev/null differ diff --git a/erpnext/docs/assets/img/articles/exchange-rate-difference-1.png b/erpnext/docs/assets/img/articles/exchange-rate-difference-1.png new file mode 100644 index 00000000000..e1425783f84 Binary files /dev/null and b/erpnext/docs/assets/img/articles/exchange-rate-difference-1.png differ diff --git a/erpnext/docs/assets/img/articles/exchange-rate-difference-2.gif b/erpnext/docs/assets/img/articles/exchange-rate-difference-2.gif new file mode 100644 index 00000000000..0e4a0094f2c Binary files /dev/null and b/erpnext/docs/assets/img/articles/exchange-rate-difference-2.gif differ diff --git a/erpnext/docs/assets/img/articles/frozen-date-1.png b/erpnext/docs/assets/img/articles/frozen-date-1.png new file mode 100644 index 00000000000..1700a08a16e Binary files /dev/null and b/erpnext/docs/assets/img/articles/frozen-date-1.png differ diff --git a/erpnext/docs/assets/img/articles/frozen-date-2.png b/erpnext/docs/assets/img/articles/frozen-date-2.png new file mode 100644 index 00000000000..4068502158d Binary files /dev/null and b/erpnext/docs/assets/img/articles/frozen-date-2.png differ diff --git a/erpnext/docs/assets/img/articles/frozen-date-3.png b/erpnext/docs/assets/img/articles/frozen-date-3.png new file mode 100644 index 00000000000..586261bb133 Binary files /dev/null and b/erpnext/docs/assets/img/articles/frozen-date-3.png differ diff --git a/erpnext/docs/assets/img/articles/multiple-currency-1.gif b/erpnext/docs/assets/img/articles/multiple-currency-1.gif new file mode 100644 index 00000000000..e853dc06a3f Binary files /dev/null and b/erpnext/docs/assets/img/articles/multiple-currency-1.gif differ diff --git a/erpnext/docs/assets/img/articles/multiple-currency-2.png b/erpnext/docs/assets/img/articles/multiple-currency-2.png new file mode 100644 index 00000000000..655c146c5dd Binary files /dev/null and b/erpnext/docs/assets/img/articles/multiple-currency-2.png differ diff --git a/erpnext/docs/assets/img/articles/pos-view.gif b/erpnext/docs/assets/img/articles/pos-view.gif new file mode 100644 index 00000000000..af25f164d39 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pos-view.gif differ diff --git a/erpnext/docs/assets/img/articles/post-dated-1.gif b/erpnext/docs/assets/img/articles/post-dated-1.gif new file mode 100644 index 00000000000..3bb03b59840 Binary files /dev/null and b/erpnext/docs/assets/img/articles/post-dated-1.gif differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-application.png b/erpnext/docs/assets/img/articles/pricing-rule-application.png new file mode 100644 index 00000000000..7a1fbb58e9b Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-application.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-disable.png b/erpnext/docs/assets/img/articles/pricing-rule-disable.png new file mode 100644 index 00000000000..06edc784735 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-disable.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-discount.png b/erpnext/docs/assets/img/articles/pricing-rule-discount.png new file mode 100644 index 00000000000..89123609a31 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-discount.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-for.png b/erpnext/docs/assets/img/articles/pricing-rule-for.png new file mode 100644 index 00000000000..a75e790825c Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-for.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-on.png b/erpnext/docs/assets/img/articles/pricing-rule-on.png new file mode 100644 index 00000000000..4997ce262c8 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-on.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-price.png b/erpnext/docs/assets/img/articles/pricing-rule-price.png new file mode 100644 index 00000000000..afa6ab219fc Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-price.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-priority.png b/erpnext/docs/assets/img/articles/pricing-rule-priority.png new file mode 100644 index 00000000000..f40b5449d82 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-priority.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-qty.png b/erpnext/docs/assets/img/articles/pricing-rule-qty.png new file mode 100644 index 00000000000..e99d7d60fa7 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-qty.png differ diff --git a/erpnext/docs/assets/img/articles/pricing-rule-validity.png b/erpnext/docs/assets/img/articles/pricing-rule-validity.png new file mode 100644 index 00000000000..bf40c672610 Binary files /dev/null and b/erpnext/docs/assets/img/articles/pricing-rule-validity.png differ diff --git a/erpnext/docs/assets/img/articles/purchase-other-charges-1.png b/erpnext/docs/assets/img/articles/purchase-other-charges-1.png new file mode 100644 index 00000000000..f22660d0c02 Binary files /dev/null and b/erpnext/docs/assets/img/articles/purchase-other-charges-1.png differ diff --git a/erpnext/docs/assets/img/articles/update-stock.png b/erpnext/docs/assets/img/articles/update-stock.png new file mode 100644 index 00000000000..9b21d6da978 Binary files /dev/null and b/erpnext/docs/assets/img/articles/update-stock.png differ diff --git a/erpnext/docs/current/index.html b/erpnext/docs/current/index.html index fd23de4d886..5762d0a52e2 100644 --- a/erpnext/docs/current/index.html +++ b/erpnext/docs/current/index.html @@ -35,7 +35,7 @@ Version - 6.16.1 + 6.16.2 @@ -52,4 +52,4 @@ - \ No newline at end of file + diff --git a/erpnext/docs/current/models/buying/supplier.html b/erpnext/docs/current/models/buying/supplier.html index 6c7564a8675..a4e2cd47de2 100644 --- a/erpnext/docs/current/models/buying/supplier.html +++ b/erpnext/docs/current/models/buying/supplier.html @@ -310,27 +310,6 @@ Supplier of Goods or Services. - - 20 - communications - - Table - - Communications - - - - - - - -Communication - - - - - - diff --git a/erpnext/docs/current/models/hr/job_applicant.html b/erpnext/docs/current/models/hr/job_applicant.html index 00578ded9ad..603689ecdfa 100644 --- a/erpnext/docs/current/models/hr/job_applicant.html +++ b/erpnext/docs/current/models/hr/job_applicant.html @@ -138,27 +138,6 @@ Hold - - 8 - communications - - Table - - Communications - - - - - - - -Communication - - - - - - diff --git a/erpnext/docs/current/models/selling/customer.html b/erpnext/docs/current/models/selling/customer.html index 00ee8b352c5..d1717968cc9 100644 --- a/erpnext/docs/current/models/selling/customer.html +++ b/erpnext/docs/current/models/selling/customer.html @@ -499,27 +499,6 @@ Last Day of the Next Month - - - - - 32 - communications - - Table - - Communications - - - - - - - -Communication - - - diff --git a/erpnext/docs/current/models/setup/sales_person.html b/erpnext/docs/current/models/setup/sales_person.html index 323e625afbc..b7de6b6b501 100644 --- a/erpnext/docs/current/models/setup/sales_person.html +++ b/erpnext/docs/current/models/setup/sales_person.html @@ -226,27 +226,6 @@ No - - - - - 13 - communications - - Table - - Communications - - - - - - - -Communication - - - diff --git a/erpnext/docs/user/manual/en/accounts/articles/depreciation-for-fixed-asset-items.md b/erpnext/docs/user/manual/en/accounts/articles/depreciation-for-fixed-asset-items.md index 5eae30dbabe..f7d1c5bef5e 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/depreciation-for-fixed-asset-items.md +++ b/erpnext/docs/user/manual/en/accounts/articles/depreciation-for-fixed-asset-items.md @@ -36,6 +36,6 @@ On submission of Stock Reconciliation, depreciation will booked for items asset Project Default Cost Center -Click [here]({{docs_base_url}}/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item) for steps to be followed when making Stock Reconciliation entry. +Click [here]({{docs_base_url}}/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.html) for steps to be followed when making Stock Reconciliation entry. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-creation.md b/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-creation.md new file mode 100644 index 00000000000..69110639fc5 --- /dev/null +++ b/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-creation.md @@ -0,0 +1,5 @@ +# Fiscal Year Creation + +New Fiscal Year should be created each year, at the end of the current fiscal year. Creation of new Fiscal Year before its begining has been automated in ERPNext. + +Three days prior to the end of the current Fiscal Year, system checks if new Fiscal Year for the incoming year is already created. If not, then system auto-creates new Fiscal Year. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-error.md b/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-error.md index 8da261e35ca..003ad31437a 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-error.md +++ b/erpnext/docs/user/manual/en/accounts/articles/fiscal-year-error.md @@ -12,7 +12,7 @@ Only User with System Manager's Role Assigned has permission to create new Fisca `Accounts > Setup > Fiscal Year` -Click [here]({{docs_base_url}}/user/manual/en/accounts/setup/fiscal-year) to learn more about Fiscal Year. +Click [here]({{docs_base_url}}/user/manual/en/accounts/setup/fiscal-year.html) to learn more about Fiscal Year. #### Set Fiscal Year as Default @@ -29,4 +29,5 @@ Default Fiscal Year will be updated in the Global Default setting as well. You c Save Global Default, and Reload your ERPNext account. Then, default Fiscal Year will be auto-updated in your transactions. Note: In transactions, you can manually select required Fiscal Year, from More Info section. + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/freeze-accounting-entries.md b/erpnext/docs/user/manual/en/accounts/articles/freeze-accounting-entries.md new file mode 100644 index 00000000000..cc2a8657ec0 --- /dev/null +++ b/erpnext/docs/user/manual/en/accounts/articles/freeze-accounting-entries.md @@ -0,0 +1,21 @@ +#Freeze Accounting Entries + +To freeze accounting entries upto a certain date, follow below given steps. + +#### Step 1: Go to: + +`Accounts > Setup > Accounts Settings` + +#### Step 2: Set Date + +Set date in the **Accounts Frozen Upto** field. + +Accounts Frozen Date + +Now, the system will not allow to make any accounting entries before set date. If at all someone tries creating entries, system will show error message as below. + +Frozen Date Error + +You can still allow user with certain role to create/edit entries beyound accounts frozen date. You can set that Role in the Account Settings itself. + +Frozen Date Error \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/how-to-freeze-accounting-entries-upto-a-specific-date.md b/erpnext/docs/user/manual/en/accounts/articles/how-to-freeze-accounting-entries-upto-a-specific-date.md deleted file mode 100644 index 1bc623121d0..00000000000 --- a/erpnext/docs/user/manual/en/accounts/articles/how-to-freeze-accounting-entries-upto-a-specific-date.md +++ /dev/null @@ -1,18 +0,0 @@ -#How to freeze accounting entries upto a specific date? - -To freeze accounting entries upto a certain date, follow these steps: - -#### Step 1: Go to - -`Accounts > Setup > Accounts Settings - - -#### Step 2: Set the date in: - -Accounts Frozen Upto field. - - - -Now, the system will not allow to make accounting entries before that date. - -But you can allow a specific Role, to make/edit accounting entries before that date. To do that set the desired **Role**, in Role Allowed to Set Frozen Accounts & Edit Frozen Entries field. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/index.txt b/erpnext/docs/user/manual/en/accounts/articles/index.txt index 05819278b6f..76ace0b7076 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/index.txt +++ b/erpnext/docs/user/manual/en/accounts/articles/index.txt @@ -4,16 +4,12 @@ changing-parent-account depreciation-for-fixed-asset-items difference-entry-button fiscal-year-error -how-to-freeze-accounting-entries-upto-a-specific-date -how-to-freeze-accounting-ledger +freeze-accounting-entries +how-to-freeze-accouting-ledger manage-foreign-exchange-difference managing-transactions-in-multiple-currency -new-fiscal-year-auto-create-feature -pos-view +fiscal-year-creation post-dated-cheque-entry -pricing-rule -recurring-order-and-invoices update-stock-option-in-sales-invoice -updating-opening-balance-in-accounts-using-temporary-account what-is-the-differences-of-total-and-valuation-in-tax-and-charges -withdrawing-salary-from-owners-equity-account +withdrawing-salary-from-owners-equity-account \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/manage-foreign-exchange-difference.md b/erpnext/docs/user/manual/en/accounts/articles/manage-foreign-exchange-difference.md index 054c9790a3e..a9a9fefb1f3 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/manage-foreign-exchange-difference.md +++ b/erpnext/docs/user/manual/en/accounts/articles/manage-foreign-exchange-difference.md @@ -1,25 +1,23 @@ # Manage Foreign Exchange Difference -When you book Sales Invoices and Purchase invoices in multiple currencies, you will have to deal with currency difference while booking payment entry. You can easily manage this in ERPNext in following ways. +In ERPNext, you can create transactions in the foriegn currency as well. When creating transaction in the foreign currency, system updates current exchanage rate with respect to customer/supplier's currency and base currency on your Company. Since Exchange Rate is always flucuating, on might receive payment from the client on exchange rate different from one mentioned in the Sales/Purchase Invoice. Following is the intruction on how to manage different amount avail in payment entry due to exchange rate change. -####Add Expense Account +#### Add Expense Account -To mange currency difference, create Account **Foreign Exchange Gain/Loss**. +To mange currency difference, create Account **Foreign Exchange Gain/Loss**. This account is generally created on the Expense side of P&L statement. However, you can place it under another group as per your accounting requirement. -![Account]({{docs_base_url}}/assets/img/articles/Selection_577.png) +Accounts Frozen Date -####Book Payment Entry +#### Book Payment Entry -In the payment voucher, update invoice amount against Customer or Supplier account, then update actual payment amount against Bank/ Cash account. Add new row and select Foreign Exchange Gain/Loss to update currency difference amount. +In the payment voucher, update invoice amount against Customer or Supplier account, then update actual payment amount against Bank/Cash account. Add new row and select Foreign Exchange Gain/Loss to update currency difference amount. -####Scenario +In the below scenario, Sales Invoice was made EUR, at the exchange rate of 1.090. As per this rate, Sales Invoice amount in USD (base currency) was $1000. -Below is the Sales Invoice for a customer in Europe. The base currency of a Company in USD. Sales Invoice is made at the exchange rate (USD to Eur) of 1.128. +One receipt of payment, exchange rate changed. As per the new exchange rate, payment received in the base currency was $1080. This means gain of $80 due to change in exchange rate. Following is how Foreign Exchange Gain will be booked in this scenerio. -![Sales Invoice]({{docs_base_url}}/assets/img/articles/Selection_576.png) +Accounts Frozen Date -When receiving payment from the customer, exchange rate changed to 1.20. As per the update in the exchange rate, payment was for $120. Following is how payment entry will be booked to adjust the difference amount. - -![Journal Entry image]({{docs_base_url}}/assets/img/articles/Selection_578.png) +In case you incur loss due to change foriegn exchnage rate, then different amount about be updated in the debit of Foreign Exchange Gain/Loss account. Also you can add another row to update another expenses like bank charges, remittance charges etc. diff --git a/erpnext/docs/user/manual/en/accounts/articles/managing-transactions-in-multiple-currency.md b/erpnext/docs/user/manual/en/accounts/articles/managing-transactions-in-multiple-currency.md index 159402cf91e..fe69ab5ab1e 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/managing-transactions-in-multiple-currency.md +++ b/erpnext/docs/user/manual/en/accounts/articles/managing-transactions-in-multiple-currency.md @@ -1,39 +1,38 @@ #Managing Transactions In Multiple Currency -You can make transaction in your base currency as well as in customer or supplier currencies. When you make transaction in your customer or supplier currency, the same currency reflects only in print format of that transaction. And system pass back end -entry in your base currency. -
-
To understand this scenario will take example of Sales Invoice, where your base currency is INR and your customer currency is USD. -
-
Following are steps to create Sales Invoice in customer currency. -
  -
Step 1: Go to Selling >> Documents >> Sales Invoice >> (+) New. -
-
Step 2: Select Customer and Enter other details. -
-
- -
Step 3: Select customer currency and related Price List. -
-
- -
-
-
On selecting customer currency 'Exchange Rate' field will open under Currency field, where you will enter exchange rate of customer currency to basic currency. In our case for USD to INR. You can check exchange rate online -for your customer currency to your currency. -
-
Also you can set default customer currency in customer master. Which will auto fetch in transactions. -
-
-  -
System has Currency Exchange master, where you can set currency exchange masters for your multiple currencies. To Set this go to Accounts > Setup > Currency Exchange.

Step 4: Select Item details.
-
On selecting Item details Sales invoice Total section will look like below image. -
-
- -
-
-
-Step 5: Save and Submit

Enter other details like Taxes and charges, Terms and Condition if there and save and submit the invoice form. After submit click on Printer Icon to check print preview. The same document print or email document will you send to your customer or supplier.
For our case it will look as below image.

  
-
-
\ No newline at end of file +In ERPNext, transactions can be created in the base currency as well as in parties (customer or supplier) currency. In transaction is created in the parties currency, their currency symbol is updated in the print foramt as well. + +Let's consider a Sales Invoice, where your base currency is of a Company is USD and party currency is EUR. + +#### Step 1: New Sales Invoice + +`Accounts > Documents > Sales Invoice > New` + +#### Step 2: Select Party + +Select Customer from the Customer master. If default Currency is updated in the Customer master, same will be fetched in the Sales Invoice as well, as Customer Currency. + +#### Step 3: Exchange Rate + +Currenct Exchange between between base currency and customer currency will auto-fetch. + +Accounts Frozen Date + +#### Step 4: Update Details + +Update other details like Item, Taxes, Terms. In the Taxes and other Charges table, charges of type Actual should be updated in the Customer's currency. + +#### Step 4: Save and Submit + +Save Sales Invoice and then check Print Format. For all the Currency field (rate, amount, totals) Customer's Currency symbol will be updated as well. + +Accounts Frozen Date + +#### Currency Exchange Masters + +If you have come to terms with party to follow standard exchange rate throughout, you can capture it by creating Currency Exchange Rate master. To create new Currency Exchange Rate master, go to: + +`Accounts > Setup > Currency Exchange` + + If system find Exchange Rate master for any cuurrecy, it is given preference over currency exchnage rate. + diff --git a/erpnext/docs/user/manual/en/accounts/articles/new-fiscal-year-auto-create-feature.md b/erpnext/docs/user/manual/en/accounts/articles/new-fiscal-year-auto-create-feature.md deleted file mode 100644 index ace7c40b3d1..00000000000 --- a/erpnext/docs/user/manual/en/accounts/articles/new-fiscal-year-auto-create-feature.md +++ /dev/null @@ -1,7 +0,0 @@ -#New Fiscal Year Auto-Create feature - -New Fiscal Year needs to be created each year at the end of the previous fiscal year. This Process however has been automated in ERPNext. - -Three days prior to the end of the existing fiscal year; the system shall check if the user has created a new fiscal year for the incoming year. If not the system generates a new fiscal year. All fiscal year Companies are also linked with the new fiscal year as in the previous year. - - - -Using POS View, you can make complete Sales Invoice, without switching to standard form view. - -**Question:** Why do I get error message for missing fields when making Purchase Receipt or other sales/purchase transactions from POS View? - -Though POS View is mainly designed for Sales Invoice, but it is also made available in all the sales and purchase transactions. In other transactions, POS View is only meant for quick selection of items. This view will not provide all the fields which are available in the standard form view. Hence, you shall use POS View in other transactions just for Item selection, and revert to form view for enter values in other mandatory fields. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/post-dated-cheque-entry.md b/erpnext/docs/user/manual/en/accounts/articles/post-dated-cheque-entry.md index 305fc5984a2..66da24e8e0a 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/post-dated-cheque-entry.md +++ b/erpnext/docs/user/manual/en/accounts/articles/post-dated-cheque-entry.md @@ -1,32 +1,32 @@ #Post Dated Cheque Entry -Post Dated Cheque is a cheque dated on future date given to another party. This actually works as an advance payment which will could be cleared post cheque date only. +Post Dated Cheque is a cheque dated on future date. Party generally give post dated cheque, as advance payment. This cheque would be cleared only after cheque date has arrived. -In ERPNext, you can manage post dated cheque entries via journal voucher. Following are step to book payment entry for post dated cheque. +In ERPNext, create Journal Entries for post dated cheque. -####New Journal Voucher +####New Journal Entry To open new journal voucher go to -`Accounts > Documents > Journal Voucher > New` +`Accounts > Documents > Journal Entry > New` -####Set Posting Date and other details +#### Set Posting Date -Assuming your Cheque Date is 31st December, 2014 (or any future date) and you need value of this cheque to reflect in the bank balance after cheque date only. +Assuming your Cheque Date is 31st December, 2016 (or any future date). As a result, this posting in your bank ledger will appear on Posting Date updated. -![Journal Voucher]({{docs_base_url}}/assets/img/articles/Selection_005d73bc7.png) +JE Posting Date Note: Journal Voucher Reference Date should equal to or less than Posting Date. -####Step 3: Save and Submit Journal Voucher +####Step 3: Save and Submit -After entering required details Save and Submit the Journal Voucher. +After entering required details, Save and Submit the Journal Entry. ####Adjusting Post Dated Cheque Entry -If Post Dated Journal Voucher needs to be adjusted against any invoice, it can be accomplished via [Payment Reconciliation Tool](https://erpnext.com/user-guide/accounts/payment-reconciliation). +If Post Dated Journal Entry needs to be adjusted against any invoice, it can be accomplished via [Payment Reconciliation Tool]({{docs_base_url}}/user/manual/en/accounts/tools/payment-reconciliation.html). -When cheque is cleared in the future date, i.e. actual date on the cheque, you can update its Clearance Date via [Bank Reconciliation Tool](https://erpnext.com/user-guide/accounts/bank-reconciliation). +When cheque is cleared, i.e. on actual date on the cheque, you can update its Clearance Date via [Bank Reconciliation Tool]({{docs_base_url}}/user/manual/en/accounts/tools/bank-reconciliation.html). -You might find value of this Journal Voucher already reflecting against bank's ledger. You should check **Bank Reconciliation Statement**, a report in the account module to know difference of balance as per system, and balance expected in the bank. +You might find value of this Journal Entry already reflecting against bank's ledger. You should check **Bank Reconciliation Statement**, a report in the account module to know difference of bank balance as per system, and actual balance in a account. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/pricing-rule.md b/erpnext/docs/user/manual/en/accounts/articles/pricing-rule.md deleted file mode 100644 index dbd00e46903..00000000000 --- a/erpnext/docs/user/manual/en/accounts/articles/pricing-rule.md +++ /dev/null @@ -1,75 +0,0 @@ -#Pricing Rule - -Pricing Rule allows you to define rules based on which item's price or discount to be applied is determined. - -### Scenario: - -Following are the few cases which can be addressed using Pricing Rule. - -1. As per the promotional sale policy, if customer purchases more than 10 units of an item, he enjoys 20% discount. - -2. For Customer "XYZ", selling price for the specific or group of "Products" should be updated as ###. - -3. Items categorized under specific Item Group has same selling or buying price. - -4. Customers catering to specific Customer Group has same selling price. - -5. Supplier's categorized under common Supplier Type should have same buying rate applied. - -To have %Discount and Price List Rate for an Item auto-applied, you should set Pricing Rules for it. - -Pricing Rule master has two sections: - -### 1. Applicability Section: - -In this section, conditions are set for the Pricing Rule. When transaction meets condition as specified in the Pricing Rule, Price or Discount as specified in the Item master will be applicable. You can set condition on following values. - -####1.1 Applicable On: - -![Applicable On]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.26.23 pm.png) - -If you want Pricing Rule to be applied on all the items, you should apply rule based on Item Group, and select most Parent Item Group for a value. - -####1.2 Applicable For: - -Applicability option will updated based on our selection for Selling or Buying or both. You can set applicability on one of the following master. - -![Applicable for]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.27.31 pm.png) - -####1.3 Quantity: - -Specify minimum and maximum qty of an item when this Pricing Rule should be applicable. - -![Pricing Rule Qty limit]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.28.05 pm.png) - -###2. Application: - -Using Price List Rule, you can ultimately define price or %discount to be applied on an item. - -![Pricing Rule Apply on]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.33.24 pm.png) - -####2.1 Price - -Price or Discount specified in the Pricing Rule will be applied only if above applicability rules are matched with values in the transaction. Price mentioned in Pricing Rule will be given priority over item's Price List rate. - -![Pricing Rule Price]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.30.27 pm.png) - -####2.2 Discount Percentage - -Discount Percentage can be applied for a specific Price List. To have it applied for all the Price List, %Discount field should be left blank. - -![Rule Discount Percent]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.31.01 pm.png) - -#### Validity - -Enter From and To date between which this Pricing Rule will be applicable. This will be useful if creating Pricing Rule for sales promotion exercise available for certain days. - -![Pricing Rule Validity]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.36.29 pm.png) - -####Disable - -Check Disable to inactive specific Pricing Rule. - -![Pricing Rule Disabled]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-09 at 1.37.38 pm.png) - - \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md b/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md index 1129585cc50..356ad432ed0 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md +++ b/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md @@ -25,7 +25,7 @@ To create new Cost Center, go to: `Accounts > Setup > Cost Center` -[Click here to learn how to manage Cost Centers.]({{docs_base_url}}/user/manual/en/accounts/setup/cost-center) +[Click here to learn how to manage Cost Centers.]({{docs_base_url}}/user/manual/en/accounts/setup/cost-center.html) #### 1.3 Update Cost Center in the Project @@ -75,6 +75,6 @@ To check Budget Variance report, go to: `Accounts > Standard Reports > Budget Variance Report` -[Click here to learn how to do budgeting from Cost Center]({{docs_base_url}}/user/manual/en/accounts/budgeting). +[Click here to learn how to do budgeting from Cost Center]({{docs_base_url}}/user/manual/en/accounts/budgeting.html). \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/update-stock-option-in-sales-invoice.md b/erpnext/docs/user/manual/en/accounts/articles/update-stock-option-in-sales-invoice.md index 5cc610482d9..3f3a4709168 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/update-stock-option-in-sales-invoice.md +++ b/erpnext/docs/user/manual/en/accounts/articles/update-stock-option-in-sales-invoice.md @@ -1,9 +1,9 @@ -#Update Stock Option in Sales Invoice +#Delivery from Sales Invoice -The Update Stock check box is available in the Items section within Sales Invoice form. +If you have items delivery and invoicing happening at the same time, you can create delivery from with Sales Invocice itself. Sales Invoice has field called **Update Stock**, just before Item table. If this field is checked, on submission of Sales Invoice, stock of Item will be deducted from selected Warehouse. - +Update Stock -Usually the Sales Invoice is a voucher specifying the amount to be paid against Quantity delivered/to be delivered as per a particular Sales Order. +On checking Update Stock, Sales Invoice Item will show relevant fields like Warehouse, Serial No., Batch No., Item valuation etc. -Checking the update Stock option before submitting an Invoice will directly deduct the Stock from the Inventory on submission of the Sales Invoice. In such a case the Sales Invoice also satisfies the function of a Delivery Note. \ No newline at end of file +On submission of Sales Invoice, with general ledger posting, stock ledger posting will happen as well. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/updating-opening-balance-in-accounts-using-temporary-account.md b/erpnext/docs/user/manual/en/accounts/articles/updating-opening-balance-in-accounts-using-temporary-account.md deleted file mode 100644 index d78715cba5e..00000000000 --- a/erpnext/docs/user/manual/en/accounts/articles/updating-opening-balance-in-accounts-using-temporary-account.md +++ /dev/null @@ -1,44 +0,0 @@ -# Updating Opening Balance in Accounts using Temporary Account - -For updating opening balances in the Accounts, you will need to use temporary adjustment accounts. In the Chart of Account, two adjustment accounts will be created by default. - -1. Temporary Account (Assets) -2. Temporary Account (Liabilities) - -Since ERPNext is a double entry accounting system, it requires balancing on debit side with credit side in an accounting entry. When start working on fresh ERPNext account, you will have to update opening balance in your Balance Sheet accounts. You can update opening balance in account(s), and use Temporary Account for balancing purpose. - -Let's consider a scenario of updating opening balance in an Account using temporary account. - -#### Identifying Accounts to Update Opening Balance - -Say we have following customer's ledger, and have receivable from them. This receivable should be updated as opening balance in their account. - -1. Comtek Solutions -1. Walky Tele Solution - -Also we can update opening balance on Bank and Cash account. - -1. Bank of Baroda -1. Cash - -All these accounts are located on the Current Asset side, hence will have Debit balance. - -#### Identifying Temporary Account - -To update debit balance in them, we will have to select Credit account for balancing it. Out of the temporary accounts available, we can use `Temporary Account (Liabilities)`. - -##### Opening Balance Entry - -For Current Asset account, their current balance will be updated on the Debit side. The total value of Debit will be entered as Credit Balance for the Temporary Account (Liability). - -![Debit Opening Balance]({{docs_base_url}}/assets/img/articles/$SGrab_431.png) - -Same way, you will update opening balance for the liability account. Since Liability accounts will have credit balance, you will have to select Temporary Account (Asset), which is a Debit account for balancing purpose. - -After you have updated opening balance in all the Asset and Liability account, you will find that balance in the temporary account will be equal. If balance in temporary accounts is not equal, it must be because opening balance is not updated in some account, or other account was used for balancing purpose. - -Since temporary account were used only for balancing purpose, it shall not have any balance in it. To nullify balance in these accounts, you should create a Journal Voucher which will set balance as zero in these account. - -![Temporary Account Nullified]({{docs_base_url}}/assets/img/articles/$SGrab_432.png) - - \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/what-is-the-differences-of-total-and-valuation-in-tax-and-charges.md b/erpnext/docs/user/manual/en/accounts/articles/what-is-the-differences-of-total-and-valuation-in-tax-and-charges.md index d4fd384d183..a23b6e75534 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/what-is-the-differences-of-total-and-valuation-in-tax-and-charges.md +++ b/erpnext/docs/user/manual/en/accounts/articles/what-is-the-differences-of-total-and-valuation-in-tax-and-charges.md @@ -1,37 +1,33 @@ #Purchase Tax or Charges Categories Consider Tax or Charge field in Purchase Taxes and Charges master has three values. -
    -
  1. Total
  2. -
  3. Valuation
  4. -
  5. Total and Valuation
  6. -
- -
-Let's consider an example to understand an effect of value selected in Consider Tax or Charge field. We purchase 10 units of item, at the rate of 800, total purchase amount would be 800. Purchased item has 4% VAT tax and INR 100 transportation charges were incurred. +- Total +- Valuation +- Total and Valuation + +Purchase Tax and Charges Categories + +Let's consider an example to understand an effect of each charge type. We purchase ten units of item, at the rate of 800. total purchase amount is 800. Purchased item has 4% VAT applied on it, and INR 100 was incurred in transportation. ####Total: -=An amount of tax/charge categorized Total will be accounted in the total of purchase transactions, but not in the value of purchased item. +Tax or Charge categorized as **Total** will be included in the total of purchase transactions. But it will not have impact on the valuation of item purchased. -If VAT 4% is applied on item, it will amount to INR 32. Since VAT is the - consumption tax, its should be added value of Purchase Order/Invoice, since it will be included in payable towards supplier, but its should not be added to the value of Purchased item. +If VAT 4% is applied on item, it will amount to INR 32 (at item's based rate is 800). Since VAT is the [consumption tax](https://frappe.io/blog/erpnext-features/managing-consumption-tax), its should be added value of Purchase Order/Invoice, since it will be included in payable towards supplier. But its should not be added to the value of Purchased item. -Hence for tax or charge you wish to be added to transaction total but not to the valuation of item, it should be categorized as Total. - -When Purchase Invoice is submitted, value of tax/charge is booked in respective account. +When Purchase Invoice is submitted, general ledger posting will be done for tax/charge categorized as Total. ####Valuation: -An amount of tax/charge categorized as Valuation will be added in the value of purchased item, but will not be added to the value of purchase transaction. +Tax or charge categorized as **Valuation** will be added in the value of purchased item, but not in the total of that purchase transaction. -Transportation charge of INR 100 should be categorized as valuation. With this, the value of purchased item will be increased from 800 to 900. Also, it will be not be added to the total of purchase transaction, because it should not be reflected to supplier, as it will be irrelevant for them. +Transportation charge of INR 100 should be categorized as valuation. With this, the value of purchased item will be increased from 800 to 900. Also, this charge will be not be added to the total of purchase transaction, because it your expense, and should not be reflected to the supplier. -When Purchase Invoice is submitted, value of tax/charge is booked in respective account. Transportation expense will be booked +Check [here]({{docs_base_url}}/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.html) to learn general posting done for expense categorized as Valuation. ####Total and Valuation: -An amount of tax/charge categorized as for Total and Valuation will be added in the value of purchase item, as well as will be included in the totals of purchase transactions. +Tax or Charge categorized as for **Total and Valuation** will be added in the valuation of item, as well as in the totals of purchase transactions. -Let's assume that transporter was arranged by our supplier, but we need to pay transportation charges to them. In that case, for transportation charges, category selected should be Total and Valuation. With this INR 100 transportation charges will be added to actual purchase amount of INR 800. Also, INR 100 will reflect in the total, as it will be payable for us towards supplier. \ No newline at end of file +Let's assume that transportion is arranged by our supplier, but we need to pay transportation charges to them. In that case, for transportation charges, category selected should be Total and Valuation. With this, INR 100 transportation charge will be added to the actual purchase amount 800. Also, INR 100 will reflect in the total, as it will be payable for us towards supplier. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt index 323764e19ea..391a1852b78 100644 --- a/erpnext/docs/user/manual/en/accounts/index.txt +++ b/erpnext/docs/user/manual/en/accounts/index.txt @@ -13,6 +13,9 @@ opening-accounts item-wise-tax point-of-sale-pos-invoice multi-currency-accounting +recurring-orders-and-invoices +pricing-rule tools setup articles + diff --git a/erpnext/docs/user/manual/en/accounts/pricing-rule.md b/erpnext/docs/user/manual/en/accounts/pricing-rule.md new file mode 100644 index 00000000000..7afcbea0a1d --- /dev/null +++ b/erpnext/docs/user/manual/en/accounts/pricing-rule.md @@ -0,0 +1,82 @@ +#Pricing Rule + +Pricing Rule is a master where you can define rules based on which discount is applied to specific Customer or Supplier. +### Scenario: + +Following are the few cases which can be addressed using Pricing Rule. + +1. As per the promotional sale policy, if customer purchases more than 10 units of an item, he enjoys 20% discount. + +2. For Customer "XYZ", selling price for the specific Item should be updated as ###. + +3. Items categorized under specific Item Group has same selling or buying price. + +4. Customers balonging to specific Customer Group should get ### selling price, ot % of Discount on Items. + +5. Supplier's categorized under specific Supplier Type should have ### buying rate applied. + +To have %Discount and Price List Rate for an Item auto-applied, you should create Pricing Rules for it. + +Pricing Rule master has two sections: + +### 1. Applicability Section: + +In this section, conditions are set for the application of Pricing Rule. When transaction meets condition as specified in this section, Price or Discount as specified in the Pricing Rule will be applied. You can set condition on following values. + +####1.1 Applicable On: + +Applicable On + +If you want Pricing Rule to be applied on all the items, select based on Item Group. For value, select **All Item Group** (parent Item Group). + +####1.2 Applicable For: + +Applicability option will updated based on our selection for Selling or Buying or both. You can set applicability on one of the following master. + +Applicable for + +####1.3 Quantity: + +Specify minimum and maximum qty of an item when this Pricing Rule should be applicable. + +Applicable Qty + +###2. Application: + +Using Price List Rule, you can ultimately define price or %discount to be applied on an item. + +Applicable + +####2.1 Price + +Price or Discount specified in the Pricing Rule will be applied only if above applicability rules are matched with values in the transaction. Price mentioned in Pricing Rule will be given priority over item's Price List rate. + +Applicable Price + +#### 2.2 Discount Percentage + +Discount Percentage can be applied for a specific Price List. To have it applied for all the Price List, %Discount field should be left blank. + +Discount + +If %Discount is to be applied on all Price Lists, then leave Price List field blank. + +#### Validity + +Enter From and To date between which this Pricing Rule will be applicable. This will be useful if creating Pricing Rule for sales promotion exercise available for certain days. + +Validity + +#### Priority + +If two or more Pricing Rules are found based on same conditions, Priority is applied. Priority is a number between 0 to 20 while default value is zero (blank). Higher number means it will take precedence if there are multiple Pricing Rules with same conditions. + +Priority + +#### Disable + +Check to Disable Pricing Rule. + +Disable + + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/recurring-order-and-invoices.md b/erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md similarity index 94% rename from erpnext/docs/user/manual/en/accounts/articles/recurring-order-and-invoices.md rename to erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md index 5db9940f839..4d256397746 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/recurring-order-and-invoices.md +++ b/erpnext/docs/user/manual/en/accounts/recurring-orders-and-invoices.md @@ -10,11 +10,11 @@ Feature of setting document as recurring is available in Sales Order, Sales Invo Option to set document as recurring will be visible only after submission. Recurring is last section in document. Check **Is Recurring** to set document as recurring. -Recurring Invoice +Recurring Invoice **From Date and To Date:** This defines contract period with the customer. -**Repeat on the Day of Month:** If recurring type is set as Monthly, then it will be day of the month on which  recurring invoice will be generated. +**Repeat on the Day of Month:** If recurring type is set as Monthly, then it will be day of the month on which recurring invoice will be generated. **End Date:** Date after which auto-creation of recurring invoice will be stopped. diff --git a/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt b/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt index 460fa1624ca..289753df5f7 100644 --- a/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt +++ b/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt @@ -7,4 +7,5 @@ merging-documents rename-tool renaming-documents search-filters -tree-master-renaming \ No newline at end of file +tree-master-renaming +pos-view \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/using-erpnext/articles/pos-view.md b/erpnext/docs/user/manual/en/using-erpnext/articles/pos-view.md new file mode 100644 index 00000000000..839e820afc5 --- /dev/null +++ b/erpnext/docs/user/manual/en/using-erpnext/articles/pos-view.md @@ -0,0 +1,11 @@ +#POS View + +POS (point of sale) view renders form in a different layout, optimized for the quick selection of items. This view has primarily been designed for the retail business. + +Using POS View, you can only create Sales Invoice, without switching to standard form view. For other transactions, like Sales Order, Delivery Note, Purchase Order, Purchase Receipt etc., POS View is only used for Item selection. For entering other values in the transaction, you should switch to form view. + +POS View + +For creating POS Invoice, check following help video. + + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/using-erpnext/index.txt b/erpnext/docs/user/manual/en/using-erpnext/index.txt index 259835e38c2..0dfa0d5a94f 100644 --- a/erpnext/docs/user/manual/en/using-erpnext/index.txt +++ b/erpnext/docs/user/manual/en/using-erpnext/index.txt @@ -6,3 +6,4 @@ calendar assignment tags articles +pos-view diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 7b67a8ff17f..96a70918580 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.16.2" +app_version = "6.16.3" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.json b/erpnext/hr/doctype/job_applicant/job_applicant.json index e1351efc7c3..b9660e28486 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.json +++ b/erpnext/hr/doctype/job_applicant/job_applicant.json @@ -25,6 +25,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -48,6 +49,7 @@ "options": "Email", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -71,6 +73,7 @@ "options": "Open\nReplied\nRejected\nHold", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -92,6 +95,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -116,6 +120,7 @@ "options": "Job Opening", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -137,6 +142,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -159,29 +165,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Communications", - "length": 0, - "no_copy": 0, - "options": "Communication", - "permlevel": 0, - "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -200,7 +184,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-11-16 06:29:48.722773", + "modified": "2016-01-06 02:36:13.556143", "modified_by": "Administrator", "module": "HR", "name": "Job Applicant", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 612a44732ac..e919e922629 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -240,3 +240,4 @@ erpnext.patches.v6_10.fix_billed_amount_in_drop_ship_po erpnext.patches.v6_10.fix_delivery_status_of_drop_ship_item #2015-12-08 erpnext.patches.v5_8.tax_rule #2015-12-08 erpnext.patches.v6_12.set_overdue_tasks +erpnext.patches.v6_16.update_billing_status_in_dn_and_pr \ No newline at end of file diff --git a/erpnext/patches/v6_10/fix_billed_amount_in_drop_ship_po.py b/erpnext/patches/v6_10/fix_billed_amount_in_drop_ship_po.py index 4aecaa7c841..d7f72b58808 100644 --- a/erpnext/patches/v6_10/fix_billed_amount_in_drop_ship_po.py +++ b/erpnext/patches/v6_10/fix_billed_amount_in_drop_ship_po.py @@ -13,6 +13,6 @@ def execute(): where purchase_order=%s and docstatus=1""", po[0]) if invoices: for inv in invoices: - frappe.get_doc("Purchase Invoice", inv[0]).update_qty(change_modified=False) + frappe.get_doc("Purchase Invoice", inv[0]).update_qty(update_modified=False) else: frappe.db.sql("""update `tabPurchase Order` set per_billed=0 where name=%s""", po[0]) \ No newline at end of file diff --git a/erpnext/patches/v6_10/fix_ordered_received_billed.py b/erpnext/patches/v6_10/fix_ordered_received_billed.py index ed4112eb592..c81a20ec545 100644 --- a/erpnext/patches/v6_10/fix_ordered_received_billed.py +++ b/erpnext/patches/v6_10/fix_ordered_received_billed.py @@ -14,4 +14,4 @@ def execute(): {"patch_date": not_null_patch_date}): doc = frappe.get_doc(doctype, name) - doc.update_qty(change_modified=False) + doc.update_qty(update_modified=False) diff --git a/erpnext/patches/v6_16/__init__.py b/erpnext/patches/v6_16/__init__.py new file mode 100644 index 00000000000..baffc488252 --- /dev/null +++ b/erpnext/patches/v6_16/__init__.py @@ -0,0 +1 @@ +from __future__ import unicode_literals diff --git a/erpnext/patches/v6_16/update_billing_status_in_dn_and_pr.py b/erpnext/patches/v6_16/update_billing_status_in_dn_and_pr.py new file mode 100644 index 00000000000..b660d39d53b --- /dev/null +++ b/erpnext/patches/v6_16/update_billing_status_in_dn_and_pr.py @@ -0,0 +1,42 @@ +# Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + for dt in ("Delivery Note", "Purchase Receipt"): + frappe.reload_doctype(dt) + frappe.reload_doctype(dt + " Item") + + # Update billed_amt in DN and PR which are not against any order + for d in frappe.db.sql("""select name from `tabDelivery Note Item` item + where (so_detail is null or so_detail = '') and docstatus=1""", as_dict=1): + + billed_amt = frappe.db.sql("""select sum(amount) from `tabSales Invoice Item` + where dn_detail=%s and docstatus=1""", d.name) + billed_amt = billed_amt and billed_amt[0][0] or 0 + frappe.db.set_value("Delivery Note Item", d.name, "billed_amt", billed_amt, update_modified=False) + + frappe.db.commit() + + # Update billed_amt in DN and PR which are not against any order + for d in frappe.db.sql("""select name from `tabPurchase Receipt Item` item + where (prevdoc_detail_docname is null or prevdoc_detail_docname = '') and docstatus=1""", as_dict=1): + + billed_amt = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item` + where pr_detail=%s and docstatus=1""", d.name) + billed_amt = billed_amt and billed_amt[0][0] or 0 + frappe.db.set_value("Purchase Receipt Item", d.name, "billed_amt", billed_amt, update_modified=False) + + frappe.db.commit() + + for dt in ("Delivery Note", "Purchase Receipt"): + # Update billed amt which are against order or invoice + # Update billing status for all + for d in frappe.db.sql("select name from `tab{0}` where docstatus=1".format(dt), as_dict=1): + doc = frappe.get_doc(dt, d.name) + doc.update_billing_status(update_modified=False) + doc.set_status(update=True, update_modified=False) + + frappe.db.commit() diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json index f27fdbf2803..3ebfa7dc9e9 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -782,30 +782,6 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Communications", - "length": 0, - "no_copy": 0, - "options": "Communication", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 } ], "hide_heading": 0, @@ -818,7 +794,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-12-08 12:50:05.106006", + "modified": "2016-01-06 02:36:04.820353", "modified_by": "Administrator", "module": "Selling", "name": "Customer", diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 6ec82a24302..99e708d5b09 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -111,14 +111,14 @@ class SalesOrder(SellingController): def validate_warehouse(self): super(SalesOrder, self).validate_warehouse() - + for d in self.get("items"): if (frappe.db.get_value("Item", d.item_code, "is_stock_item")==1 or (self.has_product_bundle(d.item_code) and self.product_bundle_has_stock_item(d.item_code))) \ and not d.warehouse and not cint(d.delivered_by_supplier): frappe.throw(_("Delivery warehouse required for stock item {0}").format(d.item_code), WarehouseRequired) - + def validate_with_previous_doc(self): super(SalesOrder, self).validate_with_previous_doc({ "Quotation": { @@ -285,8 +285,8 @@ class SalesOrder(SellingController): delivered_qty += item.delivered_qty tot_qty += item.qty - - frappe.db.set_value("Sales Order", self.name, "per_delivered", flt(delivered_qty/tot_qty) * 100, + + frappe.db.set_value("Sales Order", self.name, "per_delivered", flt(delivered_qty/tot_qty) * 100, update_modified=False) def get_list_context(context=None): @@ -518,7 +518,9 @@ def get_events(start, end, filters=None): data = frappe.db.sql("""select name, customer_name, delivery_status, billing_status, delivery_date from `tabSales Order` where (ifnull(delivery_date, '0000-00-00')!= '0000-00-00') \ - and (delivery_date between %(start)s and %(end)s) {conditions} + and (delivery_date between %(start)s and %(end)s) + and docstatus < 2 + {conditions} """.format(conditions=conditions), { "start": start, "end": end @@ -533,7 +535,7 @@ def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc= default_price_list = frappe.get_value("Supplier", for_supplier, "default_price_list") if default_price_list: target.buying_price_list = default_price_list - + if any( item.delivered_by_supplier==1 for item in source.items): if source.shipping_address_name: target.customer_address = source.shipping_address_name @@ -541,12 +543,12 @@ def make_purchase_order_for_drop_shipment(source_name, for_supplier, target_doc= else: target.customer_address = source.customer_address target.customer_address_display = source.address_display - + target.customer_contact_person = source.contact_person target.customer_contact_display = source.contact_display target.customer_contact_mobile = source.contact_mobile target.customer_contact_email = source.contact_email - + else: target.customer = "" target.customer_name = "" diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 120106aaa43..29dee1e30ab 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -101,19 +101,6 @@ class Company(Document): frappe.db.set(self, "default_payable_account", frappe.db.get_value("Account", {"company": self.name, "account_type": "Payable"})) - def add_acc(self, lst): - account = frappe.get_doc({ - "doctype": "Account", - "freeze_account": "No", - "company": self.name - }) - - for d in self.fld_dict.keys(): - account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]]) - if not account.parent_account: - account.flags.ignore_mandatory = True - account.insert() - def set_default_accounts(self): self._set_default_account("default_cash_account", "Cash") self._set_default_account("default_bank_account", "Bank") diff --git a/erpnext/setup/doctype/sales_person/sales_person.json b/erpnext/setup/doctype/sales_person/sales_person.json index adb4c67e82e..e99d14f6dfc 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.json +++ b/erpnext/setup/doctype/sales_person/sales_person.json @@ -26,6 +26,7 @@ "options": "icon-user", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -50,6 +51,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -76,6 +78,7 @@ "options": "Sales Person", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -101,6 +104,7 @@ "options": "\nYes\nNo", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -122,6 +126,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -145,6 +150,7 @@ "options": "Employee", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -169,6 +175,7 @@ "oldfieldtype": "Int", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -193,6 +200,7 @@ "oldfieldtype": "Int", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -217,6 +225,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -242,6 +251,7 @@ "options": "icon-bullseye", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -267,6 +277,7 @@ "options": "Target Detail", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -293,29 +304,7 @@ "options": "Monthly Distribution", "permlevel": 0, "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Communications", - "length": 0, - "no_copy": 0, - "options": "Communication", - "permlevel": 0, - "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -334,7 +323,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-11-16 06:29:57.194163", + "modified": "2016-01-06 02:36:22.551330", "modified_by": "Administrator", "module": "Setup", "name": "Sales Person", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index de6a85d8492..c5a3bab06e8 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -47,21 +47,13 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( this.show_general_ledger(); } if (this.frm.has_perm("submit") && (doc.status !== "Closed") - && this.frm.doc.__onload && this.frm.doc.__onload.has_return_entry) { + && this.frm.doc.__onload && !this.frm.doc.__onload.has_return_entry) { cur_frm.add_custom_button(__("Close"), this.close_delivery_note) } } - if(doc.__onload && !doc.__onload.billing_complete && doc.docstatus==1 - && !doc.is_return && doc.status!="Closed") { - // show Make Invoice button only if Delivery Note is not created from Sales Invoice - var from_sales_invoice = false; - from_sales_invoice = cur_frm.doc.items.some(function(item) { - return item.against_sales_invoice ? true : false; - }); - - if(!from_sales_invoice) - cur_frm.add_custom_button(__('Invoice'), this.make_sales_invoice).addClass("btn-primary"); + if(doc.docstatus==1 && !doc.is_return && doc.status!="Closed" && flt(doc.per_billed, 2) < 100) { + cur_frm.add_custom_button(__('Invoice'), this.make_sales_invoice).addClass("btn-primary"); } if(doc.docstatus==1 && doc.status === "Closed" && this.frm.has_perm("submit")) { @@ -285,6 +277,3 @@ if (sys_defaults.auto_accounting_for_stock) { } } } - - - diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index 17392be787f..f001f85455f 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -2154,6 +2154,30 @@ "unique": 0, "width": "150px" }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "per_billed", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "% Amount Billed", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -2317,7 +2341,7 @@ "no_copy": 1, "oldfieldname": "status", "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nCancelled\nClosed", + "options": "\nDraft\nTo Bill\nCompleted\nCancelled\nClosed", "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, @@ -2672,7 +2696,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2015-12-17 16:19:27.004718", + "modified": "2015-12-25 16:20:39.014291", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index c5fd34f80ae..b553054c5a0 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -48,7 +48,8 @@ class DeliveryNote(SellingController): 'target_ref_field': 'qty', 'source_field': 'qty', 'percent_join_field': 'against_sales_invoice', - 'overflow_type': 'delivery' + 'overflow_type': 'delivery', + 'no_tolerance': 1 }, { 'source_dt': 'Delivery Note Item', @@ -56,22 +57,12 @@ class DeliveryNote(SellingController): 'join_field': 'so_detail', 'target_field': 'returned_qty', 'target_parent_dt': 'Sales Order', - # 'target_parent_field': 'per_delivered', - # 'target_ref_field': 'qty', 'source_field': '-1 * qty', - # 'percent_join_field': 'against_sales_order', - # 'overflow_type': 'delivery', 'extra_cond': """ and exists (select name from `tabDelivery Note` where name=`tabDelivery Note Item`.parent and is_return=1)""" }] def onload(self): - billed_qty = frappe.db.sql("""select sum(qty) from `tabSales Invoice Item` - where docstatus=1 and delivery_note=%s""", self.name) - if billed_qty: - total_qty = sum((item.qty for item in self.get("items"))) - self.set_onload("billing_complete", (billed_qty[0][0] == total_qty)) - - self.set_onload("has_return_entry", len(frappe.db.exists({"doctype": "Delivery Note", + self.set_onload("has_return_entry", len(frappe.db.exists({"doctype": "Delivery Note", "is_return": 1, "return_against": self.name, "docstatus": 1}))) def before_print(self): @@ -171,7 +162,7 @@ class DeliveryNote(SellingController): def validate_warehouse(self): super(DeliveryNote, self).validate_warehouse() - + for d in self.get_item_list(): if frappe.db.get_value("Item", d['item_code'], "is_stock_item") == 1: if not d['warehouse']: @@ -199,6 +190,7 @@ class DeliveryNote(SellingController): # update delivered qty in sales order self.update_prevdoc_status() + self.update_billing_status() if not self.is_return: self.check_credit_limit() @@ -206,18 +198,15 @@ class DeliveryNote(SellingController): self.update_stock_ledger() self.make_gl_entries() - frappe.db.set(self, 'status', 'Submitted') - - def on_cancel(self): self.check_stop_or_close_sales_order("against_sales_order") self.check_next_docstatus() self.update_prevdoc_status() + self.update_billing_status() self.update_stock_ledger() - frappe.db.set(self, 'status', 'Cancelled') self.cancel_packing_slips() self.make_gl_entries_on_cancel() @@ -280,6 +269,63 @@ class DeliveryNote(SellingController): self.notify_update() clear_doctype_notifications(self) + def update_billing_status(self, update_modified=True): + updated_delivery_notes = [self.name] + for d in self.get("items"): + if d.si_detail and not d.so_detail: + d.db_set('billed_amt', d.amount, update_modified=update_modified) + elif d.so_detail: + updated_delivery_notes += update_billed_amount_based_on_so(d.so_detail, update_modified) + + for dn in set(updated_delivery_notes): + dn_doc = self if (dn == self.name) else frappe.get_doc("Delivery Note", dn) + dn_doc.update_billing_percentage(update_modified=update_modified) + + self.load_from_db() + +def update_billed_amount_based_on_so(so_detail, update_modified=True): + # Billed against Sales Order directly + billed_against_so = frappe.db.sql("""select sum(amount) from `tabSales Invoice Item` + where so_detail=%s and (dn_detail is null or dn_detail = '') and docstatus=1""", so_detail) + billed_against_so = billed_against_so and billed_against_so[0][0] or 0 + + # Get all Delivery Note Item rows against the Sales Order Item row + dn_details = frappe.db.sql("""select dn_item.name, dn_item.amount, dn_item.si_detail, dn_item.parent + from `tabDelivery Note Item` dn_item, `tabDelivery Note` dn + where dn.name=dn_item.parent and dn_item.so_detail=%s + and dn.docstatus=1 and dn.is_return = 0 + order by dn.posting_date asc, dn.posting_time asc, dn.name asc""", so_detail, as_dict=1) + + updated_dn = [] + for dnd in dn_details: + billed_amt_agianst_dn = 0 + + # If delivered against Sales Invoice + if dnd.si_detail: + billed_amt_agianst_dn = flt(dnd.amount) + billed_against_so -= billed_amt_agianst_dn + else: + # Get billed amount directly against Delivery Note + billed_amt_agianst_dn = frappe.db.sql("""select sum(amount) from `tabSales Invoice Item` + where dn_detail=%s and docstatus=1""", dnd.name) + billed_amt_agianst_dn = billed_amt_agianst_dn and billed_amt_agianst_dn[0][0] or 0 + + # Distribute billed amount directly against SO between DNs based on FIFO + if billed_against_so and billed_amt_agianst_dn < dnd.amount: + pending_to_bill = flt(dnd.amount) - billed_amt_agianst_dn + if pending_to_bill <= billed_against_so: + billed_amt_agianst_dn += pending_to_bill + billed_against_so -= pending_to_bill + else: + billed_amt_agianst_dn += billed_against_so + billed_against_so = 0 + + frappe.db.set_value("Delivery Note Item", dnd.name, "billed_amt", billed_amt_agianst_dn, update_modified=update_modified) + + updated_dn.append(dnd.parent) + + return updated_dn + def get_list_context(context=None): from erpnext.controllers.website_list_for_contact import get_list_context list_context = get_list_context(context) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_list.js b/erpnext/stock/doctype/delivery_note/delivery_note_list.js index fbbf08f0476..f1ad92914ba 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note_list.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note_list.js @@ -1,11 +1,15 @@ frappe.listview_settings['Delivery Note'] = { - add_fields: ["customer", "customer_name", "base_grand_total", "per_installed", + add_fields: ["customer", "customer_name", "base_grand_total", "per_installed", "per_billed", "transporter_name", "grand_total", "is_return", "status"], get_indicator: function(doc) { if(cint(doc.is_return)==1) { return [__("Return"), "darkgrey", "is_return,=,Yes"]; } else if(doc.status==="Closed") { return [__("Closed"), "green", "status,=,Closed"]; - } + } else if (flt(doc.per_billed, 2) < 100) { + return [__("To Bill"), "orange", "per_billed,<,100"]; + } else if (flt(doc.per_billed, 2) == 100) { + return [__("Completed"), "green", "per_billed,=,100"]; + } } }; diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index c3d8447dcad..699d8b6e2d0 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -18,6 +18,7 @@ from erpnext.stock.doctype.stock_entry.test_stock_entry \ from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos, SerialNoWarehouseError from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation \ import create_stock_reconciliation, set_valuation_method +from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order, create_dn_against_so class TestDeliveryNote(unittest.TestCase): def test_over_billing_against_dn(self): @@ -405,6 +406,112 @@ class TestDeliveryNote(unittest.TestCase): update_delivery_note_status(dn.name, "Closed") self.assertEquals(frappe.db.get_value("Delivery Note", dn.name, "Status"), "Closed") + + def test_dn_billing_status_case1(self): + # SO -> DN -> SI + so = make_sales_order() + dn = create_dn_against_so(so.name, delivered_qty=2) + + self.assertEqual(dn.status, "To Bill") + self.assertEqual(dn.per_billed, 0) + + si = make_sales_invoice(dn.name) + si.submit() + + dn.load_from_db() + self.assertEqual(dn.get("items")[0].billed_amt, 200) + self.assertEqual(dn.per_billed, 100) + self.assertEqual(dn.status, "Completed") + + def test_dn_billing_status_case2(self): + # SO -> SI and SO -> DN1, DN2 + from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note, make_sales_invoice + + so = make_sales_order() + + si = make_sales_invoice(so.name) + si.get("items")[0].qty = 5 + si.insert() + si.submit() + + frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) + + dn1 = make_delivery_note(so.name) + dn1.posting_time = "10:00" + dn1.get("items")[0].qty = 2 + dn1.submit() + + self.assertEqual(dn1.get("items")[0].billed_amt, 200) + self.assertEqual(dn1.per_billed, 100) + self.assertEqual(dn1.status, "Completed") + + dn2 = make_delivery_note(so.name) + dn2.posting_time = "08:00" + dn2.get("items")[0].qty = 4 + dn2.submit() + + dn1.load_from_db() + self.assertEqual(dn1.get("items")[0].billed_amt, 100) + self.assertEqual(dn1.per_billed, 50) + self.assertEqual(dn1.status, "To Bill") + + self.assertEqual(dn2.get("items")[0].billed_amt, 400) + self.assertEqual(dn2.per_billed, 100) + self.assertEqual(dn2.status, "Completed") + + def test_dn_billing_status_case3(self): + # SO -> DN1 -> SI and SO -> SI and SO -> DN2 + from erpnext.selling.doctype.sales_order.sales_order \ + import make_delivery_note, make_sales_invoice as make_sales_invoice_from_so + frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) + + so = make_sales_order() + + dn1 = make_delivery_note(so.name) + dn1.posting_time = "10:00" + dn1.get("items")[0].qty = 2 + dn1.submit() + + si1 = make_sales_invoice(dn1.name) + si1.submit() + + dn1.load_from_db() + self.assertEqual(dn1.per_billed, 100) + + si2 = make_sales_invoice_from_so(so.name) + si2.get("items")[0].qty = 4 + si2.submit() + + dn2 = make_delivery_note(so.name) + dn2.posting_time = "08:00" + dn2.get("items")[0].qty = 5 + dn2.submit() + + dn1.load_from_db() + self.assertEqual(dn1.get("items")[0].billed_amt, 200) + self.assertEqual(dn1.per_billed, 100) + self.assertEqual(dn1.status, "Completed") + + self.assertEqual(dn2.get("items")[0].billed_amt, 400) + self.assertEqual(dn2.per_billed, 80) + self.assertEqual(dn2.status, "To Bill") + + def test_dn_billing_status_case4(self): + # SO -> SI -> DN + from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice + from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note + + so = make_sales_order() + + si = make_sales_invoice(so.name) + si.submit() + + dn = make_delivery_note(si.name) + dn.submit() + + self.assertEqual(dn.get("items")[0].billed_amt, 1000) + self.assertEqual(dn.per_billed, 100) + self.assertEqual(dn.status, "Completed") def create_delivery_note(**args): dn = frappe.new_doc("Delivery Note") diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 2dbdd96950a..63ea4684400 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -1,1225 +1,1299 @@ { - "allow_copy": 0, - "allow_import": 0, - "allow_rename": 0, - "autoname": "hash", - "creation": "2013-04-22 13:15:44", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "hash", + "creation": "2013-04-22 13:15:44", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "barcode", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Barcode", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "barcode", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Barcode", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "item_code", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "permlevel": 0, - "print_hide": 0, - "print_width": "150px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "item_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Item Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Item Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "customer_item_code", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Customer's Item Code", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "customer_item_code", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Customer's Item Code", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "fieldname": "section_break_6", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "fieldname": "section_break_6", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "description", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 0, - "print_width": "300px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "300px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "300px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break_8", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break_8", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "image", - "fieldtype": "Attach", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Image", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image", + "fieldtype": "Attach", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "image_view", - "fieldtype": "Image", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Image View", - "length": 0, - "no_copy": 0, - "options": "image", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image_view", + "fieldtype": "Image", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "options": "image", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Quantity and Rate", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Quantity and Rate", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Price List Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Price List Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "depends_on": "price_list_rate", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Discount on Price List Rate (%)", - "length": 0, - "no_copy": 0, - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "price_list_rate", + "fieldname": "discount_percentage", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Discount on Price List Rate (%)", + "length": 0, + "no_copy": 0, + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "permlevel": 0, - "print_hide": 0, - "print_width": "50px", - "read_only": 1, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "50px", + "read_only": 1, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "50px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "section_break_1", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "section_break_1", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "150px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Amount", - "length": 0, - "no_copy": 0, - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Amount", + "length": 0, + "no_copy": 0, + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break3", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break3", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "pricing_rule", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Pricing Rule", - "length": 0, - "no_copy": 0, - "options": "Pricing Rule", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "pricing_rule", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Pricing Rule", + "length": 0, + "no_copy": 0, + "options": "Pricing Rule", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "section_break_25", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "section_break_25", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "net_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "net_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "net_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Amount", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "net_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Amount", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break_28", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break_28", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_net_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_net_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_net_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_net_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Warehouse and Reference", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Warehouse and Reference", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "From Warehouse", - "length": 0, - "no_copy": 0, - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "From Warehouse", + "length": 0, + "no_copy": 0, + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "depends_on": "", - "description": "", - "fieldname": "target_warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "in_filter": 0, - "in_list_view": 0, - "label": "To Warehouse (Optional)", - "length": 0, - "no_copy": 0, - "options": "Warehouse", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "", + "description": "", + "fieldname": "target_warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 1, + "in_filter": 0, + "in_list_view": 0, + "label": "To Warehouse (Optional)", + "length": 0, + "no_copy": 0, + "options": "Warehouse", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "serial_no", - "fieldtype": "Text", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Serial No", - "length": 0, - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "serial_no", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Serial No", + "length": 0, + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "batch_no", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Batch No", - "length": 0, - "no_copy": 0, - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "batch_no", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Batch No", + "length": 0, + "no_copy": 0, + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "fieldname": "actual_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Available Qty at From Warehouse", - "length": 0, - "no_copy": 1, - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "fieldname": "actual_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Available Qty at From Warehouse", + "length": 0, + "no_copy": 1, + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "depends_on": "batch_no", - "fieldname": "actual_batch_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Available Batch Qty at From Warehouse", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "depends_on": "batch_no", + "fieldname": "actual_batch_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Available Batch Qty at From Warehouse", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "description": "", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Item Group", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Item Group", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Brand Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Brand Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Item Tax Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Item Tax Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break4", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "expense_account", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Expense Account", - "length": 0, - "no_copy": 1, - "options": "Account", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "expense_account", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Expense Account", + "length": 0, + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "120px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "default": ":Company", - "fieldname": "cost_center", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Cost Center", - "length": 0, - "no_copy": 1, - "options": "Cost Center", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Cost Center", + "length": 0, + "no_copy": 1, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "120px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "against_sales_order", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Against Sales Order", - "length": 0, - "no_copy": 0, - "options": "Sales Order", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "against_sales_order", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Against Sales Order", + "length": 0, + "no_copy": 0, + "options": "Sales Order", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "against_sales_invoice", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Against Sales Invoice", - "length": 0, - "no_copy": 0, - "options": "Sales Invoice", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "against_sales_invoice", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Against Sales Invoice", + "length": 0, + "no_copy": 0, + "options": "Sales Invoice", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "so_detail", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Against Sales Order Item", - "length": 0, - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "so_detail", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Against Sales Order Item", + "length": 0, + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "si_detail", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Against Sales Invoice Item", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "si_detail", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Against Sales Invoice Item", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "installed_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Installed Qty", - "length": 0, - "no_copy": 1, - "oldfieldname": "installed_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "installed_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Installed Qty", + "length": 0, + "no_copy": 1, + "oldfieldname": "installed_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "fieldname": "page_break", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Page Break", - "length": 0, - "no_copy": 0, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "billed_amt", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Billed Amt", + "length": 0, + "no_copy": 1, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "fieldname": "page_break", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Page Break", + "length": 0, + "no_copy": 0, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 } - ], - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 1, - "in_create": 0, - "in_dialog": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2015-11-16 06:29:45.014492", - "modified_by": "Administrator", - "module": "Stock", - "name": "Delivery Note Item", - "owner": "Administrator", - "permissions": [], - "read_only": 0, - "read_only_onload": 0, - "sort_field": "modified", + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 1, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2016-01-06 02:22:36.503315", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Item", + "owner": "Administrator", + "permissions": [], + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", "sort_order": "DESC" -} \ No newline at end of file +} diff --git a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json index 9aaab18a63f..846537a3264 100644 --- a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json +++ b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json @@ -1,6 +1,6 @@ { "allow_copy": 0, - "allow_import": 1, + "allow_import": 0, "allow_rename": 0, "autoname": "", "creation": "2014-09-26 03:52:31.161255", @@ -25,6 +25,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -49,6 +50,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -60,13 +62,14 @@ "hide_heading": 0, "hide_toolbar": 0, "icon": "icon-edit", + "idx": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2015-11-16 06:29:48.249491", + "modified": "2016-01-06 01:47:08.939754", "modified_by": "Administrator", "module": "Stock", "name": "Item Attribute Value", diff --git a/erpnext/stock/doctype/item_variant/item_variant.json b/erpnext/stock/doctype/item_variant/item_variant.json index e51635a3be7..b7cc9ea5d2b 100644 --- a/erpnext/stock/doctype/item_variant/item_variant.json +++ b/erpnext/stock/doctype/item_variant/item_variant.json @@ -1,6 +1,6 @@ { "allow_copy": 0, - "allow_import": 1, + "allow_import": 0, "allow_rename": 0, "autoname": "", "creation": "2014-09-26 03:54:04.370259", @@ -26,6 +26,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -50,6 +51,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -61,13 +63,14 @@ "hide_heading": 0, "hide_toolbar": 0, "icon": "", + "idx": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2015-11-16 06:29:48.592686", + "modified": "2016-01-06 01:47:09.067886", "modified_by": "Administrator", "module": "Stock", "name": "Item Variant", diff --git a/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.json b/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.json index 740a514c588..9a86a6c061e 100644 --- a/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.json +++ b/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.json @@ -1,6 +1,6 @@ { "allow_copy": 0, - "allow_import": 1, + "allow_import": 0, "allow_rename": 0, "autoname": "", "creation": "2015-05-19 05:12:30.344797", @@ -26,6 +26,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -48,6 +49,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -73,6 +75,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -97,6 +100,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -120,6 +124,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -144,6 +149,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -168,6 +174,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -190,6 +197,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -214,6 +222,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -225,13 +234,14 @@ "hide_heading": 0, "hide_toolbar": 0, "icon": "", + "idx": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2015-11-16 06:29:48.641487", + "modified": "2016-01-06 01:47:09.098783", "modified_by": "Administrator", "module": "Stock", "name": "Item Variant Attribute", diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py index 89f3ad565e5..7f190d2edc6 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py @@ -15,20 +15,32 @@ class TestLandedCostVoucher(unittest.TestCase): pr = frappe.copy_doc(pr_test_records[0]) pr.submit() - bin_details = frappe.db.get_value("Bin", {"warehouse": "_Test Warehouse - _TC", - "item_code": "_Test Item"}, ["actual_qty", "stock_value"], as_dict=1) + last_sle = frappe.db.get_value("Stock Ledger Entry", { + "voucher_type": pr.doctype, + "voucher_no": pr.name, + "item_code": "_Test Item", + "warehouse": "_Test Warehouse - _TC" + }, + fieldname=["qty_after_transaction", "stock_value"], + as_dict=1) self.submit_landed_cost_voucher(pr) pr_lc_value = frappe.db.get_value("Purchase Receipt Item", {"parent": pr.name}, "landed_cost_voucher_amount") self.assertEquals(pr_lc_value, 25.0) - bin_details_after_lcv = frappe.db.get_value("Bin", {"warehouse": "_Test Warehouse - _TC", - "item_code": "_Test Item"}, ["actual_qty", "stock_value"], as_dict=1) + last_sle_after_landed_cost = frappe.db.get_value("Stock Ledger Entry", { + "voucher_type": pr.doctype, + "voucher_no": pr.name, + "item_code": "_Test Item", + "warehouse": "_Test Warehouse - _TC" + }, + fieldname=["qty_after_transaction", "stock_value"], + as_dict=1) - self.assertEqual(bin_details.actual_qty, bin_details_after_lcv.actual_qty) + self.assertEqual(last_sle.qty_after_transaction, last_sle_after_landed_cost.qty_after_transaction) - self.assertEqual(bin_details_after_lcv.stock_value - bin_details.stock_value, 25.0) + self.assertEqual(last_sle_after_landed_cost.stock_value - last_sle.stock_value, 25.0) gl_entries = get_gl_entries("Purchase Receipt", pr.name) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 9a24eed30f6..eec1a6d8b53 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -61,7 +61,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend this.make_purchase_invoice).addClass("btn-primary"); } if (this.frm.has_perm("submit") && - this.frm.doc.__onload && this.frm.doc.__onload.has_return_entry) { + this.frm.doc.__onload && !this.frm.doc.__onload.has_return_entry) { cur_frm.add_custom_button(__("Close"), this.close_purchase_receipt) } } diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 4422a77065f..f0eac39bd1c 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -1812,7 +1812,7 @@ "no_copy": 1, "oldfieldname": "status", "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nCancelled\nClosed", + "options": "\nDraft\nTo Bill\nCompleted\nCancelled\nClosed", "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, @@ -1930,6 +1930,30 @@ "unique": 0, "width": "50%" }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "per_billed", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "% Amount Billed", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -2278,7 +2302,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2015-12-17 16:18:48.969643", + "modified": "2015-12-30 18:15:06.678001", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index b0f9eaa900c..df62f7d2462 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -243,6 +243,8 @@ class PurchaseReceipt(BuyingController): self.update_prevdoc_status() self.update_ordered_qty() + self.update_billing_status() + if not self.is_return: purchase_controller.update_last_purchase_rate(self, 1) @@ -281,6 +283,8 @@ class PurchaseReceipt(BuyingController): # Must be called after updating received qty in PO self.update_ordered_qty() + self.update_billing_status() + if not self.is_return: pc_obj.update_last_purchase_rate(self, 0) @@ -436,6 +440,54 @@ class PurchaseReceipt(BuyingController): self.notify_update() clear_doctype_notifications(self) + def update_billing_status(self, update_modified=True): + updated_pr = [self.name] + for d in self.get("items"): + if d.prevdoc_detail_docname: + updated_pr += update_billed_amount_based_on_po(d.prevdoc_detail_docname, update_modified) + + for pr in set(updated_pr): + pr_doc = self if (pr == self.name) else frappe.get_doc("Purchase Receipt", pr) + pr_doc.update_billing_percentage(update_modified=update_modified) + + self.load_from_db() + +def update_billed_amount_based_on_po(po_detail, update_modified=True): + # Billed against Sales Order directly + billed_against_po = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item` + where po_detail=%s and (pr_detail is null or pr_detail = '') and docstatus=1""", po_detail) + billed_against_po = billed_against_po and billed_against_po[0][0] or 0 + + # Get all Delivery Note Item rows against the Sales Order Item row + pr_details = frappe.db.sql("""select pr_item.name, pr_item.amount, pr_item.parent + from `tabPurchase Receipt Item` pr_item, `tabPurchase Receipt` pr + where pr.name=pr_item.parent and pr_item.prevdoc_detail_docname=%s + and pr.docstatus=1 and pr.is_return = 0 + order by pr.posting_date asc, pr.posting_time asc, pr.name asc""", po_detail, as_dict=1) + + updated_pr = [] + for pr_item in pr_details: + # Get billed amount directly against Purchase Receipt + billed_amt_agianst_pr = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item` + where pr_detail=%s and docstatus=1""", pr_item.name) + billed_amt_agianst_pr = billed_amt_agianst_pr and billed_amt_agianst_pr[0][0] or 0 + + # Distribute billed amount directly against PO between PRs based on FIFO + if billed_against_po and billed_amt_agianst_pr < pr_item.amount: + pending_to_bill = flt(pr_item.amount) - billed_amt_agianst_pr + if pending_to_bill <= billed_against_po: + billed_amt_agianst_pr += pending_to_bill + billed_against_po -= pending_to_bill + else: + billed_amt_agianst_pr += billed_against_po + billed_against_po = 0 + + frappe.db.set_value("Purchase Receipt Item", pr_item.name, "billed_amt", billed_amt_agianst_pr, update_modified=update_modified) + + updated_pr.append(pr_item.parent) + + return updated_pr + @frappe.whitelist() def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js index 63148995fac..5c57fb5f010 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js @@ -1,11 +1,15 @@ frappe.listview_settings['Purchase Receipt'] = { add_fields: ["supplier", "supplier_name", "base_grand_total", "is_subcontracted", - "transporter_name", "is_return", "status"], + "transporter_name", "is_return", "status", "per_billed"], get_indicator: function(doc) { if(cint(doc.is_return)==1) { return [__("Return"), "darkgrey", "is_return,=,Yes"]; } else if(doc.status==="Closed") { return [__("Closed"), "green", "status,=,Closed"]; - } + } else if (flt(doc.per_billed, 2) < 100) { + return [__("To Bill"), "orange", "per_billed,<,100"]; + } else if (flt(doc.per_billed, 2) == 100) { + return [__("Completed"), "green", "per_billed,=,100"]; + } } }; diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 8aa9761ead5..dc814056c87 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -7,11 +7,10 @@ import unittest import frappe import frappe.defaults from frappe.utils import cint, flt, cstr +from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice class TestPurchaseReceipt(unittest.TestCase): def test_make_purchase_invoice(self): - from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice - pr = make_purchase_receipt(do_not_save=True) self.assertRaises(frappe.ValidationError, make_purchase_invoice, pr.name) pr.submit() @@ -185,6 +184,45 @@ class TestPurchaseReceipt(unittest.TestCase): update_purchase_receipt_status(pr.name, "Closed") self.assertEquals(frappe.db.get_value("Purchase Receipt", pr.name, "status"), "Closed") + def test_pr_billing_status(self): + # PO -> PR1 -> PI and PO -> PI and PO -> PR2 + from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order + from erpnext.buying.doctype.purchase_order.purchase_order \ + import make_purchase_receipt, make_purchase_invoice as make_purchase_invoice_from_po + + po = create_purchase_order() + + pr1 = make_purchase_receipt(po.name) + pr1.posting_time = "10:00" + pr1.get("items")[0].received_qty = 2 + pr1.get("items")[0].qty = 2 + pr1.submit() + + pi1 = make_purchase_invoice(pr1.name) + pi1.submit() + + pr1.load_from_db() + self.assertEqual(pr1.per_billed, 100) + + pi2 = make_purchase_invoice_from_po(po.name) + pi2.get("items")[0].qty = 4 + pi2.submit() + + pr2 = make_purchase_receipt(po.name) + pr2.posting_time = "08:00" + pr2.get("items")[0].received_qty = 5 + pr2.get("items")[0].qty = 5 + pr2.submit() + + pr1.load_from_db() + self.assertEqual(pr1.get("items")[0].billed_amt, 1000) + self.assertEqual(pr1.per_billed, 100) + self.assertEqual(pr1.status, "Completed") + + self.assertEqual(pr2.get("items")[0].billed_amt, 2000) + self.assertEqual(pr2.per_billed, 80) + self.assertEqual(pr2.status, "To Bill") + def get_gl_entries(voucher_type, voucher_no): return frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type=%s and voucher_no=%s diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 0789071a8db..0032c890b21 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1,1485 +1,1569 @@ { - "allow_copy": 0, - "allow_import": 0, - "allow_rename": 0, - "autoname": "hash", - "creation": "2013-05-24 19:29:10", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "hash", + "creation": "2013-05-24 19:29:10", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "barcode", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Barcode", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "barcode", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Barcode", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "section_break_2", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "section_break_2", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "fieldname": "item_code", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "permlevel": 0, - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break_2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "item_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Item Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Item Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "fieldname": "section_break_4", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "fieldname": "section_break_4", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "description", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "oldfieldname": "description", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "print_width": "300px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "300px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "300px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "image", - "fieldtype": "Attach", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Image", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image", + "fieldtype": "Attach", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "image_view", - "fieldtype": "Image", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Image View", - "length": 0, - "no_copy": 0, - "options": "image", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image_view", + "fieldtype": "Image", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "options": "image", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "received_and_accepted", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Received and Accepted", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "received_and_accepted", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Received and Accepted", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "fieldname": "received_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Recd Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "received_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "fieldname": "received_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Recd Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "received_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Accepted Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Accepted Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "rejected_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Rejected Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "rejected_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "rejected_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Rejected Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "rejected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Stock UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Stock UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "conversion_factor", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Conversion Factor", - "length": 0, - "no_copy": 0, - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "conversion_factor", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Conversion Factor", + "length": 0, + "no_copy": 0, + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "rate_and_amount", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Rate and Amount", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "rate_and_amount", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Rate and Amount", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Price List Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Price List Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "depends_on": "price_list_rate", - "fieldname": "discount_percentage", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Discount on Price List Rate (%)", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "price_list_rate", + "fieldname": "discount_percentage", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Discount on Price List Rate (%)", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break3", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break3", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "sec_break1", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "fieldname": "rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "import_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "fieldname": "rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "import_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Amount", - "length": 0, - "no_copy": 0, - "oldfieldname": "import_amount", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Amount", + "length": 0, + "no_copy": 0, + "oldfieldname": "import_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break4", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "purchase_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "purchase_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "pricing_rule", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Pricing Rule", - "length": 0, - "no_copy": 0, - "options": "Pricing Rule", - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "pricing_rule", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Pricing Rule", + "length": 0, + "no_copy": 0, + "options": "Pricing Rule", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "section_break_29", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "section_break_29", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "net_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "net_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "net_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Amount", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "net_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Amount", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break_32", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break_32", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_net_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_net_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "base_net_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Net Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "base_net_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Net Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Warehouse and Reference", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Warehouse and Reference", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Accepted Warehouse", - "length": 0, - "no_copy": 0, - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Accepted Warehouse", + "length": 0, + "no_copy": 0, + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "rejected_warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Rejected Warehouse", - "length": 0, - "no_copy": 1, - "oldfieldname": "rejected_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "rejected_warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Rejected Warehouse", + "length": 0, + "no_copy": 1, + "oldfieldname": "rejected_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "project_name", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Project Name", - "length": 0, - "no_copy": 0, - "options": "Project", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "project_name", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Project Name", + "length": 0, + "no_copy": 0, + "options": "Project", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "default": ":Company", - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "fieldname": "cost_center", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Cost Center", - "length": 0, - "no_copy": 0, - "options": "Cost Center", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "default": ":Company", + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Cost Center", + "length": 0, + "no_copy": 0, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "qa_no", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Quality Inspection", - "length": 0, - "no_copy": 1, - "oldfieldname": "qa_no", - "oldfieldtype": "Link", - "options": "Quality Inspection", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "qa_no", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Quality Inspection", + "length": 0, + "no_copy": 1, + "oldfieldname": "qa_no", + "oldfieldtype": "Link", + "options": "Quality Inspection", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "schedule_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Required By", - "length": 0, - "no_copy": 0, - "oldfieldname": "schedule_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "schedule_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Required By", + "length": 0, + "no_copy": 0, + "oldfieldname": "schedule_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "stock_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Qty as per Stock UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "stock_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Qty as per Stock UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Prevdoc Doctype", - "length": 0, - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Prevdoc Doctype", + "length": 0, + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "prevdoc_docname", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Purchase Order", - "length": 0, - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Purchase Order", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "prevdoc_docname", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Purchase Order", + "length": 0, + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Purchase Order", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Purchase Order Item No", - "length": 0, - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Purchase Order Item No", + "length": 0, + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "col_break5", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break5", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "bom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "BOM", - "length": 0, - "no_copy": 1, - "options": "BOM", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "bom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "BOM", + "length": 0, + "no_copy": 1, + "options": "BOM", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "serial_no", - "fieldtype": "Text", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Serial No", - "length": 0, - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "serial_no", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Serial No", + "length": 0, + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "rejected_serial_no", - "fieldtype": "Text", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Rejected Serial No", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "rejected_serial_no", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Rejected Serial No", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "batch_no", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Batch No", - "length": 0, - "no_copy": 0, - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "batch_no", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Batch No", + "length": 0, + "no_copy": 0, + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Brand", - "length": 0, - "no_copy": 0, - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "billed_amt", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Billed Amt", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "description": "", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Group", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Brand", + "length": 0, + "no_copy": 0, + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "rm_supp_cost", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Raw Materials Supplied Cost", - "length": 0, - "no_copy": 1, - "oldfieldname": "rm_supp_cost", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Group", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "rm_supp_cost", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Raw Materials Supplied Cost", + "length": 0, + "no_copy": 1, + "oldfieldname": "rm_supp_cost", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "item_tax_amount", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Item Tax Amount", - "length": 0, - "no_copy": 1, - "oldfieldname": "item_tax_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "item_tax_amount", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Item Tax Amount", + "length": 0, + "no_copy": 1, + "oldfieldname": "item_tax_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "fieldname": "landed_cost_voucher_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Landed Cost Voucher Amount", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "fieldname": "landed_cost_voucher_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Landed Cost Voucher Amount", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "fieldname": "valuation_rate", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Valuation Rate", - "length": 0, - "no_copy": 1, - "oldfieldname": "valuation_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_width": "80px", - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "fieldname": "valuation_rate", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Valuation Rate", + "length": 0, + "no_copy": 1, + "oldfieldname": "valuation_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "80px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "80px" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Item Tax Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "read_only": 1, - "report_hide": 1, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Item Tax Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 1, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "fieldname": "page_break", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Page Break", - "length": 0, - "no_copy": 0, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "fieldname": "page_break", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Page Break", + "length": 0, + "no_copy": 0, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 } - ], - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 1, - "in_create": 0, - "in_dialog": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2015-11-16 06:29:54.377742", - "modified_by": "Administrator", - "module": "Stock", - "name": "Purchase Receipt Item", - "owner": "Administrator", - "permissions": [], - "read_only": 0, - "read_only_onload": 0, - "sort_field": "modified", + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 1, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2016-01-06 02:22:04.312514", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase Receipt Item", + "owner": "Administrator", + "permissions": [], + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", "sort_order": "DESC" -} \ No newline at end of file +} diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 3965417d238..585f8dd55f7 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -133,7 +133,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ qty: function(doc, cdt, cdn) { var d = locals[cdt][cdn]; d.transfer_qty = flt(d.qty) * flt(d.conversion_factor); - refresh_field('items'); + this.calculate_basic_amount(d); }, production_order: function() { @@ -227,7 +227,89 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ items_on_form_rendered: function(doc, grid_row) { erpnext.setup_serial_no(); - } + }, + + basic_rate: function(doc, cdt, cdn) { + var item = frappe.model.get_doc(cdt, cdn); + this.calculate_basic_amount(item); + }, + + s_warehouse: function(doc, cdt, cdn) { + + }, + + t_warehouse: function(doc, cdt, cdn) { + this.s_warehouse(doc, cdt, cdn); + }, + + get_warehouse_details: function(doc, cdt, cdn) { + var me = this; + var d = locals[cdt][cdn]; + if(!d.bom_no) { + frappe.call({ + method: "erpnext.stock.doctype.stock_entry.stock_entry.get_warehouse_details", + args: { + "args": { + 'item_code': d.item_code, + 'warehouse': cstr(d.s_warehouse) || cstr(d.t_warehouse), + 'transfer_qty': d.transfer_qty, + 'serial_no': d.serial_no, + 'qty': d.s_warehouse ? -1* d.qty : d.qty, + 'posting_date': this.frm.doc.posting_date, + 'posting_time': this.frm.doc.posting_time + } + }, + callback: function(r) { + if (!r.exc) { + $.extend(d, r.message); + me.calculate_basic_amount(d); + } + } + }); + } + }, + + calculate_basic_amount: function(item) { + item.basic_amount = flt(flt(item.transfer_qty) * flt(item.basic_rate), + precision("basic_amount", item)); + + this.calculate_amount(); + }, + + calculate_amount: function() { + this.calculate_total_additional_costs(); + + var total_basic_amount = frappe.utils.sum( + (this.frm.doc.items || []).map(function(i) { return i.t_warehouse ? flt(i.basic_amount) : 0; }) + ); + + for (var i in this.frm.doc.items) { + var item = this.frm.doc.items[i]; + + if (item.t_warehouse && total_basic_amount) { + item.additional_cost = (flt(item.basic_amount) / total_basic_amount) * this.frm.doc.total_additional_costs; + } else { + item.additional_cost = 0; + } + + item.amount = flt(item.basic_amount + flt(item.additional_cost), + precision("amount", item)); + + item.valuation_rate = flt(flt(item.basic_rate) + + (flt(item.additional_cost) / flt(item.transfer_qty)), + precision("valuation_rate", item)); + } + + refresh_field('items'); + }, + + calculate_total_additional_costs: function() { + var total_additional_costs = frappe.utils.sum( + (this.frm.doc.additional_costs || []).map(function(c) { return flt(c.amount); }) + ); + + this.frm.set_value("total_additional_costs", flt(total_additional_costs, precision("total_additional_costs"))); + }, }); cur_frm.script_manager.make(erpnext.stock.StockEntry); @@ -346,23 +428,6 @@ cur_frm.cscript.barcode = function(doc, cdt, cdn) { } } -cur_frm.cscript.s_warehouse = function(doc, cdt, cdn) { - var d = locals[cdt][cdn]; - if(!d.bom_no) { - args = { - 'item_code' : d.item_code, - 'warehouse' : cstr(d.s_warehouse) || cstr(d.t_warehouse), - 'transfer_qty' : d.transfer_qty, - 'serial_no' : d.serial_no, - 'qty' : d.s_warehouse ? -1* d.qty : d.qty - } - return get_server_fields('get_warehouse_details', JSON.stringify(args), - 'items', doc, cdt, cdn, 1); - } -} - -cur_frm.cscript.t_warehouse = cur_frm.cscript.s_warehouse; - cur_frm.cscript.uom = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; if(d.uom && d.item_code){ @@ -406,3 +471,9 @@ cur_frm.cscript.company = function(doc, cdt, cdn) { cur_frm.cscript.posting_date = function(doc, cdt, cdn){ erpnext.get_fiscal_year(doc.company, doc.posting_date); } + +frappe.ui.form.on('Landed Cost Taxes and Charges', { + amount: function(frm) { + frm.cscript.calculate_amount(); + } +}) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 97029726041..247ce787a65 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -11,6 +11,7 @@ from erpnext.stock.stock_ledger import get_previous_sle, NegativeStockError from erpnext.stock.get_item_details import get_available_qty, get_default_cost_center, get_conversion_factor from erpnext.manufacturing.doctype.bom.bom import validate_bom_no from erpnext.accounts.utils import validate_fiscal_year +import json class IncorrectValuationRateError(frappe.ValidationError): pass class DuplicateEntryForProductionOrderError(frappe.ValidationError): pass @@ -293,7 +294,9 @@ class StockEntry(StockController): def update_valuation_rate(self): for d in self.get("items"): d.amount = flt(d.basic_amount + flt(d.additional_cost), d.precision("amount")) - d.valuation_rate = flt(flt(d.basic_rate) + flt(d.additional_cost) / flt(d.transfer_qty), + d.valuation_rate = flt( + flt(d.basic_rate) + + (flt(d.additional_cost) / flt(d.transfer_qty)), d.precision("valuation_rate")) def set_total_incoming_outgoing_value(self): @@ -473,7 +476,10 @@ class StockEntry(StockController): if not ret["expense_account"]: ret["expense_account"] = frappe.db.get_value("Company", self.company, "stock_adjustment_account") - stock_and_rate = args.get('warehouse') and self.get_warehouse_details(args) or {} + args['posting_date'] = self.posting_date + args['posting_time'] = self.posting_time + + stock_and_rate = args.get('warehouse') and get_warehouse_details(args) or {} ret.update(stock_and_rate) return ret @@ -495,21 +501,6 @@ class StockEntry(StockController): } return ret - def get_warehouse_details(self, args): - ret = {} - if args.get('warehouse') and args.get('item_code'): - args.update({ - "posting_date": self.posting_date, - "posting_time": self.posting_time, - }) - args = frappe._dict(args) - - ret = { - "actual_qty" : get_previous_sle(args).get("qty_after_transaction") or 0, - "basic_rate" : get_incoming_rate(args) - } - return ret - def get_items(self): self.set('items', []) self.validate_production_order() @@ -806,3 +797,23 @@ def get_operating_cost_per_unit(production_order=None, bom_no=None): operating_cost_per_unit = flt(bom.operating_cost) / flt(bom.quantity) return operating_cost_per_unit + +@frappe.whitelist() +def get_warehouse_details(args): + if isinstance(args, basestring): + args = json.loads(args) + + args = frappe._dict(args) + + ret = {} + if args.warehouse and args.item_code: + args.update({ + "posting_date": args.posting_date, + "posting_time": args.posting_time, + }) + ret = { + "actual_qty" : get_previous_sle(args).get("qty_after_transaction") or 0, + "basic_rate" : get_incoming_rate(args) + } + + return ret diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html index 78f0da4a958..1c50e15efdc 100644 --- a/erpnext/templates/form_grid/item_grid.html +++ b/erpnext/templates/form_grid/item_grid.html @@ -1,6 +1,5 @@ {% var visible_columns = row.get_visible_columns(["item_code", "qty", "rate", "amount", - "stock_uom", "uom", "discount_percentage", "schedule_date", "warehouse", - "against_sales_order", "sales_order"]); %} + "stock_uom", "uom", "discount_percentage", "warehouse"]); %} {% if(!doc) { %}
diff --git a/setup.py b/setup.py index d30cbdc2a22..787911e196d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages from pip.req import parse_requirements -version = "6.16.2" +version = "6.16.3" requirements = parse_requirements("requirements.txt", session="") setup(