From d67750dd5bc1502f35e2dcd2bbd1ec1788f242ac Mon Sep 17 00:00:00 2001 From: Arun Patidar Date: Thu, 23 Jun 2016 13:22:00 +0000 Subject: [PATCH] Applied patch from jira issue - OFBIZ-7122 - Showing Invoice address from PartyContactMech. Thanks Rahul Singh Kushwah for your contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749888 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/ofbiz/accounting/invoice/InvoiceWorker.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java index a51c8691e2..326d11b546 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java @@ -281,8 +281,12 @@ public class InvoiceWorker { public static GenericValue getSendFromAddress(GenericValue invoice) { return getInvoiceAddressByType(invoice, "PAYMENT_LOCATION"); } - + public static GenericValue getInvoiceAddressByType(GenericValue invoice, String contactMechPurposeTypeId) { + return getInvoiceAddressByType(invoice, contactMechPurposeTypeId, true); + } + + public static GenericValue getInvoiceAddressByType(GenericValue invoice, String contactMechPurposeTypeId, boolean fetchPartyAddress) { Delegator delegator = invoice.getDelegator(); List locations = null; // first try InvoiceContactMech to see if we can find the address needed @@ -292,7 +296,7 @@ public class InvoiceWorker { Debug.logError("Touble getting InvoiceContactMech entity list", module); } - if (UtilValidate.isEmpty(locations)) { + if (UtilValidate.isEmpty(locations) && fetchPartyAddress) { // if no locations found get it from the PartyAndContactMech using the from and to party on the invoice String destinationPartyId = null; Timestamp now = UtilDateTime.nowTimestamp();