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
alecs_myu
erp5
Commits
9627132a
Commit
9627132a
authored
Feb 13, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_payroll_l10n_fr: support "void" monthly DSN
parent
634edc71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_getDataDict.py
...kins/erp5_payroll_l10n_fr/DSNMonthlyReport_getDataDict.py
+3
-3
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
...skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
+16
-8
No files found.
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_getDataDict.py
View file @
9627132a
...
...
@@ -55,7 +55,7 @@ if block_id == 'S10.G00.00':
rubric_value_dict
[
'S10.G00.00.005'
]
=
'01'
rubric_value_dict
[
'S10.G00.00.006'
]
=
'P03V01'
rubric_value_dict
[
'S10.G00.00.007'
]
=
'01'
rubric_value_dict
[
'S10.G00.00.008'
]
=
'01'
rubric_value_dict
[
'S10.G00.00.008'
]
=
kw
.
get
(
'type'
,
'01'
)
# Emetteur
if
block_id
==
'S10.G00.01'
:
...
...
@@ -88,7 +88,7 @@ if block_id == 'S10.G00.02':
if
block_id
==
'S20.G00.05'
:
now
=
DateTime
()
rubric_value_dict
[
'S20.G00.05.001'
]
=
'01'
# Monthly DSN
rubric_value_dict
[
'S20.G00.05.002'
]
=
'01'
# Normal Declaration
rubric_value_dict
[
'S20.G00.05.002'
]
=
kw
.
get
(
'type'
,
'01'
)
# Normal Declaration
rubric_value_dict
[
'S20.G00.05.003'
]
=
'11'
rubric_value_dict
[
'S20.G00.05.004'
]
=
kw
[
'order'
]
# Declaration.Ordre, incremented for each DSN
rubric_value_dict
[
'S20.G00.05.005'
]
=
formatDate
(
DateTime
(
kw
[
'year'
],
kw
[
'month'
],
1
))
...
...
@@ -149,7 +149,7 @@ elif block_id == 'S21.G00.11':
rubric_value_dict
[
'S21.G00.11.005'
]
=
target
.
getDefaultAddressCity
()
rubric_value_dict
[
'S21.G00.11.006'
]
=
''
rubric_value_dict
[
'S21.G00.11.007'
]
=
''
rubric_value_dict
[
'S21.G00.11.008'
]
=
int
(
context
.
getQuantity
(
))
rubric_value_dict
[
'S21.G00.11.008'
]
=
str
(
int
(
context
.
getQuantity
(
0
)
))
rubric_value_dict
[
'S21.G00.11.009'
]
=
''
rubric_value_dict
[
'S21.G00.11.015'
]
=
(
establishment_country_code
if
establishment_country_code
not
in
france_territory_code
else
''
)
rubric_value_dict
[
'S21.G00.11.016'
]
=
''
...
...
bt5/erp5_payroll_l10n_fr/SkinTemplateItem/portal_skins/erp5_payroll_l10n_fr/DSNMonthlyReport_makeReport.py
View file @
9627132a
...
...
@@ -2,8 +2,7 @@ from Products.ERP5Type.DateUtils import addToDate, getNumberOfDayInMonth
if
context
.
getSourceAdministration
()
is
None
\
or
context
.
getEffectiveDate
()
is
None
\
or
context
.
getQuantity
()
is
None
\
or
len
(
context
.
getAggregateRelatedIdList
())
<=
0
:
or
context
.
getQuantity
()
is
None
:
return
context
.
REQUEST
.
response
.
redirect
(
"%s?portal_status_message=%s"
%
(
context
.
absolute_url
(),
"DSN can't be built if some fields are empty"
))
portal
=
context
.
getPortalObject
()
...
...
@@ -34,14 +33,19 @@ paysheet_id_list = [transaction.getId() for transaction in paysheet_list]
change_block_dict
=
context
.
DSNMonthlyReport_getChangeBlockDict
()
organisation_contact
=
context
.
getSourceAdministrationValue
()
establishment
=
accounting_module
.
restrictedTraverse
(
paysheet_id_list
[
0
]).
getDestinationTradeValue
()
if
len
(
paysheet_list
):
establishment
=
accounting_module
.
restrictedTraverse
(
paysheet_id_list
[
0
]).
getDestinationTradeValue
()
else
:
establishment
=
context
.
getSourceTradeValue
()
establishment_registration_code
=
''
.
join
(
establishment
.
getCorporateRegistrationCode
().
split
(
' '
))
# Finds the head office of the comany
if
len
(
payment_transaction_list
):
organisation
=
payment_transaction_list
[
0
].
getSourceSectionValue
()
el
se
:
el
if
len
(
paysheet_list
)
:
organisation
=
paysheet_list
[
0
].
getDestinationSectionValue
()
else
:
organisation
=
context
.
getSourceSectionValue
()
# Variable containing all the record of the DSN
...
...
@@ -60,12 +64,13 @@ leave_period_dict = context.DSNMonthlyReport_getLeavePeriodDict(bank_account)
employee_list
=
[]
# DSN HEADERS
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S10.G00.00'
))
dsn_type
=
(
'01'
if
len
(
paysheet_list
)
else
'02'
)
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S10.G00.00'
,
type
=
dsn_type
))
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S10.G00.01'
,
target
=
organisation
))
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S10.G00.02'
,
target
=
organisation_contact
))
# Monthly DSN
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S20.G00.05'
,
year
=
declared_year
,
month
=
declared_month
,
order
=
nb_dsn
))
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S20.G00.05'
,
year
=
declared_year
,
month
=
declared_month
,
order
=
nb_dsn
,
type
=
dsn_type
))
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S21.G00.06'
,
target
=
organisation
))
...
...
@@ -79,7 +84,10 @@ employee_result_list = [
for
paysheet
in
paysheet_list
]
employee_data_list
,
paysheet_data_list
=
zip
(
*
employee_result_list
)
if
len
(
employee_result_list
):
employee_data_list
,
paysheet_data_list
=
zip
(
*
employee_result_list
)
else
:
employee_data_list
,
paysheet_data_list
=
[],
[]
insurance_contract_id_list
=
set
()
for
employee_data_dict
,
paysheet_data_dict
in
employee_result_list
:
...
...
@@ -171,7 +179,7 @@ if len(payment_transaction_list):
establishment
=
establishment
,
payer
=
organisation
))
dsn_file
.
append
(
getDSNBlockDict
(
block_id
=
'S21.G00.55'
,
target
=
payment
,
establishment
=
establishment
))
el
se
:
el
if
len
(
paysheet_list
)
:
# If there is no Payment Transaction, then the organisation pays quaterly
amount
=
-
1.
*
portal
.
portal_simulation
.
getInventory
(
from_date
=
first_date_of_month
,
...
...
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