Fixes for standard chart of accounts

This commit is contained in:
Nabin Hait 2014-11-14 18:13:17 +05:30
parent 601fcde31c
commit 707322adb9
5 changed files with 153 additions and 719 deletions

View File

@ -9,8 +9,6 @@ from unidecode import unidecode
def create_charts(chart_name, company): def create_charts(chart_name, company):
chart = get_chart(chart_name) chart = get_chart(chart_name)
frappe.db.sql("delete from `tabAccount` where company=%s", company)
if chart: if chart:
accounts = [] accounts = []

View File

@ -1,592 +1,176 @@
{ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
"_(\"Accounts Payable\")": { # License: GNU General Public License v3. See license.txt
"_(\"Creditors\")": {
from __future__ import unicode_literals
from frappe import _
coa = {
_("Application of Funds (Assets)"): {
_("Current Assets"): {
_("Accounts Receivable"): {
_("Debtors"): {
"account_type": "Receivable"
}
},
_("Bank Accounts"): {
"account_type": "Bank"
},
_("Cash In Hand"): {
_("Cash"): {
"account_type": "Cash"
},
"account_type": "Cash"
},
_("Loans and Advances (Assets)"): {},
_("Securities and Deposits"): {
_("Earnest Money"): {}
},
_("Stock Assets"): {
"account_type": "Stock"
},
_("Tax Assets"): {}
},
_("Fixed Assets"): {
_("Capital Equipments"): {
"account_type": "Fixed Asset"
},
_("Computers"): {
"account_type": "Fixed Asset"
},
_("Furniture and Fixture"): {
"account_type": "Fixed Asset"
},
_("Office Equipments"): {
"account_type": "Fixed Asset"
},
_("Plant and Machinery"): {
"account_type": "Fixed Asset"
}
},
_("Investments"): {},
_("Temporary Accounts (Assets)"): {
_("Temporary Assets"): {}
},
"root_type": "Asset"
},
_("Expenses"): {
_("Direct Expenses"): {
_("Stock Expenses"): {
_("Cost of Goods Sold"): {
"account_type": "Expense Account"
},
_("Expenses Included In Valuation"): {
"account_type": "Expenses Included In Valuation"
},
_("Stock Adjustment"): {
"account_type": "Stock Adjustment"
},
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
_("Indirect Expenses"): {
_("Administrative Expenses"): {
"account_type": "Expense Account"
},
_("Commission on Sales"): {
"account_type": "Expense Account"
},
_("Depreciation"): {
"account_type": "Expense Account"
},
_("Entertainment Expenses"): {
"account_type": "Expense Account"
},
_("Freight and Forwarding Charges"): {
"account_type": "Chargeable"
},
_("Legal Expenses"): {
"account_type": "Expense Account"
},
_("Marketing Expenses"): {
"account_type": "Chargeable"
},
_("Miscellaneous Expenses"): {
"account_type": "Chargeable"
},
_("Office Maintenance Expenses"): {
"account_type": "Expense Account"
},
_("Office Rent"): {
"account_type": "Expense Account"
},
_("Postal Expenses"): {
"account_type": "Expense Account"
},
_("Print and Stationary"): {
"account_type": "Expense Account"
},
_("Rounded Off"): {
"account_type": "Expense Account"
},
_("Salary"): {
"account_type": "Expense Account"
},
_("Sales Expenses"): {
"account_type": "Expense Account"
},
_("Telephone Expenses"): {
"account_type": "Expense Account"
},
_("Travel Expenses"): {
"account_type": "Expense Account"
},
_("Utility Expenses"): {
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"root_type": "Expense"
},
_("Income"): {
_("Direct Income"): {
_("Sales"): {
"account_type": "Income Account"
},
_("Service"): {
"account_type": "Income Account"
},
"account_type": "Income Account"
},
_("Indirect Income"): {
"account_type": "Income Account"
},
"root_type": "Income"
},
_("Source of Funds (Liabilities)"): {
_("Capital Account"): {
_("Reserves and Surplus"): {},
_("Shareholders Funds"): {}
},
_("Current Liabilities"): {
_("Accounts Payable"): {
_("Creditors"): {
"account_type": "Payable" "account_type": "Payable"
} }
}, },
"_(\"Accounts Receivable\")": { _("Stock Liabilities"): {
"_(\"Debtors\")": { _("Stock Received But Not Billed"): {
"account_type": "Receivable"
}
},
"_(\"Administrative Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Application of Funds (Assets)\")": {
"_(\"Current Assets\")": {
"_(\"Accounts Receivable\")": {
"_(\"Debtors\")": {
"account_type": "Receivable"
}
},
"_(\"Bank Accounts\")": {
"account_type": "Bank"
},
"_(\"Cash In Hand\")": {
"_(\"Cash\")": {
"account_type": "Cash"
},
"account_type": "Cash"
},
"_(\"Loans and Advances (Assets)\")": {},
"_(\"Securities and Deposits\")": {
"_(\"Earnest Money\")": {}
},
"_(\"Stock Assets\")": {
"account_type": "Stock"
},
"_(\"Tax Assets\")": {}
},
"_(\"Fixed Assets\")": {
"_(\"Capital Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Computers\")": {
"account_type": "Fixed Asset"
},
"_(\"Furniture and Fixture\")": {
"account_type": "Fixed Asset"
},
"_(\"Office Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Plant and Machinery\")": {
"account_type": "Fixed Asset"
}
},
"_(\"Investments\")": {},
"_(\"Temporary Accounts (Assets)\")": {
"_(\"Temporary Assets\")": {}
}
},
"_(\"Bank Accounts\")": {
"account_type": "Bank"
},
"_(\"Bank Overdraft Account\")": {},
"_(\"Capital Account\")": {
"_(\"Reserves and Surplus\")": {},
"_(\"Shareholders Funds\")": {}
},
"_(\"Capital Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Cash In Hand\")": {
"_(\"Cash\")": {
"account_type": "Cash"
},
"account_type": "Cash"
},
"_(\"Cash\")": {
"account_type": "Cash"
},
"_(\"Charity and Donations\")": {
"account_type": "Expense Account"
},
"_(\"Commission on Sales\")": {
"account_type": "Expense Account"
},
"_(\"Computers\")": {
"account_type": "Fixed Asset"
},
"_(\"Cost of Goods Sold\")": {
"account_type": "Expense Account"
},
"_(\"Creditors\")": {
"account_type": "Payable"
},
"_(\"Current Assets\")": {
"_(\"Accounts Receivable\")": {
"_(\"Debtors\")": {
"account_type": "Receivable"
}
},
"_(\"Bank Accounts\")": {
"account_type": "Bank"
},
"_(\"Cash In Hand\")": {
"_(\"Cash\")": {
"account_type": "Cash"
},
"account_type": "Cash"
},
"_(\"Loans and Advances (Assets)\")": {},
"_(\"Securities and Deposits\")": {
"_(\"Earnest Money\")": {}
},
"_(\"Stock Assets\")": {
"account_type": "Stock"
},
"_(\"Tax Assets\")": {}
},
"_(\"Current Liabilities\")": {},
"_(\"Debtors\")": {
"account_type": "Receivable"
},
"_(\"Depreciation\")": {
"account_type": "Expense Account"
},
"_(\"Direct Expenses\")": {
"_(\"Stock Expenses\")": {
"_(\"Cost of Goods Sold\")": {
"account_type": "Expense Account"
},
"_(\"Expenses Included In Valuation\")": {
"account_type": "Expenses Included In Valuation"
},
"_(\"Stock Adjustment\")": {
"account_type": "Stock Adjustment"
},
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"_(\"Direct Income\")": {
"_(\"Sales\")": {
"account_type": "Income Account"
},
"_(\"Service\")": {
"account_type": "Income Account"
},
"account_type": "Income Account"
},
"_(\"Duties and Taxes\")": {},
"_(\"Earnest Money\")": {},
"_(\"Entertainment Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Expenses Included In Valuation\")": {
"account_type": "Expenses Included In Valuation"
},
"_(\"Expenses\")": {
"_(\"Direct Expenses\")": {
"_(\"Stock Expenses\")": {
"_(\"Cost of Goods Sold\")": {
"account_type": "Expense Account"
},
"_(\"Expenses Included In Valuation\")": {
"account_type": "Expenses Included In Valuation"
},
"_(\"Stock Adjustment\")": {
"account_type": "Stock Adjustment"
},
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"_(\"Indirect Expenses\")": {
"_(\"Administrative Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Charity and Donations\")": {
"account_type": "Expense Account"
},
"_(\"Commission on Sales\")": {
"account_type": "Expense Account"
},
"_(\"Depreciation\")": {
"account_type": "Expense Account"
},
"_(\"Entertainment Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Freight and Forwarding Charges\")": {
"account_type": "Chargeable"
},
"_(\"Legal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Marketing Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Miscellaneous Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Office Maintenance Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Office Rent\")": {
"account_type": "Expense Account"
},
"_(\"Postal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Print and Stationary\")": {
"account_type": "Expense Account"
},
"_(\"Rounded Off\")": {
"account_type": "Expense Account"
},
"_(\"Salary\")": {
"account_type": "Expense Account"
},
"_(\"Sales Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Telephone Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Travel Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Utility Expenses\")": {
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"_(\"Fixed Assets\")": {
"_(\"Capital Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Computers\")": {
"account_type": "Fixed Asset"
},
"_(\"Furniture and Fixture\")": {
"account_type": "Fixed Asset"
},
"_(\"Office Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Plant and Machinery\")": {
"account_type": "Fixed Asset"
}
},
"_(\"Freight and Forwarding Charges\")": {
"account_type": "Chargeable"
},
"_(\"Furniture and Fixture\")": {
"account_type": "Fixed Asset"
},
"_(\"Income\")": {
"_(\"Direct Income\")": {
"_(\"Sales\")": {
"account_type": "Income Account"
},
"_(\"Service\")": {
"account_type": "Income Account"
},
"account_type": "Income Account"
},
"_(\"Indirect Income\")": {
"account_type": "Income Account"
}
},
"_(\"Indirect Expenses\")": {
"_(\"Administrative Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Charity and Donations\")": {
"account_type": "Expense Account"
},
"_(\"Commission on Sales\")": {
"account_type": "Expense Account"
},
"_(\"Depreciation\")": {
"account_type": "Expense Account"
},
"_(\"Entertainment Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Freight and Forwarding Charges\")": {
"account_type": "Chargeable"
},
"_(\"Legal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Marketing Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Miscellaneous Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Office Maintenance Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Office Rent\")": {
"account_type": "Expense Account"
},
"_(\"Postal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Print and Stationary\")": {
"account_type": "Expense Account"
},
"_(\"Rounded Off\")": {
"account_type": "Expense Account"
},
"_(\"Salary\")": {
"account_type": "Expense Account"
},
"_(\"Sales Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Telephone Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Travel Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Utility Expenses\")": {
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"_(\"Indirect Income\")": {
"account_type": "Income Account"
},
"_(\"Investments\")": {},
"_(\"Legal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Loans (Liabilities)\")": {},
"_(\"Loans and Advances (Assets)\")": {},
"_(\"Marketing Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Miscellaneous Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Office Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Office Maintenance Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Office Rent\")": {
"account_type": "Expense Account"
},
"_(\"Plant and Machinery\")": {
"account_type": "Fixed Asset"
},
"_(\"Postal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Print and Stationary\")": {
"account_type": "Expense Account"
},
"_(\"Reserves and Surplus\")": {},
"_(\"Rounded Off\")": {
"account_type": "Expense Account"
},
"_(\"Salary\")": {
"account_type": "Expense Account"
},
"_(\"Sales Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Sales\")": {
"account_type": "Income Account"
},
"_(\"Secured Loans\")": {},
"_(\"Securities and Deposits\")": {
"_(\"Earnest Money\")": {}
},
"_(\"Service\")": {
"account_type": "Income Account"
},
"_(\"Shareholders Funds\")": {},
"_(\"Source of Funds (Liabilities)\")": {
"_(\"Capital Account\")": {
"_(\"Reserves and Surplus\")": {},
"_(\"Shareholders Funds\")": {}
},
"_(\"Current Liabilities\")": {},
"_(\"Temporary Accounts (Liabilities)\")": {
"_(\"Temporary Liabilities\")": {}
}
},
"_(\"Stock Adjustment\")": {
"account_type": "Stock Adjustment"
},
"_(\"Stock Assets\")": {
"account_type": "Stock"
},
"_(\"Stock Expenses\")": {
"_(\"Cost of Goods Sold\")": {
"account_type": "Expense Account"
},
"_(\"Expenses Included In Valuation\")": {
"account_type": "Expenses Included In Valuation"
},
"_(\"Stock Adjustment\")": {
"account_type": "Stock Adjustment"
},
"account_type": "Expense Account"
},
"_(\"Stock Liabilities\")": {},
"_(\"Stock Received But Not Billed\")": {
"account_type": "Stock Received But Not Billed" "account_type": "Stock Received But Not Billed"
}, },
"_(\"Tax Assets\")": {},
"_(\"Telephone Expenses\")": {
"account_type": "Expense Account"
}, },
"_(\"Temporary Accounts (Assets)\")": { _("Duties and Taxes"): {
"_(\"Temporary Assets\")": {} "account_type": "Tax"
}, },
"_(\"Temporary Accounts (Liabilities)\")": { _("Loans (Liabilities)"): {
"_(\"Temporary Liabilities\")": {} _("Secured Loans"): {},
_("Unsecured Loans"): {},
_("Bank Overdraft Account"): {},
}, },
"_(\"Temporary Assets\")": {},
"_(\"Temporary Liabilities\")": {},
"_(\"Travel Expenses\")": {
"account_type": "Expense Account"
}, },
"_(\"Unsecured Loans\")": {}, _("Temporary Accounts (Liabilities)"): {
"_(\"Utility Expenses\")": { _("Temporary Liabilities"): {}
"account_type": "Expense Account"
}, },
"root": { "root_type": "Liability"
"_(\"Application of Funds (Assets)\")": {
"_(\"Current Assets\")": {
"_(\"Accounts Receivable\")": {
"_(\"Debtors\")": {
"account_type": "Receivable"
}
},
"_(\"Bank Accounts\")": {
"account_type": "Bank"
},
"_(\"Cash In Hand\")": {
"_(\"Cash\")": {
"account_type": "Cash"
},
"account_type": "Cash"
},
"_(\"Loans and Advances (Assets)\")": {},
"_(\"Securities and Deposits\")": {
"_(\"Earnest Money\")": {}
},
"_(\"Stock Assets\")": {
"account_type": "Stock"
},
"_(\"Tax Assets\")": {}
},
"_(\"Fixed Assets\")": {
"_(\"Capital Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Computers\")": {
"account_type": "Fixed Asset"
},
"_(\"Furniture and Fixture\")": {
"account_type": "Fixed Asset"
},
"_(\"Office Equipments\")": {
"account_type": "Fixed Asset"
},
"_(\"Plant and Machinery\")": {
"account_type": "Fixed Asset"
}
},
"_(\"Investments\")": {},
"_(\"Temporary Accounts (Assets)\")": {
"_(\"Temporary Assets\")": {}
}
},
"_(\"Expenses\")": {
"_(\"Direct Expenses\")": {
"_(\"Stock Expenses\")": {
"_(\"Cost of Goods Sold\")": {
"account_type": "Expense Account"
},
"_(\"Expenses Included In Valuation\")": {
"account_type": "Expenses Included In Valuation"
},
"_(\"Stock Adjustment\")": {
"account_type": "Stock Adjustment"
},
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"_(\"Indirect Expenses\")": {
"_(\"Administrative Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Charity and Donations\")": {
"account_type": "Expense Account"
},
"_(\"Commission on Sales\")": {
"account_type": "Expense Account"
},
"_(\"Depreciation\")": {
"account_type": "Expense Account"
},
"_(\"Entertainment Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Freight and Forwarding Charges\")": {
"account_type": "Chargeable"
},
"_(\"Legal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Marketing Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Miscellaneous Expenses\")": {
"account_type": "Chargeable"
},
"_(\"Office Maintenance Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Office Rent\")": {
"account_type": "Expense Account"
},
"_(\"Postal Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Print and Stationary\")": {
"account_type": "Expense Account"
},
"_(\"Rounded Off\")": {
"account_type": "Expense Account"
},
"_(\"Salary\")": {
"account_type": "Expense Account"
},
"_(\"Sales Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Telephone Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Travel Expenses\")": {
"account_type": "Expense Account"
},
"_(\"Utility Expenses\")": {
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"account_type": "Expense Account"
},
"_(\"Income\")": {
"_(\"Direct Income\")": {
"_(\"Sales\")": {
"account_type": "Income Account"
},
"_(\"Service\")": {
"account_type": "Income Account"
},
"account_type": "Income Account"
},
"_(\"Indirect Income\")": {
"account_type": "Income Account"
}
},
"_(\"Source of Funds (Liabilities)\")": {
"_(\"Capital Account\")": {
"_(\"Reserves and Surplus\")": {},
"_(\"Shareholders Funds\")": {}
},
"_(\"Current Liabilities\")": {},
"_(\"Temporary Accounts (Liabilities)\")": {
"_(\"Temporary Liabilities\")": {}
}
},
"root_type": "true"
} }
} }

View File

@ -49,8 +49,8 @@ class Company(Document):
.format(self.get(field), self.name)) .format(self.get(field), self.name))
def on_update(self): def on_update(self):
# if not frappe.db.sql("""select name from tabAccount if not frappe.db.sql("""select name from tabAccount
# where company=%s and docstatus<2 limit 1""", self.name): where company=%s and docstatus<2 limit 1""", self.name):
self.create_default_accounts() self.create_default_accounts()
self.create_default_warehouses() self.create_default_warehouses()
self.install_country_fixtures() self.install_country_fixtures()
@ -86,8 +86,6 @@ class Company(Document):
else: else:
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts
create_charts(self.chart_of_accounts, self.name) create_charts(self.chart_of_accounts, self.name)
# else:
# self.create_standard_accounts()
frappe.db.set(self, "default_receivable_account", frappe.db.get_value("Account", frappe.db.set(self, "default_receivable_account", frappe.db.get_value("Account",
{"company": self.name, "account_type": "Receivable"})) {"company": self.name, "account_type": "Receivable"}))
@ -191,92 +189,6 @@ class Company(Document):
frappe.defaults.clear_cache() frappe.defaults.clear_cache()
def create_standard_accounts(self):
self.fld_dict = {
'account_name': 0,
'parent_account': 1,
'group_or_ledger': 2,
'account_type': 3,
'report_type': 4,
'tax_rate': 5,
'root_type': 6
}
acc_list_common = [
[_('Application of Funds (Assets)'), None,'Group', None,'Balance Sheet', None, 'Asset'],
[_('Current Assets'),_('Application of Funds (Assets)'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Accounts Receivable'),_('Current Assets'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Debtors'), _('Accounts Receivable'),'Ledger', 'Receivable','Balance Sheet', None, 'Asset'],
[_('Bank Accounts'),_('Current Assets'),'Group','Bank','Balance Sheet', None, 'Asset'],
[_('Cash In Hand'),_('Current Assets'),'Group','Cash','Balance Sheet', None, 'Asset'],
[_('Cash'),_('Cash In Hand'),'Ledger','Cash','Balance Sheet', None, 'Asset'],
[_('Loans and Advances (Assets)'),_('Current Assets'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Securities and Deposits'),_('Current Assets'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Earnest Money'),_('Securities and Deposits'),'Ledger', None,'Balance Sheet', None, 'Asset'],
[_('Stock Assets'),_('Current Assets'),'Group','Stock','Balance Sheet', None, 'Asset'],
[_('Tax Assets'),_('Current Assets'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Fixed Assets'),_('Application of Funds (Assets)'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Capital Equipments'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet', None, 'Asset'],
[_('Computers'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet', None, 'Asset'],
[_('Furniture and Fixture'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet', None, 'Asset'],
[_('Office Equipments'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet', None, 'Asset'],
[_('Plant and Machinery'),_('Fixed Assets'),'Ledger','Fixed Asset','Balance Sheet', None, 'Asset'],
[_('Investments'),_('Application of Funds (Assets)'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Temporary Accounts (Assets)'),_('Application of Funds (Assets)'),'Group', None,'Balance Sheet', None, 'Asset'],
[_('Temporary Assets'),_('Temporary Accounts (Assets)'),'Ledger', None,'Balance Sheet', None, 'Asset'],
[_('Expenses'), None,'Group','Expense Account','Profit and Loss', None, 'Expense'],
[_('Direct Expenses'),_('Expenses'),'Group','Expense Account','Profit and Loss', None, 'Expense'],
[_('Stock Expenses'),_('Direct Expenses'),'Group','Expense Account','Profit and Loss', None, 'Expense'],
[_('Cost of Goods Sold'),_('Stock Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Stock Adjustment'),_('Stock Expenses'),'Ledger','Stock Adjustment','Profit and Loss', None, 'Expense'],
[_('Expenses Included In Valuation'), _("Stock Expenses"), 'Ledger', 'Expenses Included In Valuation', 'Profit and Loss', None, 'Expense'],
[_('Indirect Expenses'), _('Expenses'),'Group','Expense Account','Profit and Loss', None, 'Expense'],
[_('Marketing Expenses'), _('Indirect Expenses'),'Ledger','Chargeable','Profit and Loss', None, 'Expense'],
[_('Sales Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Administrative Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Charity and Donations'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Commission on Sales'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Travel Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Entertainment Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Depreciation'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Freight and Forwarding Charges'), _('Indirect Expenses'),'Ledger','Chargeable','Profit and Loss', None, 'Expense'],
[_('Legal Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Miscellaneous Expenses'), _('Indirect Expenses'),'Ledger','Chargeable','Profit and Loss', None, 'Expense'],
[_('Office Maintenance Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Office Rent'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Postal Expenses'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Print and Stationary'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Rounded Off'), _('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Salary') ,_('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Telephone Expenses') ,_('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Utility Expenses') ,_('Indirect Expenses'),'Ledger','Expense Account','Profit and Loss', None, 'Expense'],
[_('Income'), None,'Group', None,'Profit and Loss', None, 'Income'],
[_('Direct Income'),_('Income'),'Group','Income Account','Profit and Loss', None, 'Income'],
[_('Sales'),_('Direct Income'),'Ledger','Income Account','Profit and Loss', None, 'Income'],
[_('Service'),_('Direct Income'),'Ledger','Income Account','Profit and Loss', None, 'Income'],
[_('Indirect Income'),_('Income'),'Group','Income Account','Profit and Loss', None, 'Income'],
[_('Source of Funds (Liabilities)'), None,'Group', None,'Balance Sheet', None, 'Liability'],
[_('Capital Account'),_('Source of Funds (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Reserves and Surplus'),_('Capital Account'),'Ledger', None,'Balance Sheet', None, 'Liability'],
[_('Shareholders Funds'),_('Capital Account'),'Ledger', None,'Balance Sheet', None, 'Liability'],
[_('Current Liabilities'),_('Source of Funds (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Accounts Payable'),_('Current Liabilities'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Creditors'), _('Accounts Payable'),'Ledger', 'Payable','Balance Sheet', None, 'Liability'],
[_('Stock Liabilities'),_('Current Liabilities'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Stock Received But Not Billed'), _('Stock Liabilities'), 'Ledger', 'Stock Received But Not Billed', 'Balance Sheet', None, 'Liability'],
[_('Duties and Taxes'),_('Current Liabilities'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Loans (Liabilities)'),_('Current Liabilities'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Secured Loans'),_('Loans (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Unsecured Loans'),_('Loans (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Bank Overdraft Account'),_('Loans (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Temporary Accounts (Liabilities)'),_('Source of Funds (Liabilities)'),'Group', None,'Balance Sheet', None, 'Liability'],
[_('Temporary Liabilities'),_('Temporary Accounts (Liabilities)'),'Ledger', None,'Balance Sheet', None, 'Liability']
]
# load common account heads
for d in acc_list_common:
self.add_acc(d)
@frappe.whitelist() @frappe.whitelist()
def replace_abbr(company, old, new): def replace_abbr(company, old, new):
frappe.only_for("System Manager") frappe.only_for("System Manager")

View File

@ -4,7 +4,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe import _
def install(company): def install(company):
docs = [ docs = [
@ -18,65 +17,3 @@ def install(company):
frappe.get_doc(d).insert() frappe.get_doc(d).insert()
except frappe.NameError: except frappe.NameError:
pass pass
# accounts
# fld_dict = {
# 'account_name': 0,
# 'parent_account': 1,
# 'group_or_ledger': 2,
# 'account_type': 3,
# 'report_type': 4,
# 'tax_rate': 5,
# 'root_type': 6
# }
#
# acc_list_india = [
# [_('CENVAT Capital Goods'),_(_('Tax Assets')),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('CENVAT'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('CENVAT Service Tax'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('CENVAT Service Tax Cess 1'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('CENVAT Service Tax Cess 2'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('CENVAT Edu Cess'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('CENVAT SHE Cess'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('Excise Duty 4'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','4.00', 'Asset'],
# [_('Excise Duty 8'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','8.00', 'Asset'],
# [_('Excise Duty 10'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','10.00', 'Asset'],
# [_('Excise Duty 14'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','14.00', 'Asset'],
# [_('Excise Duty Edu Cess 2'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','2.00', 'Asset'],
# [_('Excise Duty SHE Cess 1'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','1.00', 'Asset'],
# [_('P L A'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('P L A - Cess Portion'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'],
# [_('Edu. Cess on Excise'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'],
# [_('Edu. Cess on Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'],
# [_('Edu. Cess on TDS'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'],
# [_('Excise Duty @ 4'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','4.00', 'Liability'],
# [_('Excise Duty @ 8'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','8.00', 'Liability'],
# [_('Excise Duty @ 10'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','10.00', 'Liability'],
# [_('Excise Duty @ 14'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','14.00', 'Liability'],
# [_('Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','10.3', 'Liability'],
# [_('SHE Cess on Excise'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'],
# [_('SHE Cess on Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'],
# [_('SHE Cess on TDS'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'],
# [_('Professional Tax'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('VAT'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('TDS (Advertisement)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('TDS (Commission)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('TDS (Contractor)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('TDS (Interest)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('TDS (Rent)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'],
# [_('TDS (Salary)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability']
# ]
#
# for lst in acc_list_india:
# account = frappe.get_doc({
# "doctype": "Account",
# "freeze_account": "No",
# "company": company.name
# })
#
# for d in fld_dict.keys():
# account.set(d, (d == 'parent_account' and lst[fld_dict[d]]) and lst[fld_dict[d]] +' - '+ company.abbr or lst[fld_dict[d]])
#
# account.insert()

View File

@ -285,10 +285,13 @@ def create_taxes(args):
tax_rate = (args.get("tax_rate_" + str(i)) or "").replace("%", "") tax_rate = (args.get("tax_rate_" + str(i)) or "").replace("%", "")
try: try:
tax_group = frappe.db.get_value("Account", {"company": args.get("company_name"),
"group_or_ledger": "Group", "account_type": "Tax", "root_type": "Liability"})
if tax_group:
frappe.get_doc({ frappe.get_doc({
"doctype":"Account", "doctype":"Account",
"company": args.get("company_name").strip(), "company": args.get("company_name").strip(),
"parent_account": _("Duties and Taxes") + " - " + args.get("company_abbr"), "parent_account": tax_group,
"account_name": args.get("tax_" + str(i)), "account_name": args.get("tax_" + str(i)),
"group_or_ledger": "Ledger", "group_or_ledger": "Ledger",
"report_type": "Balance Sheet", "report_type": "Balance Sheet",