svn commit: r1533735 - in /ofbiz/branches/release12.04: ./ applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1533735 - in /ofbiz/branches/release12.04: ./ applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml

jleroux@apache.org
Author: jleroux
Date: Sat Oct 19 11:59:18 2013
New Revision: 1533735

URL: http://svn.apache.org/r1533735
Log:
"Applied fix from trunk for revision: 1527254"
------------------------------------------------------------------------
r1527254 | jleroux | 2013-09-28 23:47:10 +0200 (sam. 28 sept. 2013) | 19 lignes

A modified patch from Karl Beecher for "Updating EFT Account address resurrects out-of-date EFT Accounts" https://issues.apache.org/jira/browse/OFBIZ-5193

When you update the address that an EFT Acccount is linked to, all expired EFT accounts are "resurrected", which can mean multiple out-of-date copies of an EFT account are displayed in the Payment Method Information.

To reproduce (with OFBiz demo data):

* Go to DemoSupplier profile page and click Create EFT Account
* Enter details of a new account, making sure the account is linked to the DemoSupplier postal address.
* Click Save and then click Cancel/Done.
* Back on the profile page, Update for this new EFT account.
* Change at least one field of the account.
* Click Save (now there are two EFT account records in the database; one of which is expired). Click Cancel/Done.
* Now click Update for the DemoSupplier's postal address.
* Update at least one field. Click Save.
* Go back to the DemoSupplier profile page. You should see that the old expired EFT accounts are listed in the Payment Method Information.

We avoid this bug by altering PaymentMethodServices.xml#setPaymentMethodAddress, so that out-of-date EFT Accounts are filtered out.

jleroux: I applied changes by hand because the patch did not work. I also removed the useless line setting a now var.
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1527254

Modified: ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml?rev=1533735&r1=1533734&r2=1533735&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml (original)
+++ ofbiz/branches/release12.04/applications/accounting/script/org/ofbiz/accounting/payment/PaymentMethodServices.xml Sat Oct 19 11:59:18 2013
@@ -63,11 +63,14 @@ under the License.
 
         <find-by-and entity-name="EftAccount" map="lookupMap" list="eftAccounts"/>
         <iterate entry="eftAccount" list="eftAccounts">
-            <set-service-fields service-name="updateEftAccount" map="eftAccount" to-map="ueaMap"/>
-            <set field="ueaMap.contactMechId" from-field="parameters.contactMechId"/>
-            <set field="ueaMap.partyId" from-field="parameters.partyId"/>
-            <!-- use the service so it will expire the old account and create a new one; don't break on error since this is a background process, just get whatever we can done... -->
-            <call-service service-name="updateEftAccount" in-map-name="ueaMap" break-on-error="false"/>
+            <get-related-one relation-name="PaymentMethod" to-value-field="paymentMethod" value-field="eftAccount"/>
+            <if-empty field="paymentMethod.thruDate">
+                <set-service-fields service-name="updateEftAccount" map="eftAccount" to-map="ueaMap"/>
+                <set field="ueaMap.contactMechId" from-field="parameters.contactMechId"/>
+                <set field="ueaMap.partyId" from-field="parameters.partyId"/>
+                <!-- use the service so it will expire the old account and create a new one; don't break on error since this is a background process, just get whatever we can done... -->
+                <call-service service-name="updateEftAccount" in-map-name="ueaMap" break-on-error="false"/>
+            </if-empty>            
         </iterate>
     </simple-method>
     <!--CreateCreditCardTypeGlAccount methods -->