From b493a2567d03d6f2da14b48ec9c8e688ff7a56b7 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Mon, 3 Aug 2015 08:25:10 +0200 Subject: [PATCH] IDEMPIERE-2746 Invoice (customer) doesnt load Sales Rep from Business Partner --- .../src/org/compiere/model/CalloutInvoice.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java index 6a98f5c025..729785cbc8 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java @@ -133,7 +133,7 @@ public class CalloutInvoice extends CalloutEngine + " p.SO_Description,p.IsDiscountPrinted," + " p.SO_CreditLimit, p.SO_CreditLimit-p.SO_CreditUsed AS CreditAvailable," + " l.C_BPartner_Location_ID,c.AD_User_ID," - + " COALESCE(p.PO_PriceList_ID,g.PO_PriceList_ID) AS PO_PriceList_ID, p.PaymentRulePO,p.PO_PaymentTerm_ID " + + " COALESCE(p.PO_PriceList_ID,g.PO_PriceList_ID) AS PO_PriceList_ID, p.PaymentRulePO,p.PO_PaymentTerm_ID, p.SalesRep_ID " + "FROM C_BPartner p" + " INNER JOIN C_BP_Group g ON (p.C_BP_Group_ID=g.C_BP_Group_ID)" + " LEFT OUTER JOIN C_BPartner_Location l ON (p.C_BPartner_ID=l.C_BPartner_ID AND l.IsBillTo='Y' AND l.IsActive='Y')" @@ -151,6 +151,13 @@ public class CalloutInvoice extends CalloutEngine // if (rs.next()) { + // Sales Rep - If BP has a default SalesRep then default it + Integer salesRep = rs.getInt("SalesRep_ID"); + if (IsSOTrx && salesRep != 0 ) + { + mTab.setValue("SalesRep_ID", salesRep); + } + // PriceList & IsTaxIncluded & Currency Integer ii = new Integer(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID")); if (!rs.wasNull())