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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
6581bdd4
Commit
6581bdd4
authored
Jan 10, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: erp5_payroll_l10n_fr: allow declaration of regularisations in CTPs
parent
b9beaecd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
16 deletions
+34
-16
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
...skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
+26
-10
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/PaySheetTransaction_getSocialContributionDict.py
..._l10n_fr/PaySheetTransaction_getSocialContributionDict.py
+8
-6
No files found.
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
View file @
6581bdd4
...
...
@@ -92,22 +92,38 @@ for collective_contract in collective_contract_list:
# Generate aggregated contributions
aggregated_social_contribution_dict
=
{}
aggregated_social_regularisation_dict
=
{}
social_contribution_organisation
=
None
social_contribution_start_date
=
None
social_contribution_stop_date
=
None
for
employee_result
in
paysheet_data_list
:
employee_ctp
=
employee_result
[
'ctp'
]
for
ctp_code
in
employee_ctp
:
if
social_contribution_organisation
is
None
:
social_contribution_organisation
=
employee_ctp
[
ctp_code
][
'corporate_registration_code'
]
social_contribution_start_date
=
employee_ctp
[
ctp_code
][
'start_date'
]
social_contribution_stop_date
=
employee_ctp
[
ctp_code
][
'stop_date'
]
if
ctp_code
not
in
aggregated_social_contribution_dict
:
aggregated_social_contribution_dict
[
ctp_code
]
=
employee_ctp
[
ctp_code
].
copy
()
for
key
in
employee_ctp
:
try
:
ctp_code
,
start_date
,
stop_date
=
key
except
ValueError
:
raise
ValueError
(
key
)
# If date is different, then it is a regularisation
if
(
declared_year
,
declared_month
)
!=
start_date
[:
2
]:
aggregated_social_regularisation_dict
.
setdefault
((
start_date
,
stop_date
),
{})
if
ctp_code
not
in
aggregated_social_regularisation_dict
[(
start_date
,
stop_date
)]:
aggregated_social_regularisation_dict
[(
start_date
,
stop_date
)]
=
{
ctp_code
:
employee_ctp
[
key
].
copy
()}
else
:
for
summing_parameter
in
(
'base'
,
'quantity'
):
aggregated_social_regularisation_dict
[(
start_date
,
stop_date
)][
ctp_code
][
summing_parameter
]
=
\
aggregated_social_regularisation_dict
[(
start_date
,
stop_date
)][
ctp_code
][
summing_parameter
]
+
employee_ctp
[
key
][
summing_parameter
]
# Otherwise normal case of declaration
else
:
for
summing_parameter
in
(
'base'
,
'quantity'
):
aggregated_social_contribution_dict
[
ctp_code
][
summing_parameter
]
=
\
aggregated_social_contribution_dict
[
ctp_code
][
summing_parameter
]
+
employee_ctp
[
ctp_code
][
summing_parameter
]
if
social_contribution_organisation
is
None
and
'corporate_registration_code'
in
employee_ctp
[
key
]:
social_contribution_organisation
=
employee_ctp
[
key
][
'corporate_registration_code'
]
social_contribution_start_date
=
employee_ctp
[
key
][
'start_date'
]
social_contribution_stop_date
=
employee_ctp
[
key
][
'stop_date'
]
if
ctp_code
not
in
aggregated_social_contribution_dict
:
aggregated_social_contribution_dict
[
ctp_code
]
=
employee_ctp
[
key
].
copy
()
else
:
for
summing_parameter
in
(
'base'
,
'quantity'
):
aggregated_social_contribution_dict
[
ctp_code
][
summing_parameter
]
=
\
aggregated_social_contribution_dict
[
ctp_code
][
summing_parameter
]
+
employee_ctp
[
key
][
summing_parameter
]
# Find the payment transaction for the social contributions
if
len
(
payment_transaction_list
):
...
...
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/PaySheetTransaction_getSocialContributionDict.py
View file @
6581bdd4
...
...
@@ -150,17 +150,19 @@ for movement in context.PaySheetTransaction_getMovementList():
continue
contribution_set
=
set
(
movement
.
getBaseContributionValueList
())
start_date
=
movement
.
getStartDate
().
parts
()
stop_date
=
movement
.
getStopDate
().
parts
()
ctp_set
=
all_ctp_set
.
intersection
(
contribution_set
)
for
category
in
ctp_set
:
category
=
category
.
getCodification
()
contribution_dict
=
makeCTPBlock
(
movement
,
category
)
if
category
in
result
[
"ctp"
]:
result
[
'ctp'
][
category
][
'base'
]
=
result
[
'ctp'
][
category
][
'base'
]
+
contribution_dict
[
'base'
]
result
[
'ctp'
][
category
][
'quantity'
]
=
result
[
'ctp'
][
category
][
'quantity'
]
+
contribution_dict
[
'quantity'
]
if
(
category
,
start_date
,
stop_date
)
in
result
[
"ctp"
]:
result
[
'ctp'
][
(
category
,
start_date
,
stop_date
)][
'base'
]
=
result
[
'ctp'
][(
category
,
start_date
,
stop_date
)
][
'base'
]
+
contribution_dict
[
'base'
]
result
[
'ctp'
][
(
category
,
start_date
,
stop_date
)][
'quantity'
]
=
result
[
'ctp'
][(
category
,
start_date
,
stop_date
)
][
'quantity'
]
+
contribution_dict
[
'quantity'
]
else
:
result
[
'ctp'
][
category
]
=
contribution_dict
result
[
'ctp'
][
(
category
,
start_date
,
stop_date
)
]
=
contribution_dict
taxable_base_set
=
all_taxable_base_set
.
intersection
(
contribution_set
)
for
category
in
taxable_base_set
:
category
=
category
.
getCodification
()
...
...
@@ -246,7 +248,7 @@ if len(result['ctp']):
raise
AttributeError
(
context
.
getUrl
())
if
year_to_date_gross_salary
<
2.5
*
minimum_salary
*
int
(
context
.
getStopDate
().
month
()):
category
=
'400D'
result
[
'ctp'
][
category
]
=
{
result
[
'ctp'
][
(
category
,
start_date
,
stop_date
)
]
=
{
'code'
:
category
,
'cap'
:
(
'921'
if
category
[
-
1
]
==
'P'
else
'920'
),
'rate'
:
''
,
...
...
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