More country charts imported from openerp

This commit is contained in:
Nabin Hait 2014-03-11 17:58:42 +05:30
parent 24e136e3f3
commit 037bf6b382
15 changed files with 19841 additions and 8899 deletions

View File

@ -440,6 +440,6 @@
}
],
"name": "Account Chart CA EN",
"parent_id": null
"parent_id": 0
}
}

View File

@ -8218,6 +8218,6 @@
}
],
"name": "Plan General Contable 2008",
"parent_id": ""
"parent_id": null
}
}

View File

@ -7,6 +7,7 @@ Import chart of accounts from OpenERP sources
from __future__ import unicode_literals
import os, json
import ast
from xml.etree import ElementTree as ET
from frappe.utils.datautils import read_csv_content
from frappe.utils import cstr
@ -21,37 +22,76 @@ all_account_types = []
def go():
global accounts, charts
# get default account types
default_types_root = ET.parse(os.path.join(path, "account", "data",
"data_account_type.xml")).getroot()
default_account_types = get_account_types([default_types_root], None, prefix="account")
default_account_types = get_default_account_types()
country_dirs = []
for basepath, folders, files in os.walk(path):
basename = os.path.basename(basepath)
if basename.startswith("l10n"):
accounts, charts = {}, {}
xml_roots = get_xml_roots(basepath, files)
csv_content = get_csv_contents(basepath, files)
prefix = basename if csv_content else None
account_types = get_account_types(xml_roots.get("account.account.type", []),
csv_content.get("account.account.type", []), prefix)
account_types.update(default_account_types)
if xml_roots:
make_maps_for_xml(xml_roots, account_types, basename)
make_account_trees()
if csv_content:
make_maps_for_csv(csv_content, account_types)
make_charts()
if basename.startswith("l10n_"):
country_dirs.append(basename)
for country_dir in country_dirs:
accounts, charts = {}, {}
country_path = os.path.join(path, country_dir)
manifest = ast.literal_eval(open(os.path.join(country_path, "__openerp__.py")).read())
data_files = manifest.get("data", []) + manifest.get("init_xml", []) + \
manifest.get("update_xml", [])
files_path = [os.path.join(country_path, d) for d in data_files]
xml_roots = get_xml_roots(files_path)
csv_content = get_csv_contents(files_path)
prefix = country_dir if csv_content else None
account_types = get_account_types(xml_roots.get("account.account.type", []),
csv_content.get("account.account.type", []), prefix)
account_types.update(default_account_types)
if xml_roots:
make_maps_for_xml(xml_roots, account_types, country_dir)
if csv_content:
make_maps_for_csv(csv_content, account_types, country_dir)
make_account_trees()
make_charts()
def get_default_account_types():
default_types_root = []
for file in ["data_account_type.xml"]:
default_types_root.append(ET.parse(os.path.join(path, "account", "data",
"data_account_type.xml")).getroot())
return get_account_types(default_types_root, None, prefix="account")
# def go_test():
# global accounts, charts
# # get default account types
# default_types_root = ET.parse(os.path.join(path, "account", "data",
# "data_account_type.xml")).getroot()
# default_account_types = get_account_types([default_types_root], None, prefix="account")
#
# for basepath, folders, files in os.walk(path):
# basename = os.path.basename(basepath)
# if basename.startswith("l10n_it"):
# print basepath, folders, files
# accounts, charts = {}, {}
# xml_roots = get_xml_roots(basepath, files)
# csv_content = get_csv_contents(basepath, files)
#
# prefix = basename if csv_content else None
# account_types = get_account_types(xml_roots.get("account.account.type", []),
# csv_content.get("account.account.type", []), prefix)
# account_types.update(default_account_types)
#
# if xml_roots:
# make_maps_for_xml(xml_roots, account_types, basename)
#
# if csv_content:
# make_maps_for_csv(csv_content, account_types)
#
# make_account_trees()
# make_charts()
def get_xml_roots(basepath, files):
def get_xml_roots(files_path):
xml_roots = frappe._dict()
for fname in files:
fname = cstr(fname)
filepath = os.path.join(basepath, fname)
for filepath in files_path:
fname = os.path.basename(filepath)
if fname.endswith(".xml"):
tree = ET.parse(filepath)
root = tree.getroot()
@ -62,12 +102,12 @@ def get_xml_roots(basepath, files):
break
return xml_roots
def get_csv_contents(basepath, files):
def get_csv_contents(files_path):
csv_content = {}
for fname in files:
fname = cstr(fname)
filepath = os.path.join(basepath, fname)
for file_type in ["account.account.template", "account.account.type"]:
for filepath in files_path:
fname = os.path.basename(filepath)
for file_type in ["account.account.template", "account.account.type",
"account.chart.template"]:
if fname.startswith(file_type) and fname.endswith(".csv"):
with open(filepath, "r") as csvfile:
try:
@ -128,7 +168,7 @@ def get_account_types(root_list, csv_content, prefix=None):
types[node_id] = data
return types
def make_maps_for_xml(xml_roots, account_types, folder):
def make_maps_for_xml(xml_roots, account_types, country_dir):
"""make maps for `charts` and `accounts`"""
for model, root_list in xml_roots.iteritems():
for root in root_list:
@ -139,15 +179,17 @@ def make_maps_for_xml(xml_roots, account_types, folder):
if field.get("name")=="name":
data["name"] = field.text
if field.get("name")=="parent_id":
data["parent_id"] = field.get("ref")
parent_id = field.get("ref") or field.get("eval")
data["parent_id"] = parent_id
if field.get("name")=="user_type":
value = field.get("ref")
if account_types.get(value, {}).get("root_type"):
data["root_type"] = account_types[value]["root_type"]
else:
if "asset" in value: data["root_type"] = "Asset"
elif "liability" in value: data["root_type"] = "Liability"
elif ("liability" in value or "equity" in value):
data["root_type"] = "Liability"
elif "income" in value: data["root_type"] = "Income"
elif "expense" in value: data["root_type"] = "Expense"
@ -155,7 +197,7 @@ def make_maps_for_xml(xml_roots, account_types, folder):
data["account_type"] = account_types[value]["account_type"]
if data["account_type"] not in all_account_types:
all_account_types.append(data["account_type"])
data["children"] = []
accounts[node.get("id")] = data
@ -166,46 +208,60 @@ def make_maps_for_xml(xml_roots, account_types, folder):
data["name"] = field.text
if field.get("name")=="account_root_id":
data["account_root_id"] = field.get("ref")
data["id"] = folder
data["id"] = country_dir
charts.setdefault(node.get("id"), {}).update(data)
def make_account_trees():
"""build tree hierarchy"""
for id in accounts.keys():
account = accounts[id]
if account.get("parent_id") and accounts[account["parent_id"]]:
accounts[account["parent_id"]]["children"].append(account)
del account["parent_id"]
if account.get("parent_id"):
if accounts.get(account["parent_id"]):
accounts[account["parent_id"]]["children"].append(account)
del account["parent_id"]
else:
print account.get("name")
del accounts[id]
# remove empty children
for id in accounts.keys():
if "children" in accounts[id] and not accounts[id].get("children"):
del accounts[id]["children"]
def make_maps_for_csv(csv_content, account_types):
for content in csv_content.get("account.account.template"):
if content[0][0]=="id":
for row in content[1:]:
data = dict(zip(content[0], row))
def make_maps_for_csv(csv_content, account_types, country_dir):
for content in csv_content.get("account.account.template", []):
for row in content[1:]:
data = dict(zip(content[0], row))
account = {
"name": data.get("name"),
"parent_id": data.get("parent_id:id") or data.get("parent_id/id"),
"children": []
}
user_type = data.get("user_type/id") or data.get("user_type:id")
if account_types.get(user_type, {}).get("root_type"):
account["root_type"] = account_types[user_type]["root_type"]
account = {
if account_types.get(user_type, {}).get("account_type"):
account["account_type"] = account_types[user_type]["account_type"]
if account["account_type"] not in all_account_types:
all_account_types.append(account["account_type"])
accounts[data.get("id")] = account
if not account.get("parent_id") and data.get("chart_template_id:id"):
chart_id = data.get("chart_template_id:id")
charts.setdefault(chart_id, {}).update({"account_root_id": data.get("id")})
for content in csv_content.get("account.chart.template", []):
for row in content[1:]:
if row:
data = dict(zip(content[0], row))
charts.setdefault(data.get("id"), {}).update({
"account_root_id": data.get("account_root_id:id") or \
data.get("account_root_id/id"),
"name": data.get("name"),
"parent_id": data.get("parent_id:id") or data.get("parent_id/id"),
"children": []
}
user_type = data.get("user_type/id") or data.get("user_type:id")
if account_types.get(user_type, {}).get("root_type"):
account["root_type"] = account_types[user_type]["root_type"]
if account_types.get(user_type, {}).get("account_type"):
account["account_type"] = account_types[user_type]["account_type"]
if account["account_type"] not in all_account_types:
all_account_types.append(account["account_type"])
accounts[data.get("id")] = account
if not account.get("parent_id") and data.get("chart_template_id:id"):
chart_id = data.get("chart_template_id:id")
charts.setdefault(chart_id, {}).update({"account_root_id": data.get("id")})
"id": country_dir
})
def make_charts():
"""write chart files in app/setup/doctype/company/charts"""

