Fixed bug 29653: Payment selector now filters by child organizations
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Tue, 21 Apr 2015 14:18:22 +0200
changeset 26337 0b8b1170fe70
parent 26336 b1614f430158
child 26338 f919925114f0
Fixed bug 29653: Payment selector now filters by child organizations

The payment selector was incorrectly filtering by child organizations because the order of the parameters in the call to the AD_ISORGINCLUDED function was wrong.

It now gets all the payments belonging to the organization and any child organization of the tab's organization.
src-db/database/sourcedata/OBUISEL_SELECTOR.xml
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Wed Apr 22 10:46:09 2015 +0200
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Tue Apr 21 14:18:22 2015 +0200
@@ -500,7 +500,7 @@
 <!--A1024EFED9AF41F39C374ACD0EC1D733-->  <AD_REFERENCE_ID><![CDATA[EE2E61C84926484C809BEBBCED00C7E3]]></AD_REFERENCE_ID>
 <!--A1024EFED9AF41F39C374ACD0EC1D733-->  <AD_TABLE_ID><![CDATA[D1A97202E832470285C9B1EB026D54E2]]></AD_TABLE_ID>
 <!--A1024EFED9AF41F39C374ACD0EC1D733-->  <AD_COLUMN_ID><![CDATA[7891269C83D0655DE040007F010155CE]]></AD_COLUMN_ID>
-<!--A1024EFED9AF41F39C374ACD0EC1D733-->  <WHERECLAUSE><![CDATA[e.status in ('RPR', 'PPM') and e.amount <>0 and exists ( select 1 from FinancialMgmtFinAccPaymentMethod as  fapm join fapm.account as fa where fapm.paymentMethod = e.paymentMethod and fa.id = @FIN_Financial_Account_ID@ and (case when e.receipt = true then fapm.payinAllow else fapm.payoutAllow end) = true and fa.currency = e.account.currency) and not exists (select 1 from FIN_Finacc_Transaction as ft where e = ft.finPayment) and AD_ISORGINCLUDED(@inpadOrgId@, e.organization.id,e.client.id)<>-1]]></WHERECLAUSE>
+<!--A1024EFED9AF41F39C374ACD0EC1D733-->  <WHERECLAUSE><![CDATA[e.status in ('RPR', 'PPM') and e.amount <>0 and exists ( select 1 from FinancialMgmtFinAccPaymentMethod as  fapm join fapm.account as fa where fapm.paymentMethod = e.paymentMethod and fa.id = @FIN_Financial_Account_ID@ and (case when e.receipt = true then fapm.payinAllow else fapm.payoutAllow end) = true and fa.currency = e.account.currency) and not exists (select 1 from FIN_Finacc_Transaction as ft where e = ft.finPayment) and AD_ISORGINCLUDED(e.organization.id, @inpadOrgId@, e.client.id)<>-1]]></WHERECLAUSE>
 <!--A1024EFED9AF41F39C374ACD0EC1D733-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--A1024EFED9AF41F39C374ACD0EC1D733-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A1024EFED9AF41F39C374ACD0EC1D733-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>