Commit e8aaf809 authored by plb's avatar plb
Browse files

Ecriture du plan comptable pour chaque année comptable.

parent d69bc30c
......@@ -94,7 +94,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()
Writer.write_hreport_plan(options['years'])
dolibarr.disconnect()
......
......@@ -30,20 +30,20 @@ class Writer(object):
f.close()
@staticmethod
def write_hreport_plan():
def write_hreport_plan(years):
pc_names = settings.get('PC_NAMES')
pc_descriptions = settings.get('PC_DESCRIPTIONS')
filename = Writer.output_files['pc']
output_file = os.path.join(Writer.output_dir, filename)
f = codecs.open(output_file, 'w', 'utf-8')
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)
f.write(s)
f.close()
for year in years:
filename = Writer.output_files['pc']
output_file = os.path.join(Writer.output_dir, filename).replace("%year%", year)
f = codecs.open(output_file, 'w', 'utf-8')
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)
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