View File

@ -10,14 +10,6 @@
"name": "Mortgage Loan Payable",
"root_type": "Liability"
},
{
"name": "Owner's Equity Accounts",
"root_type": "Liability"
},
{
"name": "Unearned Revenues",
"root_type": "Liability"
},
{
"name": "Interest Payable",
"root_type": "Liability"
@ -26,6 +18,10 @@
"name": "Wages Payable",
"root_type": "Liability"
},
{
"name": "Owner's Equity Accounts",
"root_type": "Liability"
},
{
"name": "Notes Payable",
"root_type": "Liability"
@ -57,6 +53,10 @@
"name": "Accounts Payable",
"root_type": "Liability"
},
{
"name": "Unearned Revenues",
"root_type": "Liability"
},
{
"name": "Reserve and Surplus Account",
"root_type": "Liability"
@ -67,6 +67,10 @@
},
{
"children": [
{
"name": "Buildings",
"root_type": "Asset"
},
{
"name": "Supplies",
"root_type": "Asset"
@ -101,10 +105,6 @@
"name": "Prepaid Insurance",
"root_type": "Asset"
},
{
"name": "Buildings",
"root_type": "Asset"
},
{
"name": "Accumulated Depreciation - Buildings",
"root_type": "Asset"

View File

@ -46,6 +46,10 @@
"children": [
{
"children": [
{
"name": "Payroll Dept. Payroll Taxes",
"root_type": "Expense"
},
{
"name": "Payroll Dept. Supplies",
"root_type": "Expense"
@ -54,10 +58,6 @@
"name": "Payroll Dept. Telephone",
"root_type": "Expense"
},
{
"name": "Payroll Dept. Payroll Taxes",
"root_type": "Expense"
},
{
"name": "Payroll Dept. Salaries",
"root_type": "Expense"
@ -66,28 +66,6 @@
"name": "Payroll Dept. Expenses",
"root_type": "Expense"
},
{
"children": [
{
"name": "COGS - Division #2, Product Line 015",
"root_type": "Expense"
},
{
"name": "COGS - Division #1, Product Line 022",
"root_type": "Expense"
},
{
"name": "COGS - Division #3, Product Line 110",
"root_type": "Expense"
},
{
"name": "COGS - Division #1, Product Line 010",
"root_type": "Expense"
}
],
"name": "Cost of Goods Sold",
"root_type": "Expense"
},
{
"children": [
{
@ -110,6 +88,28 @@
"name": "Marketing Expenses",
"root_type": "Expense"
},
{
"children": [
{
"name": "COGS - Division #1, Product Line 022",
"root_type": "Expense"
},
{
"name": "COGS - Division #2, Product Line 015",
"root_type": "Expense"
},
{
"name": "COGS - Division #3, Product Line 110",
"root_type": "Expense"
},
{
"name": "COGS - Division #1, Product Line 010",
"root_type": "Expense"
}
],
"name": "Cost of Goods Sold",
"root_type": "Expense"
},
{
"children": [
{
@ -153,11 +153,11 @@
"root_type": "Asset"
},
{
"name": "Supplies",
"name": "Tax Receivable",
"root_type": "Asset"
},
{
"name": "Tax Receivable",
"name": "Supplies",
"root_type": "Asset"
},
{

View File

@ -3,9 +3,994 @@
"root": {
"children": [
{
"name": "CUENTAS DE ORDEN"
"children": [
{
"children": [
{
"name": "canoni di leasing",
"root_type": "Expense"
},
{
"name": "fitti passivi",
"root_type": "Expense"
}
],
"name": "COSTI PER GODIMENTO BENI DI TERZI"
},
{
"children": [
{
"name": "merci c/rimanenze finali",
"root_type": "Expense"
},
{
"name": "materie di consumo c/rimanenze finali",
"root_type": "Expense"
},
{
"name": "materie di consumo c/esistenze iniziali",
"root_type": "Expense"
},
{
"name": "merci c/esistenze iniziali",
"root_type": "Expense"
},
{
"name": "premi su acquisti",
"root_type": "Expense"
},
{
"name": "resi su acquisti",
"root_type": "Expense"
},
{
"name": "ribassi e abbuoni attivi",
"root_type": "Expense"
},
{
"name": "merci c/acquisti",
"root_type": "Expense"
},
{
"name": "materie di consumo c/acquisti",
"root_type": "Expense"
},
{
"name": "merci c/apporti",
"root_type": "Expense"
}
],
"name": "COSTO DEL VENDUTO"
},
{
"children": [
{
"children": [
{
"name": "accantonamento per spese future",
"root_type": "Expense"
},
{
"name": "accantonamento per manutenzioni programmate",
"root_type": "Expense"
}
],
"name": "ALTRI ACCANTONAMENTI"
},
{
"children": [
{
"name": "accantonamento per responsabilit\u00e0 civile",
"root_type": "Expense"
}
],
"name": "ACCANTONAMENTI PER RISCHI"
}
],
"name": "ACCANTONAMENTI"
},
{
"children": [
{
"name": "oneri fiscali diversi",
"root_type": "Expense"
},
{
"name": "oneri vari",
"root_type": "Expense"
},
{
"name": "arrotondamenti passivi",
"root_type": "Expense"
},
{
"name": "sopravvenienze passive ordinarie diverse",
"root_type": "Expense"
},
{
"name": "perdite su crediti",
"root_type": "Expense"
},
{
"name": "minusvalenze ordinarie diverse",
"root_type": "Expense"
},
{
"name": "insussistenze passive ordinarie diverse",
"root_type": "Expense"
}
],
"name": "ONERI DIVERSI"
},
{
"children": [
{
"name": "ammortamento fabbricati",
"root_type": "Expense"
},
{
"name": "ammortamento imballaggi durevoli",
"root_type": "Expense"
},
{
"name": "ammortamento arredamento",
"root_type": "Expense"
},
{
"name": "ammortamento automezzi",
"root_type": "Expense"
},
{
"name": "ammortamento attrezzature commerciali",
"root_type": "Expense"
},
{
"name": "ammortamento macchine d'ufficio",
"root_type": "Expense"
},
{
"name": "ammortamento impianti e macchinari",
"root_type": "Expense"
}
],
"name": "AMMORTAMENTI IMMOBILIZZAZIONI MATERIALI"
},
{
"children": [
{
"name": "altri costi per il personale",
"root_type": "Expense"
},
{
"name": "oneri sociali",
"root_type": "Expense"
},
{
"name": "salari e stipendi",
"root_type": "Expense"
},
{
"name": "TFRL",
"root_type": "Expense"
}
],
"name": "COSTI PER IL PERSONALE"
},
{
"children": [
{
"name": "ammortamento software",
"root_type": "Expense"
},
{
"name": "ammortamento costi di impianto",
"root_type": "Expense"
},
{
"name": "ammortamento avviamento",
"root_type": "Expense"
}
],
"name": "AMMORTAMENTI IMMOBILIZZAZIONI IMMATERIALI"
},
{
"children": [
{
"name": "costi di vigilanza",
"root_type": "Expense"
},
{
"name": "costi per i locali",
"root_type": "Expense"
},
{
"name": "costi per energia",
"root_type": "Expense"
},
{
"name": "costi di pubblicit\u00e0",
"root_type": "Expense"
},
{
"name": "costi di trasporto",
"root_type": "Expense"
},
{
"name": "costi postali",
"root_type": "Expense"
},
{
"name": "spese di incasso",
"root_type": "Expense"
},
{
"name": "provvigioni passive",
"root_type": "Expense"
},
{
"name": "costi di manutenzione e riparazione",
"root_type": "Expense"
},
{
"name": "costi di assicurazione",
"root_type": "Expense"
},
{
"name": "costi telefonici",
"root_type": "Expense"
},
{
"name": "costi di consulenze",
"root_type": "Expense"
},
{
"name": "costi di esercizio automezzi",
"root_type": "Expense"
}
],
"name": "COSTI PER SERVIZI"
},
{
"children": [
{
"name": "svalutazioni immobilizzazioni materiali",
"root_type": "Expense"
},
{
"name": "svalutazioni immobilizzazioni immateriali",
"root_type": "Expense"
},
{
"name": "svalutazione crediti",
"root_type": "Expense"
}
],
"name": "SVALUTAZIONI"
}
],
"name": "COSTI DELLA PRODUZIONE"
},
{
"children": [
{
"name": "imposte dell'esercizio",
"root_type": "Expense"
}
],
"name": "IMPOSTE DELL'ESERCIZIO"
},
{
"children": [
{
"children": [
{
"name": "banche c/sovvenzioni",
"root_type": "Liability"
},
{
"name": "mutui passivi",
"root_type": "Liability"
},
{
"name": "debiti v/altri finanziatori",
"root_type": "Liability"
},
{
"name": "banche c/c passivi",
"root_type": "Liability"
},
{
"name": "banche c/RIBA all'incasso",
"root_type": "Liability"
},
{
"name": "banche c/anticipi su fatture",
"root_type": "Liability"
},
{
"name": "banche c/cambiali all'incasso",
"root_type": "Liability"
}
],
"name": "DEBITI FINANZIARI"
},
{
"children": [
{
"name": "debiti per imposte",
"root_type": "Liability"
},
{
"account_type": "Payable",
"name": "erario c/IVA",
"root_type": "Liability"
},
{
"name": "IVA n/debito",
"root_type": "Liability"
},
{
"account_type": "Payable",
"name": "debiti per ritenute da versare",
"root_type": "Liability"
},
{
"name": "debiti per cauzioni",
"root_type": "Liability"
},
{
"name": "personale c/retribuzioni",
"root_type": "Liability"
},
{
"name": "clienti c/cessione",
"root_type": "Liability"
},
{
"name": "debiti v/istituti previdenziali",
"root_type": "Liability"
},
{
"name": "personale c/liquidazioni",
"root_type": "Liability"
},
{
"account_type": "Payable",
"name": "creditori diversi",
"root_type": "Liability"
}
],
"name": "DEBITI DIVERSI"
},
{
"children": [
{
"name": "ratei passivi",
"root_type": "Liability"
},
{
"name": "risconti passivi",
"root_type": "Liability"
}
],
"name": "RATEI E RISCONTI PASSIVI"
},
{
"children": [
{
"name": "perdita d'esercizio",
"root_type": "Liability"
},
{
"name": "utile d'esercizio",
"root_type": "Liability"
},
{
"name": "patrimonio netto",
"root_type": "Liability"
},
{
"name": "titolare c/ritenute subite",
"root_type": "Liability"
},
{
"name": "prelevamenti extra gestione",
"root_type": "Liability"
}
],
"name": "PATRIMONIO NETTO"
},
{
"children": [
{
"name": "debiti per TFRL",
"root_type": "Liability"
}
],
"name": "TRATTAMENTO FINE RAPPORTO DI LAVORO"
},
{
"children": [
{
"name": "banca ... c/c",
"root_type": "Liability"
},
{
"name": "banca ... c/c",
"root_type": "Liability"
},
{
"name": "banca ... c/c",
"root_type": "Liability"
},
{
"name": "bilancio di chiusura",
"root_type": "Liability"
},
{
"name": "bilancio di apertura",
"root_type": "Liability"
},
{
"name": "istituti previdenziali",
"root_type": "Liability"
},
{
"name": "IVA c/liquidazioni",
"root_type": "Liability"
}
],
"name": "CONTI TRANSITORI E DIVERSI"
},
{
"children": [
{
"name": "merci da ricevere",
"root_type": "Liability"
},
{
"name": "fornitori c/impegni",
"root_type": "Liability"
},
{
"name": "impegni per beni in leasing",
"root_type": "Liability"
},
{
"name": "creditori c/leasing",
"root_type": "Liability"
},
{
"name": "clienti c/impegni",
"root_type": "Liability"
},
{
"name": "merci da consegnare",
"root_type": "Liability"
},
{
"name": "creditori per fideiussioni",
"root_type": "Liability"
},
{
"name": "depositanti beni",
"root_type": "Liability"
},
{
"name": "beni di terzi",
"root_type": "Liability"
},
{
"name": "creditori per avalli",
"root_type": "Liability"
},
{
"name": "rischi per avalli",
"root_type": "Liability"
},
{
"name": "rischi per effetti scontati",
"root_type": "Liability"
},
{
"name": "banche c/effetti scontati",
"root_type": "Liability"
},
{
"name": "rischi per fideiussioni",
"root_type": "Liability"
}
],
"name": "CONTI DEI SISTEMI SUPPLEMENTARI"
},
{
"children": [
{
"name": "fatture da ricevere",
"root_type": "Liability"
},
{
"name": "debiti da liquidare",
"root_type": "Liability"
},
{
"name": "cambiali passive",
"root_type": "Liability"
},
{
"account_type": "Payable",
"name": "debiti v/fornitori",
"root_type": "Liability"
},
{
"account_type": "Payable",
"name": "clienti c/acconti",
"root_type": "Liability"
}
],
"name": "DEBITI COMMERCIALI"
},
{
"children": [
{
"name": "fondo per imposte",
"root_type": "Liability"
},
{
"name": "fondo responsabilit\u00e0 civile",
"root_type": "Liability"
},
{
"name": "fondo spese future",
"root_type": "Liability"
},
{
"name": "fondo manutenzioni programmate",
"root_type": "Liability"
}
],
"name": "FONDI PER RISCHI E ONERI"
}
],
"name": "PASSIVO"
},
{
"children": [
{
"children": [
{
"name": "arrotondamenti attivi",
"root_type": "Income"
},
{
"name": "proventi vari",
"root_type": "Income"
},
{
"name": "insussistenze attive ordinarie diverse",
"root_type": "Income"
},
{
"name": "plusvalenze ordinarie diverse",
"root_type": "Income"
},
{
"name": "fitti attivi",
"root_type": "Income"
},
{
"name": "sopravvenienze attive ordinarie diverse",
"root_type": "Income"
}
],
"name": "RICAVI E PROVENTI DIVERSI"
},
{
"children": [
{
"name": "ribassi e abbuoni passivi",
"root_type": "Income"
},
{
"name": "merci c/vendite",
"root_type": "Income"
},
{
"name": "rimborsi spese di vendita",
"root_type": "Income"
},
{
"name": "premi su vendite",
"root_type": "Income"
},
{
"name": "resi su vendite",
"root_type": "Income"
}
],
"name": "VENDITE E PRESTAZIONI"
}
],
"name": "VALORE DELLA PRODUZIONE"
},
{
"children": [
{
"children": [
{
"name": "sopravvenienze passive straordinarie",
"root_type": "Expense"
},
{
"name": "imposte esercizi precedenti",
"root_type": "Expense"
},
{
"name": "insussistenze passive straordinarie",
"root_type": "Expense"
},
{
"name": "minusvalenze straordinarie",
"root_type": "Expense"
}
],
"name": "ONERI STRAORDINARI"
},
{
"children": [
{
"name": "insussistenze attive straordinarie",
"root_type": "Income"
},
{
"name": "sopravvenienze attive straordinarie",
"root_type": "Income"
},
{
"name": "plusvalenze straordinarie",
"root_type": "Income"
}
],
"name": "PROVENTI STRAORDINARI"
}
],
"name": "PROVENTI E ONERI STRAORDINARI"
},
{
"children": [
{
"children": [
{
"name": "mutui attivi",
"root_type": "Asset"
}
],
"name": "IMMOBILIZZAZIONI FINANZIARIE"
},
{
"children": [
{
"name": "fornitori immobilizzazioni c/acconti",
"root_type": "Asset"
},
{
"name": "fondo ammortamento impianti e macchinari",
"root_type": "Asset"
},
{
"name": "fondo ammortamento fabbricati",
"root_type": "Asset"
},
{
"name": "fondo ammortamento arredamento",
"root_type": "Asset"
},
{
"name": "fondo ammortamento automezzi",
"root_type": "Asset"
},
{
"name": "fondo ammortamento attrezzature commerciali",
"root_type": "Asset"
},
{
"name": "fondo ammortamento macchine d'ufficio",
"root_type": "Asset"
},
{
"name": "fondo ammortamento imballaggi durevoli",
"root_type": "Asset"
},
{
"name": "imballaggi durevoli",
"root_type": "Asset"
},
{
"name": "macchine d'ufficio",
"root_type": "Asset"
},
{
"name": "attrezzature commerciali",
"root_type": "Asset"
},
{
"name": "automezzi",
"root_type": "Asset"
},
{
"name": "arredamento",
"root_type": "Asset"
},
{
"name": "fabbricati",
"root_type": "Asset"
},
{
"name": "impianti e macchinari",
"root_type": "Asset"
}
],
"name": "IMMOBILIZZAZIONI MATERIALI"
},
{
"children": [
{
"name": "fondo ammortamento costi di impianto",
"root_type": "Asset"
},
{
"name": "avviamento",
"root_type": "Asset"
},
{
"name": "software",
"root_type": "Asset"
},
{
"name": "costi di impianto",
"root_type": "Asset"
},
{
"name": "fondo ammortamento software",
"root_type": "Asset"
},
{
"name": "fondo ammortamento avviamento",
"root_type": "Asset"
}
],
"name": "IMMOBILIZZAZIONI IMMATERIALI"
},
{
"children": [
{
"name": "fondo svalutazione crediti",
"root_type": "Asset"
},
{
"name": "fondo rischi su crediti",
"root_type": "Asset"
},
{
"name": "crediti da liquidare",
"root_type": "Asset"
},
{
"name": "crediti commerciali diversi",
"root_type": "Asset"
},
{
"account_type": "Receivable",
"name": "clienti c/spese anticipate",
"root_type": "Asset"
},
{
"account_type": "Receivable",
"name": "crediti v/clienti",
"root_type": "Asset"
},
{
"name": "cambiali allo sconto",
"root_type": "Asset"
},
{
"name": "cambiali all'incasso",
"root_type": "Asset"
},
{
"name": "cambiali attive",
"root_type": "Asset"
},
{
"name": "fatture da emettere",
"root_type": "Asset"
},
{
"name": "cambiali insolute",
"root_type": "Asset"
},
{
"name": "crediti insoluti",
"root_type": "Asset"
}
],
"name": "CREDITI COMMERCIALI"
},
{
"children": [
{
"name": "fornitori c/acconti",
"root_type": "Asset"
},
{
"name": "materie di consumo",
"root_type": "Asset"
},
{
"name": "merci",
"root_type": "Asset"
}
],
"name": "RIMANENZE"
},
{
"children": [
{
"name": "crediti v/istituti previdenziali",
"root_type": "Asset"
},
{
"account_type": "Receivable",
"name": "debitori diversi",
"root_type": "Asset"
},
{
"name": "personale c/acconti",
"root_type": "Asset"
},
{
"name": "crediti per cauzioni",
"root_type": "Asset"
},
{
"name": "crediti per ritenute subite",
"root_type": "Asset"
},
{
"name": "crediti per imposte",
"root_type": "Asset"
},
{
"name": "IVA n/credito",
"root_type": "Asset"
},
{
"name": "IVA c/acconto",
"root_type": "Asset"
},
{
"name": "crediti per IVA",
"root_type": "Asset"
},
{
"name": "imposte c/acconto",
"root_type": "Asset"
}
],
"name": "CREDITI DIVERSI"
},
{
"children": [
{
"name": "risconti attivi",
"root_type": "Asset"
},
{
"name": "ratei attivi",
"root_type": "Asset"
}
],
"name": "RATEI E RISCONTI ATTIVI"
},
{
"children": [
{
"account_type": "Bank or Cash",
"name": "assegni",
"root_type": "Asset"
},
{
"account_type": "Bank or Cash",
"name": "denaro in cassa",
"root_type": "Asset"
},
{
"account_type": "Bank or Cash",
"name": "valori bollati",
"root_type": "Asset"
},
{
"account_type": "Bank or Cash",
"name": "c/c postali",
"root_type": "Asset"
},
{
"account_type": "Bank or Cash",
"name": "banche c/c",
"root_type": "Asset"
}
],
"name": "DISPONIBILIT\u00c0 LIQUIDE"
}
],
"name": "ATTIVO"
},
{
"children": [
{
"children": [
{
"name": "proventi finanziari diversi",
"root_type": "Income"
},
{
"name": "interessi attivi v/clienti",
"root_type": "Income"
},
{
"name": "interessi attivi bancari",
"root_type": "Income"
},
{
"name": "interessi attivi postali",
"root_type": "Income"
}
],
"name": "PROVENTI FINANZIARI"
},
{
"children": [
{
"name": "oneri finanziari diversi",
"root_type": "Expense"
},
{
"name": "interessi passivi bancari",
"root_type": "Expense"
},
{
"name": "interessi passivi su mutui",
"root_type": "Expense"
},
{
"name": "interessi passivi v/fornitori",
"root_type": "Expense"
},
{
"name": "sconti passivi bancari",
"root_type": "Expense"
}
],
"name": "ONERI FINANZIARI"
}
],
"name": "PROVENTI E ONERI FINANZIARI"
},
{
"children": [
{
"name": "stato patrimoniale",
"root_type": "Expense"
},
{
"name": "conto di risultato economico",
"root_type": "Expense"
}
],
"name": "CONTI DI RISULTATO"
}
],
"name": "PLAN DE CTAS. ECUADOR"
"name": "Azienda",
"parent_id": null
}
}

View File

@ -2726,42 +2726,54 @@
{
"children": [
{
"name": "AUTRES SUBVENTIONS D'INVESTISSEMENT"
"name": "AUTRES SUBVENTIONS D'INVESTISSEMENT",
"root_type": "Liability"
},
{
"children": [
{
"name": "Autres"
"name": "Autres",
"root_type": "Liability"
},
{
"name": "\u00c9tat"
"name": "\u00c9tat",
"root_type": "Liability"
},
{
"name": "D\u00e9partements"
"name": "D\u00e9partements",
"root_type": "Liability"
},
{
"name": "R\u00e9gions"
"name": "R\u00e9gions",
"root_type": "Liability"
},
{
"name": "Entreprises publiques ou mixtes"
"name": "Entreprises publiques ou mixtes",
"root_type": "Liability"
},
{
"name": "Communes et collectivit\u00e9s publiques d\u00e9centralis\u00e9es"
"name": "Communes et collectivit\u00e9s publiques d\u00e9centralis\u00e9es",
"root_type": "Liability"
},
{
"name": "Organismes internationaux"
"name": "Organismes internationaux",
"root_type": "Liability"
},
{
"name": "Entreprises et organismes priv\u00e9s"
"name": "Entreprises et organismes priv\u00e9s",
"root_type": "Liability"
}
],
"name": "SUBVENTIONS D'\u00c9QUIPEMENT A"
"name": "SUBVENTIONS D'\u00c9QUIPEMENT A",
"root_type": "Liability"
},
{
"name": "SUBVENTIONS D'\u00c9QUIPEMENT B"
"name": "SUBVENTIONS D'\u00c9QUIPEMENT B",
"root_type": "Liability"
}
],
"name": "SUBVENTIONS D'INVESTISSEMENT"
"name": "SUBVENTIONS D'INVESTISSEMENT",
"root_type": "Liability"
},
{
"children": [
@ -2952,204 +2964,262 @@
{
"children": [
{
"name": "ACTIONNAIRES, CAPITAL SOUSCRIT, NON APPEL\u00c9"
"name": "ACTIONNAIRES, CAPITAL SOUSCRIT, NON APPEL\u00c9",
"root_type": "Liability"
},
{
"children": [
{
"name": "Capital souscrit, appel\u00e9, vers\u00e9, amorti"
"name": "Capital souscrit, appel\u00e9, vers\u00e9, amorti",
"root_type": "Liability"
},
{
"name": "Capital souscrit, non appel\u00e9"
"name": "Capital souscrit, non appel\u00e9",
"root_type": "Liability"
},
{
"name": "Capital souscrit, appel\u00e9, vers\u00e9, non amorti"
"name": "Capital souscrit, appel\u00e9, vers\u00e9, non amorti",
"root_type": "Liability"
},
{
"name": "Capital souscrit, appel\u00e9, non vers\u00e9"
"name": "Capital souscrit, appel\u00e9, non vers\u00e9",
"root_type": "Liability"
},
{
"name": "Capital souscrit soumis \u00e0 des conditions particuli\u00e8res"
"name": "Capital souscrit soumis \u00e0 des conditions particuli\u00e8res",
"root_type": "Liability"
}
],
"name": "CAPITAL SOCIAL"
"name": "CAPITAL SOCIAL",
"root_type": "Liability"
},
{
"name": "CAPITAL PERSONNEL"
"name": "CAPITAL PERSONNEL",
"root_type": "Liability"
},
{
"children": [
{
"name": "Autres dotations"
"name": "Autres dotations",
"root_type": "Liability"
},
{
"name": "Dotation initiale"
"name": "Dotation initiale",
"root_type": "Liability"
},
{
"name": "Dotations compl\u00e9mentaires"
"name": "Dotations compl\u00e9mentaires",
"root_type": "Liability"
}
],
"name": "CAPITAL PAR DOTATION"
"name": "CAPITAL PAR DOTATION",
"root_type": "Liability"
},
{
"children": [
{
"name": "Autres primes"
"name": "Autres primes",
"root_type": "Liability"
},
{
"name": "Primes d'\u00e9mission"
"name": "Primes d'\u00e9mission",
"root_type": "Liability"
},
{
"name": "Primes de fusion"
"name": "Primes de fusion",
"root_type": "Liability"
},
{
"name": "Primes d'apport"
"name": "Primes d'apport",
"root_type": "Liability"
},
{
"name": "Primes de conversion"
"name": "Primes de conversion",
"root_type": "Liability"
}
],
"name": "PRIMES LI\u00c9ES AUX CAPITAUX PROPRES"
"name": "PRIMES LI\u00c9ES AUX CAPITAUX PROPRES",
"root_type": "Liability"
},
{
"children": [
{
"name": "Pr\u00e9l\u00e8vements d\u2019autoconsommation"
"name": "Pr\u00e9l\u00e8vements d\u2019autoconsommation",
"root_type": "Liability"
},
{
"name": "Op\u00e9rations courantes"
"name": "Op\u00e9rations courantes",
"root_type": "Liability"
},
{
"name": "R\u00e9mun\u00e9rations, imp\u00f4ts et autres charges personnelles"
"name": "R\u00e9mun\u00e9rations, imp\u00f4ts et autres charges personnelles",
"root_type": "Liability"
},
{
"name": "Apports temporaires"
"name": "Apports temporaires",
"root_type": "Liability"
},
{
"name": "Autres pr\u00e9l\u00e8vements"
"name": "Autres pr\u00e9l\u00e8vements",
"root_type": "Liability"
}
],
"name": "COMPTE DE L'EXPLOITANT"
"name": "COMPTE DE L'EXPLOITANT",
"root_type": "Liability"
},
{
"children": [
{
"name": "\u00c9carts de r\u00e9\u00e9valuation l\u00e9gale"
"name": "\u00c9carts de r\u00e9\u00e9valuation l\u00e9gale",
"root_type": "Liability"
},
{
"name": "\u00c9carts de r\u00e9\u00e9valuation libre"
"name": "\u00c9carts de r\u00e9\u00e9valuation libre",
"root_type": "Liability"
}
],
"name": "\u00c9CARTS DE R\u00c9\u00c9VALUATION"
"name": "\u00c9CARTS DE R\u00c9\u00c9VALUATION",
"root_type": "Liability"
}
],
"name": "CAPITAL"
"name": "CAPITAL",
"root_type": "Liability"
},
{
"children": [
{
"name": "R\u00c9SERVES STATUTAIRES OU CONTRACTUELLES"
"name": "R\u00c9SERVES STATUTAIRES OU CONTRACTUELLES",
"root_type": "Liability"
},
{
"name": "R\u00c9SERVE L\u00c9GALE"
"name": "R\u00c9SERVE L\u00c9GALE",
"root_type": "Liability"
},
{
"children": [
{
"name": "R\u00e9serves facultatives"
"name": "R\u00e9serves facultatives",
"root_type": "Liability"
},
{
"name": "R\u00e9serves diverses"
"name": "R\u00e9serves diverses",
"root_type": "Liability"
}
],
"name": "AUTRES R\u00c9SERVES"
"name": "AUTRES R\u00c9SERVES",
"root_type": "Liability"
},
{
"children": [
{
"name": "Autres r\u00e9serves r\u00e9glement\u00e9es"
"name": "Autres r\u00e9serves r\u00e9glement\u00e9es",
"root_type": "Liability"
},
{
"name": "R\u00e9serves cons\u00e9cutives \u00e0 l'octroi de subventions d'investissement"
"name": "R\u00e9serves cons\u00e9cutives \u00e0 l'octroi de subventions d'investissement",
"root_type": "Liability"
},
{
"name": "R\u00e9serves de plus-values nettes \u00e0 long terme"
"name": "R\u00e9serves de plus-values nettes \u00e0 long terme",
"root_type": "Liability"
}
],
"name": "R\u00c9SERVES R\u00c9GLEMENT\u00c9ES"
"name": "R\u00c9SERVES R\u00c9GLEMENT\u00c9ES",
"root_type": "Liability"
}
],
"name": "R\u00c9SERVES"
"name": "R\u00c9SERVES",
"root_type": "Liability"
},
{
"children": [
{
"children": [
{
"name": "Perte - Amortissements r\u00e9put\u00e9s diff\u00e9r\u00e9s"
"name": "Perte - Amortissements r\u00e9put\u00e9s diff\u00e9r\u00e9s",
"root_type": "Liability"
},
{
"name": "Perte nette \u00e0 reporter"
"name": "Perte nette \u00e0 reporter",
"root_type": "Liability"
}
],
"name": "REPORT \u00c0 NOUVEAU D\u00c9BITEUR"
"name": "REPORT \u00c0 NOUVEAU D\u00c9BITEUR",
"root_type": "Liability"
},
{
"name": "REPORT \u00c0 NOUVEAU CR\u00c9DITEUR"
"name": "REPORT \u00c0 NOUVEAU CR\u00c9DITEUR",
"root_type": "Liability"
}
],
"name": "REPORT \u00c0 NOUVEAU"
"name": "REPORT \u00c0 NOUVEAU",
"root_type": "Liability"
},
{
"children": [
{
"name": "R\u00c9SULTAT HORS ACTIVIT\u00c9S ORDINAIRES (R.H.A.O.)"
"name": "R\u00c9SULTAT HORS ACTIVIT\u00c9S ORDINAIRES (R.H.A.O.)",
"root_type": "Liability"
},
{
"name": "R\u00c9SULTAT NET : PERTE"
"name": "R\u00c9SULTAT NET : PERTE",
"root_type": "Liability"
},
{
"name": "EXC\u00c9DENT BRUT D'EXPLOITATION (E.B.E.)"
"name": "EXC\u00c9DENT BRUT D'EXPLOITATION (E.B.E.)",
"root_type": "Liability"
},
{
"name": "R\u00c9SULTAT D'EXPLOITATION (R.E.)"
"name": "R\u00c9SULTAT D'EXPLOITATION (R.E.)",
"root_type": "Liability"
},
{
"name": "R\u00c9SULTAT FINANCIER (R.F.)"
"name": "R\u00c9SULTAT FINANCIER (R.F.)",
"root_type": "Liability"
},
{
"name": "R\u00c9SULTAT DES ACTIVIT\u00c9S ORDINAIRES (R.A.O.)"
"name": "R\u00c9SULTAT DES ACTIVIT\u00c9S ORDINAIRES (R.A.O.)",
"root_type": "Liability"
},
{
"children": [
{
"name": "R\u00e9sultat en instance d'affectation : Perte"
"name": "R\u00e9sultat en instance d'affectation : Perte",
"root_type": "Liability"
},
{
"name": "R\u00e9sultat en instance d'affectation : B\u00e9n\u00e9fice"
"name": "R\u00e9sultat en instance d'affectation : B\u00e9n\u00e9fice",
"root_type": "Liability"
}
],
"name": "R\u00c9SULTAT EN INSANCE D\u2019AFFECTATION"
"name": "R\u00c9SULTAT EN INSANCE D\u2019AFFECTATION",
"root_type": "Liability"
},
{
"name": "R\u00c9SULTAT NET : B\u00c9N\u00c9FICE"
"name": "R\u00c9SULTAT NET : B\u00c9N\u00c9FICE",
"root_type": "Liability"
},
{
"children": [
{
"name": "Marge brute sur marchandises"
"name": "Marge brute sur marchandises",
"root_type": "Liability"
},
{
"name": "Marge brute sur mati\u00e8res"
"name": "Marge brute sur mati\u00e8res",
"root_type": "Liability"
}
],
"name": "MARGE BRUTE (M.B.)"
"name": "MARGE BRUTE (M.B.)",
"root_type": "Liability"
},
{
"name": "VALEUR AJOUT\u00c9E (V.A.)"
"name": "VALEUR AJOUT\u00c9E (V.A.)",
"root_type": "Liability"
}
],
"name": "R\u00c9SULTAT NET DE L'EXERCICE"
"name": "R\u00c9SULTAT NET DE L'EXERCICE",
"root_type": "Liability"
}
],
"name": "Comptes de capitaux"

View File

@ -1,7 +1,542 @@
{
"name": "Basic Chart of Account",
"root": {
"children": [],
"children": [
{
"children": [
{
"name": "Automobile Expense",
"root_type": "Expense"
},
{
"name": "Payroll Expenses",
"root_type": "Expense"
},
{
"name": "Interest Expense",
"root_type": "Expense"
},
{
"name": "Continuing Education",
"root_type": "Expense"
},
{
"name": "Meals and Entertainment",
"root_type": "Expense"
},
{
"name": "Custom Hire and Contract Labor",
"root_type": "Expense"
},
{
"name": "Repairs and Maintenance",
"root_type": "Expense"
},
{
"name": "Postage and Delivery",
"root_type": "Expense"
},
{
"name": "Small Tools and Equipment",
"root_type": "Expense"
},
{
"name": "Chemicals Purchased",
"root_type": "Expense"
},
{
"name": "Gasoline, Fuel and Oil",
"root_type": "Expense"
},
{
"name": "Equipment Rental",
"root_type": "Expense"
},
{
"name": "Taxes - Property",
"root_type": "Expense"
},
{
"name": "Miscellaneous Expense",
"root_type": "Expense"
},
{
"name": "Uniforms",
"root_type": "Expense"
},
{
"name": "Veterinary, Breeding, Medicine",
"root_type": "Expense"
},
{
"name": "Professional Fees",
"root_type": "Expense"
},
{
"name": "Janitorial Expense",
"root_type": "Expense"
},
{
"children": [
{
"name": "General Liability Insurance",
"root_type": "Expense"
},
{
"name": "Life and Disability Insurance",
"root_type": "Expense"
},
{
"name": "Health Insurance",
"root_type": "Expense"
},
{
"name": "Professional Liability",
"root_type": "Expense"
},
{
"name": "Worker's Compensation",
"root_type": "Expense"
}
],
"name": "Insurance Expense",
"root_type": "Expense"
},
{
"name": "Travel Expense",
"root_type": "Expense"
},
{
"name": "Advertising and Promotion",
"root_type": "Expense"
},
{
"name": "Office Supplies",
"root_type": "Expense"
},
{
"name": "Dues and Subscriptions",
"root_type": "Expense"
},
{
"name": "Feed Purchased",
"root_type": "Expense"
},
{
"name": "Bank Service Charges",
"root_type": "Expense"
},
{
"name": "Marketing Expense",
"root_type": "Expense"
},
{
"name": "Storage and Warehousing",
"root_type": "Expense"
},
{
"name": "Computer and Internet Expenses",
"root_type": "Expense"
},
{
"name": "Fertilizers and Lime",
"root_type": "Expense"
},
{
"name": "Seeds and Plants Purchased",
"root_type": "Expense"
},
{
"name": "Conservation Expenses",
"root_type": "Expense"
},
{
"name": "Freight and Trucking",
"root_type": "Expense"
},
{
"name": "Depreciation Expense",
"root_type": "Expense"
},
{
"name": "Printing and Reproduction",
"root_type": "Expense"
},
{
"name": "Car and Truck Expenses",
"root_type": "Expense"
},
{
"name": "Charitable Contributions",
"root_type": "Expense"
},
{
"name": "Rent Expense",
"root_type": "Expense"
},
{
"name": "Utilities",
"root_type": "Expense"
},
{
"name": "Telephone Expense",
"root_type": "Expense"
},
{
"name": "Business Licenses and Permits",
"root_type": "Expense"
}
],
"name": "Expenses",
"root_type": "Expense"
},
{
"children": [
{
"children": [
{
"name": "Client Trust Account",
"root_type": "Asset"
},
{
"children": [
{
"account_type": "Receivable",
"name": "Account Receivable",
"root_type": "Asset"
}
],
"name": "Receivable",
"root_type": "Asset"
},
{
"account_type": "Bank or Cash",
"name": "Cash or Cash Equivalents",
"root_type": "Asset"
}
],
"name": "Current Assets",
"root_type": "Asset"
},
{
"children": [
{
"name": "Security Deposits Asset",
"root_type": "Asset"
}
],
"name": "Other Assets",
"root_type": "Asset"
},
{
"children": [
{
"name": "Court Costs",
"root_type": "Asset"
},
{
"name": "Advanced Client Costs",
"root_type": "Asset"
},
{
"name": "Filing Fees",
"root_type": "Asset"
},
{
"name": "Expert Witness Fees",
"root_type": "Asset"
}
],
"name": "Other Current Assets",
"root_type": "Asset"
},
{
"account_type": "Fixed Asset",
"children": [
{
"account_type": "Fixed Asset",
"name": "Furniture and Equipment",
"root_type": "Asset"
},
{
"name": "Accumulated Depreciation",
"root_type": "Asset"
}
],
"name": "Fixed Assets",
"root_type": "Asset"
}
],
"name": "Assets",
"root_type": "Asset"
},
{
"children": [
{
"account_type": "Equity",
"children": [
{
"account_type": "Equity",
"name": "Capital Stock",
"root_type": "Liability"
},
{
"account_type": "Equity",
"name": "Retained Earnings",
"root_type": "Liability"
},
{
"account_type": "Equity",
"name": "Dividends Paid",
"root_type": "Liability"
},
{
"account_type": "Equity",
"name": "Opening Balance Equity",
"root_type": "Liability"
}
],
"name": "Equity",
"root_type": "Liability"
},
{
"children": [
{
"children": [
{
"children": [
{
"name": "Account Payable",
"root_type": "Liability"
}
],
"name": "Payable",
"root_type": "Liability"
}
],
"name": "Current Liabilities",
"root_type": "Liability"
},
{
"children": [
{
"name": "Sales Tax Payable",
"root_type": "Liability"
},
{
"name": "Customer Deposits Received",
"root_type": "Liability"
},
{
"name": "Payroll Liabilities",
"root_type": "Liability"
},
{
"name": "Use Tax Payable",
"root_type": "Liability"
}
],
"name": "Other Current Liabilities",
"root_type": "Liability"
}
],
"name": "Liabilities",
"root_type": "Liability"
}
],
"name": "Liabilities and Equity",
"root_type": "Liability"
},
{
"children": [
{
"name": "Settlement Income",
"root_type": "Income"
},
{
"name": "Commodity Credit Loans",
"root_type": "Income"
},
{
"name": "Administrative Fees",
"root_type": "Income"
},
{
"name": "Shipping and Delivery Income",
"root_type": "Income"
},
{
"name": "Sales",
"root_type": "Income"
},
{
"name": "Commission income",
"root_type": "Income"
},
{
"name": "Fuel Tax Credits and Other Inc.",
"root_type": "Income"
},
{
"name": "Livestock Sales",
"root_type": "Income"
},
{
"name": "Custom Hire Income",
"root_type": "Income"
},
{
"name": "Crop Insurance Proceeds",
"root_type": "Income"
},
{
"name": "Legal Fee Income",
"root_type": "Income"
},
{
"name": "Cooperative Distributions",
"root_type": "Income"
},
{
"name": "Job Income",
"root_type": "Income"
},
{
"name": "Crop Sales",
"root_type": "Income"
},
{
"name": "Sales Discounts",
"root_type": "Income"
},
{
"name": "Rental Income",
"root_type": "Income"
},
{
"name": "Farmers Market Sales",
"root_type": "Income"
},
{
"name": "Sales",
"root_type": "Income"
},
{
"name": "Sales Discounts",
"root_type": "Income"
},
{
"name": "Service Income",
"root_type": "Income"
},
{
"name": "Agricultural Program Payments",
"root_type": "Income"
}
],
"name": "Income",
"root_type": "Income"
},
{
"children": [
{
"name": "Proceeds from Sale of Assets",
"root_type": "Income"
},
{
"name": "Finance Charge Income",
"root_type": "Income"
},
{
"name": "Interest Income",
"root_type": "Income"
},
{
"name": "Insurance Proceeds Received",
"root_type": "Income"
}
],
"name": "Other Income",
"root_type": "Income"
},
{
"account_type": "Cost of Goods Sold",
"children": [
{
"account_type": "Cost of Goods Sold",
"name": "Other Job Related Costs",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Commissions Paid",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Tools and Small Equipment",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Merchant Account Fees",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Job Materials Purchased",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Subcontracted Services",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Equipment Rental for Jobs",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Purchases - Resale Items",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Commissions Paid",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Freight and Shipping Costs",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Merchant Account Fees",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Media Purchased for Clients",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Purchase Discounts",
"root_type": "Expense"
},
{
"account_type": "Cost of Goods Sold",
"name": "Subcontractors Expense",
"root_type": "Expense"
}
],
"name": "Cost of Goods Sold",
"root_type": "Expense"
}
],
"name": "Basic",
"parent_id": null
}

View File

@ -1,14 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for d in (('Asset', 'Debit', 'No'), ('Liability', 'Credit', 'No'), ('Expense', 'Debit', 'Yes'),
('Income', 'Credit', 'Yes')):
frappe.db.sql("""update `tabAccount` set root_type = %s
where debit_or_credit=%s and is_pl_account=%s""", d)
frappe.db.sql("""update `tabAccount` set balance_must_be=debit_or_credit
where ifnull(allow_negative_balance, 0) = 0""")

View File

@ -8,18 +8,25 @@ import unittest
class TestCompany(unittest.TestCase):
def test_coa(self):
company_bean = frappe.bean({
"doctype": "Company",
"company_name": "_Test Company 2",
"abbr": "_TC2",
"default_currency": "INR",
"country": "India",
"chart_of_accounts": "India - Chart of Accounts for Public Ltd"
})
for country, chart_name in frappe.db.sql("""select country, chart_name
from `tabChart of Accounts` order by country""", as_list=1):
print country
# print "Chart Name: ", chart_name
company_bean = frappe.bean({
"doctype": "Company",
"company_name": "_Test Company 2",
"abbr": "_TC2",
"default_currency": "INR",
"country": country,
"chart_of_accounts": chart_name
})
company_bean.insert()
self.assertTrue(frappe.db.get_value("Account", "Balance Sheet - _TC2"))
company_bean.insert()
self.assertTrue(frappe.db.sql("""select count(*) from tabAccount
where company='_Test Company 2'""")[0][0] > 10)
frappe.delete_doc("Company", "_Test Company 2")
test_records = [