default receivable / payable accounts in company
This commit is contained in:
parent
f09667884b
commit
98050e7646
@ -11,7 +11,6 @@ def execute():
|
||||
set_party_in_jv_and_gl_entry(receivable_payable_accounts)
|
||||
delete_individual_party_account()
|
||||
remove_customer_supplier_account_report()
|
||||
add_default_accounts_in_party(receivable_payable_accounts)
|
||||
|
||||
|
||||
def link_warehouse_account():
|
||||
@ -27,8 +26,8 @@ def create_receivable_payable_account():
|
||||
account.update(args)
|
||||
account.insert()
|
||||
|
||||
frappe.db.set_value("Company", args["company"],
|
||||
("receivables_group" if args["account_type"]=="Receivable" else "payables_group"), account.name)
|
||||
frappe.db.set_value("Company", args["company"], ("default_receivable_account"
|
||||
if args["account_type"]=="Receivable" else "default_payable_account"), account.name)
|
||||
|
||||
receivable_payable_accounts.setdefault(args["company"], {}).setdefault(args["account_type"], account.name)
|
||||
|
||||
@ -93,17 +92,3 @@ def delete_individual_party_account():
|
||||
def remove_customer_supplier_account_report():
|
||||
for d in ["Customer Account Head", "Supplier Account Head"]:
|
||||
frappe.delete_doc("Report", d)
|
||||
|
||||
def add_default_accounts_in_party(receivable_payable_accounts):
|
||||
for dt in ["Customer", "Supplier"]:
|
||||
for p in frappe.db.sql("""select name from `tab{0}` where docstatus < 2""".format(dt)):
|
||||
try:
|
||||
party = frappe.get_doc(dt, p[0])
|
||||
for company, accounts in receivable_payable_accounts.items():
|
||||
party.append("party_accounts", {
|
||||
"company": company,
|
||||
"account": accounts["Receivable" if dt == "Customer" else "Payable"]
|
||||
})
|
||||
party.save()
|
||||
except:
|
||||
pass
|
||||
|
@ -204,6 +204,7 @@ class Company(Document):
|
||||
[_('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'],
|
||||
@ -258,6 +259,7 @@ class Company(Document):
|
||||
[_('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'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user