Commit 1074aee6 authored by Kevin Deldycke's avatar Kevin Deldycke

Update Pay Sheet PDF rendering to show addendum.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10919 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 77578140
...@@ -82,10 +82,10 @@ portal = context.getPortalObject()\n ...@@ -82,10 +82,10 @@ portal = context.getPortalObject()\n
# Initialize total share\n # Initialize total share\n
gross_salary = 0.0\n gross_salary = 0.0\n
net_salary = 0.0\n net_salary = 0.0\n
taxable_net_salary = 0.0\n
total_employer_share = 0.0\n total_employer_share = 0.0\n
total_employee_share = 0.0 # Alternative: total_employee_share = r_(gross_salary - net_salary)\n total_employee_share = 0.0 # Alternative: total_employee_share = r_(gross_salary - net_salary)\n
taxable_net_salary = 0.0\n total_addendum = 0.0\n
\n
\n \n
\n \n
##############################################################################\n ##############################################################################\n
...@@ -288,8 +288,16 @@ for psl in context.objectValues(portal_type=\'Pay Sheet Line\'):\n ...@@ -288,8 +288,16 @@ for psl in context.objectValues(portal_type=\'Pay Sheet Line\'):\n
\n \n
### Addendum group handling\n ### Addendum group handling\n
elif range_type.startswith("fixed/addendum"):\n elif range_type.startswith("fixed/addendum"):\n
# TODO: support addendum\n # Ignore the base, rates and employer share\n
pass\n cell_value = r_(cell.getPrice())\n
if share_type == \'employee\':\n
updateSubLine( group_id = cell_group_id\n
, subline_id = cell_subline_id\n
, property = \'employee_share\'\n
, value = cell_value\n
)\n
# Update total addendum\n
total_addendum = r_(total_addendum + cell_value)\n
\n \n
### Default/Standard line group handling\n ### Default/Standard line group handling\n
else:\n else:\n
...@@ -344,6 +352,7 @@ details[\'totals\'][\'net_salary\'] = net_salary\n ...@@ -344,6 +352,7 @@ details[\'totals\'][\'net_salary\'] = net_salary\n
details[\'totals\'][\'taxable_net_salary\'] = taxable_net_salary\n details[\'totals\'][\'taxable_net_salary\'] = taxable_net_salary\n
details[\'totals\'][\'total_employer_share\'] = total_employer_share\n details[\'totals\'][\'total_employer_share\'] = total_employer_share\n
details[\'totals\'][\'total_employee_share\'] = total_employee_share\n details[\'totals\'][\'total_employee_share\'] = total_employee_share\n
details[\'totals\'][\'total_addendum\'] = total_addendum\n
\n \n
return details\n return details\n
...@@ -401,9 +410,10 @@ return details\n ...@@ -401,9 +410,10 @@ return details\n
<string>portal</string> <string>portal</string>
<string>gross_salary</string> <string>gross_salary</string>
<string>net_salary</string> <string>net_salary</string>
<string>taxable_net_salary</string>
<string>total_employer_share</string> <string>total_employer_share</string>
<string>total_employee_share</string> <string>total_employee_share</string>
<string>taxable_net_salary</string> <string>total_addendum</string>
<string>details</string> <string>details</string>
<string>getPSLGroupIdList</string> <string>getPSLGroupIdList</string>
<string>groupExist</string> <string>groupExist</string>
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
tal:define="details python: here.PaySheetTransaction_getDetails();\n tal:define="details python: here.PaySheetTransaction_getDetails();\n
start_date python: here.getStartDate();\n start_date python: here.getStartDate();\n
boldstyle python: \'(\\\'FONT\\\', \\\'Helvetica-Bold\\\', 7)\';\n boldstyle python: \'(\\\'FONT\\\', \\\'Helvetica-Bold\\\', 7)\';\n
GROSS_SALARY_GROUP_ID python: \'gross\'">\n GROSS_SALARY_GROUP_ID python: \'gross\';\n
ADDENDUM_GROUP_ID python: \'addendum\'">\n
\n \n
<title>Pay Sheet</title>\n <title>Pay Sheet</title>\n
<author>Nexedi ERP5</author>\n <author>Nexedi ERP5</author>\n
...@@ -112,7 +113,7 @@ ...@@ -112,7 +113,7 @@
</tr>\n </tr>\n
\n \n
<tal:block repeat="group python: details[\'groups\']">\n <tal:block repeat="group python: details[\'groups\']">\n
<tal:block condition="python: group[\'id\'] != GROSS_SALARY_GROUP_ID">\n <tal:block condition="python: group[\'id\'] not in [GROSS_SALARY_GROUP_ID, ADDENDUM_GROUP_ID]">\n
<tr tal:attributes="stylecmd boldstyle">\n <tr tal:attributes="stylecmd boldstyle">\n
<td tal:content="python: group[\'title\']"> </td>\n <td tal:content="python: group[\'title\']"> </td>\n
<td> </td>\n <td> </td>\n
...@@ -191,6 +192,55 @@ ...@@ -191,6 +192,55 @@
</tr>\n </tr>\n
</table>\n </table>\n
\n \n
<tal:block repeat="group python: details[\'groups\']">\n
<table splitbyrow="1" rowheight=\'0.4cm\' repeatrows="1" repeatcols="0" style="decompte"\n
tal:condition="python: group[\'id\'] == ADDENDUM_GROUP_ID">\n
<tr>\n
<td colwidth="4.318cm">Nature</td>\n
<td colwidth="3.81cm">Base</td>\n
<td colwidth="1.524cm"> </td>\n
<td colwidth="2.77cm"> </td>\n
<td colwidth="2.288cm"> </td>\n
<td colwidth="2.397cm"> </td>\n
<td colwidth="1.959cm">Montant</td>\n
</tr>\n
<tr tal:attributes="stylecmd boldstyle">\n
<td tal:content="python: group[\'title\']"> </td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
</tr>\n
<tr tal:repeat="line python: group[\'sublines\']" stylecmd="(\'LEFTPADDING\',8)">\n
<td><tal:block content="python: \' \' + line[\'service_title\']"/> </td>\n
<td><tal:block content="python: line[\'salary_range_title\']"/> </td>\n
<td><tal:block content="python: line[\'base\']"\n
condition="python: line[\'base\'] != None"/> </td>\n
<td><tal:block content="python: line[\'employer_rate\']"\n
condition="python: line[\'employer_rate\'] != None"/> </td>\n
<td><tal:block content="python: line[\'employer_share\']"\n
condition="python: line[\'employer_share\'] != None"/> </td>\n
<td><tal:block content="python: line[\'employee_rate\']"\n
condition="python: line[\'employee_rate\'] != None"/> </td>\n
<td><tal:block content="python: line[\'employee_share\']"\n
condition="python: line[\'employee_share\'] != None"/> </td>\n
</tr>\n
<tr tal:attributes="stylecmd boldstyle">\n
<td>Total</td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
<td> </td>\n
<td><tal:block replace="python: details[\'totals\'][\'total_addendum\']"\n
condition="python: details[\'totals\'].has_key(\'total_addendum\')"/> </td>\n
</tr>\n
</table>\n
</tal:block>\n
\n
<!-- This table act as a spacer -->\n
<table rowheight="0.6cm"><tr><td> </td></tr></table>\n <table rowheight="0.6cm"><tr><td> </td></tr></table>\n
\n \n
<table style="cumul_conges">\n <table style="cumul_conges">\n
......
2006-10-24 Kevin 2006-10-24 Kevin
* Support dynamic update of gross salary calculation on pay sheet preview. * Support dynamic update of gross salary calculation on pay sheet preview.
* Support addendum on paysheets.
* Update Pay Sheet PDF rendering to show addendum.
2006-10-23 Kevin 2006-10-23 Kevin
* Change category structure to support additional lines beside base salary to constitute the gross salary. Now the gross salary can be composed of several lines, variable or fixed. * Change category structure to support additional lines beside base salary to constitute the gross salary. Now the gross salary can be composed of several lines, variable or fixed.
......
65 72
\ No newline at end of file \ No newline at end of file
0.1.15 0.1.16
\ No newline at end of file \ No newline at end of file
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