Commit 9e4c36d5 authored by Kevin Deldycke's avatar Kevin Deldycke

2006-02-27 Kevin

* Update AccountingTransactionModule_viewAnnualSalaryReport to show more paysheet conflicts by default.
* Add AccountingModule_checkPaySheetConsistency, a usefull, but dirty, script to track bad destination and destination_section on Pay Sheet Lines.

2006-02-24 Kevin
* Update PaySheetTransaction_viewAccountingLineList form.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6027 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 33d6b4d0
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Usefull, but dirty, script to track bad destination and destination_section on pay sheet line.\n
"""\n
\n
print "<html>"\n
print "<h1>Check PaySheets Consistency</h1>"\n
for pay_sheet in context.accounting_module.objectValues(portal_type = [\'Pay Sheet Transaction\']):\n
if pay_sheet.getSimulationState() not in (\'cancelled\', \'delivered\'):\n
if str(pay_sheet.getStartDate()).split(\'/\')[0] == \'2005\':\n
print "<br/>"\n
print "<h2><a href=\'%s\'>%s - %s</a> [%s]</h2>" % (pay_sheet.absolute_url(), pay_sheet.getTitle(), pay_sheet.getStartDate(), pay_sheet.getSimulationState())\n
for pay_sheet_line in pay_sheet.objectValues(portal_type = [\'Pay Sheet Line\']):\n
social_service = pay_sheet_line.getResourceValue()\n
supplier = social_service.getSourceValue()\n
ps_destination = pay_sheet_line.getDestinationValue()\n
ps_destination_section = pay_sheet_line.getDestinationSectionValue()\n
if supplier != None:\n
if supplier != ps_destination:\n
print "<a href=\'%s\'>%s [%s]</a> has bad destination (%s instead of %s) <br/>" % ( pay_sheet_line.absolute_url()\n
, pay_sheet_line.getPath()\n
, pay_sheet_line.getTitle()\n
, repr(ps_destination).replace(\'>\', \']\').replace(\'<\', \'[\')\n
, repr(supplier).replace(\'>\', \']\').replace(\'<\', \'[\')\n
)\n
# pay_sheet_line.setDestinationValue(supplier)\n
if supplier != ps_destination_section:\n
print "<a href=\'%s\'>%s [%s]</a> has bad destination_section (%s instead of %s) <br/>" % ( pay_sheet_line.absolute_url()\n
, pay_sheet_line.getPath()\n
, pay_sheet_line.getTitle()\n
, repr(ps_destination_section).replace(\'>\', \']\').replace(\'<\', \'[\')\n
, repr(supplier).replace(\'>\', \']\').replace(\'<\', \'[\')\n
)\n
# pay_sheet_line.setDestinationSectionValue(supplier)\n
elif social_service.getId() != \'labour\':\n
print "<font color=\'#f00\'><a href=\'%s\'>%s [%s]</a> <b>Supplier is None !</b></font><br/>" % ( pay_sheet_line.absolute_url()\n
, pay_sheet_line.getPath()\n
, pay_sheet_line.getTitle()\n
)\n
print "</html>"\n
return printed\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_payroll/AccountingModule_checkPaySheetConsistency</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_print_</string>
<string>_print</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>pay_sheet</string>
<string>_getitem_</string>
<string>str</string>
<string>pay_sheet_line</string>
<string>social_service</string>
<string>supplier</string>
<string>ps_destination</string>
<string>ps_destination_section</string>
<string>None</string>
<string>repr</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountingModule_checkPaySheetConsistency</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -73,8 +73,9 @@ portal_catalog = context.getPortalObject().portal_catalog\n ...@@ -73,8 +73,9 @@ portal_catalog = context.getPortalObject().portal_catalog\n
\n \n
query = {\n query = {\n
"portal_type" : "Pay Sheet Transaction",\n "portal_type" : "Pay Sheet Transaction",\n
"simulation_state" : ["confirmed", "stopped", "delivered"],\n "simulation_state" : ["confirmed", "stopped", "delivered", "draft", "planned"],\n
"delivery.stop_date" : ">2004-12-31",\n "delivery.stop_date" : ">2004-12-31",\n
"delivery.start_date" : "<2005-12-31",\n
"sort_on" : ("delivery.start_date", "ASC")\n "sort_on" : ("delivery.start_date", "ASC")\n
}\n }\n
\n \n
...@@ -104,20 +105,21 @@ for p, paysheets in paysheet_par_person.items() :\n ...@@ -104,20 +105,21 @@ for p, paysheets in paysheet_par_person.items() :\n
gathered_data[p] = {}\n gathered_data[p] = {}\n
for paysheet in paysheets :\n for paysheet in paysheets :\n
start_month = paysheet.start_date.month() - 1\n start_month = paysheet.start_date.month() - 1\n
if not gathered_data[p].has_key (start_month) :\n if not gathered_data[p].has_key(start_month) :\n
gathered_data[p][start_month] = {}\n gathered_data[p][start_month] = {}\n
if gathered_data[p][start_month].has_key ("salary") :\n if gathered_data[p][start_month].has_key("salary") :\n
if not gathered_data[p][start_month].has_key("doubles") :\n if not gathered_data[p][start_month].has_key("duplicates") :\n
gathered_data[p][start_month]["doubles"] = 0\n gathered_data[p][start_month]["duplicates"] = []\n
gathered_data[p][start_month]["doubles"] = gathered_data [p][start_month]["doubles"] + 1\n gathered_data[p][start_month]["duplicates"].append(paysheet)\n
else :\n else :\n
# get the taxable salary\n # get the taxable salary\n
ps_details = paysheet.PaySheetTransaction_getDetails()\n ps_details = paysheet.PaySheetTransaction_getDetails()\n
salary_value = ps_details[salary_type]\n salary_value = ps_details[salary_type]\n
# Round the value the same way it is printed by PaySheetTransaction_viewPaySheetTransactionAsPDF.\n # Round the value the same way it is printed by PaySheetTransaction_viewPaySheetTransactionAsPDF.\n
# In fact the rounding must be done by PaySheetTransaction_getDetails to homogenize the value in the paysheet module.\n # In fact the rounding must be done by PaySheetTransaction_getDetails to homogenize the value in the paysheet module.\n
gathered_data [p][start_month]["salary"] = float(\'%.2f\' % salary_value)\n gathered_data[p][start_month]["salary"] = float(\'%.2f\' % salary_value)\n
gathered_data [p][start_month]["url"] = paysheet.getPath()\n gathered_data[p][start_month]["url"] = paysheet.getPath()\n
gathered_data[p][start_month]["state"] = paysheet.getSimulationState()\n
\n \n
# DISPLAY part\n # DISPLAY part\n
\n \n
...@@ -129,12 +131,14 @@ print """\n ...@@ -129,12 +131,14 @@ print """\n
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n
<title>R\xc3\xa9capitulatif des salaires bruts</title>\n <title>R\xc3\xa9capitulatif des salaires bruts</title>\n
<style>\n <style>\n
a {\n a {text-decoration : none;}\n
text-decoration : none;\n a:hover {text-decoration : underline;}\n
}\n \n
a:hover {\n .warning {color: #f00;}\n
text-decoration : underline;\n .warning a:link {color: #f00;}\n
}\n .warning a:visited {color: #f00;}\n
.warning a:hover {color: #f00;}\n
\n
table {\n table {\n
border-collapse : collapse;\n border-collapse : collapse;\n
}\n }\n
...@@ -194,8 +198,10 @@ for person_path, person_dict in gathered_data.items() :\n ...@@ -194,8 +198,10 @@ for person_path, person_dict in gathered_data.items() :\n
monthly_total[month] = 0\n monthly_total[month] = 0\n
monthly_total[month] = monthly_total[month] + person_dict[month]["salary"]\n monthly_total[month] = monthly_total[month] + person_dict[month]["salary"]\n
print "<a href=\\"%s\\">%s</a>" % (person_dict[month]["url"], person_dict[month]["salary"])\n print "<a href=\\"%s\\">%s</a>" % (person_dict[month]["url"], person_dict[month]["salary"])\n
if person_dict[month].has_key("doubles") :\n if person_dict[month].has_key("duplicates"):\n
print "!" * person_dict[month]["doubles"]\n print "[%s]<br/>" % (person_dict[month]["state"])\n
for dup_ps in person_dict[month]["duplicates"]:\n
print "<span class=\'warning\'><a href=\'%s\'><b>%s !</b> [%s]</a></span><br/>" % (dup_ps.absolute_url(), dup_ps.getGrossSalary(), dup_ps.getSimulationState())\n
print "</td>"\n print "</td>"\n
print "<td>%s</td></tr>" % person_total\n print "<td>%s</td></tr>" % person_total\n
total += person_total\n total += person_total\n
...@@ -273,7 +279,7 @@ return printed\n ...@@ -273,7 +279,7 @@ return printed\n
<string>_print</string> <string>_print</string>
<string>DateTime</string> <string>DateTime</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_catalog</string> <string>portal_catalog</string>
<string>query</string> <string>query</string>
<string>paysheet_par_person</string> <string>paysheet_par_person</string>
...@@ -297,6 +303,7 @@ return printed\n ...@@ -297,6 +303,7 @@ return printed\n
<string>person_total</string> <string>person_total</string>
<string>range</string> <string>range</string>
<string>month</string> <string>month</string>
<string>dup_ps</string>
<string>check_total</string> <string>check_total</string>
</tuple> </tuple>
</value> </value>
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Sale Invoice Transaction</string> </value> <value> <string>Pay Sheet Transaction</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
......
...@@ -338,12 +338,16 @@ ...@@ -338,12 +338,16 @@
<string>ID</string> <string>ID</string>
</tuple> </tuple>
<tuple> <tuple>
<string>title</string> <string>getSourceSectionTitle</string>
<string>Title</string> <string>Source Section</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source</string> <string>source</string>
<string>Account</string> <string>Source Account</string>
</tuple>
<tuple>
<string>getDestinationSectionTitle</string>
<string>Third Party</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_debit</string> <string>source_debit</string>
...@@ -356,6 +360,10 @@ ...@@ -356,6 +360,10 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -448,7 +456,7 @@ ...@@ -448,7 +456,7 @@
</item> </item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <int>10</int> </value> <value> <int>20</int> </value>
</item> </item>
<item> <item>
<key> <string>list_action</string> </key> <key> <string>list_action</string> </key>
...@@ -497,7 +505,7 @@ ...@@ -497,7 +505,7 @@
</item> </item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
<value> <string></string> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>search_columns</string> </key> <key> <string>search_columns</string> </key>
...@@ -586,7 +594,7 @@ ...@@ -586,7 +594,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <unicode>AccountingTransaction_searchInvoiceTransactionLines</unicode> </value> <value> <string>AccountingTransaction_searchInvoiceTransactionLines</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
2006-02-27 Kevin
* Update AccountingTransactionModule_viewAnnualSalaryReport to show more paysheet conflicts by default.
* Add AccountingModule_checkPaySheetConsistency, a usefull, but dirty, script to track bad destination and destination_section on Pay Sheet Lines.
2006-02-24 Kevin
* Update PaySheetTransaction_viewAccountingLineList form.
2006-02-15 Kevin 2006-02-15 Kevin
* Add an Annual Report generator (must be refactored and cleaned up). * Add an Annual Report generator (must be refactored and cleaned up).
* Update dependencies. * Update dependencies.
......
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