Commit 76e9e41e authored by Jérome Perrin's avatar Jérome Perrin

CUSTOM: display donor reference in account statement -done by Jerome

Conflicts:
	bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountStatementReportSectionList.xml
parent 886866f6
......@@ -150,7 +150,8 @@ request.set(\'analytic_column_list\', analytic_column_list) # for Movement_getEx
\n
selection_columns = (\n
(\'date\', \'Operation Date\'),\n
(\'Movement_getSpecificReference\', \'Transaction Reference\'),\n
# XXX Movement_getSpecificReferenceOrExplanationReference is custom code\n
(\'Movement_getSpecificReferenceOrExplanationReference\', \'Document Reference\'),\n
(\'Movement_getExplanationTitleAndAnalytics\', \'Title\\nReference and Analytics\' if analytic_column_list else \'Title\\nReference\'),\n
)\n
if len(section_uid) > 1:\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>"""Return the "donor" code of the movement, or the explanation reference.\n
\n
This script is custom code.\n
"""\n
movement = brain.getObject()\n
\n
if not (movement.hasSourceReference() or movement.hasDestinationReference()):\n
return movement.getExplanationValue().getReference()\n
\n
if brain.section_uid != brain.mirror_section_uid:\n
if movement.getSourceSectionUid() == brain.section_uid:\n
return movement.getSourceReference()\n
return movement.getDestinationReference()\n
\n
# If we have a movement which exists for both section uid and mirror section uid,\n
# we can only guess what reference should be used.\n
if round(brain.total_quantity - movement.getQuantity(), 5) == 0:\n
return movement.getDestinationReference()\n
\n
return delivery.getSourceReference()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection=None, **kwd</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getSpecificReferenceOrExplanationReference</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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