Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FFDN
himport
Commits
e8aaf809
Commit
e8aaf809
authored
Feb 21, 2016
by
plb
Browse files
Ecriture du plan comptable pour chaque année comptable.
parent
d69bc30c
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/himport
View file @
e8aaf809
...
...
@@ -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
()
...
...
himports/dolibarrWriter.py
View file @
e8aaf809
...
...
@@ -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
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment