Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
14db6c5f
Commit
14db6c5f
authored
Feb 05, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_payroll_l10n_fr: correctly computes the annual average of employees
parent
d32fcd81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_getDataDict.py
...kins/erp5_payroll_l10n_fr/DSNMonthlyReport_getDataDict.py
+6
-3
No files found.
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_getDataDict.py
View file @
14db6c5f
...
...
@@ -104,7 +104,10 @@ if block_id == 'S21.G00.06':
# XXX : should be fixed to be corrct when there exists DSN reports for
# different establishments or organisations, or replaced/cancelled DSN reports
def
getDSNOrganisation
(
dsn_value
):
return
dsn_value
.
getAggregateRelatedValueList
(
portal_type
=
"Pay Sheet Transaction"
)[
0
].
getDestinationSection
()
try
:
return
dsn_value
.
getAggregateRelatedValueList
(
portal_type
=
"Pay Sheet Transaction"
)[
0
].
getDestinationSection
()
except
IndexError
:
return
''
def
calculateManPower
():
manpower_dict
=
{}
social_declaration_module
=
portal
.
getDefaultModule
(
"DSN Monthly Report"
)
...
...
@@ -118,11 +121,11 @@ if block_id == 'S21.G00.06':
manpower_dict
.
setdefault
(
month_report
.
getEffectiveDate
().
month
(),
[]).
append
(
int
(
month_report
.
getQuantity
()))
total_manpower
=
0
for
_
,
employee_quantity
in
manpower_dict
.
items
():
total_manpower
+=
sum
(
employee_quantity
)
/
len
(
employee_quantity
)
total_manpower
+=
sum
(
employee_quantity
)
return
total_manpower
/
len
(
manpower_dict
.
keys
())
# Divide by number of months
average_manpower
=
''
if
context
.
getEffectiveDate
().
month
()
==
12
:
if
context
.
getEffectiveDate
().
month
()
==
12
and
target
.
getRelativeUrl
()
==
getDSNOrganisation
(
context
)
:
average_manpower
=
str
(
calculateManPower
())
rubric_value_dict
[
'S21.G00.06.001'
]
=
''
.
join
(
target
.
getCorporateRegistrationCode
().
split
(
' '
))[:
9
]
rubric_value_dict
[
'S21.G00.06.002'
]
=
''
.
join
(
target
.
getCorporateRegistrationCode
().
split
(
' '
))[
-
5
:]
...
...
Write
Preview
Markdown
is supported
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