This is an automated email from the ASF dual-hosted git repository.
pawan pushed a commit to branch release18.12
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/release18.12 by this push:
new 4502821 Fixed: Error while CSR creates a return (OFBIZ-11068)
4502821 is described below
commit 4502821830a236b3346101e9169e5dc5070cb8c5
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 7187c35..c46181a 100644
--- a/applications/order/config/OrderErrorUiLabels.xml
+++ b/applications/order/config/OrderErrorUiLabels.xml
@@ -6737,4 +6737,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) -->