|
@@ -30,20 +30,21 @@ class Writer(object):
|
|
f.close()
|
|
f.close()
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
- def write_hreport_plan(years):
|
|
|
|
|
|
+ def write_hreport_chart_of_accounts(years):
|
|
pc_names = settings.get('PC_NAMES')
|
|
pc_names = settings.get('PC_NAMES')
|
|
pc_descriptions = settings.get('PC_DESCRIPTIONS')
|
|
pc_descriptions = settings.get('PC_DESCRIPTIONS')
|
|
for year in years:
|
|
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)
|
|
output_file = os.path.join(Writer.output_dir, filename).replace("%year%", year)
|
|
|
|
|
|
f = codecs.open(output_file, 'w', 'utf-8')
|
|
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()):
|
|
for pc in sorted(pc_names.keys()):
|
|
name = pc_names[pc]
|
|
name = pc_names[pc]
|
|
if pc in pc_descriptions:
|
|
if pc in pc_descriptions:
|
|
desc = pc_descriptions[pc]
|
|
desc = pc_descriptions[pc]
|
|
else:
|
|
else:
|
|
desc = name
|
|
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.write(s)
|
|
f.close()
|
|
f.close()
|