[ofbiz-framework] branch trunk updated: Improved: Purchase Order Email Support (OFBIZ-11864)

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

[ofbiz-framework] branch trunk updated: Improved: Purchase Order Email Support (OFBIZ-11864)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 3ba1d7c  Improved: Purchase Order Email Support (OFBIZ-11864)
3ba1d7c is described below

commit 3ba1d7c7f30c66d8a940a5f9375a8f135d91fbb7
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Mon Aug 3 20:01:05 2020 +0200

    Improved: Purchase Order Email Support (OFBIZ-11864)
   
    This is how I intended to do it. But, since I have a save action to format
    edited lines, Eclipse forced an "unwrapping". I had to check in "Line Wrapping":
    "Never join already wrapped lines", pfew!
---
 .../org/apache/ofbiz/order/order/OrderServices.java  | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
index a8f178b..35a4d6d 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
@@ -7413,23 +7413,29 @@ public class OrderServices {
                 GenericValue orderHeader = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne();
 
                 if (orderHeader != null && "PURCHASE_ORDER".equals(orderHeader.getString("orderTypeId"))) {
-                    GenericValue vendor = EntityQuery.use(delegator).from("OrderRole").where("orderId", orderId, "roleTypeId", "BILL_FROM_VENDOR")
+                    GenericValue vendor = EntityQuery.use(delegator)
+                            .from("OrderRole")
+                            .where("orderId", orderId, "roleTypeId", "BILL_FROM_VENDOR")
                             .queryFirst();
                     if (vendor != null) {
                         String partyIdTo = vendor.getString("partyId");
                         GenericValue contactMech = PartyWorker.findPartyLatestContactMech(partyIdTo, "EMAIL_ADDRESS", delegator);
                         if (contactMech != null && contactMech.getString("infoString") != null) {
-                            GenericValue emailTemplateSetting = EntityQuery.use(delegator).from("EmailTemplateSetting")
-                                    .where("emailTemplateSettingId", emailTemplateSettingId).queryOne();
+                            GenericValue emailTemplateSetting = EntityQuery.use(delegator)
+                                    .from("EmailTemplateSetting")
+                                    .where("emailTemplateSettingId", emailTemplateSettingId)
+                                    .queryOne();
                             if (emailTemplateSetting != null) {
                                 String partyIdFrom = null;
-                                GenericValue company = EntityQuery.use(delegator).from("OrderRole")
-                                        .where("orderId", orderId, "roleTypeId", "BILL_TO_CUSTOMER").queryFirst();
+                                GenericValue company = EntityQuery.use(delegator)
+                                        .from("OrderRole")
+                                        .where("orderId", orderId, "roleTypeId", "BILL_TO_CUSTOMER")
+                                        .queryFirst();
                                 if (company != null) {
                                     partyIdFrom = company.getString("partyId");
                                 }
-                                Map<String, Object> bodyParameters = UtilMisc.toMap("orderId", orderId, "partyIdTo", partyIdTo, "partyIdFrom",
-                                        partyIdFrom);
+                                Map<String, Object> bodyParameters = UtilMisc.toMap("orderId", orderId, "partyIdTo", partyIdTo,
+                                        "partyIdFrom", partyIdFrom);
 
                                 Map<String, Object> emailCtx = UtilMisc.toMap("emailTemplateSettingId", emailTemplateSettingId, "sendTo",
                                         contactMech.getString("infoString"), "bodyParameters", bodyParameters);