diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java index bf9544d7b6..1ff8c06e30 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java @@ -271,11 +271,10 @@ public class CalloutInOut extends CalloutEngine + "p.M_PriceList_ID,p.PaymentRule,p.POReference," + "p.SO_Description,p.IsDiscountPrinted," + "p.SO_CreditLimit-p.SO_CreditUsed AS CreditAvailable," - + "l.C_BPartner_Location_ID,c.AD_User_ID " - + "FROM C_BPartner p, C_BPartner_Location l, AD_User c " - + "WHERE l.IsActive='Y' AND p.C_BPartner_ID=l.C_BPartner_ID(+)" - + " AND p.C_BPartner_ID=c.C_BPartner_ID(+)" - + " AND p.C_BPartner_ID=?"; // 1 + + "(select max(l.C_BPartner_Location_ID) from C_BPartner_Location l where p.C_BPartner_ID=l.C_BPartner_ID AND l.IsActive='Y') as C_BPartner_Location_ID," + + "(select max(c.AD_User_ID) from AD_User c where p.C_BPartner_ID=c.C_BPartner_ID AND c.IsActive='Y') as AD_User_ID " + + "FROM C_BPartner p " + + "WHERE p.C_BPartner_ID=?"; // 1 PreparedStatement pstmt = null; ResultSet rs = null;