Commit 2d484a69 authored by Aurel's avatar Aurel Committed by Jérome Perrin

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

parent bf872467
......@@ -155,7 +155,8 @@ selection_columns += analytic_column_list\n
if not mirror_section:\n
selection_columns += ( (\'Movement_getMirrorSectionTitle\', \'Third Party\'), )\n
selection_columns += (\n
(\'Movement_getExplanationReference\', \'Document Reference\'),\n
# XXX Movement_getSpecificReferenceOrExplanationReference is custom code\n
(\'Movement_getSpecificReferenceOrExplanationReference\', \'Document Reference\'),\n
(\'debit_price\', \'Debit\'),\n
(\'credit_price\', \'Credit\'),\n
(\'running_total_price\', \'Net\'),)\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