<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.PythonScripts.PythonScript</string>
          <string>PythonScript</string>
        </tuple>
        <none/>
      </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>"""Get the report sections for account statement.\n
Account is the combination of :\n
   - node (the Account in account module)\n
   - mirror_section (the Entity in organisation / person module)\n
   - payment (the Bank account for the organisation)\n
"""\n
\n
from Products.ERP5Form.Report import ReportSection\n
from Products.ERP5Type.Message import Message\n
request = context.REQUEST\n
traverse = context.getPortalObject().restrictedTraverse\n
N_ = lambda msg: Message(\'ui\', msg)\n
\n
# for preference info fields on Account_viewAccountingTransactionList\n
request.set(\'is_accounting_report\', True)\n
\n
at_date = request[\'at_date\']\n
section_uid = context.Base_getSectionUidListForSectionCategory(\n
                                             request[\'section_category\'])\n
# XXX for now node is required (ie. we cannot display all transactions with\n
# a third party regardless of the account).\n
node = request[\'node\']\n
mirror_section = request.get(\'mirror_section\', None)\n
payment = request.get(\'payment\', None)\n
simulation_state = request[\'simulation_state\']\n
from_date = request.get(\'from_date\', None)\n
detailed_from_date_summary = request.get(\'detailed_from_date_summary\', 0)\n
omit_grouping_reference = request.get(\'omit_grouping_reference\', 0)\n
parent_portal_type = request.get(\'portal_type\')\n
period_start_date = context\\\n
    .Base_getAccountingPeriodStartDateForSectionCategory(\n
                   section_category=request[\'section_category\'],\n
                   date=from_date or at_date)\n
\n
# Also get the currency, to know the precision\n
currency = context.Base_getCurrencyForSection(request[\'section_category\'])\n
precision = context.account_module.getQuantityPrecisionFromResource(currency)\n
# we set the precision in request, for formatting on editable fields\n
request.set(\'precision\', precision)\n
\n
params = dict(at_date=at_date,\n
              period_start_date=period_start_date,\n
              section_uid=section_uid,\n
              node_uid=traverse(node).getUid(),\n
              simulation_state=simulation_state,\n
              detailed_from_date_summary=detailed_from_date_summary)\n
\n
if from_date:\n
  params[\'from_date\'] = from_date\n
if payment:\n
  params[\'payment_uid\'] = traverse(payment).getUid()\n
if mirror_section:\n
  params[\'mirror_section_uid\'] = traverse(mirror_section).getUid()\n
if parent_portal_type:\n
  params[\'parent_portal_type\'] = parent_portal_type\n
if omit_grouping_reference:\n
  params[\'hide_grouping\'] = 1\n
\n
selection_columns = [\n
    (\'Movement_getSpecificReference\', \'Transaction Reference\'),\n
    (\'date\', \'Date\'),\n
    (\'Movement_getExplanationTitle\', \'Accounting Transaction Title\'),\n
    (\'Movement_getMirrorSectionTitle\', \'Third Party\'),\n
    (\'debit\', \'Debit\'),\n
    (\'credit\', \'Credit\'),\n
    (\'running_total_price\', \'Net\'),]\n
\n
report_section_list = []\n
if from_date and detailed_from_date_summary:\n
  report_section_list.append(\n
    ReportSection(form_id=\'\', level=4,\n
                  title=N_(\'Not Grouped Lines in Beginning Balance\')))\n
\n
  report_section_list.append(\n
    ReportSection(\n
            path=node,\n
            form_id=\'Account_viewNotGroupedAccountingTransactionList\',\n
            selection_name=\'account_preference_selection\',\n
            selection_params=params,\n
            selection_columns=selection_columns,\n
            listbox_display_mode=\'FlatListMode\',\n
            selection_sort_order=[\n
                        (\'stock.date\', \'ascending\'),\n
                        (\'stock.uid\', \'ascending\')],))\n
\n
  report_section_list.append(\n
    ReportSection(form_id=None, level=4,\n
                  title=N_(\'Lines in the Period\')))\n
\n
report_section_list.append(\n
    ReportSection(\n
            path=node,\n
            form_id=\'Account_viewAccountingTransactionList\',\n
            selection_name=\'account_preference_selection\',\n
            selection_params=params,\n
            selection_columns=selection_columns,\n
            listbox_display_mode=\'FlatListMode\',\n
            selection_sort_order=[\n
                        (\'stock.date\', \'ascending\'),\n
                        (\'stock.uid\', \'ascending\')],))\n
\n
return report_section_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>_params</string> </key>
            <value> <string></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>0</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>Products.ERP5Form.Report</string>
                            <string>ReportSection</string>
                            <string>Products.ERP5Type.Message</string>
                            <string>Message</string>
                            <string>_getattr_</string>
                            <string>context</string>
                            <string>request</string>
                            <string>traverse</string>
                            <string>N_</string>
                            <string>True</string>
                            <string>_getitem_</string>
                            <string>at_date</string>
                            <string>section_uid</string>
                            <string>node</string>
                            <string>None</string>
                            <string>mirror_section</string>
                            <string>payment</string>
                            <string>simulation_state</string>
                            <string>from_date</string>
                            <string>detailed_from_date_summary</string>
                            <string>omit_grouping_reference</string>
                            <string>parent_portal_type</string>
                            <string>period_start_date</string>
                            <string>currency</string>
                            <string>precision</string>
                            <string>dict</string>
                            <string>params</string>
                            <string>_write_</string>
                            <string>selection_columns</string>
                            <string>report_section_list</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>AccountModule_getAccountStatementReportSectionList</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
