Commit e8dd237a authored by Jérome Perrin's avatar Jérome Perrin

2008-05-16 jerome

* Introduce scripts to help report creation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20995 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e97c28cb
<?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>"""\n
This scripts add the balance of every gap account in the list \'account_id_list\'\n
it use portal_simulation.getInventory. \n
\n
The following REQUEST keys are mandatory : \n
at_date\n
\n
those are optional : \n
gap_base\n
simulation_state\n
resource\n
section_category\n
\n
those are ignored from the request and should explicitely passed as keywords args to this script : \n
from_date\n
\n
parameters keywords to this script overrides REQUEST keys\n
\n
"""\n
portal = context.getPortalObject()\n
request = context.REQUEST\n
\n
kw = dict(kwd)\n
kw[\'simulation_state\'] = kwd.get(\'simulation_state\', request.get(\'simulation_state\'))\n
kw["section_category"] = kwd.get(\'section_category\', request.get(\'section_category\'))\n
kw["at_date"] = request[\'at_date\'].latestTime()\n
at_date = kwd.get(\'at_date\', request[\'at_date\'])\n
kw[\'at_date\'] = at_date.latestTime()\n
\n
if request.get(\'account_id_list_conversion_script_id\'):\n
account_id_list_conversion_script = getattr(portal, request[\'account_id_list_conversion_script_id\'])\n
kw[\'node_category\'] = account_id_list_conversion_script(account_id_list)\n
else:\n
kw[\'node_category\'] = account_id_list\n
\n
context.log(kw)\n
\n
return portal.portal_simulation.getInventoryAssetPrice(**kw) or 0.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>account_id_list, **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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>account_id_list</string>
<string>kwd</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>request</string>
<string>dict</string>
<string>kw</string>
<string>_write_</string>
<string>_getitem_</string>
<string>at_date</string>
<string>getattr</string>
<string>account_id_list_conversion_script</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>AccountModule_getFiscalReportBalance</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>
<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[
"""\n
This script adds accounts value, only if they are creditors\n
"""\n
\n
request = context.REQUEST\n
portal = context.getPortalObject()\n
\n
kw = dict(kwd)\n
kw[\'simulation_state\'] = kwd.get(\'simulation_state\', request.get(\'simulation_state\'))\n
kw["section_category"] = kwd.get(\'section_category\', request.get(\'section_category\'))\n
at_date = kwd.get(\'at_date\', request[\'at_date\'])\n
kw[\'at_date\'] = at_date.latestTime()\n
\n
if request.get(\'account_id_list_conversion_script_id\'):\n
account_id_list_conversion_script = getattr(portal, request[\'account_id_list_conversion_script_id\'])\n
kw[\'node_category\'] = account_id_list_conversion_script(account_id_list)\n
else:\n
kw[\'node_category\'] = account_id_list\n
\n
sum = 0.0\n
for inventory in portal.portal_simulation.getInventoryList(\n
group_by_node=1,\n
group_by_mirror_section=1,\n
**kw):\n
if inventory.total_price < 0:\n
sum += (inventory.total_price or 0)\n
return sum\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>account_id_list, **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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>account_id_list</string>
<string>kwd</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>portal</string>
<string>dict</string>
<string>kw</string>
<string>_write_</string>
<string>_getitem_</string>
<string>at_date</string>
<string>getattr</string>
<string>account_id_list_conversion_script</string>
<string>sum</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>inventory</string>
<string>_inplacevar_</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_getFiscalReportCreditorNodeBalance</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>
<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[
"""\n
This script adds bank accounts balances, only if they are creditors\n
"""\n
\n
request = context.REQUEST\n
portal = context.getPortalObject()\n
\n
kw = dict(kwd)\n
kw[\'simulation_state\'] = kwd.get(\'simulation_state\', request.get(\'simulation_state\'))\n
kw["section_category"] = kwd.get(\'section_category\', request.get(\'section_category\'))\n
at_date = kwd.get(\'at_date\', request[\'at_date\'])\n
kw[\'at_date\'] = at_date.latestTime()\n
\n
if request.get(\'account_id_list_conversion_script_id\'):\n
account_id_list_conversion_script = getattr(portal, request[\'account_id_list_conversion_script_id\'])\n
kw[\'node_category\'] = account_id_list_conversion_script(account_id_list)\n
else:\n
kw[\'node_category\'] = account_id_list\n
\n
sum = 0.0\n
for inventory in portal.portal_simulation.getInventoryList(\n
group_by_payment=1,\n
group_by_node=1,\n
**kw):\n
if inventory.total_price < 0:\n
sum += (inventory.total_price or 0)\n
return sum\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>account_id_list, **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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>account_id_list</string>
<string>kwd</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>portal</string>
<string>dict</string>
<string>kw</string>
<string>_write_</string>
<string>_getitem_</string>
<string>at_date</string>
<string>getattr</string>
<string>account_id_list_conversion_script</string>
<string>sum</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>inventory</string>
<string>_inplacevar_</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_getFiscalReportCreditorPaymentBalance</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>
<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[
"""\n
This script adds accounts value, only if they are debtors\n
"""\n
\n
request = context.REQUEST\n
portal = context.getPortalObject()\n
\n
kw = dict(kwd)\n
kw[\'simulation_state\'] = kwd.get(\'simulation_state\', request.get(\'simulation_state\'))\n
kw["section_category"] = kwd.get(\'section_category\', request.get(\'section_category\'))\n
at_date = kwd.get(\'at_date\', request[\'at_date\'])\n
kw[\'at_date\'] = at_date.latestTime()\n
\n
if request.get(\'account_id_list_conversion_script_id\'):\n
account_id_list_conversion_script = getattr(portal, request[\'account_id_list_conversion_script_id\'])\n
kw[\'node_category\'] = account_id_list_conversion_script(account_id_list)\n
else:\n
kw[\'node_category\'] = account_id_list\n
\n
sum = 0.0\n
for inventory in portal.portal_simulation.getInventoryList(\n
group_by_node=1,\n
group_by_mirror_section=1,\n
**kw):\n
if inventory.total_price > 0:\n
sum += inventory.total_price\n
return sum\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>account_id_list, **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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>account_id_list</string>
<string>kwd</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>portal</string>
<string>dict</string>
<string>kw</string>
<string>_write_</string>
<string>_getitem_</string>
<string>at_date</string>
<string>getattr</string>
<string>account_id_list_conversion_script</string>
<string>sum</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>inventory</string>
<string>_inplacevar_</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_getFiscalReportDebitorNodeBalance</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>
<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[
"""\n
This script adds bank accounts balances, only if they are debtors\n
"""\n
\n
request = context.REQUEST\n
portal = context.getPortalObject()\n
\n
kw = dict(kwd)\n
kw[\'simulation_state\'] = kwd.get(\'simulation_state\', request.get(\'simulation_state\'))\n
kw["section_category"] = kwd.get(\'section_category\', request.get(\'section_category\'))\n
at_date = kwd.get(\'at_date\', request[\'at_date\'])\n
kw[\'at_date\'] = at_date.latestTime()\n
\n
if request.get(\'account_id_list_conversion_script_id\'):\n
account_id_list_conversion_script = getattr(portal, request[\'account_id_list_conversion_script_id\'])\n
kw[\'node_category\'] = account_id_list_conversion_script(account_id_list)\n
else:\n
kw[\'node_category\'] = account_id_list\n
\n
sum = 0.0\n
for inventory in portal.portal_simulation.getInventoryList(\n
group_by_payment=1,\n
group_by_node=1,\n
**kw):\n
if inventory.total_price > 0:\n
sum += inventory.total_price\n
return sum\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>account_id_list, **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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>account_id_list</string>
<string>kwd</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>portal</string>
<string>dict</string>
<string>kw</string>
<string>_write_</string>
<string>_getitem_</string>
<string>at_date</string>
<string>getattr</string>
<string>account_id_list_conversion_script</string>
<string>sum</string>
<string>_getiter_</string>
<string>_apply_</string>
<string>inventory</string>
<string>_inplacevar_</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_getFiscalReportDebitorPaymentBalance</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2008-05-16 jerome
* Introduce scripts to help report creation.
2008-05-14 jerome
* Use absolute_url when necessary to produce URLs compatible with virtual hosting.
......
697
\ No newline at end of file
699
\ 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