[ofbiz-framework] branch release17.12 updated: Fixed: Error while CSR creates a return (OFBIZ-11068)

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

[ofbiz-framework] branch release17.12 updated: Fixed: Error while CSR creates a return (OFBIZ-11068)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release17.12 by this push:
     new 32dcdd7  Fixed: Error while CSR creates a return (OFBIZ-11068)
32dcdd7 is described below

commit 32dcdd744cff8d97187e98da6acc6ac472d2e46e
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 918f409..a0ae693 100644
--- a/applications/order/config/OrderErrorUiLabels.xml
+++ b/applications/order/config/OrderErrorUiLabels.xml
@@ -6729,4 +6729,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) -->