Commit f134f853 authored by Jérome Perrin's avatar Jérome Perrin

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

parent e144d2af
......@@ -100,6 +100,8 @@ request.set('analytic_column_list', analytic_column_list) # for Movement_getExpl
selection_columns = (
('date', 'Operation Date'),
('Movement_getSpecificReference', 'Transaction Reference'),
# XXX Movement_getSpecificReferenceOrExplanationReference is custom code
('Movement_getSpecificReferenceOrExplanationReference', 'Document Reference'),
('mirror_section_title', 'Third Party'),
('Movement_getExplanationTitleAndAnalytics', 'Title\nReference and Analytics' if analytic_column_list else 'Title\nReference'),
)
......
"""Return the "donor" code of the movement, or the explanation reference.
This script is custom code.
"""
movement = brain.getObject()
if not (movement.hasSourceReference() or movement.hasDestinationReference()):
return movement.getExplanationValue().getReference()
if brain.section_uid != brain.mirror_section_uid:
if movement.getSourceSectionUid() == brain.section_uid:
return movement.getSourceReference()
return movement.getDestinationReference()
# If we have a movement which exists for both section uid and mirror section uid,
# we can only guess what reference should be used.
if round(brain.total_quantity - movement.getQuantity(), 5) == 0:
return movement.getDestinationReference()
return delivery.getSourceReference()
<?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>_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