Commit 8841e899 authored by Kevin Deldycke's avatar Kevin Deldycke

Support comments on Pay Sheet Lines (usefull for the accountant to add details...

Support comments on Pay Sheet Lines (usefull for the accountant to add details about why he altered one contribution).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10848 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 939c7f21
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string encoding="cdata"><![CDATA[
"""\n
This script get lines and cells from the PaySheetTransaction_viewPreview Fast Input and\n This script get lines and cells from the PaySheetTransaction_viewPreview Fast Input and\n
contruct the Pay Sheet Lines object according their own data model.\n contruct the Pay Sheet Lines object according their own data model.\n
TODO: this script is too complicated and should be refactor a little to reduce is uneeded\n TODO: this script is too complicated and should be refactor a little to reduce is uneeded\n
...@@ -90,7 +92,7 @@ for paysheet_item in context.objectValues(portal_type=[\'Pay Sheet Transaction L ...@@ -90,7 +92,7 @@ for paysheet_item in context.objectValues(portal_type=[\'Pay Sheet Transaction L
context.manage_delObjects(id_list)\n context.manage_delObjects(id_list)\n
\n \n
# This function register all paysheet informations in paysheet lines and cells\n # This function register all paysheet informations in paysheet lines and cells\n
def createPaySheetItem(title=\'\', res=\'\', dest_org=\'\', cells=[]):\n def createPaySheetItem(title=\'\', res=\'\', dest_org=\'\', desc=\'\', cells=[]):\n
# Select good cells only\n # Select good cells only\n
good_cells = []\n good_cells = []\n
for cell in cells:\n for cell in cells:\n
...@@ -106,9 +108,14 @@ def createPaySheetItem(title=\'\', res=\'\', dest_org=\'\', cells=[]):\n ...@@ -106,9 +108,14 @@ def createPaySheetItem(title=\'\', res=\'\', dest_org=\'\', cells=[]):\n
var_cat_list.append(cell["x"])\n var_cat_list.append(cell["x"])\n
if cell["y"] not in var_cat_list:\n if cell["y"] not in var_cat_list:\n
var_cat_list.append(cell["y"])\n var_cat_list.append(cell["y"])\n
# Construct the description\n
description = None\n
if len(desc) > 0:\n
description = \'\\n\'.join(desc)\n
# Add a new Pay Sheet Line\n # Add a new Pay Sheet Line\n
payline = context.newContent( portal_type = \'Pay Sheet Line\'\n payline = context.newContent( portal_type = \'Pay Sheet Line\'\n
, title = title\n , title = title\n
, description = description\n
, source = context.getSourceSection()\n , source = context.getSourceSection()\n
, resource = res\n , resource = res\n
, destination_section = dest_org\n , destination_section = dest_org\n
...@@ -163,6 +170,7 @@ for line in listbox:\n ...@@ -163,6 +170,7 @@ for line in listbox:\n
# Check that the service doesn\'t exist\n # Check that the service doesn\'t exist\n
if not paysheet_items.has_key(service_id):\n if not paysheet_items.has_key(service_id):\n
paysheet_items[service_id] = { \'title\' : service.getTitleOrId()\n paysheet_items[service_id] = { \'title\' : service.getTitleOrId()\n
, \'desc\' : []\n
, \'res\' : service.getRelativeUrl()\n , \'res\' : service.getRelativeUrl()\n
, \'dest_org\': service.getSource()\n , \'dest_org\': service.getSource()\n
, \'cells\' : []\n , \'cells\' : []\n
...@@ -204,6 +212,9 @@ for line in listbox:\n ...@@ -204,6 +212,9 @@ for line in listbox:\n
# Add the cell to the conresponding paysheet item\n # Add the cell to the conresponding paysheet item\n
if new_cell != None:\n if new_cell != None:\n
paysheet_items[service_id][\'cells\'].append(new_cell)\n paysheet_items[service_id][\'cells\'].append(new_cell)\n
# Save the comment as description\n
if line[\'description\'] not in [\'\', None]:\n
paysheet_items[service_id][\'desc\'].append(line[\'description\'])\n
\n \n
# Create a paysheet item for each service with user data in it\n # Create a paysheet item for each service with user data in it\n
for item in paysheet_items.values():\n for item in paysheet_items.values():\n
...@@ -211,6 +222,7 @@ for item in paysheet_items.values():\n ...@@ -211,6 +222,7 @@ for item in paysheet_items.values():\n
createPaySheetItem( title = item[\'title\']\n createPaySheetItem( title = item[\'title\']\n
, res = item[\'res\']\n , res = item[\'res\']\n
, dest_org = item[\'dest_org\']\n , dest_org = item[\'dest_org\']\n
, desc = item[\'desc\']\n
, cells = item[\'cells\']\n , cells = item[\'cells\']\n
)\n )\n
\n \n
...@@ -242,7 +254,9 @@ createPaySheetItem( title = \'Salary\'\n ...@@ -242,7 +254,9 @@ createPaySheetItem( title = \'Salary\'\n
# Return to pay sheet\n # Return to pay sheet\n
if not(kw.has_key(\'skip_redirect\') and kw[\'skip_redirect\'] == True):\n if not(kw.has_key(\'skip_redirect\') and kw[\'skip_redirect\'] == True):\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=Pay+sheet+calculation+done.\')\n return context.REQUEST.RESPONSE.redirect(context.absolute_url() + \'?portal_status_message=Pay+sheet+calculation+done.\')\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
......
...@@ -339,11 +339,15 @@ ...@@ -339,11 +339,15 @@
</tuple> </tuple>
<tuple> <tuple>
<string>title</string> <string>title</string>
<string>Tax Title</string> <string>Contribution</string>
</tuple>
<tuple>
<string>description</string>
<string>Comment</string>
</tuple> </tuple>
<tuple> <tuple>
<string>resource_title</string> <string>resource_title</string>
<string>Social Service</string> <string>Payroll Service</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_section_title</string> <string>source_section_title</string>
...@@ -456,6 +460,10 @@ ...@@ -456,6 +460,10 @@
<key> <string>not_viewable</string> </key> <key> <string>not_viewable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
......
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
<string>listbox_employee_share</string> <string>listbox_employee_share</string>
<string>listbox_employer_share</string> <string>listbox_employer_share</string>
<string>listbox_tax_category</string> <string>listbox_tax_category</string>
<string>listbox_description</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -337,6 +337,10 @@ ...@@ -337,6 +337,10 @@
<string>employee_share</string> <string>employee_share</string>
<string>Employee Share</string> <string>Employee Share</string>
</tuple> </tuple>
<tuple>
<string>description</string>
<string>Comment</string>
</tuple>
<tuple> <tuple>
<string>service_id</string> <string>service_id</string>
<string>Service ID</string> <string>Service ID</string>
...@@ -399,6 +403,10 @@ ...@@ -399,6 +403,10 @@
<string>employee_share</string> <string>employee_share</string>
<string>Employee Share</string> <string>Employee Share</string>
</tuple> </tuple>
<tuple>
<string>description</string>
<string>Comment</string>
</tuple>
<tuple> <tuple>
<string>service_id</string> <string>service_id</string>
<string>Service ID</string> <string>Service ID</string>
...@@ -466,6 +474,10 @@ ...@@ -466,6 +474,10 @@
<string>employee_share</string> <string>employee_share</string>
<string>Employee Share</string> <string>Employee Share</string>
</tuple> </tuple>
<tuple>
<string>description</string>
<string>Comment</string>
</tuple>
<tuple> <tuple>
<string>service_id</string> <string>service_id</string>
<string>Service ID</string> <string>Service ID</string>
......
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
......
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
......
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
......
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>max_length</string> </key>
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
* Change matrix box rendering dynamically depending of the type of the contribution. * Change matrix box rendering dynamically depending of the type of the contribution.
* Use LinesField instead of StringField to handle tax_category value, which is a list of categories. * Use LinesField instead of StringField to handle tax_category value, which is a list of categories.
* Do not call initializePreview anylonger. Use data from the listbox instead (much more flexible way to analyze data). * Do not call initializePreview anylonger. Use data from the listbox instead (much more flexible way to analyze data).
* Add new solidarity_day service.
* Reactivate lodging helps contribution.
* De-activate transportation contibution and add comments about how subtile is it to calculate it.
* Executive contributions (APEC) are due to march only.
* Support comments on Pay Sheet Lines (usefull for the accountant to add details about why he altered one contribution).
2006-10-19 Kevin 2006-10-19 Kevin
* Better dynamic display of PaySheet fast input. * Better dynamic display of PaySheet fast input.
......
38 42
\ 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