<?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>portal = context.getPortalObject()\n
getUid = portal.portal_categories.getCategoryUid\n
\n
section_category = params.pop(\'section_category\', None)\n
section_category_strict = params.pop(\'section_category_strict\', None)\n
params[\'accounting_transaction.section_uid\'] = \'\'\n
if section_category:\n
  params[\'accounting_transaction.section_uid\'] = context.Base_getSectionUidListForSectionCategory(\n
                                   section_category, strict_membership=section_category_strict)\n
\n
# rewrite payment_mode_relative_url to uid\n
payment_mode_relative_url = params.pop(\'payment_mode_relative_url\', None)\n
if payment_mode_relative_url:\n
  params[\'default_payment_mode_uid\'] = \\\n
    portal.portal_categories.payment_mode.getCategoryUid(payment_mode_relative_url)\n
\n
# rewrite currency to uid\n
resource = params.pop(\'resource\', None)\n
if resource:\n
  params[\'accounting_transaction.resource_uid\'] = getUid(resource)\n
\n
\n
# XXX wrong name compat\n
# TODO: make it better on search dialog\n
node_list = params.pop(\'node\', None)\n
if node_list:\n
  params[\'accounting_transaction_line_node_uid\'] = [\n
      getUid(node) for node in node_list]\n
\n
entity = params.pop(\'entity\', None)\n
if entity:\n
  params[\'accounting_transaction.mirror_section_uid\'] = getUid(entity)\n
\n
if not params.get(\'operation_date\'):\n
  params.pop(\'from_date\', None)\n
  params.pop(\'to_date\', None)\n
  if from_date or to_date:\n
    if from_date:\n
      if to_date:\n
        params[\'operation_date\'] = dict(\n
                    query=(from_date, to_date),\n
                    range=\'minngt\')\n
      else:\n
        params[\'operation_date\'] = dict(\n
                    query=(from_date, ),\n
                    range=\'min\')\n
    else:\n
      params[\'operation_date\'] = dict(\n
                  query=(to_date, ),\n
                  range=\'ngt\')\n
  \n
amount = params.pop(\'amount\', \'\')\n
if amount not in (None, \'\'):\n
  params[\'accounting_transaction_line_total_price\'] = amount\n
else:\n
  amount_range_min = params.pop(\'amount_range_min\', None)\n
  amount_range_max = params.pop(\'amount_range_max\', None)\n
  if amount_range_min or amount_range_max:\n
    if amount_range_min:\n
      if amount_range_max:\n
        params[\'accounting_transaction_line_total_price\'] = dict(\n
                    query=(amount_range_min, amount_range_max),\n
                    range=\'minmax\')\n
      else:\n
        params[\'accounting_transaction_line_total_price\'] = dict(\n
                    query=(amount_range_min, ),\n
                    range=\'min\')\n
    else:\n
      params[\'accounting_transaction_line_total_price\'] = dict(\n
                  query=(amount_range_max, ),\n
                  range=\'max\')\n
\n
\n
creation_date_range_min = params.pop(\'creation_date_range_min\', None)\n
creation_date_range_max = params.pop(\'creation_date_range_max\', None)\n
if creation_date_range_min or creation_date_range_max:\n
  if creation_date_range_min:\n
    if creation_date_range_max:\n
      params[\'creation_date\'] = dict(\n
                  query=(creation_date_range_min, creation_date_range_max),\n
                  range=\'minmax\')\n
    else:\n
      params[\'creation_date\'] = dict(\n
                  query=(creation_date_range_min, ),\n
                  range=\'min\')\n
  else:\n
    params[\'creation_date\'] = dict(\n
                query=(creation_date_range_max, ),\n
                range=\'max\')\n
\n
select_dict = params.get(\'select_dict\') or dict()\n
select_dict.update(dict(total_debit=None,\n
                        total_credit=None,\n
                        reference=None,\n
                        specific_reference=None,\n
                        project_uid=None,\n
                        payment_uid=None,\n
                        mirror_section_uid=None,\n
                        operation_date=None))\n
\n
params[\'select_dict\'] = select_dict\n
params.setdefault(\'group_by\', (\'uid\',))\n
\n
return context.searchFolder(**params)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>from_date=None, to_date=None, **params</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>AccountingTransactionModule_getAccountingTransactionList</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
