This is an automated email from the ASF dual-hosted git repository.
pawan pushed a commit to branch trunk
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/trunk by this push:
new 463648a Fixed: Error while CSR creates a return (OFBIZ-11068)
463648a is described below
commit 463648a6ea42c37f933880882d8441fc2c0c97e6
Author: Pawan Verma <
[hidden email]>
AuthorDate: Sat Nov 23 11:10:30 2019 +0530
Fixed: Error while CSR creates a return
(OFBIZ-11068)
Added check to validate Payment Method passed from UI while creating return. If not available in system, throw an error.
Thanks: Dikpal Kanungo for report and Rohit Hukkeri for the patch.
---
applications/order/config/OrderErrorUiLabels.xml | 3 +++
applications/order/minilang/order/OrderReturnServices.xml | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/applications/order/config/OrderErrorUiLabels.xml b/applications/order/config/OrderErrorUiLabels.xml
index cabe8ab..dc3fbcf 100644
--- a/applications/order/config/OrderErrorUiLabels.xml
+++ b/applications/order/config/OrderErrorUiLabels.xml
@@ -6752,4 +6752,7 @@
<value xml:lang="zh-CN">shoppingListId 是必须的参数</value>
<value xml:lang="zh-TW">購物列表ID是一個必須的參數。</value>
</property>
+ <property key="OrderReturnRequestPaymentMethodId">
+ <value xml:lang="en">Invalid paymentMethodId; can not locate Payment Method.</value>
+ </property>
</resource>
diff --git a/applications/order/minilang/order/OrderReturnServices.xml b/applications/order/minilang/order/OrderReturnServices.xml
index 19ae8c2..1786c0d 100644
--- a/applications/order/minilang/order/OrderReturnServices.xml
+++ b/applications/order/minilang/order/OrderReturnServices.xml
@@ -71,6 +71,16 @@ under the License.
</if-compare>
</else>
</if-empty>
+ <if-not-empty field="parameters.paymentMethodId">
+ <entity-one entity-name="PaymentMethod" value-field="paymentMethod" use-cache="true" auto-field-map="false">
+ <field-map field-name="paymentMethodId" from-field="parameters.paymentMethodId"/>
+ </entity-one>
+ <if-empty field="paymentMethod">
+ <add-error>
+ <fail-property resource="OrderErrorUiLabels" property="OrderReturnRequestPaymentMethodId"/>
+ </add-error>
+ </if-empty>
+ </if-not-empty>
<check-errors/>
<!-- check the needs (auto) inventory receive flag (default to N, meaning that return won't automatically be considered Received when Accepted) -->