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
Joshua
erp5
Commits
82198163
Commit
82198163
authored
Sep 05, 2018
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_payroll: use corporate identity for Payslip report
parent
7ac1453e
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
661 additions
and
1 deletion
+661
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReport.py
...erp5_payroll/PaySheetTransaction_generatePayslipReport.py
+45
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReport.xml
...rp5_payroll/PaySheetTransaction_generatePayslipReport.xml
+62
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReportContent.xml
...roll/PaySheetTransaction_generatePayslipReportContent.xml
+58
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReportContent.zpt
...roll/PaySheetTransaction_generatePayslipReportContent.zpt
+260
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getPayslipData.py
..._skins/erp5_payroll/PaySheetTransaction_getPayslipData.py
+84
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getPayslipData.xml
...skins/erp5_payroll/PaySheetTransaction_getPayslipData.xml
+62
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_printPayslipReport.py
...ns/erp5_payroll/PaySheetTransaction_printPayslipReport.py
+23
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_printPayslipReport.xml
...s/erp5_payroll/PaySheetTransaction_printPayslipReport.xml
+62
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheet_getODTStyleSheet.bin
...m/portal_skins/erp5_payroll/PaySheet_getODTStyleSheet.bin
+0
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheet_viewODTPrintDialog.xml
...portal_skins/erp5_payroll/PaySheet_viewODTPrintDialog.xml
+5
-1
No files found.
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReport.py
0 → 100644
View file @
82198163
"""
================================================================================
Create the actual report and return parameters for the report header
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
#
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
)
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'
)
])
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReport.xml
0 → 100644
View file @
82198163
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args, **kwargs
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaySheetTransaction_generatePayslipReport
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReportContent.xml
0 → 100644
View file @
82198163
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaySheetTransaction_generatePayslipReportContent
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_generatePayslipReportContent.zpt
0 → 100644
View file @
82198163
This diff is collapsed.
Click to expand it.
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getPayslipData.py
0 → 100644
View file @
82198163
"""
================================================================================
Get data to build a payslip report based on a person's paysheet transaction
================================================================================
"""
#
# parameters
# ------------------------------------------------------------------------------
# start_date start date of the report
# stop_date stop date of the report
#
# returns:
# {
# "general_data_dict": {
# "year": 2017,
# "net_salary": "2 300.93",
# "gross_salary": "3 085.28"
# },
# "cumulative_title_list": [
# {"value": "Gross Salary", "is_header": True},
# ...
# ],
# "cumulative_info_list":[
# {"value": "3 085.28", "is_header": True},
# ...
# ],
# 'destination_address_line_list': [
# {"value": "USERTEST Slicea", "is_header": True},
# {"value": "2 rue unerue"},
# ...
# ],
# 'destination_hiring_info_list': [
# {"value": "Hiring Date: 1990/10/10"},
# ...
# ],
# 'destination_attendance_info_list': [
# {"value": "Normal Working Hours": 151.67"},
# ...
# ]
# 'destination_vacation_info_list': [
# {"value": "Earned this period: "},
# ...
# ],
# 'destination_taxation_info_list': [
# {"value": "Price Currency: EUR"},
# ],
# 'source_address_line_list: [
# {"value": "Nexedi SA", "is_header": True},
# {"value": "147 Rue du Ballon"}
# ...
# ],
# source_corporate_info_line_list: [
# {"value": "Corporate Registration Code: 440047504 00020"},
# {"value": "Activity Code: 5829C"},
# ...
# ],
# "payslip_section_list": [
# [
# {"value": "Usertest Slicea", "is_header": True, "value_base": "", "value_employee_share_rate": "", "value_employee_share": "", "value_employer_share_rate": "", "value_employer_share": ""},
# {"value": "Salarie de Base", "value_base": "2 805.28", "value_employee_share_rate": "", "value_employee_share": "", "value_employer_share_rate": "", "value_employer_share": ""}
# ], [
# ...
# ]
# ]
#}
response
=
{
"general_data_dict"
:
{
"year"
:
""
,
"net_salary"
:
""
,
"gross_salary"
:
""
},
"cumulative_title_list"
:
[],
"cumulative_info_list"
:
[],
"destination_address_line_list"
:
[],
"destination_hiring_info_list"
:
[],
"destination_attendance_info_list"
:
[],
"destination_vacation_info_list"
:
[],
"destination_taxation_info_list"
:
[],
"source_address_line_list"
:
[],
"source_corporate_info_line_list"
:
[],
"payslip_section_list"
:
[]
}
return
response
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getPayslipData.xml
0 → 100644
View file @
82198163
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
start_date=None, stop_date=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaySheetTransaction_getPayslipData
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_printPayslipReport.py
0 → 100644
View file @
82198163
"""
================================================================================
Wire PaySheetTransaction through to erp5_corporate_identity Report
================================================================================
"""
# ERP5 web uses format= argument, which is also a python builtin
# pylint: disable=redefined-builtin
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# international_form translate terms
# language target_language
return
context
.
Base_printAsReport
(
format
=
format
,
report_title
=
"Payslip"
,
report_name
=
"Person_generatePayslipReport"
,
language
=
target_language
,
start_date
=
context
.
getStartDate
()
or
None
,
stop_date
=
context
.
getStopDate
()
or
None
,
**
kw
)
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_printPayslipReport.xml
0 → 100644
View file @
82198163
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
format=None, international_form=None, target_language=None, *args,**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaySheetTransaction_printPayslipReport
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheet_getODTStyleSheet.
obj
→
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheet_getODTStyleSheet.
bin
View file @
82198163
File moved
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheet_viewODTPrintDialog.xml
View file @
82198163
...
...
@@ -35,7 +35,7 @@
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
PaySheet
_printAsODT
</string>
</value>
<value>
<string>
PaySheet
Transaction_printPayslipReport
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
...
...
@@ -124,6 +124,10 @@
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
...
...
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