<?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>Python_magic</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>__ac_local_roles__</string> </key>
            <value>
              <none/>
            </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 encoding="cdata"><![CDATA[

"""Returns value for \'columns\' fields in accounting transaction listboxs.\n
\n
If there is more than one mirror_section on lines, the listbox will have an\n
extra column showing mirror_section_title.\n
The same for apply for payment / payment_reference.\n
"""\n
section_dict = {None: 1}\n
payment_dict = {None: 1}\n
for line in context.getMovementList():\n
  section_dict[line.getSourceSection()] = 1\n
  section_dict[line.getDestinationSection()] = 1\n
  payment_dict[line.getSourcePayment()] = 1\n
  payment_dict[line.getDestinationPayment()] = 1\n
\n
if context.getSourcePayment() or context.getDestinationSection():\n
  min_payment_count = 2\n
else:\n
  min_payment_count = 1\n
\n
if context.getSourceSection() and context.getDestinationSection():\n
  min_section_count = 3\n
else:\n
  # if we have no mirror_section on the transaction but a mirror_section on\n
  # a line, we have to show the column\n
  min_section_count = 2\n
\n
multiple_sections = len(section_dict) > min_section_count\n
multiple_payment = len(payment_dict) > min_payment_count\n
\n
column_item_list = [(\'translated_id\', \'ID\')]\n
a = column_item_list.append\n
if source:\n
  a((\'source\', \'Account\'))\n
else:\n
  a((\'destination\', \'Account\'))\n
if multiple_sections:\n
  if source:\n
    a((\'getDestinationSectionTitle\', \'Third Party\'))\n
  else:\n
    a((\'getSourceSectionTitle\', \'Third Party\'))\n
if multiple_payment:\n
  if source:\n
    a((\'getSourcePaymentReference\', \'Bank Account\'))\n
  else:\n
    a((\'getDestinationPaymentReference\', \'Bank Account\'))\n
if source:\n
  a((\'source_debit\', \'Debit\'))\n
  a((\'source_credit\', \'Credit\'))\n
else:\n
  a((\'destination_debit\', \'Debit\'))\n
  a((\'destination_credit\', \'Credit\'))\n
\n
return column_item_list\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_owner</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>source=0</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>1</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>source</string>
                            <string>None</string>
                            <string>section_dict</string>
                            <string>payment_dict</string>
                            <string>_getiter_</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>line</string>
                            <string>_write_</string>
                            <string>min_payment_count</string>
                            <string>min_section_count</string>
                            <string>len</string>
                            <string>multiple_sections</string>
                            <string>multiple_payment</string>
                            <string>column_item_list</string>
                            <string>a</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <tuple>
                <int>0</int>
              </tuple>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>AccountingTransaction_getListBoxColumnList</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
