Commit 8f474724 authored by Jérome Perrin's avatar Jérome Perrin

use Inventory API in Entity_viewAccountingTransactionList



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9893 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92f45abe
......@@ -68,112 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>src__ = 0\n
if kw.has_key(\'src__\'): src__ = kw[\'src__\']\n
precision = context.Base_getPreferredPrecision()\n
r_ = lambda x: context.Base_getRoundValue(x, precision)\n
\n
# read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n
simulation_state = preference.getPreferredAccountingTransactionSimulationStateList()\n
section_category = preference.getPreferredAccountingTransactionSectionCategory()\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n
at_date = preference.getPreferredAccountingTransactionAtDate()\n
\n
# Build the common inventory dict\n
params = {}\n
\n
if kw.get(\'no_from_date\', False): from_date = None\n
\n
if simulation_state: params[\'simulation_state\'] = simulation_state\n
if section_category: params[\'section_category\'] = section_category\n
\n
if kw.has_key(\'node_uid\') : params[\'node_uid\'] = kw[\'node_uid\']\n
if kw.has_key(\'portal_type\'): params[\'portal_type\'] = kw[\'portal_type\']\n
\n
# Create the related accouting line list\n
new_result = []\n
net_balance = 0.0\n
\n
if from_date is not None:\n
# Create a new parameter list to get the previous balance\n
get_inventory_kw = params.copy()\n
get_inventory_kw.update({ \'omit_simulation\' : True\n
, \'to_date\' : from_date\n
, \'mirror_section_uid\': context.getUid()\n
, \'where_expression\' : " section.portal_type = \'Organisation\' "\n
})\n
getInventory = context.getPortalObject().portal_simulation.getInventoryAssetPrice\n
# Get previous debit and credit\n
previous_total_debit = r_(getInventory(omit_output=True, **get_inventory_kw))\n
previous_total_credit = r_(getInventory(omit_input =True, **get_inventory_kw))\n
if previous_total_credit != 0:\n
previous_total_credit = - previous_total_credit\n
\n
# Show the previous balance if not empty\n
if previous_total_credit != 0 or previous_total_debit != 0:\n
from Products.ERP5Type.Document import newTempAccountingTransaction\n
\n
net_balance = r_(previous_total_debit - previous_total_credit)\n
previous_balance = newTempAccountingTransaction( context.getPortalObject()\n
, "temp_%s" % context.getUid()\n
)\n
previous_balance.setUid(\'new_000\')\n
\n
previous_balance.edit( \\\n
parent_title = context.Base_translateString("Previous Balance")\n
, section_title = ""\n
, date = from_date - 1\n
, portal_type = ""\n
, account_uid = None\n
, parent_reference = None\n
, parent_specific_reference = None\n
, translated_simulation_state_title = None\n
, debit = previous_total_debit\n
, credit = previous_total_credit\n
, grouping_reference = None\n
, balance = net_balance\n
, net_balance = net_balance\n
, is_previous_balance = True\n
)\n
new_result.append(previous_balance)\n
\n
\n
# Show / Hide grouping if needed\n
if kw.has_key(\'hide_grouping\'): params[\'hide_grouping\'] = kw[\'hide_grouping\']\n
\n
# FIXME: same problem as in BankAccount_getAccountingTransactionList\n
result = context.Entity_zGetAccountingTransactionList( from_date = from_date\n
, at_date = at_date\n
, src__ = src__\n
, **params\n
)\n
if src__:\n
return result\n
\n
# Add related accounting lines one by one in order to calculate intermediate balance\n
for l in result:\n
o = l.getObject()\n
net_balance += l.balance or 0.0\n
if o is not None:\n
c = o.asContext( net_balance = net_balance\n
, balance = l.balance\n
, credit = l.credit\n
, debit = l.debit\n
, date = l.date\n
, section_title = l.section_title\n
, parent_reference = l.parent_reference\n
, parent_specific_reference = l.parent_specific_reference\n
, translated_simulation_state_title = o.getTranslatedSimulationStateTitle()\n
, account_uid = l.account_uid\n
# FIXME: Overriding \'portal_type\' in asContext is clearly a bad idea,\n
# as many methods are storred on the portal type (hence the\n
# translated_simulation_state_title hack). --jerome\n
, portal_type = l.portal_type\n
)\n
new_result.append(c)\n
\n
return new_result\n
<value> <string>"""Returns Accounting Transactions where this entity is mirror section.\n
"""\n
kw[\'mirror_section_uid\'] = context.getUid()\n
kw[\'node_category_strict_membership\'] = [\'account_type/asset/receivable\',\n
\'account_type/liability/payable\']\n
return context.Node_getAccountingTransactionList(**kw)\n
</string> </value>
</item>
<item>
......@@ -223,37 +123,10 @@ return new_result\n
<value>
<tuple>
<string>kw</string>
<string>src__</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>context</string>
<string>precision</string>
<string>r_</string>
<string>preference</string>
<string>simulation_state</string>
<string>section_category</string>
<string>from_date</string>
<string>at_date</string>
<string>params</string>
<string>False</string>
<string>None</string>
<string>_write_</string>
<string>new_result</string>
<string>net_balance</string>
<string>get_inventory_kw</string>
<string>True</string>
<string>getInventory</string>
<string>_apply_</string>
<string>previous_total_debit</string>
<string>previous_total_credit</string>
<string>Products.ERP5Type.Document</string>
<string>newTempAccountingTransaction</string>
<string>previous_balance</string>
<string>result</string>
<string>_getiter_</string>
<string>l</string>
<string>o</string>
<string>c</string>
</tuple>
</value>
</item>
......
......@@ -68,7 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.Entity_statSourceBalance(omit_input=1, **kw)\n
<value> <string>"""Total balance of all accounting transactions having this\n
entity as a mirror section.\n
"""\n
kw[\'mirror_section_uid\']=context.getUid()\n
kw[\'node_category_strict_membership\'] = [\'account_type/asset/receivable\',\n
\'account_type/liability/payable\']\n
return context.Node_statAccountingBalance(**kw)\n
</string> </value>
</item>
<item>
......@@ -83,6 +89,12 @@
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
......@@ -112,9 +124,10 @@
<value>
<tuple>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
<string>_write_</string>
<string>_apply_</string>
</tuple>
</value>
</item>
......@@ -131,7 +144,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Entity_statSourceDebit</string> </value>
<value> <string>Entity_statBalance</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
<?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>"""Total credit of all accounting transactions having this\n
entity as a mirror section\n
"""\n
kw[\'mirror_section_uid\'] = context.getUid()\n
kw[\'omit_input\'] = 1\n
kw[\'node_category_strict_membership\'] = [\'account_type/asset/receivable\',\n
\'account_type/liability/payable\']\n
# here, or 0 is to prevent displaying "- 0"\n
return - context.Node_statAccountingBalance(**kw) or 0\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>**kw</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>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>_write_</string>
<string>_apply_</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>Entity_statCredit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""Total debit of all accounting transactions having this\n
entity as a mirror section\n
"""\n
kw[\'mirror_section_uid\'] = context.getUid()\n
kw[\'omit_output\'] = 1\n
kw[\'node_category_strict_membership\'] = [\'account_type/asset/receivable\',\n
\'account_type/liability/payable\']\n
return context.Node_statAccountingBalance(**kw)\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>**kw</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>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>_write_</string>
<string>_apply_</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>Entity_statDebit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -256,6 +256,10 @@
<key> <string>meta_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
......@@ -344,7 +348,7 @@
<value>
<list>
<tuple>
<string>parent_title</string>
<string>Movement_getExplanationTitle</string>
<string>Title</string>
</tuple>
<tuple>
......@@ -356,31 +360,31 @@
<string>Date</string>
</tuple>
<tuple>
<string>translated_portal_type</string>
<string>Transaction Type</string>
<string>Movement_getExplanationTranslatedPortalType</string>
<string>Type</string>
</tuple>
<tuple>
<string>Entity_getAccountingTransactionGapId</string>
<string>GAP</string>
<string>Movement_getNodeGapId</string>
<string>GAP ID</string>
</tuple>
<tuple>
<string>parent_reference</string>
<string>Movement_getExplanationReference</string>
<string>Invoice Number</string>
</tuple>
<tuple>
<string>parent_specific_reference</string>
<string>Movement_getSpecificReference</string>
<string>Transaction Reference</string>
</tuple>
<tuple>
<string>translated_simulation_state_title</string>
<string>getTranslatedSimulationStateTitle</string>
<string>State</string>
</tuple>
<tuple>
<string>debit</string>
<string>Movement_getDebitPrice</string>
<string>Debit</string>
</tuple>
<tuple>
<string>credit</string>
<string>Movement_getCreditPrice</string>
<string>Credit</string>
</tuple>
<tuple>
......@@ -388,12 +392,12 @@
<string>Grouping</string>
</tuple>
<tuple>
<string>balance</string>
<string>total_price</string>
<string>Balance</string>
</tuple>
<tuple>
<string>net_balance</string>
<string>Net</string>
<string>running_total_price</string>
<string>Running Balance</string>
</tuple>
</list>
</value>
......@@ -423,12 +427,17 @@
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list/>
<list>
<tuple>
<string>group</string>
<string>group</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
......@@ -503,6 +512,10 @@
<key> <string>not_viewable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
......@@ -569,7 +582,16 @@
<item>
<key> <string>sort</string> </key>
<value>
<list/>
<list>
<tuple>
<string>stock.date</string>
<string>ASC</string>
</tuple>
<tuple>
<string>stock.uid</string>
<string>ASC</string>
  • @jerome we plan to make both these sortings DESC for a project. But I think it would be good also for generic, i.e. get the most recent transactions first. What do you think?

  • @georgios.dagkakis I believe this is modelled after paper statements where we can only write at the end of the paper :) That's not only in ERP5 but I think in any "account statement", as we can see for example in https://www.google.com/search?q=account+statement&tbm=isch everything oldest first. It's also like this in statements received from banks etc and it's a use case sometimes to compare what's in your accounting software with what's on your bank account.

    "Stock browser" ( stock tab on products ) or "Tracking" ( Tracking tab ) on items both show the oldest first, so that when you read top --> down you can read in chronological order. Please take a look at these two actions if you are not familiar with them, they are a bit similar and we want to be consistent everywhere.

    But what's not good is that most of the time user are interested at what's at the end, so they have to go to the last page, which is especially unfriendly with ERP5JS where there is no "go to last page" button an it's also not good for computer because we have to calculate the full list. With Stock browser, this is really bad, because it just shows all movements (we still have a local change in a project to increase the limit 1000 because we have more than 1000 movements for some products), but for accounting movement list, if users set a "From Date" in their accounting preferences, then the first line of this list will be a "virtual" line showing the initial balance - that's a kind of hidden feature I'm not sure anybody uses.

    A little bit more about "sorting of chronological data" was discussed in !614 (diffs, comment 57857) when we were discussing a new data structure for workflow histories.

    It does not seem so easy than just changing to DESC. Can you tell a few words about your needs ?

  • I see. Thanks for explanations. For me ListBox default sorting in ERP5 has to do with user friendliness, provide users with the data they would be most likely to need first (that may change from user to user of course). Real-life accounting statement sorting should be followed in reports and exports. I am not sure if the 'most likely' desired sorting in "Stock browser" and "Tracking" would also be ASC or DESC, it depends a bit on how user uses them (to see the full history choronologically or to see current situation). But in Entity_viewAccountingTransactionList I feel the most common usage is to see most recent accounting history.

    Can you tell a few words about your needs ?

    Not much to say :). What you wrote as 'most of the time user are interested at what's at the end, so they have to go to the last page, which is especially unfriendly with ERP5JS where there is no "go to last page" button' nails it. That is where our users' request came from.

  • It might be a ERP5JS problem, because with xhtml style there have never been such user feedback as far as I know. In xhtml style, once user goes to last page it stays in their selection and everytime they see this listbox it shows the last page.

  • In xhtml style, once user goes to last page it stays in their selection and everytime they see this listbox it shows the last page.

    I think selection would keep the number of page, right? So if I go to customer X that has 2 pages and then to customer Y that has 4 pages, I will land to 2nd page, not the last one.

    It might be a ERP5JS problem, because with xhtml style there have never been such user feedback as far as I know.

    True, in xhtml style it is better and maybe the users never reached the "complaining threshold". Maybe in general it would be nice to have a "go to the last page" button. But in any way this would be like a work-around for the fact that the listbox is not sorted as the users usually want. For example in our project case I am pretty-sure that if we tell the users "hey, now you have a 'go to last page' button in this Listbox" they will reply "this is great, but please do also the sort as we asked".

    So no matter what is decided for this specific case in generic, I consider the discussion different to 'ERP5JS lacks a no "go to last page" button, should we have it?'

  • But isn't the root cause this incompatibility of ERP5JS ? I agree that it still have a lots of missing features most important than such a "go to last page" button, but I see that these days we break the current erp5 user interface just to workaround limitations of ERP5JS, so maybe we are doing something wrong.

    If we start to change this now (after 14 years), what will happen to all the users who were happy with the current behaviour ?

  • OK, for me the question is if we consider such a change 'breaking' of the current erp5 UI or 'editting for the better'. If it is the former, of course I would not propose it - for generic at least. If it is the latter though, we could consider, even if it would bring some surprise to current users (e.g. I would be surprised if workflow history sorting changed, but I think I would like it in the end).

    The above is to say that I do not think of it in relation to ERP5JS (even if maybe the request came because of it).

    About which of the 2 cases it is, I let you decide and I think you lean to 'breaking'

  • Yes, that's true, independently from this difference between old and new UI, maybe having all lists showing list of things in chronological order show the most recent first might be good.

    I guess you should discuss this with Thierry, maybe it's easy to prototype the change, just changing some ASC to DESC in some listboxs

Please register or sign in to reply
</tuple>
</list>
</value>
</item>
<item>
......@@ -583,16 +605,16 @@
<value>
<list>
<tuple>
<string>debit</string>
<string>Entity_statSourceDebit</string>
<string>Movement_getDebitPrice</string>
<string>Entity_statDebit</string>
</tuple>
<tuple>
<string>credit</string>
<string>Entity_statSourceCredit</string>
<string>Movement_getCreditPrice</string>
<string>Entity_statCredit</string>
</tuple>
<tuple>
<string>balance</string>
<string>Entity_statSourceBalance</string>
<string>total_price</string>
<string>Entity_statBalance</string>
</tuple>
</list>
</value>
......@@ -702,7 +724,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[(\'hide_grouping\', 0)]</string> </value>
<value> <string>python:[(\'hide_grouping\', 0), ]</string> </value>
</item>
</dictionary>
</pickle>
......@@ -740,7 +762,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: getattr(cell, \'is_previous_balance\', False) and [(x[0], None) for x in form.listbox.get_value(\'columns\')]</string> </value>
<value> <string>python: getattr(request.cell, \'is_previous_balance\', False) and [(x[0], None) for x in form.listbox.get_value(\'columns\')]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -279,7 +279,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: not getattr(cell, \'is_previous_balance\', False)</string> </value>
<value> <string>request/cell/is_previous_balance | python:1</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>return -min(brain.total_price, 0)\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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>min</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getCreditPrice</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return max(brain.total_price, 0)\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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>max</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getDebitPrice</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return brain.getObject().getExplanationValue().getReference()\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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getExplanationReference</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return brain.getObject().getExplanationValue().getTitle()\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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getExplanationTitle</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return brain.getObject().getExplanationValue().getTranslatedPortalType()\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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getExplanationTranslatedPortalType</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""Retrieve the title of the mirror section\n
"""\n
if brain.mirror_section_uid:\n
return context.getPortalObject().portal_catalog.getObject(\n
uid=brain.mirror_section_uid).getTitle()\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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getMirrorSectionTitle</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>gap_id_cache = context.REQUEST.other.get(\'Movement_getNodeGapIdCache\', {})\n
key = brain.node_relative_url\n
gap_id = gap_id_cache.get(key)\n
if gap_id is None:\n
gap_id = context.getPortalObject().restrictedTraverse(\n
key).Account_getGapId()\n
gap_id_cache[key] = gap_id\n
context.REQUEST.other[\'Movement_getNodeGapIdCache\'] = gap_id_cache\n
return gap_id\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>brain=None, selection=None, **kw</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>gap_id_cache</string>
<string>key</string>
<string>gap_id</string>
<string>None</string>
<string>_write_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getNodeGapId</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""Return the \'side-specific\' reference, ie. the source reference or\n
destination reference.\n
"""\n
delivery = brain.getObject().getExplanationValue()\n
if delivery.getSourceSectionUid() == brain.section_uid:\n
return delivery.getSourceReference()\n
return delivery.getDestinationReference()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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>brain, selection=None, **kwd</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kwd</string>
<string>_getattr_</string>
<string>delivery</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getSpecificReference</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,44 +68,41 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>kw.update(selection.getParams())\n
kwd = {}\n
if kw.has_key(\'hide_grouping\'):\n
kwd[\'hide_grouping\'] = kw[\'hide_grouping\']\n
<value> <string>portal = context.getPortalObject()\n
params = portal.ERP5Accounting_getParams(selection)\n
\n
# read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n
if kw.get(\'no_from_date\', 0) :\n
from_date = None\n
else :\n
from_date = preference.getPreferredAccountingTransactionFromDate()\n
if from_date :\n
kwd[\'from_date\'] = from_date\n
at_date = preference.getPreferredAccountingTransactionAtDate()\n
if at_date :\n
kwd[\'at_date\'] = at_date\n
simulation_state = preference.getPreferredAccountingTransactionSimulationStateList()\n
if simulation_state :\n
kwd[\'simulation_state\'] = simulation_state\n
section_category = preference.getPreferredAccountingTransactionSectionCategory()\n
if section_category :\n
kwd[\'section_category\'] = section_category\n
context.log(\'stat kw %s\'%kw,\'params %s\'%params)\n
\n
# parameters only used in reports\n
if kw.has_key(\'node_uid\'):\n
kwd[\'node_uid\'] = kw[\'node_uid\']\n
if kw.has_key(\'portal_type\'):\n
kwd[\'portal_type\'] = kw[\'portal_type\']\n
if kw.get(\'node_uid\'):\n
params[\'node_uid\'] = kw[\'node_uid\']\n
if kw.get(\'mirror_section_uid\'):\n
params[\'mirror_section_uid\'] = kw[\'mirror_section_uid\']\n
\n
if kw.get(\'omit_input\') :\n
kwd[\'omit_input\'] = 1\n
if kw.get(\'omit_output\') :\n
kwd[\'omit_output\'] = 1\n
# FIXME: bank account uses quantity, not total_price\n
if kw.get(\'payment_uid\'):\n
params[\'payment_uid\'] = kw[\'payment_uid\']\n
if kw.get(\'node_category_strict_membership\'):\n
params[\'node_category_strict_membership\'] = \\\n
kw[\'node_category_strict_membership\']\n
if kw.get(\'node_category\'):\n
params[\'node_category\'] = kw[\'node_category\']\n
\n
kwd[\'stat\'] = 1\n
result = context.Entity_zGetAccountingTransactionList(**kwd)\n
row = result[0]\n
return float(\'%.02f\' % row.total_price or 0)\n
###\n
# Get the \'where_expression\' parameter\n
# XXX can be removed ?\n
if kw.get(\'where_expression\'):\n
params[\'where_expression\'] = kw[\'where_expression\']\n
\n
# Don\'t use the from_date parameter if from_date_summary is present\n
# XXX actually I never use from date here -jerome\n
if kw.get(\'from_date_summary\', 0) and params.has_key(\'from_date\'):\n
del params[\'from_date\']\n
\n
return portal.portal_simulation.getInventoryAssetPrice(\n
omit_input=omit_input,\n
omit_output=omit_output,\n
selection_domain=selection.getDomain(),\n
**params)\n
</string> </value>
</item>
<item>
......@@ -128,7 +125,15 @@ return float(\'%.02f\' % row.total_price or 0)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>selection, **kw</string> </value>
<value> <string>selection, omit_input=0, omit_output=0, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -148,29 +153,23 @@ return float(\'%.02f\' % row.total_price or 0)\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>selection</string>
<string>omit_input</string>
<string>omit_output</string>
<string>kw</string>
<string>_getattr_</string>
<string>kwd</string>
<string>context</string>
<string>portal</string>
<string>params</string>
<string>_getitem_</string>
<string>_write_</string>
<string>context</string>
<string>preference</string>
<string>None</string>
<string>from_date</string>
<string>at_date</string>
<string>simulation_state</string>
<string>section_category</string>
<string>_apply_</string>
<string>result</string>
<string>row</string>
<string>float</string>
</tuple>
</value>
</item>
......@@ -182,12 +181,15 @@ return float(\'%.02f\' % row.total_price or 0)\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<int>0</int>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Entity_statSourceBalance</string> </value>
<value> <string>Node_statAccountingBalance</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
<?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>return - context.Node_statAccountingBalance(omit_input=1, **kw) or 0.0\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</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>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</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>Node_statAccountingCredit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,7 +68,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return - context.Entity_statSourceBalance(omit_output=1, **kw) or 0.00\n
<value> <string>return context.Node_statAccountingBalance(omit_output=1, **kw) or 0.0\n
</string> </value>
</item>
<item>
......@@ -93,6 +93,14 @@
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
......@@ -137,7 +145,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Entity_statSourceCredit</string> </value>
<value> <string>Node_statAccountingDebit</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
30
\ No newline at end of file
32
\ No newline at end of file
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