Commit 491153c0 authored by Aurel's avatar Aurel

update & improve scripts which are used in render of paysheet as ODT

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45044 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 913027d7
...@@ -55,17 +55,26 @@ ...@@ -55,17 +55,26 @@
category_list parameter is in variation_category_list of the PaySheet line \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 and wich has a base_contribution in the base_contribution_list\n
\'\'\'\n \'\'\'\n
if excluded_reference_list is None:\n
excluded_reference_list = []\n
\n \n
total_price = 0\n total_price = 0\n
movement_list = context.getMovementList(portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'))\n movement_list = context.getMovementList(portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'))\n
for movement in movement_list:\n for movement in movement_list:\n
if base_contribution is not None and movement.isMemberOf(base_contribution):\n # Reference must be checked on line\n
if "Cell" in movement.getPortalType():\n
line = movement.getParentValue()\n
else:\n
line = movement\n
if line.getReference() in excluded_reference_list:\n
continue\n
if base_contribution is not None and movement.isMemberOf(base_contribution) or no_base_contribution:\n
\n \n
# base_contribution is mandatory, but not contribution_share. If contribution_share is\n # base_contribution is mandatory, but not contribution_share. If contribution_share is\n
# given, search with it, if not, care only about base_contribution\n # given, search with it, if not, care only about base_contribution\n
if contribution_share is not None and movement.isMemberOf(contribution_share):\n if contribution_share is not None and movement.isMemberOf(contribution_share):\n
total_price += movement.getTotalPrice()\n total_price += movement.getTotalPrice()\n
elif contribution_share is None or len(movement.getContributionShareList()) == 0:\n elif include_empty_contribution and (contribution_share is None or len(movement.getContributionShareList()) == 0):\n
total_price += movement.getTotalPrice()\n total_price += movement.getTotalPrice()\n
\n \n
\n \n
...@@ -78,7 +87,7 @@ return amount\n ...@@ -78,7 +87,7 @@ return amount\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>base_contribution=None, contribution_share=None</string> </value> <value> <string>base_contribution=None, contribution_share=None, no_base_contribution=False, include_empty_contribution=True, excluded_reference_list=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -55,10 +55,6 @@ ...@@ -55,10 +55,6 @@
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
specialise_value = context.getSpecialiseValue()\n specialise_value = context.getSpecialiseValue()\n
\n \n
#XXX `model` is not used.\n
model = None\n
if specialise_value is not None:\n
model = specialise_value.getEffectiveModel(start_date=context.getStartDate(), stop_date=context.getStopDate())\n
\n \n
def getFieldAsString(field):\n def getFieldAsString(field):\n
return \', \'.join(getFieldAsLineList(field))\n return \', \'.join(getFieldAsLineList(field))\n
...@@ -232,6 +228,7 @@ if destination_administration is None:\n ...@@ -232,6 +228,7 @@ if destination_administration is None:\n
if destination_administration is None:\n if destination_administration is None:\n
destination_administration = EmptyOrganisation()\n destination_administration = EmptyOrganisation()\n
\n \n
social_organisation = getSocialOrganisationValue()\n
\n \n
data_dict = {\n data_dict = {\n
\'source_section_title\': source_section.getProperty(\'corporate_name\') or\\\n \'source_section_title\': source_section.getProperty(\'corporate_name\') or\\\n
...@@ -355,10 +352,10 @@ data_dict = {\n ...@@ -355,10 +352,10 @@ data_dict = {\n
context.getDestinationSectionValue().getProperty(\'activity_code\') or \'\'),\n context.getDestinationSectionValue().getProperty(\'activity_code\') or \'\'),\n
\'destination_section_social_codeid\': getSocialCodeId(context.getDestinationSection() and\n \'destination_section_social_codeid\': getSocialCodeId(context.getDestinationSection() and\n
context.getDestinationSectionValue().getProperty(\'social_code\') or \'\'),\n context.getDestinationSectionValue().getProperty(\'social_code\') or \'\'),\n
\'destination_section_social_company_title\' : getSocialOrganisationValue() is not None and getSocialOrganisationValue().getTitle() or \'\',\n \'destination_section_social_company_title\' : social_organisation is not None and social_organisation.getTitle() or \'\',\n
\'destination_section_social_address\': getSocialOrganisationValue() is not None and getOneLineAddress(\\\n \'destination_section_social_address\': social_organisation is not None and getOneLineAddress(\\\n
getSocialOrganisationValue().getDefaultAddressText(),\n social_organisation.getDefaultAddressText(),\n
getSocialOrganisationValue().getDefaultAddressRegionTitle()) or \'\',\n social_organisation.getDefaultAddressRegionTitle()) or \'\',\n
\'destination_administration_title\':\\\n \'destination_administration_title\':\\\n
destination_administration.getProperty(\'corporate_name\') or \\\n destination_administration.getProperty(\'corporate_name\') or \\\n
destination_administration.getTitle(),\n destination_administration.getTitle(),\n
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
the start_date of this current paysheet. Return 0.0 if there is no amount.\n the start_date of this current paysheet. Return 0.0 if there is no amount.\n
\'\'\'\n \'\'\'\n
\n \n
# XXX-Aurel : this script is currently not working as paysheet transaction line/cell\n
# are not in stock table due to the lack of source/destination definition\n
\n
if paysheet is None:\n if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
......
583 584
\ 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