[Erp5-report] r25325 - in /erp5/trunk/bt5/erp5_payroll: SkinTemplateItem/portal_skins/erp5_...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 28 12:07:50 CET 2009


Author: fabien
Date: Wed Jan 28 12:07:49 2009
New Revision: 25325

URL: http://svn.erp5.org?rev=25325&view=rev
Log:
2009-01-28 fabien
* remove some unused script and refeactor some very similar scripts in a generic one

Added:
    erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementTotalPriceFromCategory.xml
    erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.xml
Modified:
    erp5/trunk/bt5/erp5_payroll/bt/change_log
    erp5/trunk/bt5/erp5_payroll/bt/revision

Added: erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementTotalPriceFromCategory.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementTotalPriceFromCategory.xml?rev=25325&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementTotalPriceFromCategory.xml (added)
+++ erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementTotalPriceFromCategory.xml [utf8] Wed Jan 28 12:07:49 2009
@@ -1,0 +1,151 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </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>_body</string> </key>
+            <value> <string>\'\'\'\n
+  return the amount composed by all amount of paysheet line wich category of\n
+  category_list parameter is in variation_category_list of the PaySheet line \n
+  and wich has a base_contribution in the base_contribution_list\n
+\'\'\'\n
+\n
+total_price = 0\n
+movement_list = context.getMovementList(portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'))\n
+for movement in movement_list:\n
+  if movement.isMemberOf(tax_category) and movement.isMemberOf(base_contribution):\n
+    total_price += movement.getTotalPrice()\n
+\n
+# Get Precision\n
+precision = context.getPriceCurrencyValue().getQuantityPrecision()\n
+\n
+amount = round(total_price, precision)\n
+return amount\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>base_contribution=None, tax_category=None</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>2</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>base_contribution</string>
+                            <string>tax_category</string>
+                            <string>total_price</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>movement_list</string>
+                            <string>_getiter_</string>
+                            <string>movement</string>
+                            <string>_inplacevar_</string>
+                            <string>precision</string>
+                            <string>round</string>
+                            <string>amount</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>PaySheetTransaction_getMovementTotalPriceFromCategory</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.xml?rev=25325&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.xml (added)
+++ erp5/trunk/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.xml [utf8] Wed Jan 28 12:07:49 2009
@@ -1,0 +1,178 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </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>_body</string> </key>
+            <value> <string>\'\'\'\n
+  this script return the total price of the base contribution list\n
+  from the first of january of the year of the paysheet and until\n
+  the start_date of this current paysheet.\n
+\'\'\'\n
+\n
+if paysheet is None:\n
+    paysheet = context\n
+\n
+# test the list parameters\n
+if base_contribution_list is None:\n
+  base_contribution_list = []\n
+elif not (same_type(base_contribution_list, []) or\n
+          same_type(base_contribution_list, ())):\n
+  base_contribution_list = [base_contribution_list]\n
+\n
+portal = context.getPortalObject();\n
+portal_simulation = portal.portal_simulation\n
+\n
+base_amount = portal.portal_categories.base_amount\n
+context.log(base_contribution_list)\n
+base_contribution_uid_list = [getattr(base_amount, category, None).getUid() for category in base_contribution_list]\n
+\n
+params = {\n
+    \'node_uid\' : paysheet.getSourceSectionUid(),\n
+    \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
+    \'section_uid\' : paysheet.getDestinationSectionUid(),\n
+    \'tax_category_uid\' :\\\n
+        portal.portal_categories.tax_category.employee_share.getUid(),\n
+    \'to_date\' : paysheet.getStartDate(),\n
+    \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
+    \'simulation_state\'    : [\'confirmed\', \'stopped\', \'delivered\'],\n
+    \'precision\' : paysheet.getPriceCurrencyValue().getQuantityPrecision(),\n
+    \'base_contribution_uid\' : base_contribution_uid_list,\n
+    #\'src__\' : 1\n
+  }\n
+\n
+return portal_simulation.getInventoryAssetPrice(**params)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>paysheet=None, base_contribution_list=None</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>2</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>paysheet</string>
+                            <string>base_contribution_list</string>
+                            <string>None</string>
+                            <string>context</string>
+                            <string>same_type</string>
+                            <string>_getattr_</string>
+                            <string>portal</string>
+                            <string>portal_simulation</string>
+                            <string>base_amount</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>category</string>
+                            <string>getattr</string>
+                            <string>base_contribution_uid_list</string>
+                            <string>DateTime</string>
+                            <string>params</string>
+                            <string>_apply_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <none/>
+                <none/>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>PaySheetTransaction_getYearToDateBaseContributionTotalPrice</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_payroll/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/bt/change_log?rev=25325&r1=25324&r2=25325&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_payroll/bt/change_log [utf8] Wed Jan 28 12:07:49 2009
@@ -1,3 +1,6 @@
+2009-01-28 fabien
+* remove some unused script and refeactor some very similar scripts in a generic one
+
 2009-01-21 fabien
 * remove unused field base_amount_list
 * change error messages in PaySheetTransaction_checkParameters to be consistant with other translations

Modified: erp5/trunk/bt5/erp5_payroll/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_payroll/bt/revision?rev=25325&r1=25324&r2=25325&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_payroll/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_payroll/bt/revision [utf8] Wed Jan 28 12:07:49 2009
@@ -1,1 +1,1 @@
-339
+343




More information about the Erp5-report mailing list