Merge branch 'develop'

This commit is contained in:
Anand Doshi 2016-01-06 18:56:03 +05:30
commit 574415b59b
135 changed files with 4349 additions and 3360 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '6.16.2'
__version__ = '6.16.3'

View File

@ -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()

View File

@ -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")

View File

@ -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)": {},

View File

@ -1,7 +1,6 @@
{
"country_code": "be",
"name": "Belgian PCMN",
"disabled": "Yes",
"tree": {
"CLASSE 1": {
"BENEFICE (PERTE) REPORTE(E)": {

View File

@ -1,7 +1,6 @@
{
"country_code": "br",
"name": "Planilha de Contas Brasileira",
"is_active": "No",
"tree": {
"ATIVO": {
"CIRCULANTE": {

View File

@ -1,7 +1,6 @@
{
"country_code": "ca",
"name": "Chart of Accounts for english-speaking provinces",
"is_active": "Yes",
"tree": {
"ASSETS": {
"CURRENT ASSETS": {

View File

@ -1,7 +1,6 @@
{
"country_code": "ca",
"name": "Plan comptable pour les provinces francophones",
"is_active": "Yes",
"tree": {
"ACTIF": {
"ACTIFS COURANTS": {

View File

@ -1,7 +1,6 @@
{
"country_code": "ch",
"name": "Plan comptable STERCHI",
"is_active": "Yes",
"disabled": "Yes",
"tree": {
"Actif": {

View File

@ -1,7 +1,6 @@
{
"country_code": "co",
"name": "Unique Account Chart - PUC",
"is_active": "Yes",
"tree": {
"ACTIVO": {
"DEUDORES": {

View File

@ -1,7 +1,6 @@
{
"country_code": "cr",
"name": "Costa Rica - Company 0",
"is_active": "Yes",
"tree": {
"0-Activo": {
"0-Activo circulante": {

View File

@ -1,7 +1,6 @@
{
"country_code": "cr",
"name": "Costa Rica - Company 1",
"is_active": "Yes",
"tree": {
"xActivo": {
"root_type": "Asset",

View File

@ -1,7 +1,7 @@
{
"country_code": "de",
"name": "Deutscher Kontenplan SKR04",
"is_active": "Yes",
"disabled": "Yes",
"tree": {
"Bilanz - Aktiva": {
"Anlageverm\u00f6gen": {

View File

@ -1,7 +1,6 @@
{
"country_code": "de",
"name": "Deutscher Kontenplan SKR03",
"is_active": "No",
"disabled": "Yes",
"tree": {
"Aktiva": {

View File

@ -1,6 +1,7 @@
{
"country_code": "es",
"name": "PGCE com\u00fan",
"disabled": "Yes",
"tree": {
"Acreedores y deudores por operaciones comerciales": {
"Acreedores varios": {

View File

@ -1,7 +1,6 @@
{
"country_code": "et",
"name": "Ethiopia Tax and Account Chart Template",
"is_active": "Yes",
"tree": {
"ASSETS": {
"Cash and Cash Equivalents": {

View File

@ -1,7 +1,6 @@
{
"country_code": "gt",
"name": "Plantilla de cuentas de Guatemala (sencilla)",
"is_active": "Yes",
"tree": {
"Activo": {
"Activo Corriente": {

View File

@ -1,7 +1,6 @@
{
"country_code": "hn",
"name": "Plantilla de cuentas de Honduras (sencilla)",
"is_active": "Yes",
"tree": {
"Activo": {
"Activo Corriente": {

View File

@ -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": {

View File

@ -1,7 +1,6 @@
{
"country_code": "pa",
"name": "Plan de Cuentas",
"is_active": "Yes",
"tree": {
"ACTIVOS": {
"Activo Fijo": {

View File

@ -1,6 +1,7 @@
{
"country_code": "ro",
"name": "Romania - Chart of Accounts",
"disabled": "Yes",
"tree": {
"CONTURI FINANCIARE": {
"CONTURI DE BILANT": {

View File

@ -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"
}
}
}

View File

@ -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": {

View File

@ -1,7 +1,6 @@
{
"country_code": "th",
"name": "Thailand Chart of Accounts",
"is_active": "Yes",
"tree": {
"Assets": {
"Account Receivable": {},

View File

@ -1,7 +1,6 @@
{
"country_code": "uy",
"name": "Plan de Cuentas",
"is_active": "Yes",
"tree": {
"ACTIVO": {
"ACTIVO CORRIENTE": {

View File

@ -1,7 +1,6 @@
{
"country_code": "ae",
"name": "U.A.E Chart of Accounts",
"is_active": "Yes",
"tree": {
"Assets": {
"Current Assets": {

View File

@ -1,7 +1,6 @@
{
"country_code": "gt",
"name": "Cuentas de Guatemala",
"is_active": "Yes",
"tree": {
"Activos": {
"Activo Corriente": {

View File

@ -1,7 +1,6 @@
{
"country_code": "in",
"name": "Chart of Accounts - India",
"is_active": "Yes",
"tree": {
"Application of Funds (Assets)": {
"Current Assets": {

View File

@ -1,7 +1,6 @@
{
"country_code": "ni",
"name": "Catalogo de Cuentas Nicaragua",
"is_active": "Yes",
"tree": {
"Activo": {
"Activo Corriente": {

View File

@ -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"
}
}
}

View File

@ -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"
}
}
}

View File

@ -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:

View File

@ -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

View File

@ -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)

View File

@ -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",

View File

@ -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();
}
})
}
});

View File

@ -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):

View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -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(" ", "_")

View File

@ -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):

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -35,7 +35,7 @@
Version
</td>
<td>
<code>6.16.1</code>
<code>6.16.2</code>
</td>
</tr>
</table>
@ -52,4 +52,4 @@
<!-- autodoc -->
<!-- jinja -->
<!-- static -->
<!-- static -->

View File

@ -310,27 +310,6 @@ Supplier of Goods or Services.
<td></td>
</tr>
<tr >
<td>20</td>
<td ><code>communications</code></td>
<td >
Table</td>
<td class="text-muted" title="Hidden">
Communications
</td>
<td>
<a href="https://frappe.github.io/erpnext/current/models/core/communication">Communication</a>
</td>
</tr>
</tbody>
</table>

View File

@ -138,27 +138,6 @@ Hold</pre>
<td></td>
</tr>
<tr >
<td>8</td>
<td ><code>communications</code></td>
<td >
Table</td>
<td class="text-muted" title="Hidden">
Communications
</td>
<td>
<a href="https://frappe.github.io/erpnext/current/models/core/communication">Communication</a>
</td>
</tr>
</tbody>
</table>

View File

@ -499,27 +499,6 @@ Last Day of the Next Month</pre>
</td>
</tr>
<tr >
<td>32</td>
<td ><code>communications</code></td>
<td >
Table</td>
<td class="text-muted" title="Hidden">
Communications
</td>
<td>
<a href="https://frappe.github.io/erpnext/current/models/core/communication">Communication</a>
</td>
</tr>

View File

@ -226,27 +226,6 @@ No</pre>
</td>
</tr>
<tr >
<td>13</td>
<td ><code>communications</code></td>
<td >
Table</td>
<td class="text-muted" title="Hidden">
Communications
</td>
<td>
<a href="https://frappe.github.io/erpnext/current/models/core/communication">Communication</a>
</td>
</tr>

View File

@ -36,6 +36,6 @@ On submission of Stock Reconciliation, depreciation will booked for items asset
<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/depreciation-4.png">
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.
<!-- markdown -->

View File

@ -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.

View File

@ -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.
<!-- markdown -->

View File

@ -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.
<img alt="Accounts Frozen Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/frozen-date-1.png">
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.
<img alt="Frozen Date Error" class="screenshot" src="{{docs_base_url}}/assets/img/articles/frozen-date-2.png">
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.
<img alt="Frozen Date Error" class="screenshot" src="{{docs_base_url}}/assets/img/articles/frozen-date-3.png">

View File

@ -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.
<img src="{{docs_base_path}}/assets/img/articles/freeze-accounting-entry.png" height="302" width="488">
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 &amp; Edit Frozen Entries field.

View File

@ -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

View File

@ -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)
<img alt="Accounts Frozen Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/exchange-rate-difference-1.png">
####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)
<img alt="Accounts Frozen Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/exchange-rate-difference-2.gif">
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.
<!-- markdown -->

View File

@ -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.
<br>
<br>To understand this scenario will take example of Sales Invoice, where your base currency is INR and your customer currency is USD.
<br>
<br>Following are steps to create Sales Invoice in customer currency.
<br>&nbsp;
<br><b>Step 1:</b> Go to Selling &gt;&gt; Documents &gt;&gt; Sales Invoice &gt;&gt; (+) New.
<br>
<br><b>Step 2:</b> Select Customer and Enter other details.
<br>
<br>
<img src="{{docs_base_path}}/assets/img/articles/Selection_012.png">
<br><b>Step 3:</b> Select customer currency and related Price List.
<br>
<br>
<img src="{{docs_base_path}}/assets/img/articles/Selection_016.png">
<br>
<br>
<br>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.
<br>
<br>Also you can set default customer currency in customer master. Which will auto fetch in transactions.
<br>
<br>
<img src="{{docs_base_path}}/assets/img/articles/Selection_017.png">&nbsp;
<br>System has Currency Exchange master, where you can set currency exchange masters for your multiple currencies. To Set this go to Accounts &gt; Setup &gt; Currency Exchange. <br><br><b>Step 4:</b> Select Item details.<br>
<br>On selecting Item details Sales invoice Total section will look like below image.
<br>
<br>
<img src="{{docs_base_path}}/assets/img/articles/Selection_018.png" width="750">
<br>
<br>
<br>
<b>Step 5:</b> Save and Submit <br><br>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.<br>For our case it will look as below image.<br><br><img src="{{docs_base_path}}/assets/img/articles/Selection_019.png">&nbsp;&nbsp; <br>
<br>
<br>
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.
<img alt="Accounts Frozen Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/multiple-currency-1.gif">
#### 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.
<img alt="Accounts Frozen Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/multiple-currency-2.png">
#### 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.

View File

@ -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.
<img src="{{docs_base_path}}/assets/img/articles/Screen Shot 2014-12-03 at 5.03.10 pm.png"

View File

@ -1,11 +0,0 @@
#POS View
POS view renders form in a different layout, mainly designed for the quick selection of items. This view has primarily been designed for the retail business, who needs to be quick at invoicing.
<img src="{{docs_base_path}}/assets/img/articles/$SGrab_219.png">
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.

View File

@ -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)
<img alt="JE Posting Date" class="screenshot" src="{{docs_base_url}}/assets/img/articles/post-dated-1.gif">
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.
<!-- markdown -->

View File

@ -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)
<!-- markdown -->

View File

@ -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).
<!-- markdown -->

View File

@ -1,9 +1,9 @@
#Update Stock Option in Sales Invoice
#Delivery from Sales Invoice
The <i>Update Stock</i> check box is available in the <i>Items</i> section within <i>Sales Invoice</i> 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.
<img src="{{docs_base_path}}/assets/img/articles/kb_updatestk_field.png" height="221" width="603">
<img alt="Update Stock" class="screenshot" src="{{docs_base_url}}/assets/img/articles/update-stock.png">
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.
On submission of Sales Invoice, with general ledger posting, stock ledger posting will happen as well.

View File

@ -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)
<!-- markdown -->

View File

@ -1,37 +1,33 @@
#Purchase Tax or Charges Categories
Consider Tax or Charge field in Purchase Taxes and Charges master has three values.
<ol>
<li>Total</li>
<li>Valuation</li>
<li>Total and Valuation</li>
</ol>
<img src="{{docs_base_path}}/assets/img/articles/Screen Shot 2015-04-15 at 6.04.02 pm.png"><br>
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
<img alt="Purchase Tax and Charges Categories" class="screenshot" src="{{docs_base_url}}/assets/img/articles/purchase-other-charges-1.png">
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
<a href="https://frappe.io/blog/erpnext-features/managing-consumption-tax" target="_blank"> consumption tax</a>, 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.
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.

View File

@ -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

View File

@ -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:
<img alt="Applicable On" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-on.png">
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.
<img alt="Applicable for" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-for.png">
####1.3 Quantity:
Specify minimum and maximum qty of an item when this Pricing Rule should be applicable.
<img alt="Applicable Qty" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-qty.png">
###2. Application:
Using Price List Rule, you can ultimately define price or %discount to be applied on an item.
<img alt="Applicable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-application.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.
<img alt="Applicable Price" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-price.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.
<img alt="Discount" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-discount.png">
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.
<img alt="Validity" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-validity.png">
#### 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.
<img alt="Priority" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-priority.png">
#### Disable
Check to Disable Pricing Rule.
<img alt="Disable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-disable.png">
<!-- markdown -->

Some files were not shown because too many files have changed in this diff Show More