From 1f6a5ab0b7bc805f502dce464a5bfaf45c8ba50e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 30 Mar 2007 22:32:47 +0000 Subject: [PATCH] Integrate some reported compiere bugs https://sourceforge.net/tracker/?func=detail&atid=410215&aid=1689808&group_id=29057 https://sourceforge.net/tracker/?func=detail&atid=410215&aid=1590304&group_id=29057 --- base/src/org/compiere/model/MBPartnerLocation.java | 11 +++++++---- base/src/org/compiere/model/MOrder.java | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/base/src/org/compiere/model/MBPartnerLocation.java b/base/src/org/compiere/model/MBPartnerLocation.java index 958f984d68..e99768ecf3 100644 --- a/base/src/org/compiere/model/MBPartnerLocation.java +++ b/base/src/org/compiere/model/MBPartnerLocation.java @@ -36,18 +36,18 @@ public class MBPartnerLocation extends X_C_BPartner_Location * @param C_BPartner_ID bp * @return array of locations */ - public static MBPartnerLocation[] getForBPartner (Properties ctx, int C_BPartner_ID) + public MBPartnerLocation[] getForBPartner (Properties ctx, int C_BPartner_ID) { ArrayList list = new ArrayList(); String sql = "SELECT * FROM C_BPartner_Location WHERE C_BPartner_ID=?"; PreparedStatement pstmt = null; try { - pstmt = DB.prepareStatement (sql, null); + pstmt = DB.prepareStatement (sql, trxName); pstmt.setInt (1, C_BPartner_ID); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) - list.add(new MBPartnerLocation(ctx, rs, null)); + list.add(new MBPartnerLocation(ctx, rs, trxName)); rs.close (); pstmt.close (); pstmt = null; @@ -93,6 +93,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location setIsPayFrom (true); setIsBillTo (true); } + this.trxName = trxName; } // MBPartner_Location /** @@ -113,9 +114,11 @@ public class MBPartnerLocation extends X_C_BPartner_Location * @param rs current row of result set to be loaded * @param trxName transaction */ + private String trxName = null; public MBPartnerLocation (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); + this.trxName = trxName; } // MBPartner_Location /** Cached Location */ @@ -173,7 +176,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location makeUnique(address); // Check uniqueness - MBPartnerLocation[] locations = MBPartnerLocation.getForBPartner(getCtx(), getC_BPartner_ID()); + MBPartnerLocation[] locations = getForBPartner(getCtx(), getC_BPartner_ID()); boolean unique = locations.length == 0; while (!unique) { diff --git a/base/src/org/compiere/model/MOrder.java b/base/src/org/compiere/model/MOrder.java index ffa106fc2d..1972b0b21d 100644 --- a/base/src/org/compiere/model/MOrder.java +++ b/base/src/org/compiere/model/MOrder.java @@ -1593,6 +1593,8 @@ public class MOrder extends X_C_Order implements DocAction } if (!oTax.delete(true, get_TrxName())) return false; + if (!oTax.save(get_TrxName())) + return false; } else {