Author: arunpatidar
Date: Thu Jun 23 13:22:00 2016
New Revision: 1749888

URL: http://svn.apache.org/viewvc?rev=1749888&view=rev
Log:
Applied patch from jira issue - OFBIZ-7122 - Showing Invoice address from 
PartyContactMech. Thanks Rahul Singh Kushwah for your contribution.

Modified:
    
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java

Modified: 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java?rev=1749888&r1=1749887&r2=1749888&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
 (original)
+++ 
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
 Thu Jun 23 13:22:00 2016
@@ -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<GenericValue> 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();


Reply via email to