diff --git a/base/src/org/compiere/model/I_I_PriceList.java b/base/src/org/compiere/model/I_I_PriceList.java index 09c085a3a9..6218cd00f8 100644 --- a/base/src/org/compiere/model/I_I_PriceList.java +++ b/base/src/org/compiere/model/I_I_PriceList.java @@ -352,12 +352,12 @@ public interface I_I_PriceList /** Set Price Precision. * Precision (number of decimals) for the Price */ - public void setPricePrecision (BigDecimal PricePrecision); + public void setPricePrecision (int PricePrecision); /** Get Price Precision. * Precision (number of decimals) for the Price */ - public BigDecimal getPricePrecision(); + public int getPricePrecision(); /** Column name PriceStd */ public static final String COLUMNNAME_PriceStd = "PriceStd"; diff --git a/base/src/org/compiere/model/I_M_PriceList.java b/base/src/org/compiere/model/I_M_PriceList.java index faf9f54df0..3f6206d65a 100644 --- a/base/src/org/compiere/model/I_M_PriceList.java +++ b/base/src/org/compiere/model/I_M_PriceList.java @@ -238,12 +238,12 @@ public interface I_M_PriceList /** Set Price Precision. * Precision (number of decimals) for the Price */ - public void setPricePrecision (BigDecimal PricePrecision); + public void setPricePrecision (int PricePrecision); /** Get Price Precision. * Precision (number of decimals) for the Price */ - public BigDecimal getPricePrecision(); + public int getPricePrecision(); /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/base/src/org/compiere/model/MPriceList.java b/base/src/org/compiere/model/MPriceList.java index fea455e744..c92a1042a6 100644 --- a/base/src/org/compiere/model/MPriceList.java +++ b/base/src/org/compiere/model/MPriceList.java @@ -167,7 +167,7 @@ public class MPriceList extends X_M_PriceList public static int getPricePrecision (Properties ctx, int M_PriceList_ID) { MPriceList pl = MPriceList.get(ctx, M_PriceList_ID, null); - return pl.getPricePrecisionInt(); + return pl.getPricePrecision(); } // getPricePrecision /** Cache of Price Lists */ @@ -269,27 +269,4 @@ public class MPriceList extends X_M_PriceList return m_precision.intValue(); } // getStandardPrecision - - /** - * Set Price Precision - * @param PricePrecision precision - */ - public void setPricePrecision (int PricePrecision) - { - setPricePrecision (BigDecimal.valueOf(PricePrecision)); - } // setPricePrecision - - - /** - * Get Price Precision as int - * @return precision - -1 for none - */ - public int getPricePrecisionInt () - { - BigDecimal bd = getPricePrecision (); - if (bd == null) - return -1; - return bd.intValue(); - } // getPricePrecisionInt - } // MPriceList diff --git a/base/src/org/compiere/model/X_I_PriceList.java b/base/src/org/compiere/model/X_I_PriceList.java index 0612a532a0..3d34476538 100644 --- a/base/src/org/compiere/model/X_I_PriceList.java +++ b/base/src/org/compiere/model/X_I_PriceList.java @@ -575,20 +575,20 @@ public class X_I_PriceList extends PO implements I_I_PriceList, I_Persistent @param PricePrecision Precision (number of decimals) for the Price */ - public void setPricePrecision (BigDecimal PricePrecision) + public void setPricePrecision (int PricePrecision) { - set_Value (COLUMNNAME_PricePrecision, PricePrecision); + set_Value (COLUMNNAME_PricePrecision, Integer.valueOf(PricePrecision)); } /** Get Price Precision. @return Precision (number of decimals) for the Price */ - public BigDecimal getPricePrecision () + public int getPricePrecision () { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PricePrecision); - if (bd == null) - return Env.ZERO; - return bd; + Integer ii = (Integer)get_Value(COLUMNNAME_PricePrecision); + if (ii == null) + return 0; + return ii.intValue(); } /** Set Standard Price. diff --git a/base/src/org/compiere/model/X_M_PriceList.java b/base/src/org/compiere/model/X_M_PriceList.java index 9e747c24e5..e6f8b2fcbb 100644 --- a/base/src/org/compiere/model/X_M_PriceList.java +++ b/base/src/org/compiere/model/X_M_PriceList.java @@ -18,11 +18,9 @@ package org.compiere.model; import java.lang.reflect.Constructor; -import java.math.BigDecimal; import java.sql.ResultSet; import java.util.Properties; import java.util.logging.Level; -import org.compiere.util.Env; import org.compiere.util.KeyNamePair; /** Generated Model for M_PriceList @@ -49,7 +47,7 @@ public class X_M_PriceList extends PO implements I_M_PriceList, I_Persistent setIsTaxIncluded (false); setM_PriceList_ID (0); setName (null); - setPricePrecision (Env.ZERO); + setPricePrecision (0); // 2 } */ } @@ -354,19 +352,19 @@ public class X_M_PriceList extends PO implements I_M_PriceList, I_Persistent @param PricePrecision Precision (number of decimals) for the Price */ - public void setPricePrecision (BigDecimal PricePrecision) + public void setPricePrecision (int PricePrecision) { - set_Value (COLUMNNAME_PricePrecision, PricePrecision); + set_Value (COLUMNNAME_PricePrecision, Integer.valueOf(PricePrecision)); } /** Get Price Precision. @return Precision (number of decimals) for the Price */ - public BigDecimal getPricePrecision () + public int getPricePrecision () { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PricePrecision); - if (bd == null) - return Env.ZERO; - return bd; + Integer ii = (Integer)get_Value(COLUMNNAME_PricePrecision); + if (ii == null) + return 0; + return ii.intValue(); } } \ No newline at end of file diff --git a/migration/353a-trunk/oracle/550_BF2840359_PricePrecision.sql b/migration/353a-trunk/oracle/550_BF2840359_PricePrecision.sql new file mode 100644 index 0000000000..c607ce5925 --- /dev/null +++ b/migration/353a-trunk/oracle/550_BF2840359_PricePrecision.sql @@ -0,0 +1,10 @@ +-- Aug 29, 2009 10:19:32 PM EEST +-- BF [2840359] - currency precsion should be just an integer +UPDATE AD_Column SET AD_Reference_ID=11,Updated=TO_DATE('2009-08-29 22:19:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56979 +; + +-- Aug 29, 2009 10:25:24 PM EEST +-- BF [2840359] - currency precsion should be just an integer +UPDATE AD_Column SET AD_Reference_ID=11,Updated=TO_DATE('2009-08-29 22:25:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13051 +; + diff --git a/migration/353a-trunk/postgresql/550_BF2840359_PricePrecision.sql b/migration/353a-trunk/postgresql/550_BF2840359_PricePrecision.sql new file mode 100644 index 0000000000..d34f9506a9 --- /dev/null +++ b/migration/353a-trunk/postgresql/550_BF2840359_PricePrecision.sql @@ -0,0 +1,10 @@ +-- Aug 29, 2009 10:19:32 PM EEST +-- BF [2840359] - currency precsion should be just an integer +UPDATE AD_Column SET AD_Reference_ID=11,Updated=TO_TIMESTAMP('2009-08-29 22:19:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56979 +; + +-- Aug 29, 2009 10:25:24 PM EEST +-- BF [2840359] - currency precsion should be just an integer +UPDATE AD_Column SET AD_Reference_ID=11,Updated=TO_TIMESTAMP('2009-08-29 22:25:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13051 +; +