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

complete source/destination section independance

(FIXME: the naming of the script is wrong then)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5603 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 00c48041
...@@ -68,26 +68,23 @@ ...@@ -68,26 +68,23 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>accounting_transaction_lines_portal_types = context.getPortalAccountingMovementTypeList()\n <value> <string>accounting_transaction_lines_portal_types = context.getPortalAccountingMovementTypeList()\n
\n \n
transaction = brain.getObject()\n if brain is not None :\n
credit = 0\n transaction = brain.getObject()\n
for line in transaction.objectValues() :\n transaction = context\n
if line.getPortalType() in accounting_transaction_lines_portal_types :\n
credit += line.getSourceCredit()\n
if line.getSourceSection() == line.getDestinationSection() : \n
credit += line.getSourceCredit()\n
return credit\n
\n \n
## old implementation with portal_catalog:\n credit = 0\n
params = selection.getParams()\n group_category = context.getPortalObject().portal_preferences\\\n
kw = {}\n .getPreferredAccountingTransactionSectionCategory()\n
kw[\'section_category\'] = params.get(\'section_category\')\n
kw[\'stat\'] = 1\n
kw[\'omit_output\'] = 1\n
kw[\'transaction\'] = context.getUid()\n
\n \n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(selection=selection, **kw)\n for line in transaction.contentValues(\n
row = result[0]\n filter={\'portal_type\': accounting_transaction_lines_portal_types} ) :\n
return float(\'%.02f\' % (row.quantity or 0.0))\n source_section = line.getSourceSectionValue()\n
if source_section is not None and source_section.isMemberOf(group_category) :\n
credit += line.getSourceInventoriatedTotalAssetCredit() or 0\n
destination_section = line.getDestinationSectionValue()\n
if destination_section is not None and destination_section.isMemberOf(group_category) :\n
credit += line.getDestinationInventoriatedTotalAssetCredit() or 0\n
return credit\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -96,9 +93,15 @@ return float(\'%.02f\' % (row.quantity or 0.0))\n ...@@ -96,9 +93,15 @@ return float(\'%.02f\' % (row.quantity or 0.0))\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/local_accounting/AccountingTransactionModule_getSourceCredit</string> </value> <value> <string>Script (Python):/erp5/portal_skins/erp5_accounting/AccountingTransactionModule_getSourceCredit</string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
...@@ -134,17 +137,14 @@ return float(\'%.02f\' % (row.quantity or 0.0))\n ...@@ -134,17 +137,14 @@ return float(\'%.02f\' % (row.quantity or 0.0))\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>accounting_transaction_lines_portal_types</string> <string>accounting_transaction_lines_portal_types</string>
<string>None</string>
<string>transaction</string> <string>transaction</string>
<string>credit</string> <string>credit</string>
<string>group_category</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>line</string> <string>line</string>
<string>params</string> <string>source_section</string>
<string>_write_</string> <string>destination_section</string>
<string>_apply_</string>
<string>result</string>
<string>_getitem_</string>
<string>row</string>
<string>float</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -175,4 +175,25 @@ return float(\'%.02f\' % (row.quantity or 0.0))\n ...@@ -175,4 +175,25 @@ return float(\'%.02f\' % (row.quantity or 0.0))\n
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -68,29 +68,23 @@ ...@@ -68,29 +68,23 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>accounting_transaction_lines_portal_types = context.getPortalAccountingMovementTypeList()\n <value> <string>accounting_transaction_lines_portal_types = context.getPortalAccountingMovementTypeList()\n
\n \n
transaction = brain.getObject()\n if brain is not None :\n
transaction = brain.getObject()\n
transaction = context\n
debit = 0\n debit = 0\n
for line in transaction.objectValues() :\n
if line.getPortalType() in accounting_transaction_lines_portal_types :\n
debit += line.getSourceDebit()\n
if line.getSourceSection() == line.getDestinationSection() : \n
debit += line.getSourceDebit()\n
return debit\n
\n \n
## old implementation with portal_catalog:\n group_category = context.getPortalObject().portal_preferences\\\n
if selection is not None:\n .getPreferredAccountingTransactionSectionCategory()\n
params = selection.getParams()\n
else:\n
params = {}\n
kw = {}\n
kw[\'section_category\'] = params.get(\'section_category\')\n
kw[\'stat\'] = 1\n
kw[\'omit_input\'] = 1\n
kw[\'transaction\'] = context.getUid()\n
\n \n
result = context.AccountingTransactionModule_zGetAccountingTransactionList(selection=selection,selection_params=kw, **kw)\n for line in transaction.contentValues(\n
row = result[0]\n filter={\'portal_type\': accounting_transaction_lines_portal_types} ) :\n
return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n source_section = line.getSourceSectionValue()\n
if source_section is not None and source_section.isMemberOf(group_category) :\n
debit += line.getSourceInventoriatedTotalAssetDebit() or 0\n
destination_section = line.getDestinationSectionValue()\n
if destination_section is not None and destination_section.isMemberOf(group_category) :\n
debit += line.getDestinationInventoriatedTotalAssetDebit() or 0\n
return debit\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -99,9 +93,15 @@ return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n ...@@ -99,9 +93,15 @@ return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/local_accounting/AccountingTransactionModule_getSourceDebit</string> </value> <value> <string>Script (Python):/erp5/portal_skins/erp5_accounting/AccountingTransactionModule_getSourceDebit</string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
...@@ -137,18 +137,14 @@ return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n ...@@ -137,18 +137,14 @@ return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>accounting_transaction_lines_portal_types</string> <string>accounting_transaction_lines_portal_types</string>
<string>None</string>
<string>transaction</string> <string>transaction</string>
<string>debit</string> <string>debit</string>
<string>group_category</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>line</string> <string>line</string>
<string>None</string> <string>source_section</string>
<string>params</string> <string>destination_section</string>
<string>_write_</string>
<string>_apply_</string>
<string>result</string>
<string>_getitem_</string>
<string>row</string>
<string>float</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -179,4 +175,25 @@ return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n ...@@ -179,4 +175,25 @@ return float(\'%.02f\' % (row.quantity and - row.quantity or 0.0))\n
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
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