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
kwd={"omit_simulation" : 1}\n
# read settings from user preference\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
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
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
kwd[\'transaction_simulation_state\'] = simulation_state\n
section_category = preference.getPreferredAccountingTransactionSectionCategory()\n
section_category = preference\\\n
.getPreferredAccountingTransactionSectionCategory()\n
if section_category :\n
kwd[\'transaction_section_category\'] = section_category\n
kwd[\'section_category\'] = section_category\n
\n
# Special filtering for GL\n
# XXX this script could also be used for entity / bank account ?\n
MARKER = []\n
source_payment_uid = kw.get(\'source_payment_uid\', MARKER)\n
if source_payment_uid is not MARKER:\n
kwd[\'source_payment_uid\'] = source_payment_uid\n
no_source_payment = kw.get(\'no_source_payment_uid\', MARKER)\n
if no_source_payment is not MARKER:\n
kwd[\'no_source_payment_uid\'] = 1\n
payment_uid = kw.get(\'source_uid\', MARKER)\n
if payment_uid is not MARKER:\n
kwd[\'payment_uid\'] = payment_uid\n
no_payment_uid = kw.get(\'no_source_uid\', MARKER)\n
if no_payment_uid is not MARKER:\n
kwd[\'no_payment_uid\'] = 1\n
\n
destination_section_uid = kw.get(\'destination_section_uid\', MARKER)\n
if destination_section_uid is not MARKER:\n
kwd[\'destination_section_uid\'] = destination_section_uid\n
no_destination_section_uid = kw.get(\'no_destination_section_uid\', MARKER)\n
if no_destination_section_uid is not MARKER:\n
kwd[\'no_destination_section_uid\'] = 1\n
mirror_section_uid = kw.get(\'mirror_section_uid\', MARKER)\n
if mirror_section_uid is not MARKER:\n
kwd[\'mirror_section_uid\'] = mirror_section_uid\n
no_mirror_section_uid = kw.get(\'no_mirror_section_uid\', MARKER)\n
if no_mirror_section_uid is not MARKER:\n
kwd[\'no_mirror_section_uid\'] = 1\n
\n
node_uid = kw.get(\'node_uid\', MARKER)\n
if node_uid is not MARKER:\n
......@@ -112,43 +119,47 @@ if node_uid is not MARKER:\n
new_result = []\n
#LOG(\'kwd %s\' % 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
net_balance = 0.0\n
\n
if from_date not in (None, MARKER) and kw.get(\'from_date_summary\', 0) :\n
get_inventory_kw = {}\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
if simulation_state :\n
get_inventory_kw[\'simulation_state\'] = simulation_state\n
if destination_section_uid is not MARKER :\n
get_inventory_kw[\'mirror_section_uid\'] = destination_section_uid\n
if source_payment_uid is not MARKER :\n
get_inventory_kw[\'payment_uid\'] = source_payment_uid\n
if mirror_section_uid is not MARKER :\n
get_inventory_kw[\'mirror_section_uid\'] = mirror_section_uid\n
if payment_uid is not MARKER :\n
get_inventory_kw[\'payment_uid\'] = payment_uid\n
\n
getInventory = context.getPortalObject().portal_simulation.getInventory\n
last_total_source_debit = getInventory(omit_output=1, to_date=from_date, **get_inventory_kw)\n
last_total_source_credit = getInventory(omit_input=1, to_date=from_date, **get_inventory_kw)\n
if last_total_source_credit != 0 : \n
last_total_source_credit = - last_total_source_credit \n
getInventoryAssetPrice = context.getPortalObject()\\\n
.portal_simulation.getInventoryAssetPrice\n
last_total_debit = getInventoryAssetPrice(omit_output=1,\n
to_date=from_date, **get_inventory_kw)\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
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
context.getPortalObject(), "temp_%s" % context.getUid())\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
title = context.Base_TranslateString("Previous Balance"),\n
translated_portal_type = "",\n
translated_simulation_state_title = "",\n
net_balance = net_balance, \n
source_balance = net_balance,\n
source_credit = last_total_source_credit,\n
source_debit = last_total_source_debit,\n
net_balance = net_balance,\n
balance = net_balance,\n
credit = last_total_credit,\n
debit = last_total_debit,\n
current_transaction_line_path = None,\n
third_party = None,\n
date = from_date,\n
)\n
new_result.append(from_date_summary)\n
\n
......@@ -157,15 +168,18 @@ if src__:\n
\n
for l in result:\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
c = o.asContext( net_balance = net_balance,\n
source_balance = l.source_balance,\n
source_credit = l.source_credit,\n
source_debit = l.source_debit,\n
current_transaction_line_path = l.current_transaction_line_path,\n
third_party = l.third_party,\n
source_payment = l.source_payment_uid\n
balance = l.balance,\n
credit = l.credit,\n
debit = l.debit,\n
date = l.date,\n
current_transaction_line_path =\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
new_result.append(c)\n
\n
......@@ -186,7 +200,7 @@ return new_result\n
</item>
<item>
<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>
<key> <string>_params</string> </key>
......@@ -231,10 +245,10 @@ return new_result\n
<string>simulation_state</string>
<string>section_category</string>
<string>MARKER</string>
<string>source_payment_uid</string>
<string>no_source_payment</string>
<string>destination_section_uid</string>
<string>no_destination_section_uid</string>
<string>payment_uid</string>
<string>no_payment_uid</string>
<string>mirror_section_uid</string>
<string>no_mirror_section_uid</string>
<string>node_uid</string>
<string>new_result</string>
<string>_apply_</string>
......@@ -242,9 +256,9 @@ return new_result\n
<string>net_balance</string>
<string>None</string>
<string>get_inventory_kw</string>
<string>getInventory</string>
<string>last_total_source_debit</string>
<string>last_total_source_credit</string>
<string>getInventoryAssetPrice</string>
<string>last_total_debit</string>
<string>last_total_credit</string>
<string>from_date_summary</string>
<string>_getiter_</string>
<string>l</string>
......
......@@ -340,7 +340,7 @@
<value>
<list>
<tuple>
<string>source_reference</string>
<string>specific_reference</string>
<string>Reference</string>
</tuple>
<tuple>
......@@ -348,7 +348,7 @@
<string>Title</string>
</tuple>
<tuple>
<string>start_date</string>
<string>date</string>
<string>Date</string>
</tuple>
<tuple>
......@@ -364,19 +364,19 @@
<string>Third Party</string>
</tuple>
<tuple>
<string>translated_simulation_state</string>
<string>translated_simulation_state_title</string>
<string>State</string>
</tuple>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>Debit</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>Credit</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>Balance</string>
</tuple>
<tuple>
......@@ -571,15 +571,15 @@
<value>
<list>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>Account_statSourceDebit</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>Account_statSourceCredit</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>Account_statSourceBalance</string>
</tuple>
</list>
......
......@@ -186,6 +186,10 @@
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
......@@ -252,7 +256,9 @@
</item>
<item>
<key> <string>portal_types</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>report_root_list</string> </key>
......@@ -338,11 +344,11 @@
<string>Title</string>
</tuple>
<tuple>
<string>default_source_section_title</string>
<string>section_title</string>
<string>Section</string>
</tuple>
<tuple>
<string>getStartDate</string>
<string>date</string>
<string>Date</string>
</tuple>
<tuple>
......@@ -350,27 +356,23 @@
<string>Type</string>
</tuple>
<tuple>
<string>source_reference</string>
<string>Source Reference</string>
</tuple>
<tuple>
<string>destination_reference</string>
<string>Destination Reference</string>
<string>specific_reference</string>
<string>Specific Reference</string>
</tuple>
<tuple>
<string>translated_simulation_state_title</string>
<string>State</string>
</tuple>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>Debit</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>Credit</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>Balance</string>
</tuple>
<tuple>
......@@ -476,7 +478,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -542,7 +544,7 @@
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>bank_account_transaction_selection</string> </value>
<value> <string>bbank_account_transaction_selection</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
......@@ -561,15 +563,15 @@
<value>
<list>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>BankAccount_statSourceDebit</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>BankAccount_statSourceCredit</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>BankAccount_statSourceBalance</string>
</tuple>
</list>
......@@ -578,7 +580,7 @@
<item>
<key> <string>stat_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -614,6 +616,25 @@
</pickle>
</record>
<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>
<tuple>
<tuple>
......@@ -632,7 +653,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<tuple>
......
......@@ -322,12 +322,7 @@
<item>
<key> <string>all_columns</string> </key>
<value>
<list>
<tuple>
<string>destination_reference</string>
<string>Destination Reference</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -349,7 +344,7 @@
<string>Title</string>
</tuple>
<tuple>
<string>default_source_section_title</string>
<string>section_title</string>
<string>Section</string>
</tuple>
<tuple>
......@@ -361,7 +356,7 @@
<string>Type</string>
</tuple>
<tuple>
<string>Entity_getAccountingTransactionSourceGapId</string>
<string>Entity_getAccountingTransactionGapId</string>
<string>GAP</string>
</tuple>
<tuple>
......@@ -369,19 +364,19 @@
<string>Invoice Number</string>
</tuple>
<tuple>
<string>parent_source_reference</string>
<string>Source Reference</string>
<string>parent_specific_reference</string>
<string>Specific Reference</string>
</tuple>
<tuple>
<string>translated_simulation_state_title</string>
<string>State</string>
</tuple>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>Debit</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>Credit</string>
</tuple>
<tuple>
......@@ -389,7 +384,7 @@
<string>Grouping</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>Balance</string>
</tuple>
<tuple>
......@@ -589,15 +584,15 @@
<value>
<list>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>Entity_statSourceDebit</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>Entity_statSourceCredit</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>Entity_statSourceBalance</string>
</tuple>
</list>
......@@ -622,7 +617,7 @@
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
<string>default_source_section_title</string>
<string>section_title</string>
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
......@@ -634,7 +629,7 @@
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
<string>Entity_getAccountingTransactionSourceGapId</string>
<string>Entity_getAccountingTransactionGapId</string>
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
......@@ -642,7 +637,7 @@
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
<string>parent_source_reference</string>
<string>parent_specific_reference</string>
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
......@@ -650,11 +645,11 @@
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
<string>source_debit</string>
<string>debit</string>
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
<string>source_credit</string>
<string>credit</string>
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
......@@ -662,7 +657,7 @@
<string>AccountingTransactionLine_getParentUrl</string>
</tuple>
<tuple>
<string>source_balance</string>
<string>balance</string>
<string>AccountingTransactionLine_getParentUrl</string>
</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