<?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>params = {}\n
pref = context.getPortalObject().portal_preferences\n
precision = context.Base_getPreferredPrecision()\n
\n
###\n
# Get the \'from_date\' parameter\n
from_date = kw.get( \'from_date\'\n
                  , pref.getPreferredAccountingTransactionFromDate()\n
                  )\n
if from_date:\n
  params[\'from_date\'] = from_date\n
\n
###\n
# Get the \'at_date\' parameter\n
at_date = kw.get( \'at_date\'\n
                , pref.getPreferredAccountingTransactionAtDate()\n
                )\n
if at_date:\n
  params[\'at_date\'] = at_date\n
\n
###\n
# Get the \'simulation_state\' parameter\n
# Sometimes \'simulation_state\' is now as \'transaction_simulation_state\'\n
simulation_state = kw.get( \'transaction_simulation_state\'\n
                         , None\n
                         )\n
if not simulation_state:\n
  simulation_state = kw.get( \'simulation_state\'\n
                           , pref.getPreferredAccountingTransactionSimulationStateList()\n
                           )\n
if simulation_state:\n
  params[\'simulation_state\'] = simulation_state\n
\n
###\n
# Get the \'section_category\' parameter\n
# Sometimes \'section_category\' is now as \'transaction_section_category\'\n
section_category = kw.get( \'transaction_section_category\'\n
                         , None\n
                         )\n
if not section_category:\n
  section_category = kw.get( \'section_category\'\n
                           , pref.getPreferredAccountingTransactionSectionCategory()\n
                           )\n
if section_category:\n
  params[\'section_category\'] = section_category\n
\n
###\n
# Parameters only used in reports\n
if kw.has_key(\'node_uid\'): params[\'node_uid\'] = kw[\'node_uid\']\n
\n
###\n
# Get omit parameters\n
if kw.get(\'omit_input\') : params[\'omit_input\']  = 1\n
if kw.get(\'omit_output\'): params[\'omit_output\'] = 1\n
\n
params[\'stat\'] = 1\n
\n
if kw.has_key(\'getUid\')      : params[\'getUid\']       = kw[\'getUid\']\n
if kw.has_key(\'getParentUid\'): params[\'getParentUid\'] = kw[\'getParentUid\']\n
\n
###\n
# Call the query with selected parameters\n
result = context.BankAccount_zGetAccountingTransactionList(**params)\n
row = result[0]\n
\n
###\n
# Round the result to avoid float bad precision\n
# TODO: use currency precision\n
return context.Base_getRoundValue(row.quantity or 0.0, precision)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>**kw</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>BankAccount_statSourceBalance</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
