Commit 695d6c08 authored by Jérome Perrin's avatar Jérome Perrin

remove all source_ to be side independant


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5596 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 382ab478
...@@ -73,33 +73,40 @@ from Products.ERP5Type.Document import newTempAccountingTransaction\n ...@@ -73,33 +73,40 @@ from Products.ERP5Type.Document import newTempAccountingTransaction\n
kwd={"omit_simulation" : 1}\n kwd={"omit_simulation" : 1}\n
# read settings from user preference\n # read settings from user preference\n
preference = context.getPortalObject().portal_preferences\n preference = context.getPortalObject().portal_preferences\n
from_date = kw.get(\'from_date\', preference.getPreferredAccountingTransactionFromDate())\n from_date = kw.get(\'from_date\', preference\\\n
.getPreferredAccountingTransactionFromDate())\n
if from_date :\n if from_date :\n
kwd[\'from_date\'] = from_date\n kwd[\'from_date\'] = from_date\n
at_date = kw.get(\'at_date\', preference.getPreferredAccountingTransactionAtDate())\n at_date = kw.get(\'at_date\', preference\\\n
.getPreferredAccountingTransactionAtDate())\n
if at_date :\n if at_date :\n
kwd[\'at_date\'] = at_date\n kwd[\'at_date\'] = at_date\n
simulation_state = kw.get(\'simulation_state\', preference.getPreferredAccountingTransactionSimulationStateList())\n simulation_state = kw.get(\'simulation_state\', preference\\\n
.getPreferredAccountingTransactionSimulationStateList())\n
if simulation_state :\n if simulation_state :\n
kwd[\'transaction_simulation_state\'] = simulation_state\n kwd[\'transaction_simulation_state\'] = simulation_state\n
section_category = preference.getPreferredAccountingTransactionSectionCategory()\n section_category = preference\\\n
.getPreferredAccountingTransactionSectionCategory()\n
if section_category :\n if section_category :\n
kwd[\'transaction_section_category\'] = section_category\n kwd[\'transaction_section_category\'] = section_category\n
kwd[\'section_category\'] = section_category\n
\n \n
# Special filtering for GL\n
# XXX this script could also be used for entity / bank account ?\n
MARKER = []\n MARKER = []\n
source_payment_uid = kw.get(\'source_payment_uid\', MARKER)\n payment_uid = kw.get(\'source_uid\', MARKER)\n
if source_payment_uid is not MARKER:\n if payment_uid is not MARKER:\n
kwd[\'source_payment_uid\'] = source_payment_uid\n kwd[\'payment_uid\'] = payment_uid\n
no_source_payment = kw.get(\'no_source_payment_uid\', MARKER)\n no_payment_uid = kw.get(\'no_source_uid\', MARKER)\n
if no_source_payment is not MARKER:\n if no_payment_uid is not MARKER:\n
kwd[\'no_source_payment_uid\'] = 1\n kwd[\'no_payment_uid\'] = 1\n
\n \n
destination_section_uid = kw.get(\'destination_section_uid\', MARKER)\n mirror_section_uid = kw.get(\'mirror_section_uid\', MARKER)\n
if destination_section_uid is not MARKER:\n if mirror_section_uid is not MARKER:\n
kwd[\'destination_section_uid\'] = destination_section_uid\n kwd[\'mirror_section_uid\'] = mirror_section_uid\n
no_destination_section_uid = kw.get(\'no_destination_section_uid\', MARKER)\n no_mirror_section_uid = kw.get(\'no_mirror_section_uid\', MARKER)\n
if no_destination_section_uid is not MARKER:\n if no_mirror_section_uid is not MARKER:\n
kwd[\'no_destination_section_uid\'] = 1\n kwd[\'no_mirror_section_uid\'] = 1\n
\n \n
node_uid = kw.get(\'node_uid\', MARKER)\n node_uid = kw.get(\'node_uid\', MARKER)\n
if node_uid is not MARKER:\n if node_uid is not MARKER:\n
...@@ -112,43 +119,47 @@ if node_uid is not MARKER:\n ...@@ -112,43 +119,47 @@ if node_uid is not MARKER:\n
new_result = []\n new_result = []\n
#LOG(\'kwd %s\' % kwd)\n #LOG(\'kwd %s\' % kwd)\n
#LOG(\'SQL:\\n%s\'%context.Account_zGetAccountingTransactionList(src__=1, **kwd))\n #LOG(\'SQL:\\n%s\'%context.Account_zGetAccountingTransactionList(src__=1, **kwd))\n
result = context.Account_zGetAccountingTransactionList(src__=src__, **kwd)\n result = context.Account_zGetAccountingTransactionList(**kwd)\n
\n \n
net_balance = 0.0\n net_balance = 0.0\n
\n \n
if from_date not in (None, MARKER) and kw.get(\'from_date_summary\', 0) :\n if from_date not in (None, MARKER) and kw.get(\'from_date_summary\', 0) :\n
get_inventory_kw = {}\n get_inventory_kw = {}\n
get_inventory_kw[\'omit_simulation\'] = 1\n get_inventory_kw[\'omit_simulation\'] = 1\n
get_inventory_kw[\'section_category\'] = section_category # FIXME: shouldn\'t we use section_uid, ie displaying only the organisation rather than the group ???\n get_inventory_kw[\'section_category\'] = section_category\n
get_inventory_kw[\'node_uid\'] = kw.get(\'node_uid\', context.getUid())\n get_inventory_kw[\'node_uid\'] = kw.get(\'node_uid\', context.getUid())\n
if simulation_state :\n if simulation_state :\n
get_inventory_kw[\'simulation_state\'] = simulation_state\n get_inventory_kw[\'simulation_state\'] = simulation_state\n
if destination_section_uid is not MARKER :\n if mirror_section_uid is not MARKER :\n
get_inventory_kw[\'mirror_section_uid\'] = destination_section_uid\n get_inventory_kw[\'mirror_section_uid\'] = mirror_section_uid\n
if source_payment_uid is not MARKER :\n if payment_uid is not MARKER :\n
get_inventory_kw[\'payment_uid\'] = source_payment_uid\n get_inventory_kw[\'payment_uid\'] = payment_uid\n
\n \n
getInventory = context.getPortalObject().portal_simulation.getInventory\n getInventoryAssetPrice = context.getPortalObject()\\\n
last_total_source_debit = getInventory(omit_output=1, to_date=from_date, **get_inventory_kw)\n .portal_simulation.getInventoryAssetPrice\n
last_total_source_credit = getInventory(omit_input=1, to_date=from_date, **get_inventory_kw)\n last_total_debit = getInventoryAssetPrice(omit_output=1,\n
if last_total_source_credit != 0 : \n to_date=from_date, **get_inventory_kw)\n
last_total_source_credit = - last_total_source_credit \n last_total_credit = getInventoryAssetPrice(omit_input=1,\n
to_date=from_date, **get_inventory_kw)\n
if last_total_credit != 0 :\n
last_total_credit = - last_total_credit\n
\n \n
if last_total_source_debit != 0 or last_total_source_credit != 0 :\n if last_total_debit != 0 or last_total_credit != 0 :\n
from_date_summary = newTempAccountingTransaction(\n from_date_summary = newTempAccountingTransaction(\n
context.getPortalObject(), "temp_%s" % context.getUid())\n context.getPortalObject(), "temp_%s" % context.getUid())\n
from_date_summary.setUid(\'new_000\')\n from_date_summary.setUid(\'new_000\')\n
net_balance = last_total_source_debit - last_total_source_credit\n net_balance = last_total_debit - last_total_credit\n
from_date_summary.edit(\n from_date_summary.edit(\n
title = context.Base_TranslateString("Previous Balance"),\n title = context.Base_TranslateString("Previous Balance"),\n
translated_portal_type = "",\n translated_portal_type = "",\n
translated_simulation_state_title = "",\n translated_simulation_state_title = "",\n
net_balance = net_balance, \n net_balance = net_balance,\n
source_balance = net_balance,\n balance = net_balance,\n
source_credit = last_total_source_credit,\n credit = last_total_credit,\n
source_debit = last_total_source_debit,\n debit = last_total_debit,\n
current_transaction_line_path = None,\n current_transaction_line_path = None,\n
third_party = None,\n third_party = None,\n
date = from_date,\n
)\n )\n
new_result.append(from_date_summary)\n new_result.append(from_date_summary)\n
\n \n
...@@ -157,15 +168,18 @@ if src__:\n ...@@ -157,15 +168,18 @@ if src__:\n
\n \n
for l in result:\n for l in result:\n
o = l.getObject()\n o = l.getObject()\n
net_balance += l.source_balance or 0.0\n net_balance += l.balance or 0.0\n
if o is not None:\n if o is not None:\n
c = o.asContext( net_balance = net_balance,\n c = o.asContext( net_balance = net_balance,\n
source_balance = l.source_balance,\n balance = l.balance,\n
source_credit = l.source_credit,\n credit = l.credit,\n
source_debit = l.source_debit,\n debit = l.debit,\n
current_transaction_line_path = l.current_transaction_line_path,\n date = l.date,\n
third_party = l.third_party,\n current_transaction_line_path =\n
source_payment = l.source_payment_uid\n l.current_transaction_line_path,\n
third_party = l.third_party,\n
payment = l.payment_uid,\n
specific_reference = l.specific_reference,\n
)\n )\n
new_result.append(c)\n new_result.append(c)\n
\n \n
...@@ -186,7 +200,7 @@ return new_result\n ...@@ -186,7 +200,7 @@ return new_result\n
</item> </item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_accounting/Account_getAccountingTransactionList</string> </value> <value> <string>Script (Python):/erp5/portal_skins/erp5_accounting/Account_getAccountingTransactionList</string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
...@@ -231,10 +245,10 @@ return new_result\n ...@@ -231,10 +245,10 @@ return new_result\n
<string>simulation_state</string> <string>simulation_state</string>
<string>section_category</string> <string>section_category</string>
<string>MARKER</string> <string>MARKER</string>
<string>source_payment_uid</string> <string>payment_uid</string>
<string>no_source_payment</string> <string>no_payment_uid</string>
<string>destination_section_uid</string> <string>mirror_section_uid</string>
<string>no_destination_section_uid</string> <string>no_mirror_section_uid</string>
<string>node_uid</string> <string>node_uid</string>
<string>new_result</string> <string>new_result</string>
<string>_apply_</string> <string>_apply_</string>
...@@ -242,9 +256,9 @@ return new_result\n ...@@ -242,9 +256,9 @@ return new_result\n
<string>net_balance</string> <string>net_balance</string>
<string>None</string> <string>None</string>
<string>get_inventory_kw</string> <string>get_inventory_kw</string>
<string>getInventory</string> <string>getInventoryAssetPrice</string>
<string>last_total_source_debit</string> <string>last_total_debit</string>
<string>last_total_source_credit</string> <string>last_total_credit</string>
<string>from_date_summary</string> <string>from_date_summary</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>l</string> <string>l</string>
......
...@@ -340,7 +340,7 @@ ...@@ -340,7 +340,7 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>source_reference</string> <string>specific_reference</string>
<string>Reference</string> <string>Reference</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -348,7 +348,7 @@ ...@@ -348,7 +348,7 @@
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>start_date</string> <string>date</string>
<string>Date</string> <string>Date</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -364,19 +364,19 @@ ...@@ -364,19 +364,19 @@
<string>Third Party</string> <string>Third Party</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_simulation_state</string> <string>translated_simulation_state_title</string>
<string>State</string> <string>State</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>Debit</string> <string>Debit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>Credit</string> <string>Credit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>Balance</string> <string>Balance</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -571,15 +571,15 @@ ...@@ -571,15 +571,15 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>Account_statSourceDebit</string> <string>Account_statSourceDebit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>Account_statSourceCredit</string> <string>Account_statSourceCredit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>Account_statSourceBalance</string> <string>Account_statSourceBalance</string>
</tuple> </tuple>
</list> </list>
......
...@@ -186,6 +186,10 @@ ...@@ -186,6 +186,10 @@
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -252,7 +256,9 @@ ...@@ -252,7 +256,9 @@
</item> </item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>report_root_list</string> </key> <key> <string>report_root_list</string> </key>
...@@ -338,11 +344,11 @@ ...@@ -338,11 +344,11 @@
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>default_source_section_title</string> <string>section_title</string>
<string>Section</string> <string>Section</string>
</tuple> </tuple>
<tuple> <tuple>
<string>getStartDate</string> <string>date</string>
<string>Date</string> <string>Date</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -350,27 +356,23 @@ ...@@ -350,27 +356,23 @@
<string>Type</string> <string>Type</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_reference</string> <string>specific_reference</string>
<string>Source Reference</string> <string>Specific Reference</string>
</tuple>
<tuple>
<string>destination_reference</string>
<string>Destination Reference</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_simulation_state_title</string> <string>translated_simulation_state_title</string>
<string>State</string> <string>State</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>Debit</string> <string>Debit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>Credit</string> <string>Credit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>Balance</string> <string>Balance</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -476,7 +478,7 @@ ...@@ -476,7 +478,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -542,7 +544,7 @@ ...@@ -542,7 +544,7 @@
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>bank_account_transaction_selection</string> </value> <value> <string>bbank_account_transaction_selection</string> </value>
</item> </item>
<item> <item>
<key> <string>sort</string> </key> <key> <string>sort</string> </key>
...@@ -561,15 +563,15 @@ ...@@ -561,15 +563,15 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>BankAccount_statSourceDebit</string> <string>BankAccount_statSourceDebit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>BankAccount_statSourceCredit</string> <string>BankAccount_statSourceCredit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>BankAccount_statSourceBalance</string> <string>BankAccount_statSourceBalance</string>
</tuple> </tuple>
</list> </list>
...@@ -578,7 +580,7 @@ ...@@ -578,7 +580,7 @@
<item> <item>
<key> <string>stat_method</string> </key> <key> <string>stat_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -614,6 +616,25 @@ ...@@ -614,6 +616,25 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[(x, x) for x in here.getPortalAccountingTransactionTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
...@@ -632,7 +653,7 @@ ...@@ -632,7 +653,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
......
...@@ -322,12 +322,7 @@ ...@@ -322,12 +322,7 @@
<item> <item>
<key> <string>all_columns</string> </key> <key> <string>all_columns</string> </key>
<value> <value>
<list> <list/>
<tuple>
<string>destination_reference</string>
<string>Destination Reference</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -349,7 +344,7 @@ ...@@ -349,7 +344,7 @@
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>default_source_section_title</string> <string>section_title</string>
<string>Section</string> <string>Section</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -361,7 +356,7 @@ ...@@ -361,7 +356,7 @@
<string>Type</string> <string>Type</string>
</tuple> </tuple>
<tuple> <tuple>
<string>Entity_getAccountingTransactionSourceGapId</string> <string>Entity_getAccountingTransactionGapId</string>
<string>GAP</string> <string>GAP</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -369,19 +364,19 @@ ...@@ -369,19 +364,19 @@
<string>Invoice Number</string> <string>Invoice Number</string>
</tuple> </tuple>
<tuple> <tuple>
<string>parent_source_reference</string> <string>parent_specific_reference</string>
<string>Source Reference</string> <string>Specific Reference</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_simulation_state_title</string> <string>translated_simulation_state_title</string>
<string>State</string> <string>State</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>Debit</string> <string>Debit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>Credit</string> <string>Credit</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -389,7 +384,7 @@ ...@@ -389,7 +384,7 @@
<string>Grouping</string> <string>Grouping</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>Balance</string> <string>Balance</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -589,15 +584,15 @@ ...@@ -589,15 +584,15 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>Entity_statSourceDebit</string> <string>Entity_statSourceDebit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>Entity_statSourceCredit</string> <string>Entity_statSourceCredit</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>Entity_statSourceBalance</string> <string>Entity_statSourceBalance</string>
</tuple> </tuple>
</list> </list>
...@@ -622,7 +617,7 @@ ...@@ -622,7 +617,7 @@
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>default_source_section_title</string> <string>section_title</string>
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -634,7 +629,7 @@ ...@@ -634,7 +629,7 @@
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>Entity_getAccountingTransactionSourceGapId</string> <string>Entity_getAccountingTransactionGapId</string>
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -642,7 +637,7 @@ ...@@ -642,7 +637,7 @@
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>parent_source_reference</string> <string>parent_specific_reference</string>
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -650,11 +645,11 @@ ...@@ -650,11 +645,11 @@
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_debit</string> <string>debit</string>
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_credit</string> <string>credit</string>
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -662,7 +657,7 @@ ...@@ -662,7 +657,7 @@
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>source_balance</string> <string>balance</string>
<string>AccountingTransactionLine_getParentUrl</string> <string>AccountingTransactionLine_getParentUrl</string>
</tuple> </tuple>
<tuple> <tuple>
......
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