Commit e458ef14 authored by plb's avatar plb
Browse files

himport produce chart_of_accounts for hreport (>2016/03)

parent b106d22f
......@@ -89,7 +89,7 @@ def do_sqlalchemy(options):
Writer.write("sells", sell_journal, options['years'])
Writer.write("suppliers", supplier_journal, options['years'])
Writer.write("social", social_journal, options['years'])
Writer.write_hreport_plan(options['years'])
Writer.write_hreport_chart_of_accounts(options['years'])
dolibarr.disconnect()
......
......@@ -20,7 +20,7 @@ OUTPUT_FILES = {
"sells": "exercices/%year%/ecritures.d/vente.journal",
"suppliers": "exercices/%year%/ecritures.d/achat.journal",
"social": "exercices/%year%/ecritures.d/cotisations_sociales.journal",
"pc": "plan.journal",
"chart_of_accounts" : "exercices/%year%/chart_of_accounrs.journal"
}
#
......
......@@ -30,20 +30,21 @@ class Writer(object):
f.close()
@staticmethod
def write_hreport_plan(years):
def write_hreport_chart_of_accounts(years):
pc_names = settings.get('PC_NAMES')
pc_descriptions = settings.get('PC_DESCRIPTIONS')
for year in years:
filename = Writer.output_files['pc']
filename = Writer.output_files['chart_of_accounts']
output_file = os.path.join(Writer.output_dir, filename).replace("%year%", year)
f = codecs.open(output_file, 'w', 'utf-8')
f.write("%s/01/01 * Chart of account\n" % (year))
for pc in sorted(pc_names.keys()):
name = pc_names[pc]
if pc in pc_descriptions:
desc = pc_descriptions[pc]
else:
desc = name
s = "%s %s %s\n" % (name.ljust(80), pc.ljust(12), desc)
s = " %s 0 ; %s %s\n" % (name, pc, desc)
f.write(s)
f.close()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment