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
Labels
Merge Requests
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
112690df
Commit
112690df
authored
Feb 04, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_payroll: remove useless code
parent
ef1547b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
40 deletions
+3
-40
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReport.py
...erp5_payroll/PaySheetTransaction_generatePayslipReport.py
+3
-40
No files found.
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReport.py
View file @
112690df
"""
================================================================================
Create the actual report and return parameters for the report header
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
#
kwargs
[
"report_data"
]
=
context
.
PaySheetTransaction_getPayslipData
()
def
translateText
(
snip
):
return
rep_localiser
.
erp5_ui
.
gettext
(
snip
,
lang
=
rep_language
).
encode
(
'utf-8'
).
strip
()
rep
=
context
rep_language
=
rep
.
getLanguage
()
if
getattr
(
rep
,
'getLanguage'
,
None
)
else
None
rep_localiser
=
rep
.
getPortalObject
().
Localizer
rep_data_source_caller
=
None
rep_start_date
=
kwargs
.
get
(
'start_date'
,
None
)
rep_stop_date
=
kwargs
.
get
(
'stop_date'
,
None
)
rep_title
=
kwargs
.
get
(
'report_title'
)
# bridge for filling in testdata and setting exported title to bogus dates
if
kwargs
.
get
(
'override_batch_mode'
):
rep_data_source_caller
=
getattr
(
context
,
"PaySheetTransaction_getPayslipTestData"
,
None
)
rep_start_date
=
DateTime
(
"1976-11-04"
)
rep_stop_date
=
DateTime
(
"1976-11-30"
)
if
rep_data_source_caller
is
None
:
rep_data_source_caller
=
getattr
(
context
,
"PaySheetTransaction_getPayslipTestData"
)
rep_start_date
=
rep_start_date
or
context
.
Base_getFirstAndLastDayOfMonth
(
day
=
"first"
)
rep_stop_date
=
rep_stop_date
or
context
.
Base_getFirstAndLastDayOfMonth
(
day
=
"last"
)
kwargs
[
"report_data"
]
=
rep_data_source_caller
(
start_date
=
rep_start_date
,
stop_date
=
rep_stop_date
)
rep_content
=
context
.
Person_generatePayslipReportContent
(
*
args
,
**
kwargs
)
rep_content
=
context
.
PaySheetTransaction_generatePayslipReportContent
(
*
args
,
**
kwargs
)
if
isinstance
(
rep_content
,
unicode
):
rep_content
=
rep_content
.
encode
(
"utf8"
)
return
rep_content
,
rep_title
,
' '
.
join
([
translateText
(
"from"
).
title
(),
rep_start_date
.
strftime
(
'%Y/%m/%d'
),
translateText
(
"to"
),
rep_stop_date
.
strftime
(
'%Y/%m/%d'
)
])
return
rep_content
,
""
,
""
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