Commit 6f08d94d authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_payroll_l10n_fr: improvement

1. display employee number
2. add preview
3. add parameter to send to maileva
parent 208e47b9
context.log('You should set properly security so only accounting stuff have access')
<?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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PDF_setAccountingSecurity</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -30,6 +30,7 @@
<span tal:condition='other_data_dict/source_section_default_career_start_date' tal:content='python:other_data_dict["source_section_default_career_start_date"]'>12/09/2005</span>
<span tal:condition='other_data_dict/source_section_career_title' tal:content='python:other_data_dict["source_section_career_title"]'>Réceptionniste</span>
<span tal:condition='other_data_dict/source_section_default_career_coefficient' tal:content='python:other_data_dict["source_section_default_career_coefficient"]'>100</span>
<span tal:condition='other_data_dict/source_section_career_employee_number' tal:content='python: other_data_dict["source_section_career_employee_number"]'></span>
</div>
</div>
</tal:block>
\ No newline at end of file
......@@ -14,6 +14,13 @@ def getFieldAsLineList(field):
text_list = text.split('\n')
return [x for x in text_list if x]
def getEmployeeNumber(source_section_career):
employee_number = source_section_career.getReference()
s = ''
if employee_number:
s = '%s: %s' % (translateString('Employee Number'), employee_number)
return s
def getSocialCodeId(social_code_id):
s = ''
if social_code_id:
......@@ -212,6 +219,7 @@ data_dict = {
'total_employee_tax': getTotalEmployeeTaxId(total_employee_tax),
'total_employer_tax': getTotalEmployerTaxId(total_employer_tax),
'year_to_date_total_employer_tax': year_to_date_total_employer_tax,
'source_section_career_employee_number': getEmployeeNumber(source_section_career)
}
return unicodeDict(data_dict)
......@@ -11,18 +11,28 @@ Wire PaySheetTransaction through to erp5_corporate_identity Report
# format: output in html*, pdf
# international_form translate terms
# language target_language
return context.Base_printAsReport(
format=format,
report_header = "PaySheetTransaction_generatePayslipReportHeader",
report_name = "PaySheetTransaction_generatePayslipReport",
report_footer = "PaySheetTransaction_generatePayslipReportFooter",
conversion_dict = dict(
margin_top=60,
header_spacing=5
),
css_path="payslip_css/payslip",
document_language=target_language,
start_date=context.getStartDate() or None,
stop_date=context.getStopDate() or None,
**kw
kw['format'] =format
kw['report_header'] = "PaySheetTransaction_generatePayslipReportHeader"
kw['report_name'] = "PaySheetTransaction_generatePayslipReport"
kw['report_footer'] = "PaySheetTransaction_generatePayslipReportFooter"
kw['conversion_dict'] = dict(
margin_top=60,
header_spacing=5
)
kw['css_path']="payslip_css/payslip"
kw['document_language']=target_language
kw['start_date']=context.getStartDate() or None
kw['stop_date']=context.getStopDate() or None
kw['get_doc_after_save'] = send_to_maileva
if not send_to_maileva:
return context.Base_printAsReport(**kw)
document = context.Base_printAsReport(**kw)
document.edit(title='BULLETIN DE PAIE: %s' % document.getTitle())
document.PDF_sendToMaileva(recipient=context.getSourceSectionValue(), sender=context.getDestinationTradeValue())
document.setFollowUpValue(context)
document.PDF_setAccountingSecurity()
return document.Base_redirect('PDF_viewPDFJSPreview', keep_items={'portal_status_message': 'This document is sending to maileva'})
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format=None, international_form=None, target_language=None, *args,**kw</string> </value>
<value> <string>format=None, international_form=None, target_language=None, send_to_maileva=None,*args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
from Products.ERP5Type.Message import translateString
if dialog_id is not None:
request = container.REQUEST
request.form['portal_status_message'] = translateString('Preview updated.')
request.form['cancel_url'] = cancel_url
request.form['format'] = format
request.form['send_to_maileva'] = send_to_maileva
request.form['evoluation_remuneration'] = evoluation_remuneration
request.form['taken_holiday'] = taken_holiday
request.form['total_holiday'] = total_holiday
return context.Base_renderForm(dialog_id)
<?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>dialog_id=None, cancel_url=None, format=None, send_to_maileva=None, evoluation_remuneration=None, taken_holiday=None, total_holiday = None, *args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetTransaction_updatePayslipReportDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -65,6 +65,7 @@
<list>
<string>left</string>
<string>right</string>
<string>bottom</string>
</list>
</value>
</item>
......@@ -72,6 +73,14 @@
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>content</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
......@@ -89,6 +98,7 @@
<value>
<list>
<string>your_format</string>
<string>your_send_to_maileva</string>
</list>
</value>
</item>
......@@ -129,7 +139,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
<value> <string>PaySheetTransaction_updatePayslipReportDialog</string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_send_to_maileva</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>This field is mandatory.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Send To Maileva</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment