Merged idempiere/idempiere-experimental/default into default

This commit is contained in:
Carlos Ruiz 2018-10-31 15:27:30 +01:00
commit a78bb93284
578 changed files with 3597 additions and 2246 deletions

View File

@ -8,6 +8,7 @@ alpn-boot.jar
org.adempiere.webstore/bin org.adempiere.webstore/bin
org.idempiere.hazelcast.service.config/bin org.idempiere.hazelcast.service.config/bin
*/target */target
runtime-server.product
syntax: regexp syntax: regexp
^adempiere$ ^adempiere$
^org\.adempiere\.install/lib$ ^org\.adempiere\.install/lib$

View File

@ -2,7 +2,8 @@
<feature <feature
id="org.adempiere.base.feature" id="org.adempiere.base.feature"
label="Adempiere Base" label="Adempiere Base"
version="5.1.0.qualifier"> version="5.1.0.qualifier"
provider-name="iDempiere Community">
<description url="http://www.example.com/description"> <description url="http://www.example.com/description">
[Enter Feature Description here.] [Enter Feature Description here.]
@ -99,13 +100,6 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="javax.activation"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin <plugin
id="javax.jms" id="javax.jms"
download-size="0" download-size="0"
@ -162,13 +156,6 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="javax.management.j2ee-api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin <plugin
id="org.apache.commons.logging" id="org.apache.commons.logging"
download-size="0" download-size="0"
@ -176,34 +163,6 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="javax.ejb"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.xml.rpc"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.xml.soap"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.xml.bind"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin <plugin
id="javax.xml.stream" id="javax.xml.stream"
download-size="0" download-size="0"
@ -329,13 +288,6 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="groovy-all"
download-size="0"
install-size="0"
version="2.4.13"
unpack="false"/>
<plugin <plugin
id="com.ibm.icu" id="com.ibm.icu"
download-size="0" download-size="0"
@ -371,14 +323,6 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="javax.transaction"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin <plugin
id="org.apache.commons.commons-collections4" id="org.apache.commons.commons-collections4"
download-size="0" download-size="0"
@ -386,13 +330,6 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="org.apache.commons.configuration"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin <plugin
id="org.apache.commons.net" id="org.apache.commons.net"
download-size="0" download-size="0"
@ -421,4 +358,145 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="jaxb-api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.transaction-api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.interceptor-api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.enterprise.cdi-api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.inject"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.annotation-api"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="groovy"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.commons-configuration2"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.transaction"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-console"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-datetime"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-json"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-jsr223"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-nio"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-swing"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="groovy-xml"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="javax.jws"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.activation"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature> </feature>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/> <classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>

View File

@ -1,7 +1,3 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: iDempiere Callout Bundle-Name: iDempiere Callout
Bundle-SymbolicName: org.adempiere.base.callout Bundle-SymbolicName: org.adempiere.base.callout
Bundle-Version: 5.1.0.qualifier Bundle-Version: 5.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=1.10))"
Require-Bundle: org.adempiere.base;bundle-version="0.0.0" Require-Bundle: org.adempiere.base;bundle-version="0.0.0"
Eclipse-RegisterBuddy: org.adempiere.base Eclipse-RegisterBuddy: org.adempiere.base
Service-Component: OSGI-INF/costadjustmentcalloutfactory.xml, OSGI-INF/bpartnerquickentrycalloutFactory.xml Service-Component: OSGI-INF/costadjustmentcalloutfactory.xml, OSGI-INF/bpartnerquickentrycalloutFactory.xml
@ -11,4 +11,5 @@ Bundle-ActivationPolicy: lazy
Export-Package: org.compiere.model Export-Package: org.compiere.model
Bundle-ClassPath: . Bundle-ClassPath: .
Automatic-Module-Name: org.adempiere.base.callout Automatic-Module-Name: org.adempiere.base.callout
Bundle-Vendor: iDempiere Community

View File

@ -18,6 +18,7 @@
package org.adempiere.model; package org.adempiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Properties; import java.util.Properties;
import org.adempiere.base.Core; import org.adempiere.base.Core;
@ -101,7 +102,7 @@ public class CalloutRMA extends CalloutEngine {
BigDecimal lineNetAmt = invoiceLine.getQtyEntered().multiply(invoiceLine.getPriceEntered()); BigDecimal lineNetAmt = invoiceLine.getQtyEntered().multiply(invoiceLine.getPriceEntered());
int precision = invoiceLine.getPrecision(); int precision = invoiceLine.getPrecision();
if (lineNetAmt.scale() > precision) if (lineNetAmt.scale() > precision)
lineNetAmt = lineNetAmt.setScale(precision, BigDecimal.ROUND_HALF_UP); lineNetAmt = lineNetAmt.setScale(precision, RoundingMode.HALF_UP);
mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt); mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt);
} }
else if (iol.getC_OrderLine_ID() != 0) else if (iol.getC_OrderLine_ID() != 0)
@ -122,7 +123,7 @@ public class CalloutRMA extends CalloutEngine {
BigDecimal lineNetAmt = orderLine.getQtyEntered().multiply(orderLine.getPriceEntered()); BigDecimal lineNetAmt = orderLine.getQtyEntered().multiply(orderLine.getPriceEntered());
int precision = orderLine.getPrecision(); int precision = orderLine.getPrecision();
if (lineNetAmt.scale() > precision) if (lineNetAmt.scale() > precision)
lineNetAmt = lineNetAmt.setScale(precision, BigDecimal.ROUND_HALF_UP); lineNetAmt = lineNetAmt.setScale(precision, RoundingMode.HALF_UP);
mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt); mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt);
} }
@ -193,7 +194,7 @@ public class CalloutRMA extends CalloutEngine {
BigDecimal lineNetAmt = Env.ONE.multiply(pp.getPriceStd()); BigDecimal lineNetAmt = Env.ONE.multiply(pp.getPriceStd());
if (lineNetAmt.scale() > precision) if (lineNetAmt.scale() > precision)
lineNetAmt = lineNetAmt.setScale(precision, BigDecimal.ROUND_HALF_UP); lineNetAmt = lineNetAmt.setScale(precision, RoundingMode.HALF_UP);
mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt); mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt);
return ""; return "";
@ -246,7 +247,7 @@ public class CalloutRMA extends CalloutEngine {
BigDecimal lineNetAmt = Env.ONE.multiply(charge.getChargeAmt()); BigDecimal lineNetAmt = Env.ONE.multiply(charge.getChargeAmt());
if (lineNetAmt.scale() > precision) if (lineNetAmt.scale() > precision)
lineNetAmt = lineNetAmt.setScale(precision, BigDecimal.ROUND_HALF_UP); lineNetAmt = lineNetAmt.setScale(precision, RoundingMode.HALF_UP);
mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt); mTab.setValue(MRMALine.COLUMNNAME_LineNetAmt, lineNetAmt);
return ""; return "";

View File

@ -92,7 +92,7 @@ public class CalloutAssignment extends CalloutEngine
if (log.isLoggable(Level.FINE)) log.fine("S_ResourceAssignment_ID=" + S_ResourceAssignment_ID + " - M_Product_ID=" + M_Product_ID); if (log.isLoggable(Level.FINE)) log.fine("S_ResourceAssignment_ID=" + S_ResourceAssignment_ID + " - M_Product_ID=" + M_Product_ID);
if (M_Product_ID != 0) if (M_Product_ID != 0)
{ {
mTab.setValue ("M_Product_ID", new Integer (M_Product_ID)); mTab.setValue ("M_Product_ID", Integer.valueOf(M_Product_ID));
if (Description != null) if (Description != null)
Name += " (" + Description + ")"; Name += " (" + Description + ")";
if (!".".equals(Name)) if (!".".equals(Name))

View File

@ -84,7 +84,7 @@ public class CalloutCashJournal extends CalloutEngine
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
mTab.setValue("C_Currency_ID", new Integer(rs.getInt(2))); mTab.setValue("C_Currency_ID", Integer.valueOf(rs.getInt(2)));
BigDecimal PayAmt = rs.getBigDecimal(3); BigDecimal PayAmt = rs.getBigDecimal(3);
BigDecimal DiscountAmt = rs.getBigDecimal(5); BigDecimal DiscountAmt = rs.getBigDecimal(5);
boolean isSOTrx = "Y".equals(rs.getString(4)); boolean isSOTrx = "Y".equals(rs.getString(4));

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -103,7 +104,7 @@ public class CalloutGLJournal extends CalloutEngine
pstmt = null; pstmt = null;
} }
if (C_Period_ID != 0) if (C_Period_ID != 0)
mTab.setValue("C_Period_ID", new Integer(C_Period_ID)); mTab.setValue("C_Period_ID", Integer.valueOf(C_Period_ID));
} }
// When C_Period_ID is changed, check if in DateAcct range and set to end date if not // When C_Period_ID is changed, check if in DateAcct range and set to end date if not
@ -222,10 +223,10 @@ public class CalloutGLJournal extends CalloutEngine
AmtSourceCr = Env.ZERO; AmtSourceCr = Env.ZERO;
BigDecimal AmtAcctDr = AmtSourceDr.multiply(CurrencyRate); BigDecimal AmtAcctDr = AmtSourceDr.multiply(CurrencyRate);
AmtAcctDr = AmtAcctDr.setScale(Precision, BigDecimal.ROUND_HALF_UP); AmtAcctDr = AmtAcctDr.setScale(Precision, RoundingMode.HALF_UP);
mTab.setValue("AmtAcctDr", AmtAcctDr); mTab.setValue("AmtAcctDr", AmtAcctDr);
BigDecimal AmtAcctCr = AmtSourceCr.multiply(CurrencyRate); BigDecimal AmtAcctCr = AmtSourceCr.multiply(CurrencyRate);
AmtAcctCr = AmtAcctCr.setScale(Precision, BigDecimal.ROUND_HALF_UP); AmtAcctCr = AmtAcctCr.setScale(Precision, RoundingMode.HALF_UP);
mTab.setValue("AmtAcctCr", AmtAcctCr); mTab.setValue("AmtAcctCr", AmtAcctCr);
return ""; return "";

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -61,28 +62,28 @@ public class CalloutInOut extends CalloutEngine
{ {
mTab.setValue("DateOrdered", order.getDateOrdered()); mTab.setValue("DateOrdered", order.getDateOrdered());
mTab.setValue("POReference", order.getPOReference()); mTab.setValue("POReference", order.getPOReference());
mTab.setValue("AD_Org_ID", new Integer(order.getAD_Org_ID())); mTab.setValue("AD_Org_ID", Integer.valueOf(order.getAD_Org_ID()));
mTab.setValue("AD_OrgTrx_ID", new Integer(order.getAD_OrgTrx_ID())); mTab.setValue("AD_OrgTrx_ID", Integer.valueOf(order.getAD_OrgTrx_ID()));
mTab.setValue("C_Activity_ID", new Integer(order.getC_Activity_ID())); mTab.setValue("C_Activity_ID", Integer.valueOf(order.getC_Activity_ID()));
mTab.setValue("C_Campaign_ID", new Integer(order.getC_Campaign_ID())); mTab.setValue("C_Campaign_ID", Integer.valueOf(order.getC_Campaign_ID()));
mTab.setValue("C_Project_ID", new Integer(order.getC_Project_ID())); mTab.setValue("C_Project_ID", Integer.valueOf(order.getC_Project_ID()));
mTab.setValue("User1_ID", new Integer(order.getUser1_ID())); mTab.setValue("User1_ID", Integer.valueOf(order.getUser1_ID()));
mTab.setValue("User2_ID", new Integer(order.getUser2_ID())); mTab.setValue("User2_ID", Integer.valueOf(order.getUser2_ID()));
mTab.setValue("M_Warehouse_ID", new Integer(order.getM_Warehouse_ID())); mTab.setValue("M_Warehouse_ID", Integer.valueOf(order.getM_Warehouse_ID()));
// //
mTab.setValue("DeliveryRule", order.getDeliveryRule()); mTab.setValue("DeliveryRule", order.getDeliveryRule());
mTab.setValue("DeliveryViaRule", order.getDeliveryViaRule()); mTab.setValue("DeliveryViaRule", order.getDeliveryViaRule());
mTab.setValue("M_Shipper_ID", new Integer(order.getM_Shipper_ID())); mTab.setValue("M_Shipper_ID", Integer.valueOf(order.getM_Shipper_ID()));
mTab.setValue("FreightCostRule", order.getFreightCostRule()); mTab.setValue("FreightCostRule", order.getFreightCostRule());
mTab.setValue("FreightAmt", order.getFreightAmt()); mTab.setValue("FreightAmt", order.getFreightAmt());
mTab.setValue("C_BPartner_ID", new Integer(order.getC_BPartner_ID())); mTab.setValue("C_BPartner_ID", Integer.valueOf(order.getC_BPartner_ID()));
//[ 1867464 ] //[ 1867464 ]
mTab.setValue("C_BPartner_Location_ID", new Integer(order.getC_BPartner_Location_ID())); mTab.setValue("C_BPartner_Location_ID", Integer.valueOf(order.getC_BPartner_Location_ID()));
if (order.getAD_User_ID() > 0) if (order.getAD_User_ID() > 0)
mTab.setValue("AD_User_ID", new Integer(order.getAD_User_ID())); mTab.setValue("AD_User_ID", Integer.valueOf(order.getAD_User_ID()));
else else
mTab.setValue("AD_User_ID", null); mTab.setValue("AD_User_ID", null);
} }
@ -128,28 +129,28 @@ public class CalloutInOut extends CalloutEngine
{ {
mTab.setValue("DateOrdered", originalReceipt.getDateOrdered()); mTab.setValue("DateOrdered", originalReceipt.getDateOrdered());
mTab.setValue("POReference", originalReceipt.getPOReference()); mTab.setValue("POReference", originalReceipt.getPOReference());
mTab.setValue("AD_Org_ID", new Integer(originalReceipt.getAD_Org_ID())); mTab.setValue("AD_Org_ID", Integer.valueOf(originalReceipt.getAD_Org_ID()));
mTab.setValue("AD_OrgTrx_ID", new Integer(originalReceipt.getAD_OrgTrx_ID())); mTab.setValue("AD_OrgTrx_ID", Integer.valueOf(originalReceipt.getAD_OrgTrx_ID()));
mTab.setValue("C_Activity_ID", new Integer(originalReceipt.getC_Activity_ID())); mTab.setValue("C_Activity_ID", Integer.valueOf(originalReceipt.getC_Activity_ID()));
mTab.setValue("C_Campaign_ID", new Integer(originalReceipt.getC_Campaign_ID())); mTab.setValue("C_Campaign_ID", Integer.valueOf(originalReceipt.getC_Campaign_ID()));
mTab.setValue("C_Project_ID", new Integer(originalReceipt.getC_Project_ID())); mTab.setValue("C_Project_ID", Integer.valueOf(originalReceipt.getC_Project_ID()));
mTab.setValue("User1_ID", new Integer(originalReceipt.getUser1_ID())); mTab.setValue("User1_ID", Integer.valueOf(originalReceipt.getUser1_ID()));
mTab.setValue("User2_ID", new Integer(originalReceipt.getUser2_ID())); mTab.setValue("User2_ID", Integer.valueOf(originalReceipt.getUser2_ID()));
mTab.setValue("M_Warehouse_ID", new Integer(originalReceipt.getM_Warehouse_ID())); mTab.setValue("M_Warehouse_ID", Integer.valueOf(originalReceipt.getM_Warehouse_ID()));
// //
mTab.setValue("DeliveryRule", originalReceipt.getDeliveryRule()); mTab.setValue("DeliveryRule", originalReceipt.getDeliveryRule());
mTab.setValue("DeliveryViaRule", originalReceipt.getDeliveryViaRule()); mTab.setValue("DeliveryViaRule", originalReceipt.getDeliveryViaRule());
mTab.setValue("M_Shipper_ID", new Integer(originalReceipt.getM_Shipper_ID())); mTab.setValue("M_Shipper_ID", Integer.valueOf(originalReceipt.getM_Shipper_ID()));
mTab.setValue("FreightCostRule", originalReceipt.getFreightCostRule()); mTab.setValue("FreightCostRule", originalReceipt.getFreightCostRule());
mTab.setValue("FreightAmt", originalReceipt.getFreightAmt()); mTab.setValue("FreightAmt", originalReceipt.getFreightAmt());
mTab.setValue("C_BPartner_ID", new Integer(originalReceipt.getC_BPartner_ID())); mTab.setValue("C_BPartner_ID", Integer.valueOf(originalReceipt.getC_BPartner_ID()));
//[ 1867464 ] //[ 1867464 ]
mTab.setValue("C_BPartner_Location_ID", new Integer(originalReceipt.getC_BPartner_Location_ID())); mTab.setValue("C_BPartner_Location_ID", Integer.valueOf(originalReceipt.getC_BPartner_Location_ID()));
if (originalReceipt.getAD_User_ID() > 0) if (originalReceipt.getAD_User_ID() > 0)
mTab.setValue("AD_User_ID", new Integer(originalReceipt.getAD_User_ID())); mTab.setValue("AD_User_ID", Integer.valueOf(originalReceipt.getAD_User_ID()));
else else
mTab.setValue("AD_User_ID", null); mTab.setValue("AD_User_ID", null);
} }
@ -290,13 +291,13 @@ public class CalloutInOut extends CalloutEngine
if (!IsSOTrx) if (!IsSOTrx)
{ {
// Location // Location
Integer ii = new Integer(rs.getInt("C_BPartner_Location_ID")); Integer ii = Integer.valueOf(rs.getInt("C_BPartner_Location_ID"));
if (rs.wasNull()) if (rs.wasNull())
mTab.setValue("C_BPartner_Location_ID", null); mTab.setValue("C_BPartner_Location_ID", null);
else else
mTab.setValue("C_BPartner_Location_ID", ii); mTab.setValue("C_BPartner_Location_ID", ii);
// Contact // Contact
ii = new Integer(rs.getInt("AD_User_ID")); ii = Integer.valueOf(rs.getInt("AD_User_ID"));
if (rs.wasNull()) if (rs.wasNull())
mTab.setValue("AD_User_ID", null); mTab.setValue("AD_User_ID", null);
else else
@ -361,12 +362,12 @@ public class CalloutInOut extends CalloutEngine
if (rs.next()) if (rs.next())
{ {
// Org // Org
Integer ii = new Integer(rs.getInt(1)); Integer ii = Integer.valueOf(rs.getInt(1));
int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID"); int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID");
if (AD_Org_ID != ii.intValue()) if (AD_Org_ID != ii.intValue())
mTab.setValue("AD_Org_ID", ii); mTab.setValue("AD_Org_ID", ii);
// Locator // Locator
ii = new Integer(rs.getInt(2)); ii = Integer.valueOf(rs.getInt(2));
if (rs.wasNull()) if (rs.wasNull())
Env.setContext(ctx, WindowNo, 0, "M_Locator_ID", null); Env.setContext(ctx, WindowNo, 0, "M_Locator_ID", null);
else else
@ -416,17 +417,17 @@ public class CalloutInOut extends CalloutEngine
if (ol.get_ID() != 0) if (ol.get_ID() != 0)
{ {
if (ol.getC_Charge_ID() > 0 && ol.getM_Product_ID() <= 0) { if (ol.getC_Charge_ID() > 0 && ol.getM_Product_ID() <= 0) {
mTab.setValue("C_Charge_ID", new Integer(ol.getC_Charge_ID())); mTab.setValue("C_Charge_ID", Integer.valueOf(ol.getC_Charge_ID()));
mTab.setValue("M_Product_ID", null); mTab.setValue("M_Product_ID", null);
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
} }
else { else {
mTab.setValue("M_Product_ID", new Integer(ol.getM_Product_ID())); mTab.setValue("M_Product_ID", Integer.valueOf(ol.getM_Product_ID()));
mTab.setValue("M_AttributeSetInstance_ID", new Integer(ol.getM_AttributeSetInstance_ID())); mTab.setValue("M_AttributeSetInstance_ID", Integer.valueOf(ol.getM_AttributeSetInstance_ID()));
mTab.setValue("C_Charge_ID", null); mTab.setValue("C_Charge_ID", null);
} }
// //
mTab.setValue("C_UOM_ID", new Integer(ol.getC_UOM_ID())); mTab.setValue("C_UOM_ID", Integer.valueOf(ol.getC_UOM_ID()));
BigDecimal MovementQty = ol.getQtyOrdered().subtract(ol.getQtyDelivered()); BigDecimal MovementQty = ol.getQtyOrdered().subtract(ol.getQtyDelivered());
BigDecimal runningqty = DB.getSQLValueBDEx(null, "SELECT SUM(MovementQty) FROM M_InOutLine WHERE M_InOut_ID=? AND M_InOutLine_ID!=? AND C_OrderLine_ID=?", BigDecimal runningqty = DB.getSQLValueBDEx(null, "SELECT SUM(MovementQty) FROM M_InOutLine WHERE M_InOut_ID=? AND M_InOutLine_ID!=? AND C_OrderLine_ID=?",
Env.getContextAsInt(ctx, WindowNo, "M_InOut_ID"), Env.getContextAsInt(ctx, WindowNo, "M_InOut_ID"),
@ -439,17 +440,17 @@ public class CalloutInOut extends CalloutEngine
BigDecimal QtyEntered = MovementQty; BigDecimal QtyEntered = MovementQty;
if (ol.getQtyEntered().compareTo(ol.getQtyOrdered()) != 0) if (ol.getQtyEntered().compareTo(ol.getQtyOrdered()) != 0)
QtyEntered = QtyEntered.multiply(ol.getQtyEntered()) QtyEntered = QtyEntered.multiply(ol.getQtyEntered())
.divide(ol.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP); .divide(ol.getQtyOrdered(), 12, RoundingMode.HALF_UP);
mTab.setValue("QtyEntered", QtyEntered); mTab.setValue("QtyEntered", QtyEntered);
// //
mTab.setValue("C_Activity_ID", new Integer(ol.getC_Activity_ID())); mTab.setValue("C_Activity_ID", Integer.valueOf(ol.getC_Activity_ID()));
mTab.setValue("C_Campaign_ID", new Integer(ol.getC_Campaign_ID())); mTab.setValue("C_Campaign_ID", Integer.valueOf(ol.getC_Campaign_ID()));
mTab.setValue("C_Project_ID", new Integer(ol.getC_Project_ID())); mTab.setValue("C_Project_ID", Integer.valueOf(ol.getC_Project_ID()));
mTab.setValue("C_ProjectPhase_ID", new Integer(ol.getC_ProjectPhase_ID())); mTab.setValue("C_ProjectPhase_ID", Integer.valueOf(ol.getC_ProjectPhase_ID()));
mTab.setValue("C_ProjectTask_ID", new Integer(ol.getC_ProjectTask_ID())); mTab.setValue("C_ProjectTask_ID", Integer.valueOf(ol.getC_ProjectTask_ID()));
mTab.setValue("AD_OrgTrx_ID", new Integer(ol.getAD_OrgTrx_ID())); mTab.setValue("AD_OrgTrx_ID", Integer.valueOf(ol.getAD_OrgTrx_ID()));
mTab.setValue("User1_ID", new Integer(ol.getUser1_ID())); mTab.setValue("User1_ID", Integer.valueOf(ol.getUser1_ID()));
mTab.setValue("User2_ID", new Integer(ol.getUser2_ID())); mTab.setValue("User2_ID", Integer.valueOf(ol.getUser2_ID()));
} }
return ""; return "";
} // orderLine } // orderLine
@ -474,30 +475,30 @@ public class CalloutInOut extends CalloutEngine
if (rl.get_ID() != 0) if (rl.get_ID() != 0)
{ {
if (rl.getC_Charge_ID() > 0 && rl.getM_Product_ID() <= 0) { if (rl.getC_Charge_ID() > 0 && rl.getM_Product_ID() <= 0) {
mTab.setValue("C_Charge_ID", new Integer(rl.getC_Charge_ID())); mTab.setValue("C_Charge_ID", Integer.valueOf(rl.getC_Charge_ID()));
mTab.setValue("M_Product_ID", null); mTab.setValue("M_Product_ID", null);
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
} }
else { else {
mTab.setValue("M_Product_ID", new Integer(rl.getM_Product_ID())); mTab.setValue("M_Product_ID", Integer.valueOf(rl.getM_Product_ID()));
mTab.setValue("M_AttributeSetInstance_ID", new Integer(rl.getM_AttributeSetInstance_ID())); mTab.setValue("M_AttributeSetInstance_ID", Integer.valueOf(rl.getM_AttributeSetInstance_ID()));
mTab.setValue("C_Charge_ID", null); mTab.setValue("C_Charge_ID", null);
} }
// //
mTab.setValue("C_UOM_ID", new Integer(rl.getC_UOM_ID())); mTab.setValue("C_UOM_ID", Integer.valueOf(rl.getC_UOM_ID()));
BigDecimal MovementQty = rl.getQty().subtract(rl.getQtyDelivered()); BigDecimal MovementQty = rl.getQty().subtract(rl.getQtyDelivered());
mTab.setValue("MovementQty", MovementQty); mTab.setValue("MovementQty", MovementQty);
BigDecimal QtyEntered = MovementQty; BigDecimal QtyEntered = MovementQty;
mTab.setValue("QtyEntered", QtyEntered); mTab.setValue("QtyEntered", QtyEntered);
// //
mTab.setValue("C_Activity_ID", new Integer(rl.getC_Activity_ID())); mTab.setValue("C_Activity_ID", Integer.valueOf(rl.getC_Activity_ID()));
mTab.setValue("C_Campaign_ID", new Integer(rl.getC_Campaign_ID())); mTab.setValue("C_Campaign_ID", Integer.valueOf(rl.getC_Campaign_ID()));
mTab.setValue("C_Project_ID", new Integer(rl.getC_Project_ID())); mTab.setValue("C_Project_ID", Integer.valueOf(rl.getC_Project_ID()));
mTab.setValue("C_ProjectPhase_ID", new Integer(rl.getC_ProjectPhase_ID())); mTab.setValue("C_ProjectPhase_ID", Integer.valueOf(rl.getC_ProjectPhase_ID()));
mTab.setValue("C_ProjectTask_ID", new Integer(rl.getC_ProjectTask_ID())); mTab.setValue("C_ProjectTask_ID", Integer.valueOf(rl.getC_ProjectTask_ID()));
mTab.setValue("AD_OrgTrx_ID", new Integer(rl.getAD_OrgTrx_ID())); mTab.setValue("AD_OrgTrx_ID", Integer.valueOf(rl.getAD_OrgTrx_ID()));
mTab.setValue("User1_ID", new Integer(rl.getUser1_ID())); mTab.setValue("User1_ID", Integer.valueOf(rl.getUser1_ID()));
mTab.setValue("User2_ID", new Integer(rl.getUser2_ID())); mTab.setValue("User2_ID", Integer.valueOf(rl.getUser2_ID()));
} }
return ""; return "";
} // rmaLine } // rmaLine
@ -525,10 +526,10 @@ public class CalloutInOut extends CalloutEngine
&& Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0)
{ {
mTab.setValue("M_AttributeSetInstance_ID", mTab.setValue("M_AttributeSetInstance_ID",
new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); Integer.valueOf(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID")));
M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Locator_ID"); M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Locator_ID");
if (M_Locator_ID != 0) if (M_Locator_ID != 0)
mTab.setValue("M_Locator_ID", new Integer(M_Locator_ID)); mTab.setValue("M_Locator_ID", Integer.valueOf(M_Locator_ID));
} }
else else
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
@ -542,7 +543,7 @@ public class CalloutInOut extends CalloutEngine
// Set UOM/Locator/Qty // Set UOM/Locator/Qty
MProduct product = MProduct.get(ctx, M_Product_ID.intValue()); MProduct product = MProduct.get(ctx, M_Product_ID.intValue());
mTab.setValue("C_UOM_ID", new Integer (product.getC_UOM_ID())); mTab.setValue("C_UOM_ID", Integer.valueOf(product.getC_UOM_ID()));
BigDecimal QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); BigDecimal QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
mTab.setValue("MovementQty", QtyEntered); mTab.setValue("MovementQty", QtyEntered);
if (M_Locator_ID != 0) if (M_Locator_ID != 0)
@ -551,7 +552,7 @@ public class CalloutInOut extends CalloutEngine
{ {
MLocator loc = MLocator.get(ctx, product.getM_Locator_ID()); MLocator loc = MLocator.get(ctx, product.getM_Locator_ID());
if (M_Warehouse_ID == loc.getM_Warehouse_ID()) if (M_Warehouse_ID == loc.getM_Warehouse_ID())
mTab.setValue("M_Locator_ID", new Integer (product.getM_Locator_ID())); mTab.setValue("M_Locator_ID", Integer.valueOf(product.getM_Locator_ID()));
else else
if (log.isLoggable(Level.FINE)) log.fine("No Locator for M_Product_ID=" + M_Product_ID + " and M_Warehouse_ID=" + M_Warehouse_ID); if (log.isLoggable(Level.FINE)) log.fine("No Locator for M_Product_ID=" + M_Product_ID + " and M_Warehouse_ID=" + M_Warehouse_ID);
} }
@ -591,7 +592,7 @@ public class CalloutInOut extends CalloutEngine
{ {
int C_UOM_To_ID = ((Integer)value).intValue(); int C_UOM_To_ID = ((Integer)value).intValue();
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), RoundingMode.HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0) if (QtyEntered.compareTo(QtyEntered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID
@ -622,7 +623,7 @@ public class CalloutInOut extends CalloutEngine
{ {
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
QtyEntered = (BigDecimal)value; QtyEntered = (BigDecimal)value;
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), RoundingMode.HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0) if (QtyEntered.compareTo(QtyEntered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID
@ -648,7 +649,7 @@ public class CalloutInOut extends CalloutEngine
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
MovementQty = (BigDecimal)value; MovementQty = (BigDecimal)value;
int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision(); int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision();
BigDecimal MovementQty1 = MovementQty.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal MovementQty1 = MovementQty.setScale(precision, RoundingMode.HALF_UP);
if (MovementQty.compareTo(MovementQty1) != 0) if (MovementQty.compareTo(MovementQty1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected MovementQty " if (log.isLoggable(Level.FINE)) log.fine("Corrected MovementQty "
@ -704,7 +705,7 @@ public class CalloutInOut extends CalloutEngine
if (selectedM_Locator_ID != 0) if (selectedM_Locator_ID != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Selected M_Locator_ID=" + selectedM_Locator_ID); if (log.isLoggable(Level.FINE)) log.fine("Selected M_Locator_ID=" + selectedM_Locator_ID);
mTab.setValue("M_Locator_ID", new Integer (selectedM_Locator_ID)); mTab.setValue("M_Locator_ID", Integer.valueOf(selectedM_Locator_ID));
} }
} }
MAttributeSetInstance asi = MAttributeSetInstance.get(ctx, M_ASI_ID.intValue(), 0); MAttributeSetInstance asi = MAttributeSetInstance.get(ctx, M_ASI_ID.intValue(), 0);

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -161,7 +162,7 @@ public class CalloutInvoice extends CalloutEngine
} }
// PriceList & IsTaxIncluded & Currency // PriceList & IsTaxIncluded & Currency
Integer ii = new Integer(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID")); Integer ii = Integer.valueOf(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("M_PriceList_ID", ii); mTab.setValue("M_PriceList_ID", ii);
else else
@ -171,13 +172,13 @@ public class CalloutInvoice extends CalloutEngine
{ {
MPriceList pl = new MPriceList(ctx, i, null); MPriceList pl = new MPriceList(ctx, i, null);
if (IsSOTrx == pl.isSOPriceList()) if (IsSOTrx == pl.isSOPriceList())
mTab.setValue("M_PriceList_ID", new Integer(i)); mTab.setValue("M_PriceList_ID", Integer.valueOf(i));
else else
{ {
String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC"; String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx); ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx);
if (ii != 0) if (ii != 0)
mTab.setValue("M_PriceList_ID", new Integer(ii)); mTab.setValue("M_PriceList_ID", Integer.valueOf(ii));
} }
} }
} }
@ -189,7 +190,7 @@ public class CalloutInvoice extends CalloutEngine
if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term
s = X_C_Invoice.PAYMENTRULE_OnCredit; s = X_C_Invoice.PAYMENTRULE_OnCredit;
// Payment Term // Payment Term
ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID")); ii = Integer.valueOf(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_PaymentTerm_ID", ii); mTab.setValue("C_PaymentTerm_ID", ii);
@ -206,7 +207,7 @@ public class CalloutInvoice extends CalloutEngine
if (locID == 0) if (locID == 0)
mTab.setValue("C_BPartner_Location_ID", null); mTab.setValue("C_BPartner_Location_ID", null);
else else
mTab.setValue("C_BPartner_Location_ID", new Integer(locID)); mTab.setValue("C_BPartner_Location_ID", Integer.valueOf(locID));
// Contact - overwritten by InfoBP selection // Contact - overwritten by InfoBP selection
int contID = rs.getInt("AD_User_ID"); int contID = rs.getInt("AD_User_ID");
@ -219,7 +220,7 @@ public class CalloutInvoice extends CalloutEngine
if (contID == 0) if (contID == 0)
mTab.setValue("AD_User_ID", null); mTab.setValue("AD_User_ID", null);
else else
mTab.setValue("AD_User_ID", new Integer(contID)); mTab.setValue("AD_User_ID", Integer.valueOf(contID));
// CreditAvailable // CreditAvailable
if (IsSOTrx) if (IsSOTrx)
@ -358,9 +359,9 @@ public class CalloutInvoice extends CalloutEngine
mTab.setValue("PriceLimit", pp.getPriceLimit()); mTab.setValue("PriceLimit", pp.getPriceLimit());
mTab.setValue("PriceActual", pp.getPriceStd()); mTab.setValue("PriceActual", pp.getPriceStd());
mTab.setValue("PriceEntered", pp.getPriceStd()); mTab.setValue("PriceEntered", pp.getPriceStd());
mTab.setValue("C_Currency_ID", new Integer(pp.getC_Currency_ID())); mTab.setValue("C_Currency_ID", Integer.valueOf(pp.getC_Currency_ID()));
// mTab.setValue("Discount", pp.getDiscount()); // mTab.setValue("Discount", pp.getDiscount());
mTab.setValue("C_UOM_ID", new Integer(pp.getC_UOM_ID())); mTab.setValue("C_UOM_ID", Integer.valueOf(pp.getC_UOM_ID()));
Env.setContext(ctx, WindowNo, "EnforcePriceLimit", pp.isEnforcePriceLimit() ? "Y" : "N"); Env.setContext(ctx, WindowNo, "EnforcePriceLimit", pp.isEnforcePriceLimit() ? "Y" : "N");
Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N"); Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N");
// //
@ -393,7 +394,7 @@ public class CalloutInvoice extends CalloutEngine
} }
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
mTab.setValue("S_ResourceAssignment_ID", null); mTab.setValue("S_ResourceAssignment_ID", null);
mTab.setValue("C_UOM_ID", new Integer(100)); // EA mTab.setValue("C_UOM_ID", Integer.valueOf(100)); // EA
Env.setContext(ctx, WindowNo, "DiscountSchema", "N"); Env.setContext(ctx, WindowNo, "DiscountSchema", "N");
String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?"; String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?";
@ -490,7 +491,7 @@ public class CalloutInvoice extends CalloutEngine
if (C_Tax_ID == 0) if (C_Tax_ID == 0)
mTab.fireDataStatusEEvent(CLogger.retrieveError()); mTab.fireDataStatusEEvent(CLogger.retrieveError());
else else
mTab.setValue("C_Tax_ID", new Integer(C_Tax_ID)); mTab.setValue("C_Tax_ID", Integer.valueOf(C_Tax_ID));
// //
return amt (ctx, WindowNo, mTab, mField, value); return amt (ctx, WindowNo, mTab, mField, value);
} // tax } // tax
@ -618,7 +619,7 @@ public class CalloutInvoice extends CalloutEngine
{ {
PriceActual = new BigDecimal ((100.0 - Discount.doubleValue()) / 100.0 * PriceList.doubleValue()); PriceActual = new BigDecimal ((100.0 - Discount.doubleValue()) / 100.0 * PriceList.doubleValue());
if (PriceActual.scale() > StdPrecision) if (PriceActual.scale() > StdPrecision)
PriceActual = PriceActual.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); PriceActual = PriceActual.setScale(StdPrecision, RoundingMode.HALF_UP);
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID, PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
C_UOM_To_ID, PriceActual); C_UOM_To_ID, PriceActual);
if (PriceEntered == null) if (PriceEntered == null)
@ -634,7 +635,7 @@ public class CalloutInvoice extends CalloutEngine
else else
Discount = new BigDecimal ((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0); Discount = new BigDecimal ((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0);
if (Discount.scale() > 2) if (Discount.scale() > 2)
Discount = Discount.setScale(2, BigDecimal.ROUND_HALF_UP); Discount = Discount.setScale(2, RoundingMode.HALF_UP);
mTab.setValue("Discount", Discount); mTab.setValue("Discount", Discount);
} }
log.fine("amt = PriceEntered=" + PriceEntered + ", Actual" + PriceActual + ", Discount=" + Discount); log.fine("amt = PriceEntered=" + PriceEntered + ", Actual" + PriceActual + ", Discount=" + Discount);
@ -663,7 +664,7 @@ public class CalloutInvoice extends CalloutEngine
{ {
Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0); Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0);
if (Discount.scale () > 2) if (Discount.scale () > 2)
Discount = Discount.setScale (2, BigDecimal.ROUND_HALF_UP); Discount = Discount.setScale (2, RoundingMode.HALF_UP);
// mTab.setValue ("Discount", Discount); // mTab.setValue ("Discount", Discount);
} }
} }
@ -671,7 +672,7 @@ public class CalloutInvoice extends CalloutEngine
// Line Net Amt // Line Net Amt
BigDecimal LineNetAmt = QtyInvoiced.multiply(PriceActual); BigDecimal LineNetAmt = QtyInvoiced.multiply(PriceActual);
if (LineNetAmt.scale() > StdPrecision) if (LineNetAmt.scale() > StdPrecision)
LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); LineNetAmt = LineNetAmt.setScale(StdPrecision, RoundingMode.HALF_UP);
if (log.isLoggable(Level.INFO)) log.info("amt = LineNetAmt=" + LineNetAmt); if (log.isLoggable(Level.INFO)) log.info("amt = LineNetAmt=" + LineNetAmt);
mTab.setValue("LineNetAmt", LineNetAmt); mTab.setValue("LineNetAmt", LineNetAmt);
@ -757,7 +758,7 @@ public class CalloutInvoice extends CalloutEngine
{ {
int C_UOM_To_ID = ((Integer)value).intValue(); int C_UOM_To_ID = ((Integer)value).intValue();
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), RoundingMode.HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0) if (QtyEntered.compareTo(QtyEntered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID
@ -788,7 +789,7 @@ public class CalloutInvoice extends CalloutEngine
{ {
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
QtyEntered = (BigDecimal)value; QtyEntered = (BigDecimal)value;
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), RoundingMode.HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0) if (QtyEntered.compareTo(QtyEntered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID
@ -814,7 +815,7 @@ public class CalloutInvoice extends CalloutEngine
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
QtyInvoiced = (BigDecimal)value; QtyInvoiced = (BigDecimal)value;
int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision(); int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision();
BigDecimal QtyInvoiced1 = QtyInvoiced.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal QtyInvoiced1 = QtyInvoiced.setScale(precision, RoundingMode.HALF_UP);
if (QtyInvoiced.compareTo(QtyInvoiced1) != 0) if (QtyInvoiced.compareTo(QtyInvoiced1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyInvoiced Scale " if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyInvoiced Scale "

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -108,7 +109,7 @@ public class CalloutInvoiceBatch extends CalloutEngine
if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term if (Env.getContext(ctx, WindowNo, "DocBaseType").endsWith("C")) // Credits are Payment Term
s = X_C_Invoice.PAYMENTRULE_OnCredit; s = X_C_Invoice.PAYMENTRULE_OnCredit;
// Payment Term // Payment Term
Integer ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID")); Integer ii = Integer.valueOf(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_PaymentTerm_ID", ii); mTab.setValue("C_PaymentTerm_ID", ii);
@ -125,7 +126,7 @@ public class CalloutInvoiceBatch extends CalloutEngine
if (locID == 0) if (locID == 0)
mTab.setValue("C_BPartner_Location_ID", null); mTab.setValue("C_BPartner_Location_ID", null);
else else
mTab.setValue("C_BPartner_Location_ID", new Integer(locID)); mTab.setValue("C_BPartner_Location_ID", Integer.valueOf(locID));
// Contact - overwritten by InfoBP selection // Contact - overwritten by InfoBP selection
int contID = rs.getInt("AD_User_ID"); int contID = rs.getInt("AD_User_ID");
@ -138,7 +139,7 @@ public class CalloutInvoiceBatch extends CalloutEngine
if (contID == 0) if (contID == 0)
mTab.setValue("AD_User_ID", null); mTab.setValue("AD_User_ID", null);
else else
mTab.setValue("AD_User_ID", new Integer(contID)); mTab.setValue("AD_User_ID", Integer.valueOf(contID));
// CreditAvailable // CreditAvailable
if (IsSOTrx) if (IsSOTrx)
@ -324,7 +325,7 @@ public class CalloutInvoiceBatch extends CalloutEngine
if (C_Tax_ID == 0) if (C_Tax_ID == 0)
mTab.fireDataStatusEEvent(CLogger.retrieveError()); mTab.fireDataStatusEEvent(CLogger.retrieveError());
else else
mTab.setValue("C_Tax_ID", new Integer(C_Tax_ID)); mTab.setValue("C_Tax_ID", Integer.valueOf(C_Tax_ID));
// //
return amt (ctx, WindowNo, mTab, mField, value); return amt (ctx, WindowNo, mTab, mField, value);
} // tax } // tax
@ -360,7 +361,7 @@ public class CalloutInvoiceBatch extends CalloutEngine
// Line Net Amt // Line Net Amt
BigDecimal LineNetAmt = QtyEntered.multiply(PriceEntered); BigDecimal LineNetAmt = QtyEntered.multiply(PriceEntered);
if (LineNetAmt.scale() > StdPrecision) if (LineNetAmt.scale() > StdPrecision)
LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); LineNetAmt = LineNetAmt.setScale(StdPrecision, RoundingMode.HALF_UP);
// Calculate Tax Amount // Calculate Tax Amount
boolean IsTaxIncluded = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsTaxIncluded")); boolean IsTaxIncluded = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsTaxIncluded"));

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -186,7 +187,7 @@ public class CalloutOrder extends CalloutEngine
if (s != null && s.length() != 0) if (s != null && s.length() != 0)
mTab.setValue("PaymentRule", s); mTab.setValue("PaymentRule", s);
// Payment Term // Payment Term
Integer ii =new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID")); Integer ii =Integer.valueOf(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_PaymentTerm_ID", ii); mTab.setValue("C_PaymentTerm_ID", ii);
// InvoiceRule // InvoiceRule
@ -278,7 +279,7 @@ public class CalloutOrder extends CalloutEngine
} }
// PriceList (indirect: IsTaxIncluded & Currency) // PriceList (indirect: IsTaxIncluded & Currency)
Integer ii = new Integer(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID")); Integer ii = Integer.valueOf(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("M_PriceList_ID", ii); mTab.setValue("M_PriceList_ID", ii);
else else
@ -288,13 +289,13 @@ public class CalloutOrder extends CalloutEngine
{ {
MPriceList pl = new MPriceList(ctx, i, null); MPriceList pl = new MPriceList(ctx, i, null);
if (IsSOTrx == pl.isSOPriceList()) if (IsSOTrx == pl.isSOPriceList())
mTab.setValue("M_PriceList_ID", new Integer(i)); mTab.setValue("M_PriceList_ID", Integer.valueOf(i));
else else
{ {
String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC"; String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx); ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx);
if (ii != 0) if (ii != 0)
mTab.setValue("M_PriceList_ID", new Integer(ii)); mTab.setValue("M_PriceList_ID", Integer.valueOf(ii));
} }
} }
} }
@ -325,7 +326,7 @@ public class CalloutOrder extends CalloutEngine
if (bill_Location_ID == 0) if (bill_Location_ID == 0)
mTab.setValue("Bill_Location_ID", null); mTab.setValue("Bill_Location_ID", null);
else else
mTab.setValue("Bill_Location_ID", new Integer(bill_Location_ID)); mTab.setValue("Bill_Location_ID", Integer.valueOf(bill_Location_ID));
// Ship-To Location // Ship-To Location
if (shipTo_ID == 0) if (shipTo_ID == 0)
shipTo_ID = rs.getInt("C_BPartner_Location_ID"); shipTo_ID = rs.getInt("C_BPartner_Location_ID");
@ -333,7 +334,7 @@ public class CalloutOrder extends CalloutEngine
if (shipTo_ID == 0) if (shipTo_ID == 0)
mTab.setValue("C_BPartner_Location_ID", null); mTab.setValue("C_BPartner_Location_ID", null);
else else
mTab.setValue("C_BPartner_Location_ID", new Integer(shipTo_ID)); mTab.setValue("C_BPartner_Location_ID", Integer.valueOf(shipTo_ID));
// Contact - overwritten by InfoBP selection // Contact - overwritten by InfoBP selection
int contID = rs.getInt("AD_User_ID"); int contID = rs.getInt("AD_User_ID");
@ -347,8 +348,8 @@ public class CalloutOrder extends CalloutEngine
mTab.setValue("AD_User_ID", null); mTab.setValue("AD_User_ID", null);
else else
{ {
mTab.setValue("AD_User_ID", new Integer(contID)); mTab.setValue("AD_User_ID", Integer.valueOf(contID));
mTab.setValue("Bill_User_ID", new Integer(contID)); mTab.setValue("Bill_User_ID", Integer.valueOf(contID));
} }
// CreditAvailable // CreditAvailable
@ -399,7 +400,7 @@ public class CalloutOrder extends CalloutEngine
if (s != null && s.length() != 0) if (s != null && s.length() != 0)
mTab.setValue("PaymentRule", s); mTab.setValue("PaymentRule", s);
// Payment Term // Payment Term
ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID")); ii = Integer.valueOf(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_PaymentTerm_ID", ii); mTab.setValue("C_PaymentTerm_ID", ii);
// InvoiceRule // InvoiceRule
@ -479,7 +480,7 @@ public class CalloutOrder extends CalloutEngine
if (rs.next()) if (rs.next())
{ {
// PriceList (indirect: IsTaxIncluded & Currency) // PriceList (indirect: IsTaxIncluded & Currency)
Integer ii = new Integer(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID")); Integer ii = Integer.valueOf(rs.getInt(IsSOTrx ? "M_PriceList_ID" : "PO_PriceList_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("M_PriceList_ID", ii); mTab.setValue("M_PriceList_ID", ii);
else else
@ -489,13 +490,13 @@ public class CalloutOrder extends CalloutEngine
{ {
MPriceList pl = new MPriceList(ctx, i, null); MPriceList pl = new MPriceList(ctx, i, null);
if (IsSOTrx == pl.isSOPriceList()) if (IsSOTrx == pl.isSOPriceList())
mTab.setValue("M_PriceList_ID", new Integer(i)); mTab.setValue("M_PriceList_ID", Integer.valueOf(i));
else else
{ {
String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC"; String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx); ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx);
if (ii != 0) if (ii != 0)
mTab.setValue("M_PriceList_ID", new Integer(ii)); mTab.setValue("M_PriceList_ID", Integer.valueOf(ii));
} }
} }
} }
@ -518,7 +519,7 @@ public class CalloutOrder extends CalloutEngine
if (bill_Location_ID == 0) if (bill_Location_ID == 0)
mTab.setValue("Bill_Location_ID", null); mTab.setValue("Bill_Location_ID", null);
else else
mTab.setValue("Bill_Location_ID", new Integer(bill_Location_ID)); mTab.setValue("Bill_Location_ID", Integer.valueOf(bill_Location_ID));
// Contact - overwritten by InfoBP selection // Contact - overwritten by InfoBP selection
int contID = rs.getInt("AD_User_ID"); int contID = rs.getInt("AD_User_ID");
@ -531,7 +532,7 @@ public class CalloutOrder extends CalloutEngine
if (contID == 0) if (contID == 0)
mTab.setValue("Bill_User_ID", null); mTab.setValue("Bill_User_ID", null);
else else
mTab.setValue("Bill_User_ID", new Integer(contID)); mTab.setValue("Bill_User_ID", Integer.valueOf(contID));
// CreditAvailable // CreditAvailable
if (IsSOTrx) if (IsSOTrx)
@ -577,7 +578,7 @@ public class CalloutOrder extends CalloutEngine
if (s != null && s.length() != 0) if (s != null && s.length() != 0)
mTab.setValue("PaymentRule", s); mTab.setValue("PaymentRule", s);
// Payment Term // Payment Term
ii = new Integer(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID")); ii = Integer.valueOf(rs.getInt(IsSOTrx ? "C_PaymentTerm_ID" : "PO_PaymentTerm_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_PaymentTerm_ID", ii); mTab.setValue("C_PaymentTerm_ID", ii);
// InvoiceRule // InvoiceRule
@ -783,9 +784,9 @@ public class CalloutOrder extends CalloutEngine
mTab.setValue("PriceLimit", pp.getPriceLimit()); mTab.setValue("PriceLimit", pp.getPriceLimit());
mTab.setValue("PriceActual", pp.getPriceStd()); mTab.setValue("PriceActual", pp.getPriceStd());
mTab.setValue("PriceEntered", pp.getPriceStd()); mTab.setValue("PriceEntered", pp.getPriceStd());
mTab.setValue("C_Currency_ID", new Integer(pp.getC_Currency_ID())); mTab.setValue("C_Currency_ID", Integer.valueOf(pp.getC_Currency_ID()));
mTab.setValue("Discount", pp.getDiscount()); mTab.setValue("Discount", pp.getDiscount());
mTab.setValue("C_UOM_ID", new Integer(pp.getC_UOM_ID())); mTab.setValue("C_UOM_ID", Integer.valueOf(pp.getC_UOM_ID()));
mTab.setValue("QtyOrdered", mTab.getValue("QtyEntered")); mTab.setValue("QtyOrdered", mTab.getValue("QtyEntered"));
Env.setContext(ctx, WindowNo, "EnforcePriceLimit", pp.isEnforcePriceLimit() ? "Y" : "N"); Env.setContext(ctx, WindowNo, "EnforcePriceLimit", pp.isEnforcePriceLimit() ? "Y" : "N");
Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N"); Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N");
@ -795,7 +796,7 @@ public class CalloutOrder extends CalloutEngine
// Integer wh = (Integer)mTab.getValue("M_Warehouse_ID"); // Integer wh = (Integer)mTab.getValue("M_Warehouse_ID");
// if (wh.intValue() != M_Warehouse_ID) // if (wh.intValue() != M_Warehouse_ID)
// { // {
// mTab.setValue("M_Warehouse_ID", new Integer(M_Warehouse_ID)); // mTab.setValue("M_Warehouse_ID", Integer.valueOf(M_Warehouse_ID));
// ADialog.warn(,WindowNo, "WarehouseChanged"); // ADialog.warn(,WindowNo, "WarehouseChanged");
// } // }
@ -822,7 +823,7 @@ public class CalloutOrder extends CalloutEngine
{ {
Integer C_OrderLine_ID = (Integer)mTab.getValue("C_OrderLine_ID"); Integer C_OrderLine_ID = (Integer)mTab.getValue("C_OrderLine_ID");
if (C_OrderLine_ID == null) if (C_OrderLine_ID == null)
C_OrderLine_ID = new Integer(0); C_OrderLine_ID = Integer.valueOf(0);
BigDecimal notReserved = MOrderLine.getNotReserved(ctx, BigDecimal notReserved = MOrderLine.getNotReserved(ctx,
M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,
C_OrderLine_ID.intValue()); C_OrderLine_ID.intValue());
@ -869,7 +870,7 @@ public class CalloutOrder extends CalloutEngine
} }
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", null);
mTab.setValue("S_ResourceAssignment_ID", null); mTab.setValue("S_ResourceAssignment_ID", null);
mTab.setValue("C_UOM_ID", new Integer(100)); // EA mTab.setValue("C_UOM_ID", Integer.valueOf(100)); // EA
Env.setContext(ctx, WindowNo, "DiscountSchema", "N"); Env.setContext(ctx, WindowNo, "DiscountSchema", "N");
String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?"; String sql = "SELECT ChargeAmt FROM C_Charge WHERE C_Charge_ID=?";
@ -976,7 +977,7 @@ public class CalloutOrder extends CalloutEngine
if (C_Tax_ID == 0) if (C_Tax_ID == 0)
mTab.fireDataStatusEEvent(CLogger.retrieveError()); mTab.fireDataStatusEEvent(CLogger.retrieveError());
else else
mTab.setValue("C_Tax_ID", new Integer(C_Tax_ID)); mTab.setValue("C_Tax_ID", Integer.valueOf(C_Tax_ID));
// //
if (steps) log.warning("fini"); if (steps) log.warning("fini");
return amt(ctx, WindowNo, mTab, mField, value); return amt(ctx, WindowNo, mTab, mField, value);
@ -1119,7 +1120,7 @@ public class CalloutOrder extends CalloutEngine
if ( PriceList.doubleValue() != 0 ) if ( PriceList.doubleValue() != 0 )
PriceActual = BigDecimal.valueOf((100.0 - Discount.doubleValue()) / 100.0 * PriceList.doubleValue()); PriceActual = BigDecimal.valueOf((100.0 - Discount.doubleValue()) / 100.0 * PriceList.doubleValue());
if (PriceActual.scale() > StdPrecision) if (PriceActual.scale() > StdPrecision)
PriceActual = PriceActual.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); PriceActual = PriceActual.setScale(StdPrecision, RoundingMode.HALF_UP);
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID, PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
C_UOM_To_ID, PriceActual); C_UOM_To_ID, PriceActual);
if (PriceEntered == null) if (PriceEntered == null)
@ -1135,7 +1136,7 @@ public class CalloutOrder extends CalloutEngine
else else
Discount = BigDecimal.valueOf((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0); Discount = BigDecimal.valueOf((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0);
if (Discount.scale() > 2) if (Discount.scale() > 2)
Discount = Discount.setScale(2, BigDecimal.ROUND_HALF_UP); Discount = Discount.setScale(2, RoundingMode.HALF_UP);
mTab.setValue("Discount", Discount); mTab.setValue("Discount", Discount);
} }
if (log.isLoggable(Level.FINE)) log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount); if (log.isLoggable(Level.FINE)) log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount);
@ -1163,7 +1164,7 @@ public class CalloutOrder extends CalloutEngine
{ {
Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0); Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0);
if (Discount.scale () > 2) if (Discount.scale () > 2)
Discount = Discount.setScale (2, BigDecimal.ROUND_HALF_UP); Discount = Discount.setScale (2, RoundingMode.HALF_UP);
mTab.setValue ("Discount", Discount); mTab.setValue ("Discount", Discount);
} }
} }
@ -1171,7 +1172,7 @@ public class CalloutOrder extends CalloutEngine
// Line Net Amt // Line Net Amt
BigDecimal LineNetAmt = QtyOrdered.multiply(PriceActual); BigDecimal LineNetAmt = QtyOrdered.multiply(PriceActual);
if (LineNetAmt.scale() > StdPrecision) if (LineNetAmt.scale() > StdPrecision)
LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); LineNetAmt = LineNetAmt.setScale(StdPrecision, RoundingMode.HALF_UP);
if (log.isLoggable(Level.INFO)) log.info("LineNetAmt=" + LineNetAmt); if (log.isLoggable(Level.INFO)) log.info("LineNetAmt=" + LineNetAmt);
mTab.setValue("LineNetAmt", LineNetAmt); mTab.setValue("LineNetAmt", LineNetAmt);
// //
@ -1210,7 +1211,7 @@ public class CalloutOrder extends CalloutEngine
{ {
int C_UOM_To_ID = ((Integer)value).intValue(); int C_UOM_To_ID = ((Integer)value).intValue();
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), RoundingMode.HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0) if (QtyEntered.compareTo(QtyEntered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID
@ -1241,7 +1242,7 @@ public class CalloutOrder extends CalloutEngine
{ {
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
QtyEntered = (BigDecimal)value; QtyEntered = (BigDecimal)value;
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), RoundingMode.HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0) if (QtyEntered.compareTo(QtyEntered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID
@ -1267,7 +1268,7 @@ public class CalloutOrder extends CalloutEngine
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID"); int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
QtyOrdered = (BigDecimal)value; QtyOrdered = (BigDecimal)value;
int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision(); int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision();
BigDecimal QtyOrdered1 = QtyOrdered.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal QtyOrdered1 = QtyOrdered.setScale(precision, RoundingMode.HALF_UP);
if (QtyOrdered.compareTo(QtyOrdered1) != 0) if (QtyOrdered.compareTo(QtyOrdered1) != 0)
{ {
if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyOrdered Scale " if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyOrdered Scale "
@ -1315,7 +1316,7 @@ public class CalloutOrder extends CalloutEngine
{ {
Integer C_OrderLine_ID = (Integer)mTab.getValue("C_OrderLine_ID"); Integer C_OrderLine_ID = (Integer)mTab.getValue("C_OrderLine_ID");
if (C_OrderLine_ID == null) if (C_OrderLine_ID == null)
C_OrderLine_ID = new Integer(0); C_OrderLine_ID = Integer.valueOf(0);
BigDecimal notReserved = MOrderLine.getNotReserved(ctx, BigDecimal notReserved = MOrderLine.getNotReserved(ctx,
M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID, M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID,
C_OrderLine_ID.intValue()); C_OrderLine_ID.intValue());

View File

@ -127,7 +127,7 @@ public class CalloutPaySelection extends CalloutEngine
{ {
OpenAmt = rs.getBigDecimal(1); OpenAmt = rs.getBigDecimal(1);
DiscountAmt = rs.getBigDecimal(2); DiscountAmt = rs.getBigDecimal(2);
IsSOTrx = new Boolean ("Y".equals(rs.getString(3))); IsSOTrx = Boolean.valueOf ("Y".equals(rs.getString(3)));
} }
} }
catch (SQLException e) catch (SQLException e)

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -94,9 +95,9 @@ public class CalloutPayment extends CalloutEngine
rs = pstmt.executeQuery (); rs = pstmt.executeQuery ();
if (rs.next ()) if (rs.next ())
{ {
mTab.setValue ("C_BPartner_ID", new Integer (rs.getInt (1))); mTab.setValue ("C_BPartner_ID", Integer.valueOf(rs.getInt (1)));
int C_Currency_ID = rs.getInt (2); // Set Invoice Currency int C_Currency_ID = rs.getInt (2); // Set Invoice Currency
mTab.setValue ("C_Currency_ID", new Integer (C_Currency_ID)); mTab.setValue ("C_Currency_ID", Integer.valueOf(C_Currency_ID));
// //
BigDecimal InvoiceOpen = rs.getBigDecimal (3); // Set Invoice BigDecimal InvoiceOpen = rs.getBigDecimal (3); // Set Invoice
// OPen Amount // OPen Amount
@ -170,9 +171,9 @@ public class CalloutPayment extends CalloutEngine
rs = pstmt.executeQuery (); rs = pstmt.executeQuery ();
if (rs.next ()) if (rs.next ())
{ {
mTab.setValue ("C_BPartner_ID", new Integer (rs.getInt (1))); mTab.setValue ("C_BPartner_ID", Integer.valueOf(rs.getInt (1)));
int C_Currency_ID = rs.getInt (2); // Set Order Currency int C_Currency_ID = rs.getInt (2); // Set Order Currency
mTab.setValue ("C_Currency_ID", new Integer (C_Currency_ID)); mTab.setValue ("C_Currency_ID", Integer.valueOf(C_Currency_ID));
// //
BigDecimal GrandTotal = rs.getBigDecimal (3); // Set Pay BigDecimal GrandTotal = rs.getBigDecimal (3); // Set Pay
// Amount // Amount
@ -411,7 +412,7 @@ public class CalloutPayment extends CalloutEngine
} }
// //
InvoiceOpenAmt = InvoiceOpenAmt.multiply (CurrencyRate).setScale ( InvoiceOpenAmt = InvoiceOpenAmt.multiply (CurrencyRate).setScale (
currency.getStdPrecision (), BigDecimal.ROUND_HALF_UP); currency.getStdPrecision (), RoundingMode.HALF_UP);
if (log.isLoggable(Level.FINE)) log.fine ("Rate=" + CurrencyRate + ", InvoiceOpenAmt=" if (log.isLoggable(Level.FINE)) log.fine ("Rate=" + CurrencyRate + ", InvoiceOpenAmt="
+ InvoiceOpenAmt); + InvoiceOpenAmt);
} }
@ -420,16 +421,16 @@ public class CalloutPayment extends CalloutEngine
|| colName.equals ("C_ConversionType_ID")) || colName.equals ("C_ConversionType_ID"))
{ {
PayAmt = PayAmt.multiply (CurrencyRate).setScale ( PayAmt = PayAmt.multiply (CurrencyRate).setScale (
currency.getStdPrecision (), BigDecimal.ROUND_HALF_UP); currency.getStdPrecision (), RoundingMode.HALF_UP);
mTab.setValue ("PayAmt", PayAmt); mTab.setValue ("PayAmt", PayAmt);
DiscountAmt = DiscountAmt.multiply (CurrencyRate).setScale ( DiscountAmt = DiscountAmt.multiply (CurrencyRate).setScale (
currency.getStdPrecision (), BigDecimal.ROUND_HALF_UP); currency.getStdPrecision (), RoundingMode.HALF_UP);
mTab.setValue ("DiscountAmt", DiscountAmt); mTab.setValue ("DiscountAmt", DiscountAmt);
WriteOffAmt = WriteOffAmt.multiply (CurrencyRate).setScale ( WriteOffAmt = WriteOffAmt.multiply (CurrencyRate).setScale (
currency.getStdPrecision (), BigDecimal.ROUND_HALF_UP); currency.getStdPrecision (), RoundingMode.HALF_UP);
mTab.setValue ("WriteOffAmt", WriteOffAmt); mTab.setValue ("WriteOffAmt", WriteOffAmt);
OverUnderAmt = OverUnderAmt.multiply (CurrencyRate).setScale ( OverUnderAmt = OverUnderAmt.multiply (CurrencyRate).setScale (
currency.getStdPrecision (), BigDecimal.ROUND_HALF_UP); currency.getStdPrecision (), RoundingMode.HALF_UP);
mTab.setValue ("OverUnderAmt", OverUnderAmt); mTab.setValue ("OverUnderAmt", OverUnderAmt);
} }
// No Invoice - Set Discount, Witeoff, Under/Over to 0 // No Invoice - Set Discount, Witeoff, Under/Over to 0

View File

@ -95,9 +95,9 @@ public class CalloutPaymentAllocate extends CalloutEngine
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
// mTab.setValue("C_BPartner_ID", new Integer(rs.getInt(1))); // mTab.setValue("C_BPartner_ID", Integer.valueOf(rs.getInt(1)));
// int C_Currency_ID = rs.getInt(2); // Set Invoice Currency // int C_Currency_ID = rs.getInt(2); // Set Invoice Currency
// mTab.setValue("C_Currency_ID", new Integer(C_Currency_ID)); // mTab.setValue("C_Currency_ID", Integer.valueOf(C_Currency_ID));
// //
BigDecimal InvoiceOpen = rs.getBigDecimal(3); // Set Invoice OPen Amount BigDecimal InvoiceOpen = rs.getBigDecimal(3); // Set Invoice OPen Amount
if (InvoiceOpen == null) if (InvoiceOpen == null)

View File

@ -43,7 +43,7 @@ public class CalloutProductCategory extends CalloutEngine
Integer productCategoryId = (Integer) mTab.getValue(MProductCategory.COLUMNNAME_M_Product_Category_ID); Integer productCategoryId = (Integer) mTab.getValue(MProductCategory.COLUMNNAME_M_Product_Category_ID);
if (productCategoryId == null) if (productCategoryId == null)
productCategoryId = new Integer(0); productCategoryId = Integer.valueOf(0);
if (productCategoryId.intValue() > 0) { if (productCategoryId.intValue() > 0) {
MProductCategory pc = new MProductCategory(ctx, productCategoryId.intValue(), null); MProductCategory pc = new MProductCategory(ctx, productCategoryId.intValue(), null);

View File

@ -51,7 +51,7 @@ public class CalloutProduction extends CalloutEngine
if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue() if (Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_Product_ID") == M_Product_ID.intValue()
&& Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0)
{ {
mTab.setValue("M_AttributeSetInstance_ID", new Integer(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"))); mTab.setValue("M_AttributeSetInstance_ID", Integer.valueOf(Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID")));
} }
else else
{ {

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
@ -61,7 +62,7 @@ public class CalloutProject extends CalloutEngine
// //
BigDecimal PlannedAmt = PlannedQty.multiply(PlannedPrice); BigDecimal PlannedAmt = PlannedQty.multiply(PlannedPrice);
if (PlannedAmt.scale() > StdPrecision) if (PlannedAmt.scale() > StdPrecision)
PlannedAmt = PlannedAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); PlannedAmt = PlannedAmt.setScale(StdPrecision, RoundingMode.HALF_UP);
// //
if (log.isLoggable(Level.FINE)) log.fine("PlannedQty=" + PlannedQty + " * PlannedPrice=" + PlannedPrice + " -> PlannedAmt=" + PlannedAmt + " (Precision=" + StdPrecision+ ")"); if (log.isLoggable(Level.FINE)) log.fine("PlannedQty=" + PlannedQty + " * PlannedPrice=" + PlannedPrice + " -> PlannedAmt=" + PlannedAmt + " (Precision=" + StdPrecision+ ")");
mTab.setValue("PlannedAmt", PlannedAmt); mTab.setValue("PlannedAmt", PlannedAmt);

View File

@ -138,7 +138,7 @@ public class CalloutRequest extends CalloutEngine
MRequestType rt = MRequestType.get(ctx, R_RequestType_ID); MRequestType rt = MRequestType.get(ctx, R_RequestType_ID);
int R_Status_ID = rt.getDefaultR_Status_ID(); int R_Status_ID = rt.getDefaultR_Status_ID();
if (R_Status_ID != 0) if (R_Status_ID != 0)
mTab.setValue("R_Status_ID", new Integer(R_Status_ID)); mTab.setValue("R_Status_ID", Integer.valueOf(R_Status_ID));
return ""; return "";
} // type } // type

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
@ -89,7 +90,7 @@ public class CalloutRequisition extends CalloutEngine
// Multiply // Multiply
BigDecimal LineNetAmt = Qty.multiply(PriceActual); BigDecimal LineNetAmt = Qty.multiply(PriceActual);
if (LineNetAmt.scale() > StdPrecision) if (LineNetAmt.scale() > StdPrecision)
LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); LineNetAmt = LineNetAmt.setScale(StdPrecision, RoundingMode.HALF_UP);
line.setLineNetAmt(LineNetAmt); line.setLineNetAmt(LineNetAmt);
if (log.isLoggable(Level.INFO)) log.info("amt - LineNetAmt=" + LineNetAmt); if (log.isLoggable(Level.INFO)) log.info("amt - LineNetAmt=" + LineNetAmt);
// //

View File

@ -98,7 +98,7 @@ public class CalloutTimeExpense extends CalloutEngine
if (priceActual == null) if (priceActual == null)
priceActual = rs.getBigDecimal("PriceLimit"); priceActual = rs.getBigDecimal("PriceLimit");
// Currency // Currency
Integer ii = new Integer(rs.getInt("C_Currency_ID")); Integer ii = Integer.valueOf(rs.getInt("C_Currency_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_Currency_ID", ii); mTab.setValue("C_Currency_ID", ii);
} }
@ -143,7 +143,7 @@ public class CalloutTimeExpense extends CalloutEngine
if (priceActual == null) if (priceActual == null)
priceActual = rs.getBigDecimal("PriceLimit"); priceActual = rs.getBigDecimal("PriceLimit");
// Currency // Currency
Integer ii = new Integer(rs.getInt("C_Currency_ID")); Integer ii = Integer.valueOf(rs.getInt("C_Currency_ID"));
if (!rs.wasNull()) if (!rs.wasNull())
mTab.setValue("C_Currency_ID", ii); mTab.setValue("C_Currency_ID", ii);
} }

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/> <classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>

View File

@ -1,7 +1,3 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: iDempiere Processes Bundle-Name: iDempiere Processes
Bundle-SymbolicName: org.adempiere.base.process Bundle-SymbolicName: org.adempiere.base.process
Bundle-Version: 5.1.0.qualifier Bundle-Version: 5.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=1.10))"
Require-Bundle: org.adempiere.base;bundle-version="0.0.0" Require-Bundle: org.adempiere.base;bundle-version="0.0.0"
Export-Package: org.adempiere.process, Export-Package: org.adempiere.process,
org.compiere.process, org.compiere.process,
@ -16,3 +16,4 @@ Import-Package: javax.mail;version="1.5",
Eclipse-RegisterBuddy: org.adempiere.base Eclipse-RegisterBuddy: org.adempiere.base
Bundle-ClassPath: . Bundle-ClassPath: .
Automatic-Module-Name: org.adempiere.base.process Automatic-Module-Name: org.adempiere.base.process
Bundle-Vendor: iDempiere Community

View File

@ -173,7 +173,7 @@ public class Export extends SvrProcess
if (rs.next()) if (rs.next())
{ {
HashMap<String, Integer> variableMap = new HashMap<String, Integer>(); HashMap<String, Integer> variableMap = new HashMap<String, Integer>();
variableMap.put(TOTAL_SEGMENTS, new Integer(1)); variableMap.put(TOTAL_SEGMENTS, Integer.valueOf(1));
Element rootElement = outDocument.createElement(exportFormat.getValue()); Element rootElement = outDocument.createElement(exportFormat.getValue());
rootElement.appendChild(outDocument.createComment(exportFormat.getDescription())); rootElement.appendChild(outDocument.createComment(exportFormat.getDescription()));
@ -395,11 +395,11 @@ public class Export extends SvrProcess
if (variableName != null && !"".equals(variableName) ) { if (variableName != null && !"".equals(variableName) ) {
Integer var = variableMap.get(variableName); Integer var = variableMap.get(variableName);
if (var == null) { if (var == null) {
var = new Integer(0); var = Integer.valueOf(0);
} }
int intValue = var.intValue(); int intValue = var.intValue();
intValue++; intValue++;
variableMap.put(variableName, new Integer(intValue)); variableMap.put(variableName, Integer.valueOf(intValue));
} }
} }

View File

@ -122,7 +122,7 @@ public class AcctSchemaCopyAcct extends SvrProcess
String columnName = pp.getName(); String columnName = pp.getName();
MAccount sourceAccount = MAccount.get(getCtx(), sourceC_ValidCombination_ID); MAccount sourceAccount = MAccount.get(getCtx(), sourceC_ValidCombination_ID);
MAccount targetAccount = createAccount(targetAS, sourceAccount); MAccount targetAccount = createAccount(targetAS, sourceAccount);
target.setValue(columnName, new Integer(targetAccount.getC_ValidCombination_ID())); target.setValue(columnName, Integer.valueOf(targetAccount.getC_ValidCombination_ID()));
} }
if (!target.save()) if (!target.save())
throw new AdempiereSystemError("Could not Save GL"); throw new AdempiereSystemError("Could not Save GL");
@ -147,7 +147,7 @@ public class AcctSchemaCopyAcct extends SvrProcess
String columnName = pp.getName(); String columnName = pp.getName();
MAccount sourceAccount = MAccount.get(getCtx(), sourceC_ValidCombination_ID); MAccount sourceAccount = MAccount.get(getCtx(), sourceC_ValidCombination_ID);
MAccount targetAccount = createAccount(targetAS, sourceAccount); MAccount targetAccount = createAccount(targetAS, sourceAccount);
target.setValue(columnName, new Integer(targetAccount.getC_ValidCombination_ID())); target.setValue(columnName, Integer.valueOf(targetAccount.getC_ValidCombination_ID()));
} }
if (!target.save()) if (!target.save())
throw new AdempiereSystemError("Could not Save Default"); throw new AdempiereSystemError("Could not Save Default");

View File

@ -91,9 +91,9 @@ public class ChangeLogProcess extends SvrProcess
if (para[i].getParameter() == null) if (para[i].getParameter() == null)
; ;
else if (name.equals("CheckNewValue")) else if (name.equals("CheckNewValue"))
p_CheckNewValue = new Boolean("Y".equals(para[i].getParameter())); p_CheckNewValue = Boolean.valueOf("Y".equals(para[i].getParameter()));
else if (name.equals("CheckOldValue")) else if (name.equals("CheckOldValue"))
p_CheckOldValue = new Boolean("Y".equals(para[i].getParameter())); p_CheckOldValue = Boolean.valueOf("Y".equals(para[i].getParameter()));
else if (name.equals("SetCustomization")) else if (name.equals("SetCustomization"))
p_SetCustomization = "Y".equals(para[i].getParameter()); p_SetCustomization = "Y".equals(para[i].getParameter());
else else

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.MBPartner; import org.compiere.model.MBPartner;
@ -191,7 +192,7 @@ public class DistributionCreate extends SvrProcess
BigDecimal ratio = dll.getRatio(); BigDecimal ratio = dll.getRatio();
BigDecimal qty = p_Qty.multiply(ratio); BigDecimal qty = p_Qty.multiply(ratio);
if (qty.compareTo(Env.ZERO) != 0) if (qty.compareTo(Env.ZERO) != 0)
qty = qty.divide(m_dl.getRatioTotal(), m_product.getUOMPrecision(), BigDecimal.ROUND_HALF_UP); qty = qty.divide(m_dl.getRatioTotal(), m_product.getUOMPrecision(), RoundingMode.HALF_UP);
BigDecimal minQty = dll.getMinQty(); BigDecimal minQty = dll.getMinQty();
if (qty.compareTo(minQty) < 0) if (qty.compareTo(minQty) < 0)
qty = minQty; qty = minQty;

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -413,7 +414,7 @@ public class DistributionRun extends SvrProcess
if (detail.isCanAdjust()) if (detail.isCanAdjust())
{ {
BigDecimal diffRatio = detail.getRatio().multiply(difference) BigDecimal diffRatio = detail.getRatio().multiply(difference)
.divide(ratioTotal, BigDecimal.ROUND_HALF_UP); // precision from total .divide(ratioTotal, RoundingMode.HALF_UP); // precision from total
if (log.isLoggable(Level.FINE)) log.fine("Detail=" + detail.toString() if (log.isLoggable(Level.FINE)) log.fine("Detail=" + detail.toString()
+ ", Allocation=" + detail.getActualAllocation() + ", Allocation=" + detail.getActualAllocation()
+ ", DiffRatio=" + diffRatio); + ", DiffRatio=" + diffRatio);
@ -646,7 +647,7 @@ public class DistributionRun extends SvrProcess
log.info("Qty Total Available:" + drl.getTotalQty()); log.info("Qty Total Available:" + drl.getTotalQty());
log.info("Qty Total Demand:" + totalration); log.info("Qty Total Demand:" + totalration);
} }
BigDecimal factor = ration.divide(totalration, 12 , BigDecimal.ROUND_HALF_UP); BigDecimal factor = ration.divide(totalration, 12 , RoundingMode.HALF_UP);
record.setQty(drl.getTotalQty().multiply(factor)); record.setQty(drl.getTotalQty().multiply(factor));
record.saveEx(); record.saveEx();
} }
@ -750,7 +751,7 @@ public class DistributionRun extends SvrProcess
, p_M_DistributionRun_ID, record.getM_Product_ID()); , p_M_DistributionRun_ID, record.getM_Product_ID());
MDistributionRunLine drl = (MDistributionRunLine) MTable.get(getCtx(), MDistributionRunLine.Table_ID).getPO(record.getM_DistributionRunLine_ID(), get_TrxName()); MDistributionRunLine drl = (MDistributionRunLine) MTable.get(getCtx(), MDistributionRunLine.Table_ID).getPO(record.getM_DistributionRunLine_ID(), get_TrxName());
BigDecimal ration = record.getRatio(); BigDecimal ration = record.getRatio();
BigDecimal factor = ration.divide(total_ration,BigDecimal.ROUND_HALF_UP); BigDecimal factor = ration.divide(total_ration,RoundingMode.HALF_UP);
record.setQty(factor.multiply(drl.getTotalQty())); record.setQty(factor.multiply(drl.getTotalQty()));
record.saveEx(); record.saveEx();
} }

View File

@ -159,7 +159,7 @@ public class DunningPrint extends SvrProcess
// query // query
MQuery query = new MQuery("C_Dunning_Header_v"); MQuery query = new MQuery("C_Dunning_Header_v");
query.addRestriction("C_DunningRunEntry_ID", MQuery.EQUAL, query.addRestriction("C_DunningRunEntry_ID", MQuery.EQUAL,
new Integer(entry.getC_DunningRunEntry_ID())); Integer.valueOf(entry.getC_DunningRunEntry_ID()));
// Engine // Engine
PrintInfo info = new PrintInfo( PrintInfo info = new PrintInfo(

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.MCurrency; import org.compiere.model.MCurrency;
@ -122,7 +123,7 @@ public class InOutCreateInvoice extends SvrProcess
BigDecimal igt = invoice.getGrandTotal(); BigDecimal igt = invoice.getGrandTotal();
BigDecimal percent = Env.ONE; BigDecimal percent = Env.ONE;
if (ogt.compareTo(igt) != 0) if (ogt.compareTo(igt) != 0)
percent = igt.divide(ogt, 10, BigDecimal.ROUND_HALF_UP); percent = igt.divide(ogt, 10, RoundingMode.HALF_UP);
MCurrency cur = MCurrency.get(order.getCtx(), order.getC_Currency_ID()); MCurrency cur = MCurrency.get(order.getCtx(), order.getC_Currency_ID());
int scale = cur.getStdPrecision(); int scale = cur.getStdPrecision();
@ -132,7 +133,7 @@ public class InOutCreateInvoice extends SvrProcess
if (percent != Env.ONE) { if (percent != Env.ONE) {
BigDecimal propDueAmt = ops.getDueAmt().multiply(percent); BigDecimal propDueAmt = ops.getDueAmt().multiply(percent);
if (propDueAmt.scale() > scale) if (propDueAmt.scale() > scale)
propDueAmt = propDueAmt.setScale(scale, BigDecimal.ROUND_HALF_UP); propDueAmt = propDueAmt.setScale(scale, RoundingMode.HALF_UP);
ips.setDueAmt(propDueAmt); ips.setDueAmt(propDueAmt);
} }
ips.setC_Invoice_ID(invoice.getC_Invoice_ID()); ips.setC_Invoice_ID(invoice.getC_Invoice_ID());

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -448,7 +449,7 @@ public class InOutGenerate extends SvrProcess
if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0) if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0)
line.setQtyEntered(qty line.setQtyEntered(qty
.multiply(orderLine.getQtyEntered()) .multiply(orderLine.getQtyEntered())
.divide(orderLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP)); .divide(orderLine.getQtyOrdered(), 12, RoundingMode.HALF_UP));
line.setLine(m_line + orderLine.getLine()); line.setLine(m_line + orderLine.getLine());
if (!line.save()) if (!line.save())
throw new IllegalStateException("Could not create Shipment Line"); throw new IllegalStateException("Could not create Shipment Line");
@ -504,7 +505,7 @@ public class InOutGenerate extends SvrProcess
line.setQty(line.getMovementQty().add(deliver)); line.setQty(line.getMovementQty().add(deliver));
if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0) if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0)
line.setQtyEntered(line.getMovementQty().multiply(orderLine.getQtyEntered()) line.setQtyEntered(line.getMovementQty().multiply(orderLine.getQtyEntered())
.divide(orderLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP)); .divide(orderLine.getQtyOrdered(), 12, RoundingMode.HALF_UP));
line.setLine(m_line + orderLine.getLine()); line.setLine(m_line + orderLine.getLine());
if (!line.save()) if (!line.save())
throw new IllegalStateException("Could not create Shipment Line"); throw new IllegalStateException("Could not create Shipment Line");
@ -530,7 +531,7 @@ public class InOutGenerate extends SvrProcess
line.setQty(toDeliver); line.setQty(toDeliver);
if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0) if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0)
line.setQtyEntered(line.getMovementQty().multiply(orderLine.getQtyEntered()) line.setQtyEntered(line.getMovementQty().multiply(orderLine.getQtyEntered())
.divide(orderLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP)); .divide(orderLine.getQtyOrdered(), 12, RoundingMode.HALF_UP));
line.setLine(m_line + orderLine.getLine()); line.setLine(m_line + orderLine.getLine());
if (!line.save()) if (!line.save())
throw new IllegalStateException("Could not create Shipment Line"); throw new IllegalStateException("Could not create Shipment Line");

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -300,7 +301,7 @@ public class InvoiceGenerate extends SvrProcess
if (oLine.getQtyEntered().compareTo(oLine.getQtyOrdered()) != 0) if (oLine.getQtyEntered().compareTo(oLine.getQtyOrdered()) != 0)
qtyEntered = toInvoice qtyEntered = toInvoice
.multiply(oLine.getQtyEntered()) .multiply(oLine.getQtyEntered())
.divide(oLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP); .divide(oLine.getQtyOrdered(), 12, RoundingMode.HALF_UP);
createLine (order, oLine, toInvoice, qtyEntered); createLine (order, oLine, toInvoice, qtyEntered);
} }
else if (!completeOrder) else if (!completeOrder)
@ -492,7 +493,7 @@ public class InvoiceGenerate extends SvrProcess
BigDecimal igt = m_invoice.getGrandTotal(); BigDecimal igt = m_invoice.getGrandTotal();
BigDecimal percent = Env.ONE; BigDecimal percent = Env.ONE;
if (ogt.compareTo(igt) != 0) if (ogt.compareTo(igt) != 0)
percent = igt.divide(ogt, 10, BigDecimal.ROUND_HALF_UP); percent = igt.divide(ogt, 10, RoundingMode.HALF_UP);
MCurrency cur = MCurrency.get(order.getCtx(), order.getC_Currency_ID()); MCurrency cur = MCurrency.get(order.getCtx(), order.getC_Currency_ID());
int scale = cur.getStdPrecision(); int scale = cur.getStdPrecision();
@ -502,7 +503,7 @@ public class InvoiceGenerate extends SvrProcess
if (percent != Env.ONE) { if (percent != Env.ONE) {
BigDecimal propDueAmt = ops.getDueAmt().multiply(percent); BigDecimal propDueAmt = ops.getDueAmt().multiply(percent);
if (propDueAmt.scale() > scale) if (propDueAmt.scale() > scale)
propDueAmt = propDueAmt.setScale(scale, BigDecimal.ROUND_HALF_UP); propDueAmt = propDueAmt.setScale(scale, RoundingMode.HALF_UP);
ips.setDueAmt(propDueAmt); ips.setDueAmt(propDueAmt);
} }
ips.setC_Invoice_ID(m_invoice.getC_Invoice_ID()); ips.setC_Invoice_ID(m_invoice.getC_Invoice_ID());

View File

@ -275,7 +275,7 @@ public class InvoicePrint extends SvrProcess
format.setTranslationLanguage(language); format.setTranslationLanguage(language);
// query // query
MQuery query = new MQuery("C_Invoice_Header_v"); MQuery query = new MQuery("C_Invoice_Header_v");
query.addRestriction("C_Invoice_ID", MQuery.EQUAL, new Integer(C_Invoice_ID)); query.addRestriction("C_Invoice_ID", MQuery.EQUAL, Integer.valueOf(C_Invoice_ID));
// Engine // Engine
PrintInfo info = new PrintInfo( PrintInfo info = new PrintInfo(

View File

@ -20,6 +20,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -544,7 +545,7 @@ public class M_PriceList_Create extends SvrProcess {
} }
if (conversion != null) if (conversion != null)
{ {
price = price.divide(conversion.getDivideRate(), precision, BigDecimal.ROUND_HALF_DOWN); price = price.divide(conversion.getDivideRate(), precision, RoundingMode.HALF_DOWN);
StringBuilder sqlupdate = new StringBuilder(); StringBuilder sqlupdate = new StringBuilder();
sqlupdate.append("UPDATE M_ProductPrice SET PriceList=").append(price).append(" WHERE M_PriceList_Version_ID=").append(p_PriceList_Version_ID) sqlupdate.append("UPDATE M_ProductPrice SET PriceList=").append(price).append(" WHERE M_PriceList_Version_ID=").append(p_PriceList_Version_ID)
.append(" AND M_Product_ID= ").append(product_id); .append(" AND M_Product_ID= ").append(product_id);

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.MProduct; import org.compiere.model.MProduct;
@ -95,8 +96,8 @@ public class ProductUOMConvert extends SvrProcess
throw new AdempiereUserError("@NotFound@: @C_UOM_Conversion_ID@"); throw new AdempiereUserError("@NotFound@: @C_UOM_Conversion_ID@");
MUOM uomTo = MUOM.get(getCtx(), productTo.getC_UOM_ID()); MUOM uomTo = MUOM.get(getCtx(), productTo.getC_UOM_ID());
BigDecimal qtyTo = p_Qty.divide(conversion.getDivideRate(), uomTo.getStdPrecision(), BigDecimal.ROUND_HALF_UP); BigDecimal qtyTo = p_Qty.divide(conversion.getDivideRate(), uomTo.getStdPrecision(), RoundingMode.HALF_UP);
BigDecimal qtyTo6 = p_Qty.divide(conversion.getDivideRate(), 6, BigDecimal.ROUND_HALF_UP); BigDecimal qtyTo6 = p_Qty.divide(conversion.getDivideRate(), 6, RoundingMode.HALF_UP);
if (qtyTo.compareTo(qtyTo6) != 0) if (qtyTo.compareTo(qtyTo6) != 0)
throw new AdempiereUserError("@StdPrecision@: " + qtyTo + " <> " + qtyTo6 throw new AdempiereUserError("@StdPrecision@: " + qtyTo + " <> " + qtyTo6
+ " (" + p_Qty + "/" + conversion.getDivideRate() + ")"); + " (" + p_Qty + "/" + conversion.getDivideRate() + ")");

View File

@ -358,7 +358,7 @@ public class ReplenishReport extends SvrProcess
if(custom==null){ if(custom==null){
// if no OSGi plugin is found try the legacy way (in my own classpath) // if no OSGi plugin is found try the legacy way (in my own classpath)
Class<?> clazz = Class.forName(className); Class<?> clazz = Class.forName(className);
custom = (ReplenishInterface) clazz.newInstance(); custom = (ReplenishInterface) clazz.getDeclaredConstructor().newInstance();
} }
} }
catch (Exception e) catch (Exception e)

View File

@ -392,7 +392,7 @@ public class ReplenishReportProduction extends SvrProcess
if(custom==null){ if(custom==null){
// if no OSGi plugin is found try the legacy way (in my own classpath) // if no OSGi plugin is found try the legacy way (in my own classpath)
Class<?> clazz = Class.forName(className); Class<?> clazz = Class.forName(className);
custom = (ReplenishInterface) clazz.newInstance(); custom = (ReplenishInterface) clazz.getDeclaredConstructor().newInstance();
} }
} }
catch (Exception e) catch (Exception e)

View File

@ -170,7 +170,7 @@ public class ReplicationLocal extends SvrProcess
+ "WHERE rt.IsActive='Y' AND t.IsActive='Y'" + "WHERE rt.IsActive='Y' AND t.IsActive='Y'"
+ " AND AD_ReplicationStrategy_ID=? " // #1 + " AND AD_ReplicationStrategy_ID=? " // #1
+ "ORDER BY t.LoadSeq"; + "ORDER BY t.LoadSeq";
RowSet rowset = getRowSet(sql, new Object[]{new Integer(m_replication.getAD_ReplicationStrategy_ID())}); RowSet rowset = getRowSet(sql, new Object[]{Integer.valueOf(m_replication.getAD_ReplicationStrategy_ID())});
if (rowset == null) if (rowset == null)
throw new Exception("setupRemote - No RowSet Data"); throw new Exception("setupRemote - No RowSet Data");
@ -222,7 +222,7 @@ public class ReplicationLocal extends SvrProcess
+ " AND AD_ReplicationStrategy_ID=?" // #1 + " AND AD_ReplicationStrategy_ID=?" // #1
+ " AND rt.ReplicationType='M' " // Merge + " AND rt.ReplicationType='M' " // Merge
+ "ORDER BY t.LoadSeq"; + "ORDER BY t.LoadSeq";
RowSet rowset = getRowSet(sql, new Object[]{new Integer(m_replication.getAD_ReplicationStrategy_ID())}); RowSet rowset = getRowSet(sql, new Object[]{Integer.valueOf(m_replication.getAD_ReplicationStrategy_ID())});
try try
{ {
while (rowset.next()) while (rowset.next())
@ -400,7 +400,7 @@ public class ReplicationLocal extends SvrProcess
+ " AND AD_ReplicationStrategy_ID=?" // #1 + " AND AD_ReplicationStrategy_ID=?" // #1
+ " AND rt.ReplicationType='R' " // Reference + " AND rt.ReplicationType='R' " // Reference
+ "ORDER BY t.LoadSeq"; + "ORDER BY t.LoadSeq";
RowSet rowset = getRowSet(sql, new Object[]{new Integer(m_replication.getAD_ReplicationStrategy_ID())}); RowSet rowset = getRowSet(sql, new Object[]{Integer.valueOf(m_replication.getAD_ReplicationStrategy_ID())});
try try
{ {
while (rowset.next()) while (rowset.next())

View File

@ -17,6 +17,7 @@
package org.compiere.process; package org.compiere.process;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.MBPartner; import org.compiere.model.MBPartner;
@ -129,7 +130,7 @@ public class RfQCreateSO extends SvrProcess
{ {
margin = margin.add(Env.ONEHUNDRED); margin = margin.add(Env.ONEHUNDRED);
price = price.multiply(margin) price = price.multiply(margin)
.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP); .divide(Env.ONEHUNDRED, 2, RoundingMode.HALF_UP);
} }
} }
} // price } // price

View File

@ -252,7 +252,7 @@ public class SendMailText extends SvrProcess
private Boolean sendIndividualMail (String Name, int AD_User_ID, StringBuilder unsubscribe) private Boolean sendIndividualMail (String Name, int AD_User_ID, StringBuilder unsubscribe)
{ {
// Prevent two email // Prevent two email
Integer ii = new Integer (AD_User_ID); Integer ii = Integer.valueOf(AD_User_ID);
if (m_list.contains(ii)) if (m_list.contains(ii))
return null; return null;
m_list.add(ii); m_list.add(ii);
@ -290,7 +290,7 @@ public class SendMailText extends SvrProcess
} }
StringBuilder msglog = new StringBuilder((OK ? "@OK@" : "@ERROR@")).append(" - ").append(to.getEMail()); StringBuilder msglog = new StringBuilder((OK ? "@OK@" : "@ERROR@")).append(" - ").append(to.getEMail());
addLog(0, null, null, msglog.toString()); addLog(0, null, null, msglog.toString());
return new Boolean(OK); return Boolean.valueOf(OK);
} // sendIndividualMail } // sendIndividualMail
} // SendMailText } // SendMailText

View File

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
<attribute name="add-exports" value="java.sql.rowset/com.sun.rowset=ALL-UNNAMED"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/> <classpathentry kind="src" path="src/"/>
<classpathentry exported="true" kind="lib" path="lib/bsh.jar"/> <classpathentry exported="true" kind="lib" path="lib/bsh.jar"/>

View File

@ -10,15 +10,12 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning
@ -27,7 +24,6 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
@ -108,4 +104,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.release=enabled

View File

@ -56,14 +56,14 @@ Export-Package: bsh,
org.idempiere.broadcast, org.idempiere.broadcast,
org.idempiere.distributed, org.idempiere.distributed,
org.idempiere.model org.idempiere.model
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=1.10))"
Import-Package: com.sun.mail.smtp;version="1.5", Import-Package: com.sun.mail.smtp;version="1.5",
javax.activation,
javax.jms;version="1.1.0", javax.jms;version="1.1.0",
javax.mail;version="1.5", javax.mail;version="1.5",
javax.mail.internet;version="1.5", javax.mail.internet;version="1.5",
javax.servlet;version="3.0.0", javax.servlet;version="3.0.0",
javax.servlet.http;version="3.0.0", javax.servlet.http;version="3.0.0",
javax.xml.bind;version="2.3.0",
junit.framework;version="3.8.2";resolution:=optional, junit.framework;version="3.8.2";resolution:=optional,
junit.textui;version="3.8.2";resolution:=optional, junit.textui;version="3.8.2";resolution:=optional,
net.sf.cglib.proxy, net.sf.cglib.proxy,
@ -77,8 +77,6 @@ Import-Package: com.sun.mail.smtp;version="1.5",
org.apache.ecs, org.apache.ecs,
org.apache.ecs.xhtml, org.apache.ecs.xhtml,
org.apache.felix.scr;version="1.6.0", org.apache.felix.scr;version="1.6.0",
org.apache.poi.hssf.usermodel,
org.apache.poi.ss.usermodel,
org.apache.tools.ant, org.apache.tools.ant,
org.apache.tools.ant.taskdefs, org.apache.tools.ant.taskdefs,
org.eclipse.core.runtime;version="3.4.0", org.eclipse.core.runtime;version="3.4.0",
@ -121,6 +119,11 @@ Require-Bundle: org.eclipse.equinox.app;bundle-version="0.0.0",
com.itextpdf;bundle-version="0.0.0", com.itextpdf;bundle-version="0.0.0",
net.sf.supercsv.super-csv;bundle-version="0.0.0", net.sf.supercsv.super-csv;bundle-version="0.0.0",
bcprov;bundle-version="1.54.0", bcprov;bundle-version="1.54.0",
groovy-all;bundle-version="0.0.0", org.krysalis.barcode4j;bundle-version="0.0.0",
org.krysalis.barcode4j;bundle-version="0.0.0" groovy,
javax.xml;bundle-version="1.3.4",
org.apache.poi.poi;bundle-version="3.15.0",
org.apache.poi.poi-ooxml;bundle-version="3.15.0",
javax.activation;bundle-version="1.1.0"
Automatic-Module-Name: org.adempiere.base Automatic-Module-Name: org.adempiere.base
Bundle-Vendor: iDempiere Community

View File

@ -17,7 +17,11 @@
<artifactId>tycho-compiler-plugin</artifactId> <artifactId>tycho-compiler-plugin</artifactId>
<configuration> <configuration>
<!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431 --> <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=367431 -->
<compilerArgument>-warn:+forbidden</compilerArgument> <compilerArgs>
<arg>-warn:+forbidden</arg>
<arg>--add-exports</arg>
<arg>java.sql.rowset/com.sun.rowset=ALL-UNNAMED</arg>
</compilerArgs>
</configuration> </configuration>
</plugin> </plugin>
@ -45,7 +49,7 @@
<artifactItem> <artifactItem>
<groupId>org.python</groupId> <groupId>org.python</groupId>
<artifactId>jython</artifactId> <artifactId>jython</artifactId>
<version>2.2.1</version> <version>2.7.0</version>
</artifactItem> </artifactItem>
<artifactItem> <artifactItem>
<groupId>it.sauronsoftware.cron4j</groupId> <groupId>it.sauronsoftware.cron4j</groupId>

View File

@ -252,7 +252,7 @@ public class AddressLookup implements AddressLookupInterface {
NodeList firstValueList = firstElement.getElementsByTagName("Value"); NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0); Element ValueElement = (Element) firstValueList.item(0);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);} if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
resultCode = (int) new Integer(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim()); resultCode = (int) Integer.valueOf(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
} }
} }

View File

@ -44,7 +44,7 @@ public class DefaultAddressValidationFactory implements IAddressValidationFactor
{ {
Class<?> ppClass = Class.forName(className); Class<?> ppClass = Class.forName(className);
if (ppClass != null) if (ppClass != null)
myProcessor = (IAddressValidation) ppClass.newInstance(); myProcessor = (IAddressValidation) ppClass.getDeclaredConstructor().newInstance();
} }
catch (Error e1) catch (Error e1)
{ // NoClassDefFound { // NoClassDefFound

View File

@ -80,7 +80,7 @@ public class DefaultCalloutFactory implements ICalloutFactory {
//Get callout //Get callout
try try
{ {
callout = (Callout)calloutClass.newInstance(); callout = (Callout)calloutClass.getDeclaredConstructor().newInstance();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -269,7 +269,7 @@ public class DefaultModelFactory implements IModelFactory {
s_log.warning("No transaction Constructor for " + clazz + " (" + msg + ")"); s_log.warning("No transaction Constructor for " + clazz + " (" + msg + ")");
} }
PO po = constructor!=null ? (PO)constructor.newInstance(new Object[] {Env.getCtx(), new Integer(Record_ID), trxName}) : null; PO po = constructor!=null ? (PO)constructor.newInstance(new Object[] {Env.getCtx(), Integer.valueOf(Record_ID), trxName}) : null;
return po; return po;
} }
catch (Exception e) catch (Exception e)

View File

@ -56,7 +56,7 @@ public class DefaultModelValidatorFactory implements IModelValidatorFactory {
} }
if (clazz != null) { if (clazz != null) {
try { try {
validator = (ModelValidator)clazz.newInstance(); validator = (ModelValidator)clazz.getDeclaredConstructor().newInstance();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -42,7 +42,7 @@ public class DefaultPaymentExporterFactory implements IPaymentExporterFactory {
try { try {
Class<?> peClass = Class.forName(className); Class<?> peClass = Class.forName(className);
if (peClass != null) if (peClass != null)
myExporter = (PaymentExport)peClass.newInstance(); myExporter = (PaymentExport)peClass.getDeclaredConstructor().newInstance();
} catch (Error e1) { // NoClassDefFound } catch (Error e1) { // NoClassDefFound
s_log.log(Level.SEVERE, className + " - Error=" + e1.getMessage()); s_log.log(Level.SEVERE, className + " - Error=" + e1.getMessage());
return null; return null;

View File

@ -45,7 +45,7 @@ public class DefaultPaymentProcessorFactory implements IPaymentProcessorFactory
try { try {
Class<?> ppClass = Class.forName(className); Class<?> ppClass = Class.forName(className);
if (ppClass != null) if (ppClass != null)
myProcessor = (PaymentProcessor)ppClass.newInstance(); myProcessor = (PaymentProcessor)ppClass.getDeclaredConstructor().newInstance();
} catch (Error e1) { // NoClassDefFound } catch (Error e1) { // NoClassDefFound
s_log.log(Level.SEVERE, className + " - Error=" + e1.getMessage()); s_log.log(Level.SEVERE, className + " - Error=" + e1.getMessage());
return null; return null;

View File

@ -77,7 +77,7 @@ public class DefaultProcessFactory implements IProcessFactory {
//Get Process //Get Process
try try
{ {
process = (ProcessCall)processClass.newInstance(); process = (ProcessCall)processClass.getDeclaredConstructor().newInstance();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -43,7 +43,7 @@ public class DefaultShipmentProcessorFactory implements IShipmentProcessorFactor
{ {
Class<?> ppClass = Class.forName(className); Class<?> ppClass = Class.forName(className);
if (ppClass != null) if (ppClass != null)
myProcessor = (IShipmentProcessor) ppClass.newInstance(); myProcessor = (IShipmentProcessor) ppClass.getDeclaredConstructor().newInstance();
} }
catch (Error e1) catch (Error e1)
{ // NoClassDefFound { // NoClassDefFound

View File

@ -38,7 +38,7 @@ public class DefaultTaxProviderFactory implements ITaxProviderFactory {
{ {
Class<?> ppClass = Class.forName(className); Class<?> ppClass = Class.forName(className);
if (ppClass != null) if (ppClass != null)
myCalculator = (ITaxProvider) ppClass.newInstance(); myCalculator = (ITaxProvider) ppClass.getDeclaredConstructor().newInstance();
} }
catch (Error e1) catch (Error e1)
{ // NoClassDefFound { // NoClassDefFound

View File

@ -368,7 +368,7 @@ public class RequestEventHandler extends AbstractEventHandler implements Managed
} }
// Check duplicate receivers // Check duplicate receivers
Integer ii = new Integer (AD_User_ID); Integer ii = Integer.valueOf(AD_User_ID);
if (userList.contains(ii)) if (userList.contains(ii))
continue; continue;
userList.add(ii); userList.add(ii);

View File

@ -35,6 +35,7 @@ import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.compiere.model.MSysConfig; import org.compiere.model.MSysConfig;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
@ -166,13 +167,13 @@ public abstract class AbstractExcelExporter
if (isHeader) { if (isHeader) {
if (m_fontHeader == null) { if (m_fontHeader == null) {
m_fontHeader = m_workbook.createFont(); m_fontHeader = m_workbook.createFont();
m_fontHeader.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); m_fontHeader.setBold(true);
} }
font = m_fontHeader; font = m_fontHeader;
} }
else if (isFunctionRow()) { else if (isFunctionRow()) {
font = m_workbook.createFont(); font = m_workbook.createFont();
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); font.setBold(true);
font.setItalic(true); font.setItalic(true);
} }
else { else {
@ -232,10 +233,10 @@ public abstract class AbstractExcelExporter
HSSFFont font = getFont(false); HSSFFont font = getFont(false);
cs.setFont(font); cs.setFont(font);
// Border // Border
cs.setBorderLeft((short)1); cs.setBorderLeft(BorderStyle.THIN);
cs.setBorderTop((short)1); cs.setBorderTop(BorderStyle.THIN);
cs.setBorderRight((short)1); cs.setBorderRight(BorderStyle.THIN);
cs.setBorderBottom((short)1); cs.setBorderBottom(BorderStyle.THIN);
// //
String cellFormat = getCellFormat(row, col); String cellFormat = getCellFormat(row, col);
if (cellFormat != null) if (cellFormat != null)
@ -268,10 +269,10 @@ public abstract class AbstractExcelExporter
HSSFFont font_header = getFont(true); HSSFFont font_header = getFont(true);
cs_header = m_workbook.createCellStyle(); cs_header = m_workbook.createCellStyle();
cs_header.setFont(font_header); cs_header.setFont(font_header);
cs_header.setBorderLeft((short)2); cs_header.setBorderLeft(BorderStyle.MEDIUM);
cs_header.setBorderTop((short)2); cs_header.setBorderTop(BorderStyle.MEDIUM);
cs_header.setBorderRight((short)2); cs_header.setBorderRight(BorderStyle.MEDIUM);
cs_header.setBorderBottom((short)2); cs_header.setBorderBottom(BorderStyle.MEDIUM);
cs_header.setDataFormat(HSSFDataFormat.getBuiltinFormat("text")); cs_header.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
cs_header.setWrapText(true); cs_header.setWrapText(true);
m_styles.put(key, cs_header); m_styles.put(key, cs_header);

View File

@ -114,7 +114,7 @@ public class GenericPO extends PO {
if (AD_OrgTrx_ID == 0) if (AD_OrgTrx_ID == 0)
set_Value("AD_OrgTrx_ID", null); set_Value("AD_OrgTrx_ID", null);
else else
set_Value("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); set_Value("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID));
} }
/** /**

View File

@ -50,7 +50,7 @@ public class MBroadcastMessage extends X_AD_BroadcastMessage
public static MBroadcastMessage get (Properties ctx, int AD_BroadcastMessage_ID) public static MBroadcastMessage get (Properties ctx, int AD_BroadcastMessage_ID)
{ {
Integer key = new Integer(AD_BroadcastMessage_ID); Integer key = Integer.valueOf(AD_BroadcastMessage_ID);
MBroadcastMessage retValue = (MBroadcastMessage)s_cache.get(key); MBroadcastMessage retValue = (MBroadcastMessage)s_cache.get(key);
if (retValue == null) if (retValue == null)
{ {

View File

@ -14,6 +14,7 @@
package org.adempiere.model; package org.adempiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -295,7 +296,7 @@ public class PromotionRule {
nol.setC_Charge_ID(C_Charge_ID); nol.setC_Charge_ID(C_Charge_ID);
nol.setQty(qty); nol.setQty(qty);
if (discount.scale() > 2) if (discount.scale() > 2)
discount = discount.setScale(2, BigDecimal.ROUND_HALF_UP); discount = discount.setScale(2, RoundingMode.HALF_UP);
nol.setPriceEntered(discount.negate()); nol.setPriceEntered(discount.negate());
nol.setPriceActual(discount.negate()); nol.setPriceActual(discount.negate());
if (ol != null && Integer.toString(ol.getLine()).endsWith("0")) { if (ol != null && Integer.toString(ol.getLine()).endsWith("0")) {

View File

@ -216,7 +216,7 @@ public abstract class AbstractDocumentSearch {
rsSO = pstmtSO.executeQuery(); rsSO = pstmtSO.executeQuery();
Vector<Integer> idSO = new Vector<Integer>(); Vector<Integer> idSO = new Vector<Integer>();
while (rsSO.next()) { while (rsSO.next()) {
idSO.add(new Integer(rsSO.getInt(1))); idSO.add(Integer.valueOf(rsSO.getInt(1)));
} }
if (role.getWindowAccess(msd.getAD_Window_ID()) != null) { if (role.getWindowAccess(msd.getAD_Window_ID()) != null) {
msglog = new StringBuilder("Open Window: ").append(msd.getAD_Window_ID()).append(" / Table: ") msglog = new StringBuilder("Open Window: ").append(msd.getAD_Window_ID()).append(" / Table: ")
@ -225,7 +225,7 @@ public abstract class AbstractDocumentSearch {
if (idSO.size() == 0 && (searchString == null || searchString.trim().length() == 0)) { if (idSO.size() == 0 && (searchString == null || searchString.trim().length() == 0)) {
// No search string - open the window with new record // No search string - open the window with new record
idSO.add(new Integer(0)); idSO.add(Integer.valueOf(0));
} }
openWindow(idSO, table.getTableName(), msd.getAD_Window_ID()); openWindow(idSO, table.getTableName(), msd.getAD_Window_ID());
@ -239,7 +239,7 @@ public abstract class AbstractDocumentSearch {
rsPO = pstmtPO.executeQuery(); rsPO = pstmtPO.executeQuery();
Vector<Integer> idPO = new Vector<Integer>(); Vector<Integer> idPO = new Vector<Integer>();
while (rsPO.next()) { while (rsPO.next()) {
idPO.add(new Integer(rsPO.getInt(1))); idPO.add(Integer.valueOf(rsPO.getInt(1)));
} }
if (role.getWindowAccess(msd.getPO_Window_ID()) != null) { if (role.getWindowAccess(msd.getPO_Window_ID()) != null) {
msglog = new StringBuilder("Open Window: ").append(msd.getPO_Window_ID()).append(" / Table: ") msglog = new StringBuilder("Open Window: ").append(msd.getPO_Window_ID()).append(" / Table: ")

View File

@ -406,10 +406,10 @@ public class GenerateModelJPA
sb.append("if (").append (columnName).append (" <= 0) ") sb.append("if (").append (columnName).append (" <= 0) ")
.append(setValue).append(" (\"").append(columnName).append("\", null); else \n"); .append(setValue).append(" (\"").append(columnName).append("\", null); else \n");
} }
sb.append(setValue).append(" (\"").append(columnName).append("\", new Integer(").append(columnName).append("));"); sb.append(setValue).append(" (\"").append(columnName).append("\", Integer.valueOf(").append(columnName).append("));");
} }
else if (clazz.equals(Boolean.class)) else if (clazz.equals(Boolean.class))
sb.append(setValue).append(" (\"").append(columnName).append("\", new Boolean(").append(columnName).append("));"); sb.append(setValue).append(" (\"").append(columnName).append("\", Boolean.valueOf(").append(columnName).append("));");
else else
{ {
if (isMandatory && AD_Reference_ID == 0) // does not apply to int/boolean if (isMandatory && AD_Reference_ID == 0) // does not apply to int/boolean

View File

@ -1036,12 +1036,12 @@ public abstract class Doc
} }
// Get All Currencies // Get All Currencies
HashSet<Integer> set = new HashSet<Integer>(); HashSet<Integer> set = new HashSet<Integer>();
set.add(new Integer(getC_Currency_ID())); set.add(Integer.valueOf(getC_Currency_ID()));
for (int i = 0; p_lines != null && i < p_lines.length; i++) for (int i = 0; p_lines != null && i < p_lines.length; i++)
{ {
int C_Currency_ID = p_lines[i].getC_Currency_ID(); int C_Currency_ID = p_lines[i].getC_Currency_ID();
if (C_Currency_ID != NO_CURRENCY) if (C_Currency_ID != NO_CURRENCY)
set.add(new Integer(C_Currency_ID)); set.add(Integer.valueOf(C_Currency_ID));
} }
// just one and the same // just one and the same

View File

@ -17,6 +17,7 @@
package org.compiere.acct; package org.compiere.acct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.ArrayList; import java.util.ArrayList;
@ -780,7 +781,7 @@ public class Doc_AllocationHdr extends Doc
// Round // Round
int precision = as.getStdPrecision(); int precision = as.getStdPrecision();
if (invoiceDifference.scale() > precision) if (invoiceDifference.scale() > precision)
invoiceDifference = invoiceDifference.setScale(precision, BigDecimal.ROUND_HALF_UP); invoiceDifference = invoiceDifference.setScale(precision, RoundingMode.HALF_UP);
StringBuilder d2 = new StringBuilder("(partial) = ").append(invoiceDifference).append(" - Multiplier=").append(multiplier); StringBuilder d2 = new StringBuilder("(partial) = ").append(invoiceDifference).append(" - Multiplier=").append(multiplier);
if (log.isLoggable(Level.FINE)) log.fine(d2.toString()); if (log.isLoggable(Level.FINE)) log.fine(d2.toString());
descriptionInv.append(" - ").append(d2); descriptionInv.append(" - ").append(d2);
@ -847,7 +848,7 @@ public class Doc_AllocationHdr extends Doc
// Round // Round
int precision = as.getStdPrecision(); int precision = as.getStdPrecision();
if (paymentDifference.scale() > precision) if (paymentDifference.scale() > precision)
paymentDifference = paymentDifference.setScale(precision, BigDecimal.ROUND_HALF_UP); paymentDifference = paymentDifference.setScale(precision, RoundingMode.HALF_UP);
StringBuilder d2 = new StringBuilder("(partial) = ").append(paymentDifference).append(" - Multiplier=").append(multiplier); StringBuilder d2 = new StringBuilder("(partial) = ").append(paymentDifference).append(" - Multiplier=").append(multiplier);
if (log.isLoggable(Level.FINE)) log.fine(d2.toString()); if (log.isLoggable(Level.FINE)) log.fine(d2.toString());
descriptionPay.append(" - ").append(d2); descriptionPay.append(" - ").append(d2);
@ -1193,10 +1194,10 @@ class Doc_AllocationTax
|| amt.signum() == 0) || amt.signum() == 0)
return Env.ZERO; return Env.ZERO;
// //
BigDecimal multiplier = tax.divide(total, 10, BigDecimal.ROUND_HALF_UP); BigDecimal multiplier = tax.divide(total, 10, RoundingMode.HALF_UP);
BigDecimal retValue = multiplier.multiply(amt); BigDecimal retValue = multiplier.multiply(amt);
if (retValue.scale() > precision) if (retValue.scale() > precision)
retValue = retValue.setScale(precision, BigDecimal.ROUND_HALF_UP); retValue = retValue.setScale(precision, RoundingMode.HALF_UP);
if (log.isLoggable(Level.FINE)) log.fine(retValue + " (Mult=" + multiplier + "(Prec=" + precision + ")"); if (log.isLoggable(Level.FINE)) log.fine(retValue + " (Mult=" + multiplier + "(Prec=" + precision + ")");
return retValue; return retValue;
} // calcAmount } // calcAmount

View File

@ -17,6 +17,7 @@
package org.compiere.acct; package org.compiere.acct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -922,7 +923,7 @@ public class Doc_Invoice extends Doc
BigDecimal qty = allocation.getQty(); BigDecimal qty = allocation.getQty();
if (qty.compareTo(iol.getMovementQty()) != 0) if (qty.compareTo(iol.getMovementQty()) != 0)
{ {
amt = amt.multiply(iol.getMovementQty()).divide(qty, 12, BigDecimal.ROUND_HALF_UP); amt = amt.multiply(iol.getMovementQty()).divide(qty, 12, RoundingMode.HALF_UP);
} }
estimatedAmt = estimatedAmt.add(amt); estimatedAmt = estimatedAmt.add(amt);
} }
@ -931,7 +932,7 @@ public class Doc_Invoice extends Doc
if (estimatedAmt.scale() > as.getCostingPrecision()) if (estimatedAmt.scale() > as.getCostingPrecision())
{ {
estimatedAmt = estimatedAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); estimatedAmt = estimatedAmt.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
} }
BigDecimal costAdjustmentAmt = allocationAmt; BigDecimal costAdjustmentAmt = allocationAmt;
if (estimatedAmt.signum() > 0) if (estimatedAmt.signum() > 0)
@ -996,7 +997,7 @@ public class Doc_Invoice extends Doc
getDateAcct(), getC_ConversionType_ID(), getDateAcct(), getC_ConversionType_ID(),
getAD_Client_ID(), getAD_Org_ID()); getAD_Client_ID(), getAD_Org_ID());
if (costDetailAmt.scale() > as.getCostingPrecision()) if (costDetailAmt.scale() > as.getCostingPrecision())
costDetailAmt = costDetailAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); costDetailAmt = costDetailAmt.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
String key = lca.getM_Product_ID()+"_"+lca.getM_AttributeSetInstance_ID(); String key = lca.getM_Product_ID()+"_"+lca.getM_AttributeSetInstance_ID();
BigDecimal prevAmt = costDetailAmtMap.remove(key); BigDecimal prevAmt = costDetailAmtMap.remove(key);
@ -1041,11 +1042,11 @@ public class Doc_Invoice extends Doc
{ {
if (allocationAmt.scale() > as.getStdPrecision()) if (allocationAmt.scale() > as.getStdPrecision())
{ {
allocationAmt = allocationAmt.setScale(as.getStdPrecision(), BigDecimal.ROUND_HALF_UP); allocationAmt = allocationAmt.setScale(as.getStdPrecision(), RoundingMode.HALF_UP);
} }
if (estimatedAmt.scale() > as.getStdPrecision()) if (estimatedAmt.scale() > as.getStdPrecision())
{ {
estimatedAmt = estimatedAmt.setScale(as.getStdPrecision(), BigDecimal.ROUND_HALF_UP); estimatedAmt = estimatedAmt.setScale(as.getStdPrecision(), RoundingMode.HALF_UP);
} }
int compare = allocationAmt.compareTo(estimatedAmt); int compare = allocationAmt.compareTo(estimatedAmt);
if (compare > 0) if (compare > 0)

View File

@ -17,6 +17,7 @@
package org.compiere.acct; package org.compiere.acct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Savepoint; import java.sql.Savepoint;
@ -167,7 +168,7 @@ public class Doc_MatchInv extends Doc
// NotInvoicedReceipt DR // NotInvoicedReceipt DR
// From Receipt // From Receipt
BigDecimal multiplier = getQty() BigDecimal multiplier = getQty()
.divide(m_receiptLine.getMovementQty(), 12, BigDecimal.ROUND_HALF_UP) .divide(m_receiptLine.getMovementQty(), 12, RoundingMode.HALF_UP)
.abs(); .abs();
FactLine dr = fact.createLine (null, FactLine dr = fact.createLine (null,
getAccount(Doc.ACCTTYPE_NotInvoicedReceipts, as), getAccount(Doc.ACCTTYPE_NotInvoicedReceipts, as),
@ -212,7 +213,7 @@ public class Doc_MatchInv extends Doc
expense = m_pc.getAccount(ProductCost.ACCTTYPE_P_Expense, as); expense = m_pc.getAccount(ProductCost.ACCTTYPE_P_Expense, as);
BigDecimal LineNetAmt = m_invoiceLine.getLineNetAmt(); BigDecimal LineNetAmt = m_invoiceLine.getLineNetAmt();
multiplier = getQty() multiplier = getQty()
.divide(m_invoiceLine.getQtyInvoiced(), 12, BigDecimal.ROUND_HALF_UP) .divide(m_invoiceLine.getQtyInvoiced(), 12, RoundingMode.HALF_UP)
.abs(); .abs();
if (multiplier.compareTo(Env.ONE) != 0) if (multiplier.compareTo(Env.ONE) != 0)
LineNetAmt = LineNetAmt.multiply(multiplier); LineNetAmt = LineNetAmt.multiply(multiplier);
@ -453,7 +454,7 @@ public class Doc_MatchInv extends Doc
BigDecimal LineNetAmt = m_invoiceLine.getLineNetAmt(); BigDecimal LineNetAmt = m_invoiceLine.getLineNetAmt();
BigDecimal multiplier = getQty() BigDecimal multiplier = getQty()
.divide(m_invoiceLine.getQtyInvoiced(), 12, BigDecimal.ROUND_HALF_UP) .divide(m_invoiceLine.getQtyInvoiced(), 12, RoundingMode.HALF_UP)
.abs(); .abs();
if (multiplier.compareTo(Env.ONE) != 0) if (multiplier.compareTo(Env.ONE) != 0)
LineNetAmt = LineNetAmt.multiply(multiplier); LineNetAmt = LineNetAmt.multiply(multiplier);
@ -469,7 +470,7 @@ public class Doc_MatchInv extends Doc
{ {
tQty = tQty.add(mInv[i].getQty()); tQty = tQty.add(mInv[i].getQty());
multiplier = mInv[i].getQty() multiplier = mInv[i].getQty()
.divide(m_invoiceLine.getQtyInvoiced(), 12, BigDecimal.ROUND_HALF_UP).abs(); .divide(m_invoiceLine.getQtyInvoiced(), 12, RoundingMode.HALF_UP).abs();
tAmt = tAmt.add(m_invoiceLine.getLineNetAmt().multiply(multiplier)); tAmt = tAmt.add(m_invoiceLine.getLineNetAmt().multiply(multiplier));
} }
} }
@ -516,7 +517,7 @@ public class Doc_MatchInv extends Doc
{ {
BigDecimal totalAmt = allocation.getAmt(); BigDecimal totalAmt = allocation.getAmt();
BigDecimal totalQty = allocation.getQty(); BigDecimal totalQty = allocation.getQty();
BigDecimal amt = totalAmt.multiply(tQty).divide(totalQty, 12, BigDecimal.ROUND_HALF_UP); BigDecimal amt = totalAmt.multiply(tQty).divide(totalQty, 12, RoundingMode.HALF_UP);
if (orderLine.getC_Currency_ID() != as.getC_Currency_ID()) if (orderLine.getC_Currency_ID() != as.getC_Currency_ID())
{ {
I_C_Order order = orderLine.getC_Order(); I_C_Order order = orderLine.getC_Order();
@ -532,7 +533,7 @@ public class Doc_MatchInv extends Doc
} }
amt = amt.multiply(rate); amt = amt.multiply(rate);
if (amt.scale() > as.getCostingPrecision()) if (amt.scale() > as.getCostingPrecision())
amt = amt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); amt = amt.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
} }
int elementId = allocation.getC_OrderLandedCost().getM_CostElement_ID(); int elementId = allocation.getC_OrderLandedCost().getM_CostElement_ID();
BigDecimal elementAmt = landedCostMap.get(elementId); BigDecimal elementAmt = landedCostMap.get(elementId);

View File

@ -233,7 +233,7 @@ public class Doc_MatchPO extends Doc
amt = amt.divide(getQty(), 12, RoundingMode.HALF_UP); amt = amt.divide(getQty(), 12, RoundingMode.HALF_UP);
landedCost = landedCost.add(amt); landedCost = landedCost.add(amt);
if (landedCost.scale() > as.getCostingPrecision()) if (landedCost.scale() > as.getCostingPrecision())
landedCost = landedCost.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); landedCost = landedCost.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
int elementId = allocation.getC_OrderLandedCost().getM_CostElement_ID(); int elementId = allocation.getC_OrderLandedCost().getM_CostElement_ID();
BigDecimal elementAmt = landedCostMap.get(elementId); BigDecimal elementAmt = landedCostMap.get(elementId);
if (elementAmt == null) if (elementAmt == null)
@ -263,7 +263,7 @@ public class Doc_MatchPO extends Doc
} }
poCost = poCost.multiply(rate); poCost = poCost.multiply(rate);
if (poCost.scale() > as.getCostingPrecision()) if (poCost.scale() > as.getCostingPrecision())
poCost = poCost.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); poCost = poCost.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
} }
String costingError = createMatchPOCostDetail(as, poCost, landedCostMap); String costingError = createMatchPOCostDetail(as, poCost, landedCostMap);
@ -492,7 +492,7 @@ public class Doc_MatchPO extends Doc
} }
if (tAmt.scale() > as.getCostingPrecision()) if (tAmt.scale() > as.getCostingPrecision())
tAmt = tAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); tAmt = tAmt.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
// Set Total Amount and Total Quantity from Matched PO // Set Total Amount and Total Quantity from Matched PO
if (!MCostDetail.createOrder(as, m_oLine.getAD_Org_ID(), if (!MCostDetail.createOrder(as, m_oLine.getAD_Org_ID(),
getM_Product_ID(), mMatchPO.getM_AttributeSetInstance_ID(), getM_Product_ID(), mMatchPO.getM_AttributeSetInstance_ID(),
@ -523,7 +523,7 @@ public class Doc_MatchPO extends Doc
BigDecimal amt = landedCostMap.get(elementId); BigDecimal amt = landedCostMap.get(elementId);
amt = amt.multiply(tQty); amt = amt.multiply(tQty);
if (amt.scale() > as.getCostingPrecision()) if (amt.scale() > as.getCostingPrecision())
amt = amt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); amt = amt.setScale(as.getCostingPrecision(), RoundingMode.HALF_UP);
if (!MCostDetail.createOrder(as, m_oLine.getAD_Org_ID(), if (!MCostDetail.createOrder(as, m_oLine.getAD_Org_ID(),
getM_Product_ID(), mMatchPO.getM_AttributeSetInstance_ID(), getM_Product_ID(), mMatchPO.getM_AttributeSetInstance_ID(),
m_oLine.getC_OrderLine_ID(), elementId, m_oLine.getC_OrderLine_ID(), elementId,

View File

@ -159,7 +159,7 @@ public class Doc_Order extends Doc
for (int i = 0; i < oLines.length; i++) for (int i = 0; i < oLines.length; i++)
{ {
MOrderLine line = oLines[i]; MOrderLine line = oLines[i];
qtys.put(new Integer(line.getC_OrderLine_ID()), line.getQtyOrdered()); qtys.put(Integer.valueOf(line.getC_OrderLine_ID()), line.getQtyOrdered());
} }
// //
ArrayList<DocLine> list = new ArrayList<DocLine>(); ArrayList<DocLine> list = new ArrayList<DocLine>();
@ -182,7 +182,7 @@ public class Doc_Order extends Doc
DocLine docLine = new DocLine (line, this); DocLine docLine = new DocLine (line, this);
// Quantity - not more then OrderLine // Quantity - not more then OrderLine
// Issue: Split of Requisition to multiple POs & different price // Issue: Split of Requisition to multiple POs & different price
Integer key = new Integer(line.getC_OrderLine_ID()); Integer key = Integer.valueOf(line.getC_OrderLine_ID());
BigDecimal maxQty = qtys.get(key); BigDecimal maxQty = qtys.get(key);
BigDecimal Qty = line.getQty().max(maxQty); BigDecimal Qty = line.getQty().max(maxQty);
if (Qty.signum() == 0) if (Qty.signum() == 0)

View File

@ -17,6 +17,7 @@
package org.compiere.acct; package org.compiere.acct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.ArrayList; import java.util.ArrayList;
@ -318,7 +319,7 @@ public class Doc_Production extends Doc
costMap.put(line0.get_ID()+ "_"+ ma.getM_AttributeSetInstance_ID(),maCost); costMap.put(line0.get_ID()+ "_"+ ma.getM_AttributeSetInstance_ID(),maCost);
costs0 = costs0.add(maCost); costs0 = costs0.add(maCost);
} }
bomCost = bomCost.add(costs0.setScale(2,BigDecimal.ROUND_HALF_UP)); bomCost = bomCost.add(costs0.setScale(2,RoundingMode.HALF_UP));
} }
else else
p_Error = "Failed to post - No Attribute Set for line"; p_Error = "Failed to post - No Attribute Set for line";
@ -339,7 +340,7 @@ public class Doc_Production extends Doc
costs0 = line0.getProductCosts(as, line0.getAD_Org_ID(), false); costs0 = line0.getProductCosts(as, line0.getAD_Org_ID(), false);
} }
costMap.put(line0.get_ID()+ "_"+ line0.getM_AttributeSetInstance_ID(),costs0); costMap.put(line0.get_ID()+ "_"+ line0.getM_AttributeSetInstance_ID(),costs0);
bomCost = bomCost.add(costs0.setScale(2,BigDecimal.ROUND_HALF_UP)); bomCost = bomCost.add(costs0.setScale(2,RoundingMode.HALF_UP));
} }
} }
@ -358,7 +359,7 @@ public class Doc_Production extends Doc
costs0 = line0.getProductCosts(as, line0.getAD_Org_ID(), false); costs0 = line0.getProductCosts(as, line0.getAD_Org_ID(), false);
} }
costMap.put(line0.get_ID()+ "_"+ line0.getM_AttributeSetInstance_ID(),costs0); costMap.put(line0.get_ID()+ "_"+ line0.getM_AttributeSetInstance_ID(),costs0);
bomCost = bomCost.add(costs0.setScale(2,BigDecimal.ROUND_HALF_UP)); bomCost = bomCost.add(costs0.setScale(2,RoundingMode.HALF_UP));
} }
} }
} }
@ -366,8 +367,8 @@ public class Doc_Production extends Doc
qtyProduced = manipulateQtyProduced (mQtyProduced, endProLine, prod.isUseProductionPlan(), null); qtyProduced = manipulateQtyProduced (mQtyProduced, endProLine, prod.isUseProductionPlan(), null);
if (line.getQty().compareTo(qtyProduced) != 0) if (line.getQty().compareTo(qtyProduced) != 0)
{ {
BigDecimal factor = line.getQty().divide(qtyProduced, 12, BigDecimal.ROUND_HALF_UP); BigDecimal factor = line.getQty().divide(qtyProduced, 12, RoundingMode.HALF_UP);
bomCost = bomCost.multiply(factor).setScale(2,BigDecimal.ROUND_HALF_UP); bomCost = bomCost.multiply(factor).setScale(2,RoundingMode.HALF_UP);
} }
if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel)) if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel))
@ -386,7 +387,7 @@ public class Doc_Production extends Doc
else else
{ {
int precision = as.getStdPrecision(); int precision = as.getStdPrecision();
BigDecimal variance = (costs.setScale(precision, BigDecimal.ROUND_HALF_UP)).subtract(bomCost.negate()); BigDecimal variance = (costs.setScale(precision, RoundingMode.HALF_UP)).subtract(bomCost.negate());
// only post variance if it's not zero // only post variance if it's not zero
if (variance.signum() != 0) if (variance.signum() != 0)
{ {

View File

@ -378,7 +378,7 @@ public final class Fact
for (int i = 0; i < m_lines.size(); i++) for (int i = 0; i < m_lines.size(); i++)
{ {
FactLine line = (FactLine)m_lines.get(i); FactLine line = (FactLine)m_lines.get(i);
Integer key = new Integer(line.getAD_Org_ID()); Integer key = Integer.valueOf(line.getAD_Org_ID());
BigDecimal bal = line.getSourceBalance(); BigDecimal bal = line.getSourceBalance();
BigDecimal oldBal = (BigDecimal)map.get(key); BigDecimal oldBal = (BigDecimal)map.get(key);
if (oldBal != null) if (oldBal != null)
@ -445,7 +445,7 @@ public final class Fact
for (int i = 0; i < m_lines.size(); i++) for (int i = 0; i < m_lines.size(); i++)
{ {
FactLine line = (FactLine)m_lines.get(i); FactLine line = (FactLine)m_lines.get(i);
Integer key = new Integer(line.getAD_Org_ID()); Integer key = Integer.valueOf(line.getAD_Org_ID());
// BigDecimal balance = line.getSourceBalance(); // BigDecimal balance = line.getSourceBalance();
Balance oldBalance = (Balance)map.get(key); Balance oldBalance = (Balance)map.get(key);
if (oldBalance == null) if (oldBalance == null)

View File

@ -17,6 +17,7 @@
package org.compiere.acct; package org.compiere.acct;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -252,14 +253,14 @@ public final class FactLine extends X_Fact_Acct
int precision = MCurrency.getStdPrecision(getCtx(), C_Currency_ID); int precision = MCurrency.getStdPrecision(getCtx(), C_Currency_ID);
if (AmtSourceDr != null && AmtSourceDr.scale() > precision) if (AmtSourceDr != null && AmtSourceDr.scale() > precision)
{ {
BigDecimal AmtSourceDr1 = AmtSourceDr.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal AmtSourceDr1 = AmtSourceDr.setScale(precision, RoundingMode.HALF_UP);
if (AmtSourceDr1.compareTo(AmtSourceDr) != 0) if (AmtSourceDr1.compareTo(AmtSourceDr) != 0)
log.warning("Source DR Precision " + AmtSourceDr + " -> " + AmtSourceDr1); log.warning("Source DR Precision " + AmtSourceDr + " -> " + AmtSourceDr1);
setAmtSourceDr(AmtSourceDr1); setAmtSourceDr(AmtSourceDr1);
} }
if (AmtSourceCr != null && AmtSourceCr.scale() > precision) if (AmtSourceCr != null && AmtSourceCr.scale() > precision)
{ {
BigDecimal AmtSourceCr1 = AmtSourceCr.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal AmtSourceCr1 = AmtSourceCr.setScale(precision, RoundingMode.HALF_UP);
if (AmtSourceCr1.compareTo(AmtSourceCr) != 0) if (AmtSourceCr1.compareTo(AmtSourceCr) != 0)
log.warning("Source CR Precision " + AmtSourceCr + " -> " + AmtSourceCr1); log.warning("Source CR Precision " + AmtSourceCr + " -> " + AmtSourceCr1);
setAmtSourceCr(AmtSourceCr1); setAmtSourceCr(AmtSourceCr1);
@ -326,14 +327,14 @@ public final class FactLine extends X_Fact_Acct
int precision = MCurrency.getStdPrecision(getCtx(), C_Currency_ID); int precision = MCurrency.getStdPrecision(getCtx(), C_Currency_ID);
if (AmtAcctDr != null && AmtAcctDr.scale() > precision) if (AmtAcctDr != null && AmtAcctDr.scale() > precision)
{ {
BigDecimal AmtAcctDr1 = AmtAcctDr.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal AmtAcctDr1 = AmtAcctDr.setScale(precision, RoundingMode.HALF_UP);
if (AmtAcctDr1.compareTo(AmtAcctDr) != 0) if (AmtAcctDr1.compareTo(AmtAcctDr) != 0)
log.warning("Accounted DR Precision " + AmtAcctDr + " -> " + AmtAcctDr1); log.warning("Accounted DR Precision " + AmtAcctDr + " -> " + AmtAcctDr1);
setAmtAcctDr(AmtAcctDr1); setAmtAcctDr(AmtAcctDr1);
} }
if (AmtAcctCr != null && AmtAcctCr.scale() > precision) if (AmtAcctCr != null && AmtAcctCr.scale() > precision)
{ {
BigDecimal AmtAcctCr1 = AmtAcctCr.setScale(precision, BigDecimal.ROUND_HALF_UP); BigDecimal AmtAcctCr1 = AmtAcctCr.setScale(precision, RoundingMode.HALF_UP);
if (AmtAcctCr1.compareTo(AmtAcctCr) != 0) if (AmtAcctCr1.compareTo(AmtAcctCr) != 0)
log.warning("Accounted CR Precision " + AmtAcctCr + " -> " + AmtAcctCr1); log.warning("Accounted CR Precision " + AmtAcctCr + " -> " + AmtAcctCr1);
setAmtAcctCr(AmtAcctCr1); setAmtAcctCr(AmtAcctCr1);

View File

@ -94,7 +94,7 @@ public class WebProjectDeploy extends SvrProcess
// Stage // Stage
MCStage[] stages = MCStage.getStages(m_project); MCStage[] stages = MCStage.getStages(m_project);
for (int i = 0; i < stages.length; i++) for (int i = 0; i < stages.length; i++)
m_map.put(new Integer(stages[i].getCM_CStage_ID()), stages[i]); m_map.put(Integer.valueOf(stages[i].getCM_CStage_ID()), stages[i]);
// Copy Stage Tree // Copy Stage Tree
MTree treeS = new MTree (getCtx(), m_project.getAD_TreeCMS_ID(), false, false, get_TrxName()); MTree treeS = new MTree (getCtx(), m_project.getAD_TreeCMS_ID(), false, false, get_TrxName());
@ -106,7 +106,7 @@ public class WebProjectDeploy extends SvrProcess
for (int i = 0; i < containers.length; i++) for (int i = 0; i < containers.length; i++)
{ {
MContainer container = containers[i]; MContainer container = containers[i];
if (!m_idList.contains(new Integer(container.getCM_Container_ID()))) if (!m_idList.contains(Integer.valueOf(container.getCM_Container_ID())))
{ {
String name = container.getName(); String name = container.getName();
if (container.delete(true)) { if (container.delete(true)) {
@ -155,14 +155,14 @@ public class WebProjectDeploy extends SvrProcess
private void copyStage (MTreeNode node, String path) private void copyStage (MTreeNode node, String path)
{ {
org.compiere.cm.CacheHandler thisHandler = new org.compiere.cm.CacheHandler(org.compiere.cm.CacheHandler.convertJNPURLToCacheURL(getCtx().getProperty("java.naming.provider.url")), log, getCtx(), get_TrxName()); org.compiere.cm.CacheHandler thisHandler = new org.compiere.cm.CacheHandler(org.compiere.cm.CacheHandler.convertJNPURLToCacheURL(getCtx().getProperty("java.naming.provider.url")), log, getCtx(), get_TrxName());
Integer ID = new Integer(node.getNode_ID()); Integer ID = Integer.valueOf(node.getNode_ID());
MCStage stage = m_map.get(ID); MCStage stage = m_map.get(ID);
// //
int size = node.getChildCount(); int size = node.getChildCount();
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
MTreeNode child = (MTreeNode)node.getChildAt(i); MTreeNode child = (MTreeNode)node.getChildAt(i);
ID = new Integer(child.getNode_ID()); ID = Integer.valueOf(child.getNode_ID());
stage = m_map.get(ID); stage = m_map.get(ID);
if (stage == null) if (stage == null)
{ {

View File

@ -18,6 +18,7 @@
package org.compiere.impexp; package org.compiere.impexp;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
@ -309,7 +310,7 @@ public final class ImpFormatRow
if (methodStart != -1) // no class if (methodStart != -1) // no class
{ {
Class<?> cClass = Class.forName(callout.substring(0,methodStart)); Class<?> cClass = Class.forName(callout.substring(0,methodStart));
m_callout = (Callout)cClass.newInstance(); m_callout = (Callout)cClass.getDeclaredConstructor().newInstance();
m_method = callout.substring(methodStart+1); m_method = callout.substring(methodStart+1);
} }
} }
@ -525,7 +526,7 @@ public final class ImpFormatRow
bd = BigDecimal.ZERO; bd = BigDecimal.ZERO;
if (m_divideBy100) // assumed two decimal scale if (m_divideBy100) // assumed two decimal scale
bd = bd.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP); bd = bd.divide(Env.ONEHUNDRED, 2, RoundingMode.HALF_UP);
return bd.toString(); return bd.toString();
} // parseNumber } // parseNumber

View File

@ -18,6 +18,7 @@ package org.compiere.model;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
@ -103,9 +104,9 @@ public class CalloutEngine implements Callout
{ {
Object[] args = null; Object[] args = null;
if (argLength == 6) if (argLength == 6)
args = new Object[] {ctx, new Integer(WindowNo), mTab, mField, value, oldValue}; args = new Object[] {ctx, Integer.valueOf(WindowNo), mTab, mField, value, oldValue};
else else
args = new Object[] {ctx, new Integer(WindowNo), mTab, mField, value}; args = new Object[] {ctx, Integer.valueOf(WindowNo), mTab, mField, value};
retValue = (String)method.invoke(this, args); retValue = (String)method.invoke(this, args);
} }
catch (Exception e) catch (Exception e)
@ -303,7 +304,7 @@ public class CalloutEngine implements Callout
BigDecimal rate2 = Env.ZERO; BigDecimal rate2 = Env.ZERO;
if (rate1.signum() != 0.0) // no divide by zero if (rate1.signum() != 0.0) // no divide by zero
rate2 = Env.ONE.divide(rate1, 12, BigDecimal.ROUND_HALF_UP); rate2 = Env.ONE.divide(rate1, 12, RoundingMode.HALF_UP);
// //
if (mField.getColumnName().equals("MultiplyRate")) if (mField.getColumnName().equals("MultiplyRate"))
mTab.setValue("DivideRate", rate2); mTab.setValue("DivideRate", rate2);

View File

@ -791,14 +791,14 @@ public class GridField
&& (m_vo.ColumnName.equals("AD_Client_ID") || m_vo.ColumnName.equals("AD_Org_ID"))) && (m_vo.ColumnName.equals("AD_Client_ID") || m_vo.ColumnName.equals("AD_Org_ID")))
{ {
if (log.isLoggable(Level.FINE)) log.fine("[SystemAccess] " + m_vo.ColumnName + "=0"); if (log.isLoggable(Level.FINE)) log.fine("[SystemAccess] " + m_vo.ColumnName + "=0");
return new Integer(0); return Integer.valueOf(0);
} }
// Set Org to System, if Client access // Set Org to System, if Client access
else if (X_AD_Table.ACCESSLEVEL_SystemPlusClient.equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, GridTab.CTX_AccessLevel)) else if (X_AD_Table.ACCESSLEVEL_SystemPlusClient.equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, GridTab.CTX_AccessLevel))
&& m_vo.ColumnName.equals("AD_Org_ID")) && m_vo.ColumnName.equals("AD_Org_ID"))
{ {
if (log.isLoggable(Level.FINE)) log.fine("[ClientAccess] " + m_vo.ColumnName + "=0"); if (log.isLoggable(Level.FINE)) log.fine("[ClientAccess] " + m_vo.ColumnName + "=0");
return new Integer(0); return Integer.valueOf(0);
} }
return null; return null;
@ -1057,17 +1057,17 @@ public class GridField
int ii = Integer.parseInt(value); int ii = Integer.parseInt(value);
if (ii < 0) if (ii < 0)
return null; return null;
return new Integer(ii); return Integer.valueOf(ii);
} }
catch (Exception e) catch (Exception e)
{ {
log.warning("Cannot parse: " + value + " - " + e.getMessage()); log.warning("Cannot parse: " + value + " - " + e.getMessage());
} }
return new Integer(0); return Integer.valueOf(0);
} }
// Integer // Integer
if (m_vo.displayType == DisplayType.Integer) if (m_vo.displayType == DisplayType.Integer)
return new Integer(value); return Integer.valueOf(value);
// Number // Number
if (DisplayType.isNumeric(m_vo.displayType)) if (DisplayType.isNumeric(m_vo.displayType))
@ -2057,7 +2057,7 @@ public class GridField
|| (DisplayType.isID(dt) && getColumnName().endsWith("_ID"))) || (DisplayType.isID(dt) && getColumnName().endsWith("_ID")))
{ {
int i = Integer.parseInt(newValue); int i = Integer.parseInt(newValue);
setValue (new Integer(i), inserting); setValue (Integer.valueOf(i), inserting);
} }
// Return BigDecimal // Return BigDecimal
else if (DisplayType.isNumeric(dt)) else if (DisplayType.isNumeric(dt))

View File

@ -870,7 +870,7 @@ public class GridFieldVO implements Serializable
public static class SeqNoComparator implements Comparator<GridFieldVO> { public static class SeqNoComparator implements Comparator<GridFieldVO> {
@Override @Override
public int compare(GridFieldVO gf1, GridFieldVO gf2) { public int compare(GridFieldVO gf1, GridFieldVO gf2) {
return (new Integer(gf1.SeqNo)).compareTo(new Integer(gf2.SeqNo)); return (Integer.valueOf(gf1.SeqNo)).compareTo(Integer.valueOf(gf2.SeqNo));
} }
} }

View File

@ -1818,13 +1818,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (rs.next()) if (rs.next())
{ {
// {0} - Number of lines // {0} - Number of lines
Integer lines = new Integer(rs.getInt(1)); Integer lines = Integer.valueOf(rs.getInt(1));
arguments[0] = lines; arguments[0] = lines;
// {1} - Line net // {1} - Line net
Double net = new Double(rs.getDouble(2)); Double net = Double.valueOf(rs.getDouble(2));
arguments[1] = net; arguments[1] = net;
// {2} - Line net // {2} - Line net
Double total = new Double(rs.getDouble(3)); Double total = Double.valueOf(rs.getDouble(3));
arguments[2] = total; arguments[2] = total;
filled = true; filled = true;
} }
@ -1905,19 +1905,19 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (rs.next()) if (rs.next())
{ {
// {0} - Number of lines // {0} - Number of lines
Integer lines = new Integer(rs.getInt(1)); Integer lines = Integer.valueOf(rs.getInt(1));
arguments[0] = lines; arguments[0] = lines;
// {1} - Line toral // {1} - Line toral
Double lineTotal = new Double(rs.getDouble(3)); Double lineTotal = Double.valueOf(rs.getDouble(3));
arguments[1] = lineTotal; arguments[1] = lineTotal;
// {2} - Grand total (including tax, etc.) // {2} - Grand total (including tax, etc.)
Double grandTotal = new Double(rs.getDouble(4)); Double grandTotal = Double.valueOf(rs.getDouble(4));
arguments[2] = grandTotal; arguments[2] = grandTotal;
// {3} - Currency // {3} - Currency
String currency = rs.getString(2); String currency = rs.getString(2);
arguments[3] = currency; arguments[3] = currency;
// (4) - Grand total converted to Euro // (4) - Grand total converted to Euro
Double grandEuro = new Double(rs.getDouble(5)); Double grandEuro = Double.valueOf(rs.getDouble(5));
arguments[4] = grandEuro; arguments[4] = grandEuro;
filled = true; filled = true;
} }
@ -1979,10 +1979,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (rs.next()) if (rs.next())
{ {
// {0} - Number of lines // {0} - Number of lines
Integer lines = new Integer(rs.getInt(1)); Integer lines = Integer.valueOf(rs.getInt(1));
arguments[0] = lines; arguments[0] = lines;
// {1} - Line total // {1} - Line total
Double total = new Double(rs.getDouble(2)); Double total = Double.valueOf(rs.getDouble(2));
arguments[1] = total; arguments[1] = total;
// {3} - Currency // {3} - Currency
arguments[2] = " "; arguments[2] = " ";
@ -2234,7 +2234,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
Integer key = new Integer(rs.getInt(1)); Integer key = Integer.valueOf(rs.getInt(1));
m_Lock.add(key); m_Lock.add(key);
} }
} }
@ -2264,7 +2264,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (m_Lock == null || m_Lock.isEmpty()) if (m_Lock == null || m_Lock.isEmpty())
return false; return false;
// //
Integer key = new Integer(m_mTable.getKeyID (m_currentRow)); Integer key = Integer.valueOf(m_mTable.getKeyID (m_currentRow));
return m_Lock.contains(key); return m_Lock.contains(key);
} // isLocked } // isLocked
@ -2927,7 +2927,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (call == null) { if (call == null) {
//no match from factory, check java classpath //no match from factory, check java classpath
Class<?> cClass = Class.forName(className); Class<?> cClass = Class.forName(className);
call = (Callout)cClass.newInstance(); call = (Callout)cClass.getDeclaredConstructor().newInstance();
} }
} }
} }
@ -3190,9 +3190,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
lineNoCurrentRow = (Integer) m_mTable.getValueAt(from, lineCol); lineNoCurrentRow = (Integer) m_mTable.getValueAt(from, lineCol);
lineNoNextRow = (Integer) m_mTable.getValueAt(to, lineCol); lineNoNextRow = (Integer) m_mTable.getValueAt(to, lineCol);
} else if (m_mTable.getValueAt(from, lineCol) instanceof BigDecimal) { } else if (m_mTable.getValueAt(from, lineCol) instanceof BigDecimal) {
lineNoCurrentRow = new Integer(((BigDecimal) m_mTable.getValueAt(from, lineCol)) lineNoCurrentRow = Integer.valueOf(((BigDecimal) m_mTable.getValueAt(from, lineCol))
.intValue()); .intValue());
lineNoNextRow = new Integer(((BigDecimal) m_mTable.getValueAt(to, lineCol)) lineNoNextRow = Integer.valueOf(((BigDecimal) m_mTable.getValueAt(to, lineCol))
.intValue()); .intValue());
} else { } else {
log.fine("unknown value format - return"); log.fine("unknown value format - return");

View File

@ -1303,8 +1303,8 @@ public class GridTable extends AbstractTableModel
// Save old value // Save old value
m_oldValue = new Object[3]; m_oldValue = new Object[3];
m_oldValue[0] = new Integer(row); m_oldValue[0] = Integer.valueOf(row);
m_oldValue[1] = new Integer(col); m_oldValue[1] = Integer.valueOf(col);
m_oldValue[2] = oldValue; m_oldValue[2] = oldValue;
// Set Data item // Set Data item
@ -1894,7 +1894,7 @@ public class GridTable extends AbstractTableModel
if (dd instanceof Integer) if (dd instanceof Integer)
iii = (Integer)dd; iii = (Integer)dd;
else else
iii = new Integer(dd.toString()); iii = Integer.valueOf(dd.toString());
if (encrypted) if (encrypted)
iii = (Integer)encrypt(iii, getAD_Client_ID()); iii = (Integer)encrypt(iii, getAD_Client_ID());
if (manualUpdate) if (manualUpdate)
@ -3242,7 +3242,7 @@ public class GridTable extends AbstractTableModel
// Integer, ID, Lookup // Integer, ID, Lookup
if (displayType == DisplayType.Integer || (DisplayType.isID(displayType) && !(columnName.equals("EntityType") || columnName.equals("AD_Language")))) if (displayType == DisplayType.Integer || (DisplayType.isID(displayType) && !(columnName.equals("EntityType") || columnName.equals("AD_Language"))))
{ {
rowData[j] = new Integer(rs.getInt(j+1)); // Integer rowData[j] = Integer.valueOf(rs.getInt(j+1)); // Integer
if (rs.wasNull()) if (rs.wasNull())
rowData[j] = null; rowData[j] = null;
} }
@ -3261,7 +3261,7 @@ public class GridTable extends AbstractTableModel
String str = rs.getString(j+1); String str = rs.getString(j+1);
if (field.isEncryptedColumn()) if (field.isEncryptedColumn())
str = (String)decrypt(str, getAD_Client_ID(rs)); str = (String)decrypt(str, getAD_Client_ID(rs));
rowData[j] = new Boolean ("Y".equals(str)); // Boolean rowData[j] = Boolean.valueOf("Y".equals(str)); // Boolean
} }
// LOB // LOB
else if (DisplayType.isLOB(displayType)) else if (DisplayType.isLOB(displayType))

View File

@ -62,7 +62,7 @@ public class MAcctSchema extends X_C_AcctSchema
public static MAcctSchema get (Properties ctx, int C_AcctSchema_ID, String trxName) public static MAcctSchema get (Properties ctx, int C_AcctSchema_ID, String trxName)
{ {
// Check Cache // Check Cache
Integer key = new Integer(C_AcctSchema_ID); Integer key = Integer.valueOf(C_AcctSchema_ID);
MAcctSchema retValue = (MAcctSchema)s_cache.get(key); MAcctSchema retValue = (MAcctSchema)s_cache.get(key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;
@ -93,7 +93,7 @@ public class MAcctSchema extends X_C_AcctSchema
public static synchronized MAcctSchema[] getClientAcctSchema (Properties ctx, int AD_Client_ID, String trxName) public static synchronized MAcctSchema[] getClientAcctSchema (Properties ctx, int AD_Client_ID, String trxName)
{ {
// Check Cache // Check Cache
Integer key = new Integer(AD_Client_ID); Integer key = Integer.valueOf(AD_Client_ID);
if (s_schema.containsKey(key)) if (s_schema.containsKey(key))
return (MAcctSchema[])s_schema.get(key); return (MAcctSchema[])s_schema.get(key);

View File

@ -57,7 +57,7 @@ public class MAcctSchemaElement extends X_C_AcctSchema_Element
*/ */
public static MAcctSchemaElement[] getAcctSchemaElements (MAcctSchema as) public static MAcctSchemaElement[] getAcctSchemaElements (MAcctSchema as)
{ {
Integer key = new Integer (as.getC_AcctSchema_ID()); Integer key = Integer.valueOf(as.getC_AcctSchema_ID());
MAcctSchemaElement[] retValue = (MAcctSchemaElement[]) s_cache.get (key); MAcctSchemaElement[] retValue = (MAcctSchemaElement[]) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -116,9 +116,9 @@ public class MAging extends X_T_Aging
// Optional // Optional
// setC_Invoice_ID (C_Invoice_ID); // may be zero // setC_Invoice_ID (C_Invoice_ID); // may be zero
set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID));
// setC_InvoicePaySchedule_ID(C_InvoicePaySchedule_ID); // may be zero // setC_InvoicePaySchedule_ID(C_InvoicePaySchedule_ID); // may be zero
set_Value ("C_InvoicePaySchedule_ID", new Integer(C_InvoicePaySchedule_ID)); set_Value ("C_InvoicePaySchedule_ID", Integer.valueOf(C_InvoicePaySchedule_ID));
setIsListInvoices(C_Invoice_ID != 0); setIsListInvoices(C_Invoice_ID != 0);
// //
setDueDate(DueDate); // only sensible if List invoices setDueDate(DueDate); // only sensible if List invoices
@ -156,9 +156,9 @@ public class MAging extends X_T_Aging
// Optional // Optional
// setC_Invoice_ID (C_Invoice_ID); // may be zero // setC_Invoice_ID (C_Invoice_ID); // may be zero
set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID));
// setC_InvoicePaySchedule_ID(C_InvoicePaySchedule_ID); // may be zero // setC_InvoicePaySchedule_ID(C_InvoicePaySchedule_ID); // may be zero
set_Value ("C_InvoicePaySchedule_ID", new Integer(C_InvoicePaySchedule_ID)); set_Value ("C_InvoicePaySchedule_ID", Integer.valueOf(C_InvoicePaySchedule_ID));
setIsListInvoices(C_Invoice_ID != 0); setIsListInvoices(C_Invoice_ID != 0);
// //
setDueDate(DueDate); // only sensible if List invoices setDueDate(DueDate); // only sensible if List invoices

View File

@ -18,6 +18,7 @@ package org.compiere.model;
import java.io.File; import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -1066,7 +1067,7 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
// Round // Round
int precision = MCurrency.getStdPrecision(getCtx(), client.getC_Currency_ID()); int precision = MCurrency.getStdPrecision(getCtx(), client.getC_Currency_ID());
if (openBalanceDiff.scale() > precision) if (openBalanceDiff.scale() > precision)
openBalanceDiff = openBalanceDiff.setScale(precision, BigDecimal.ROUND_HALF_UP); openBalanceDiff = openBalanceDiff.setScale(precision, RoundingMode.HALF_UP);
} }
} }

View File

@ -51,7 +51,7 @@ public class MAttributeSet extends X_M_AttributeSet
*/ */
public static MAttributeSet get (Properties ctx, int M_AttributeSet_ID) public static MAttributeSet get (Properties ctx, int M_AttributeSet_ID)
{ {
Integer key = new Integer (M_AttributeSet_ID); Integer key = Integer.valueOf(M_AttributeSet_ID);
MAttributeSet retValue = (MAttributeSet) s_cache.get (key); MAttributeSet retValue = (MAttributeSet) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -45,7 +45,7 @@ public class MBOM extends X_M_BOM
*/ */
public static MBOM get (Properties ctx, int M_BOM_ID) public static MBOM get (Properties ctx, int M_BOM_ID)
{ {
Integer key = new Integer (M_BOM_ID); Integer key = Integer.valueOf(M_BOM_ID);
MBOM retValue = (MBOM) s_cache.get (key); MBOM retValue = (MBOM) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -17,6 +17,7 @@
package org.compiere.model; package org.compiere.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.Properties; import java.util.Properties;
@ -49,7 +50,7 @@ public class MBPGroup extends X_C_BP_Group
*/ */
public static MBPGroup get (Properties ctx, int C_BP_Group_ID) public static MBPGroup get (Properties ctx, int C_BP_Group_ID)
{ {
Integer key = new Integer (C_BP_Group_ID); Integer key = Integer.valueOf(C_BP_Group_ID);
MBPGroup retValue = (MBPGroup) s_cache.get (key); MBPGroup retValue = (MBPGroup) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;
@ -82,7 +83,7 @@ public class MBPGroup extends X_C_BP_Group
public static MBPGroup getDefault (Properties ctx) public static MBPGroup getDefault (Properties ctx)
{ {
int AD_Client_ID = Env.getAD_Client_ID(ctx); int AD_Client_ID = Env.getAD_Client_ID(ctx);
Integer key = new Integer (AD_Client_ID); Integer key = Integer.valueOf(AD_Client_ID);
MBPGroup retValue = (MBPGroup) s_cacheDefault.get (key); MBPGroup retValue = (MBPGroup) s_cacheDefault.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;
@ -141,7 +142,7 @@ public class MBPGroup extends X_C_BP_Group
if (rs.next ()) if (rs.next ())
{ {
retValue = new MBPGroup (ctx, rs, null); retValue = new MBPGroup (ctx, rs, null);
Integer key = new Integer (retValue.getC_BP_Group_ID()); Integer key = Integer.valueOf(retValue.getC_BP_Group_ID());
if (retValue.get_ID () != 0) if (retValue.get_ID () != 0)
s_cache.put (key, retValue); s_cache.put (key, retValue);
} }
@ -220,7 +221,7 @@ public class MBPGroup extends X_C_BP_Group
{ {
BigDecimal bd = super.getCreditWatchPercent(); BigDecimal bd = super.getCreditWatchPercent();
if (bd.compareTo(Env.ZERO) != 0) if (bd.compareTo(Env.ZERO) != 0)
return bd.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP); return bd.divide(Env.ONEHUNDRED, 2, RoundingMode.HALF_UP);
return BigDecimal.valueOf(0.90); return BigDecimal.valueOf(0.90);
} // getCreditWatchRatio } // getCreditWatchRatio

View File

@ -63,7 +63,7 @@ public class MBPartner extends X_C_BPartner
// Reset // Reset
if (template != null) if (template != null)
{ {
template.set_ValueNoCheck ("C_BPartner_ID", new Integer(0)); template.set_ValueNoCheck ("C_BPartner_ID", Integer.valueOf(0));
template.set_ValueNoCheck ("C_BPartner_UU", (String)null); template.set_ValueNoCheck ("C_BPartner_UU", (String)null);
template.setAD_OrgBP_ID(0); template.setAD_OrgBP_ID(0);
template.setLogo_ID(0); template.setLogo_ID(0);
@ -660,7 +660,7 @@ public class MBPartner extends X_C_BPartner
*/ */
public void setPrimaryC_BPartner_Location_ID(int C_BPartner_Location_ID) public void setPrimaryC_BPartner_Location_ID(int C_BPartner_Location_ID)
{ {
m_primaryC_BPartner_Location_ID = new Integer (C_BPartner_Location_ID); m_primaryC_BPartner_Location_ID = Integer.valueOf(C_BPartner_Location_ID);
} // setPrimaryC_BPartner_Location_ID } // setPrimaryC_BPartner_Location_ID
/** /**
@ -669,7 +669,7 @@ public class MBPartner extends X_C_BPartner
*/ */
public void setPrimaryAD_User_ID(int AD_User_ID) public void setPrimaryAD_User_ID(int AD_User_ID)
{ {
m_primaryAD_User_ID = new Integer (AD_User_ID); m_primaryAD_User_ID = Integer.valueOf(AD_User_ID);
} // setPrimaryAD_User_ID } // setPrimaryAD_User_ID

View File

@ -105,7 +105,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location {
this(bp.getCtx(), 0, bp.get_TrxName()); this(bp.getCtx(), 0, bp.get_TrxName());
setClientOrg(bp); setClientOrg(bp);
// may (still) be 0 // may (still) be 0
set_ValueNoCheck("C_BPartner_ID", new Integer(bp.getC_BPartner_ID())); set_ValueNoCheck("C_BPartner_ID", Integer.valueOf(bp.getC_BPartner_ID()));
} // MBPartner_Location } // MBPartner_Location
/** /**

View File

@ -43,7 +43,7 @@ public class MBank extends X_C_Bank
*/ */
public static MBank get (Properties ctx, int C_Bank_ID) public static MBank get (Properties ctx, int C_Bank_ID)
{ {
Integer key = new Integer (C_Bank_ID); Integer key = Integer.valueOf(C_Bank_ID);
MBank retValue = (MBank)s_cache.get (key); MBank retValue = (MBank)s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -47,7 +47,7 @@ public class MBankAccount extends X_C_BankAccount
*/ */
public static MBankAccount get (Properties ctx, int C_BankAccount_ID) public static MBankAccount get (Properties ctx, int C_BankAccount_ID)
{ {
Integer key = new Integer (C_BankAccount_ID); Integer key = Integer.valueOf(C_BankAccount_ID);
MBankAccount retValue = (MBankAccount) s_cache.get (key); MBankAccount retValue = (MBankAccount) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -132,7 +132,7 @@ import org.compiere.util.Util;
if(m_loader==null){ if(m_loader==null){
// if no OSGi plugin is found try the legacy way (in my own classpath) // if no OSGi plugin is found try the legacy way (in my own classpath)
Class<?> bsrClass = Class.forName(getStmtLoaderClass()); Class<?> bsrClass = Class.forName(getStmtLoaderClass());
m_loader = (BankStatementLoaderInterface) bsrClass.newInstance(); m_loader = (BankStatementLoaderInterface) bsrClass.getDeclaredConstructor().newInstance();
} }
} }
catch(Exception e) catch(Exception e)

View File

@ -141,7 +141,7 @@ public class MBankStatementMatcher extends X_C_BankStatementMatcher
if(m_matcher==null){ if(m_matcher==null){
// if no OSGi plugin is found try the legacy way (in my own classpath) // if no OSGi plugin is found try the legacy way (in my own classpath)
Class<?> bsrClass = Class.forName(className); Class<?> bsrClass = Class.forName(className);
m_matcher = (BankStatementMatcherInterface) bsrClass.newInstance(); m_matcher = (BankStatementMatcherInterface) bsrClass.getDeclaredConstructor().newInstance();
} }
m_matcherValid = Boolean.TRUE; m_matcherValid = Boolean.TRUE;
} }

View File

@ -46,7 +46,7 @@ public class MCalendar extends X_C_Calendar
*/ */
public static MCalendar get (Properties ctx, int C_Calendar_ID) public static MCalendar get (Properties ctx, int C_Calendar_ID)
{ {
Integer key = new Integer (C_Calendar_ID); Integer key = Integer.valueOf(C_Calendar_ID);
MCalendar retValue = (MCalendar) s_cache.get (key); MCalendar retValue = (MCalendar) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -57,7 +57,7 @@ public class MCashBook extends X_C_CashBook
*/ */
public static MCashBook get(Properties ctx, int C_CashBook_ID, String trxName) public static MCashBook get(Properties ctx, int C_CashBook_ID, String trxName)
{ {
Integer key = new Integer (C_CashBook_ID); Integer key = Integer.valueOf(C_CashBook_ID);
MCashBook retValue = (MCashBook) s_cache.get (key); MCashBook retValue = (MCashBook) s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;
@ -93,7 +93,7 @@ public class MCashBook extends X_C_CashBook
.first(); .first();
if (retValue!=null) if (retValue!=null)
{ {
Integer key = new Integer (retValue.getC_CashBook_ID()); Integer key = Integer.valueOf(retValue.getC_CashBook_ID());
s_cache.put (key, retValue); s_cache.put (key, retValue);
} }
return retValue; return retValue;

View File

@ -72,7 +72,7 @@ public class MChangeLog extends X_AD_ChangeLog
pstmt = DB.prepareStatement(sql, null); pstmt = DB.prepareStatement(sql, null);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
list.add(new Integer(rs.getInt(1))); list.add(Integer.valueOf(rs.getInt(1)));
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -87,7 +87,7 @@ public class MCharge extends X_C_Charge
*/ */
public static MCharge get (Properties ctx, int C_Charge_ID) public static MCharge get (Properties ctx, int C_Charge_ID)
{ {
Integer key = new Integer (C_Charge_ID); Integer key = Integer.valueOf(C_Charge_ID);
MCharge retValue = (MCharge)s_cache.get (key); MCharge retValue = (MCharge)s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -42,7 +42,7 @@ public class MChatType extends X_CM_ChatType
*/ */
public static MChatType get (Properties ctx, int CM_ChatType_ID) public static MChatType get (Properties ctx, int CM_ChatType_ID)
{ {
Integer key = new Integer (CM_ChatType_ID); Integer key = Integer.valueOf(CM_ChatType_ID);
MChatType retValue = (MChatType)s_cache.get (key); MChatType retValue = (MChatType)s_cache.get (key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;

View File

@ -46,7 +46,7 @@ public class MCity extends X_C_City
*/ */
public static MCity get (Properties ctx, int C_City_ID) public static MCity get (Properties ctx, int C_City_ID)
{ {
Integer key = new Integer (C_City_ID); Integer key = Integer.valueOf(C_City_ID);
MCity r = s_Cities.get(key); MCity r = s_Cities.get(key);
if (r != null) if (r != null)
return r; return r;

View File

@ -66,7 +66,7 @@ public class MClient extends X_AD_Client
*/ */
public static MClient get (Properties ctx, int AD_Client_ID) public static MClient get (Properties ctx, int AD_Client_ID)
{ {
Integer key = new Integer (AD_Client_ID); Integer key = Integer.valueOf(AD_Client_ID);
MClient client = (MClient)s_cache.get(key); MClient client = (MClient)s_cache.get(key);
if (client != null) if (client != null)
return client; return client;
@ -97,7 +97,7 @@ public class MClient extends X_AD_Client
.setOrderBy(orderBy) .setOrderBy(orderBy)
.list(); .list();
for(MClient client:list ){ for(MClient client:list ){
s_cache.put (new Integer (client.getAD_Client_ID()), client); s_cache.put (Integer.valueOf(client.getAD_Client_ID()), client);
} }
MClient[] retValue = new MClient[list.size ()]; MClient[] retValue = new MClient[list.size ()];
list.toArray (retValue); list.toArray (retValue);

View File

@ -61,7 +61,7 @@ public class MClientInfo extends X_AD_ClientInfo
*/ */
public static MClientInfo get (Properties ctx, int AD_Client_ID, String trxName) public static MClientInfo get (Properties ctx, int AD_Client_ID, String trxName)
{ {
Integer key = new Integer (AD_Client_ID); Integer key = Integer.valueOf(AD_Client_ID);
MClientInfo info = (MClientInfo)s_cache.get(key); MClientInfo info = (MClientInfo)s_cache.get(key);
if (info != null) if (info != null)
return info; return info;

Some files were not shown because too many files have changed in this diff Show More