Author: lektran
Date: Mon Nov 9 01:38:27 2009
New Revision: 833962
URL:
http://svn.apache.org/viewvc?rev=833962&view=revLog:
When creating a payment, if no paymentMethodTypeId or paymentMethodId has been provided but a paymentPreferenceId has been then use the values from the OrderPaymentPreference record
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=833962&r1=833961&r2=833962&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Mon Nov 9 01:38:27 2009
@@ -51,6 +51,17 @@
<log level="info" message="Replacing passed payment method type [${parameters.paymentMethodTypeId}] with payment method type [${paymentMethod.paymentMethodTypeId}] for payment method [${parameters.paymentMethodId}]"/>
<set field="parameters.paymentMethodTypeId" from-field="paymentMethod.paymentMethodTypeId"/>
</if-not-empty>
+ <if-not-empty field="parameters.paymentPreferenceId">
+ <entity-one value-field="orderPaymentPreference" entity-name="OrderPaymentPreference">
+ <field-map field-name="orderPaymentPreferenceId" from-field="parameters.paymentPreferenceId"/>
+ </entity-one>
+ <if-empty field="parameters.paymentMethodId">
+ <set field="parameters.paymentMethodId" from-field="orderPaymentPreference.paymentMethodId"/>
+ </if-empty>
+ <if-empty field="parameters.paymentMethodTypeId">
+ <set field="parameters.paymentMethodTypeId" from-field="orderPaymentPreference.paymentMethodTypeId"/>
+ </if-empty>
+ </if-not-empty>
<if-empty field="parameters.paymentMethodTypeId">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingPaymentMethodIdPaymentMethodTypeIdNullError"/>