Author: lektran
Date: Tue Sep 18 01:30:58 2007
New Revision: 576773
URL: http://svn.apache.org/viewvc?rev=576773&view=rev
Log:
Changed all occurances of new BigDecimal("0") to BigDecimal.ZERO and likewise
for BigDecimal.ONE
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createItemList.bsh
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/filterorderlist.bsh
ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
Tue Sep 18 01:30:58 2007
@@ -48,7 +48,7 @@
public static final String module = AgreementServices.class.getName();
// set some BigDecimal properties
- private static BigDecimal ZERO = new BigDecimal("0");
+ private static BigDecimal ZERO = BigDecimal.ZERO;
private static int decimals = -1;
private static int rounding = -1;
static {
@@ -96,7 +96,7 @@
try {
BigDecimal amount = ((BigDecimal)context.get("amount"));
BigDecimal quantity = (BigDecimal)context.get("quantity");
- quantity = quantity == null ? new BigDecimal("1") : quantity;
+ quantity = quantity == null ? BigDecimal.ONE : quantity;
boolean negative = amount.signum() < 0;
// Ensure that price and quantity are positive since the terms may
not be linear.
amount = amount.abs();
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
Tue Sep 18 01:30:58 2007
@@ -350,7 +350,7 @@
// now we make sure there is something to refund
if (actualBalance.doubleValue() > 0) {
BigDecimal remainingBalance = new
BigDecimal(actualBalance.toString());
- BigDecimal refundAmount = new BigDecimal(0);
+ BigDecimal refundAmount = BigDecimal.ZERO;
EntityCondition condition = new
EntityExpr("finAccountTransTypeId", EntityOperator.EQUALS, "DEPOSIT");
EntityListIterator eli = null;
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
Tue Sep 18 01:30:58 2007
@@ -100,7 +100,7 @@
public static String module = InvoiceServices.class.getName();
// set some BigDecimal properties
- private static BigDecimal ZERO = new BigDecimal("0");
+ private static BigDecimal ZERO = BigDecimal.ZERO;
private static int decimals =
UtilNumber.getBigDecimalScale("invoice.decimals");
private static int rounding =
UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
private static int taxDecimals =
UtilNumber.getBigDecimalScale("salestax.calc.decimals");
@@ -689,8 +689,8 @@
if ("N".equalsIgnoreCase(prorateShipping)) {
// Set the divisor and multiplier to 1 to avoid prorating
- BigDecimal divisor = new BigDecimal("1");
- BigDecimal multiplier = new BigDecimal("1");
+ BigDecimal divisor = BigDecimal.ONE;
+ BigDecimal multiplier = BigDecimal.ONE;
// The base amount in this case is the adjustment amount
minus the total already invoiced for that adjustment, since
// it won't be prorated
@@ -728,8 +728,8 @@
if ("N".equalsIgnoreCase(prorateTaxes)) {
// Set the divisor and multiplier to 1 to avoid prorating
- BigDecimal divisor = new BigDecimal("1");
- BigDecimal multiplier = new BigDecimal("1");
+ BigDecimal divisor = BigDecimal.ONE;
+ BigDecimal multiplier = BigDecimal.ONE;
// The base amount in this case is the adjustment amount
minus the total already invoiced for that adjustment, since
// it won't be prorated
@@ -2473,7 +2473,7 @@
// get the invoice item applied value
BigDecimal quantity = null;
if (invoiceItem.get("quantity") == null) {
- quantity = new BigDecimal("1");
+ quantity = BigDecimal.ONE;
} else {
quantity =
invoiceItem.getBigDecimal("quantity").setScale(decimals,rounding);
}
@@ -2729,7 +2729,7 @@
// get the invoiceItem
invoiceItem = (GenericValue) i.next();
if (debug) Debug.logInfo("Start processing item: " +
invoiceItem.getString("invoiceItemSeqId"), module);
- BigDecimal itemQuantity = new BigDecimal("1");
+ BigDecimal itemQuantity = BigDecimal.ONE;
if (invoiceItem.get("quantity") != null &&
invoiceItem.getBigDecimal("quantity").signum() != 0) {
itemQuantity = new
BigDecimal(invoiceItem.getString("quantity")).setScale(decimals,rounding);
}
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
Tue Sep 18 01:30:58 2007
@@ -42,7 +42,7 @@
public class InvoiceWorker {
public static String module = InvoiceWorker.class.getName();
- private static BigDecimal ZERO = new BigDecimal("0");
+ private static BigDecimal ZERO = BigDecimal.ZERO;
private static int decimals =
UtilNumber.getBigDecimalScale("invoice.decimals");
private static int rounding =
UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
private static int taxDecimals =
UtilNumber.getBigDecimalScale("salestax.calc.decimals");
@@ -92,7 +92,7 @@
}
public static BigDecimal getInvoiceTaxTotalBd(GenericValue invoice) {
BigDecimal invoiceTaxTotal = ZERO;
- BigDecimal ONE = new BigDecimal("1");
+ BigDecimal ONE = BigDecimal.ONE;
if (invoice == null)
throw new IllegalArgumentException("The invoiceId passed does not
match an existing invoice");
@@ -158,7 +158,7 @@
if (amount == null)
amount = ZERO;
if (quantity == null)
- quantity = new BigDecimal("1");
+ quantity = BigDecimal.ONE;
if
("ITM_SALES_TAX".equals(invoiceItem.get("invoiceItemTypeId"))) {
invoiceTaxTotal = invoiceTaxTotal.add(
amount.multiply(quantity)).setScale(taxDecimals, taxRounding);
} else {
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java
Tue Sep 18 01:30:58 2007
@@ -54,7 +54,7 @@
public class BillingAccountWorker {
public static final String module = BillingAccountWorker.class.getName();
- private static BigDecimal ZERO = new BigDecimal("0");
+ private static BigDecimal ZERO = BigDecimal.ZERO;
private static int decimals = -1;
private static int rounding = -1;
static {
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
Tue Sep 18 01:30:58 2007
@@ -54,7 +54,7 @@
public static final int CARD_NUMBER_LENGTH = 14;
public static final int PIN_NUMBER_LENGTH = 6;
- public static BigDecimal ZERO = new BigDecimal("0.00");
+ public static BigDecimal ZERO = BigDecimal.ZERO;
// Base Gift Certificate Services
public static Map createGiftCertificate(DispatchContext dctx, Map context)
{
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java
Tue Sep 18 01:30:58 2007
@@ -215,7 +215,7 @@
throw new IllegalArgumentException("Payment list cannot be null");
}
- BigDecimal paymentsTotal = new BigDecimal("0");
+ BigDecimal paymentsTotal = BigDecimal.ZERO;
Iterator i = payments.iterator();
while (i.hasNext()) {
GenericValue payment = (GenericValue) i.next();
@@ -261,7 +261,7 @@
}
public static BigDecimal getPaymentAppliedBd(GenericValue payment) {
- BigDecimal paymentApplied = new BigDecimal("0");
+ BigDecimal paymentApplied = BigDecimal.ZERO;
List paymentApplications = null;
try {
paymentApplications = payment.getRelated("PaymentApplication");
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
Tue Sep 18 01:30:58 2007
@@ -54,8 +54,8 @@
public class TaxAuthorityServices {
public static final String module = TaxAuthorityServices.class.getName();
- public static final BigDecimal ZERO_BASE = new BigDecimal("0.000");
- public static final BigDecimal ONE_BASE = new BigDecimal("1.000");
+ public static final BigDecimal ZERO_BASE = BigDecimal.ZERO;
+ public static final BigDecimal ONE_BASE = BigDecimal.ONE;
public static final BigDecimal PERCENT_SCALE = new BigDecimal("100.000");
public static int
salestaxFinalDecimals=UtilNumber.getBigDecimalScale("salestax.final.decimals");
public static int
salestaxCalcDecimals=UtilNumber.getBigDecimalScale("salestax.calc.decimals");
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh
(original)
+++
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createApplicationList.bsh
Tue Sep 18 01:30:58 2007
@@ -30,7 +30,7 @@
int decimals = UtilNumber.getBigDecimalScale("invoice.decimals");
int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
-NULL = new BigDecimal("0.00");
+NULL = BigDecimal.ZERO;
delegator = request.getAttribute("delegator");
invoiceId = request.getParameter("invoiceId");
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createItemList.bsh
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createItemList.bsh?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createItemList.bsh
(original)
+++
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/createItemList.bsh
Tue Sep 18 01:30:58 2007
@@ -33,9 +33,9 @@
// find existing items
invoiceItemsDb = null;
List invoiceItems = new LinkedList();
-BigDecimal invoiceAmount = new BigDecimal("0.00");
-BigDecimal total = new BigDecimal("0.00");
-BigDecimal quantity = new BigDecimal("0.00");
+BigDecimal invoiceAmount = BigDecimal.ZERO;
+BigDecimal total = BigDecimal.ZERO;
+BigDecimal quantity = BigDecimal.ZERO;
if ((invoiceId != null) && (invoice != null)) {
invoiceItemsDb = invoice.getRelated("InvoiceItem",
UtilMisc.toList("invoiceItemSeqId"));
if (invoiceItemsDb != null && invoiceItemsDb.size() > 0) {
@@ -44,14 +44,14 @@
while (i.hasNext()) {
item = i.next();
if (item.get("quantity") == null ||
item.getDouble("quantity").doubleValue() == 0.00) {
- quantity = new BigDecimal("1.00");
+ quantity = BigDecimal.ONE;
} else {
quantity = item.getBigDecimal("quantity");
}
if (item.get("amount")!= null) {
total =
item.getBigDecimal("amount").multiply(quantity).setScale(decimals,rounding);
} else {
- total = new BigDecimal("0.00");
+ total = BigDecimal.ZERO;
}
invoiceAmount = invoiceAmount.add(total);
Map itemmap = new HashMap();
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh
(original)
+++
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh
Tue Sep 18 01:30:58 2007
@@ -36,8 +36,8 @@
context.put("invoice", invoice);
other = parameters.get("other"); // allow the display of the
invoice in the currency of the other party. sales: partyId, purch: partyIdFrom
using the convertUom service.
-BigDecimal conversionRate = new BigDecimal("1");
-private static BigDecimal ZERO = new BigDecimal("0");
+BigDecimal conversionRate = BigDecimal.ONE;
+private static BigDecimal ZERO = BigDecimal.ZERO;
private static int decimals =
UtilNumber.getBigDecimalScale("invoice.decimals");
private static int rounding =
UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
if (other != null && other.equalsIgnoreCase("y")) {
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Tue Sep 18 01:30:58 2007
@@ -66,8 +66,8 @@
public static final String module = ProductionRunServices.class.getName();
public static final String resource = "ManufacturingUiLabels";
- private static BigDecimal ZERO = new BigDecimal("0");
- private static BigDecimal ONE = new BigDecimal("1");
+ private static BigDecimal ZERO = BigDecimal.ZERO;
+ private static BigDecimal ONE = BigDecimal.ONE;
private static int decimals = -1;
private static int rounding = -1;
static {
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java
Tue Sep 18 01:30:58 2007
@@ -48,7 +48,7 @@
*/
public static int decimals =
UtilNumber.getBigDecimalScale("finaccount.decimals");
public static int rounding =
UtilNumber.getBigDecimalRoundingMode("finaccount.rounding");
- public static final BigDecimal ZERO = (new
BigDecimal("0.0")).setScale(decimals, rounding);
+ public static final BigDecimal ZERO = BigDecimal.ZERO.setScale(decimals,
rounding);
public static final String giftCertFinAccountTypeId = "GIFTCERT_ACCOUNT";
public static final boolean defaultPinRequired = false;
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
Tue Sep 18 01:30:58 2007
@@ -557,7 +557,7 @@
GenericValue orderHeader = (GenericValue) i.next();
OrderReadHelper orh = new OrderReadHelper(orderHeader);
BigDecimal backorderQty = orh.getOrderBackorderQuantity();
- if (backorderQty.compareTo(new BigDecimal("0")) == 1) {
+ if (backorderQty.compareTo(BigDecimal.ZERO) == 1) {
filterInventoryProblems.add(orh.getOrderId());
}
}
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
Tue Sep 18 01:30:58 2007
@@ -70,7 +70,7 @@
public static final int taxCalcScale =
UtilNumber.getBigDecimalScale("salestax.calc.decimals");
public static final int taxFinalScale =
UtilNumber.getBigDecimalScale("salestax.final.decimals");
public static final int taxRounding =
UtilNumber.getBigDecimalRoundingMode("salestax.rounding");
- public static final BigDecimal ZERO = (new
BigDecimal("0")).setScale(scale, rounding);
+ public static final BigDecimal ZERO = (BigDecimal.ZERO).setScale(scale,
rounding);
public static final BigDecimal percentage = (new
BigDecimal("0.01")).setScale(scale, rounding);
protected GenericValue orderHeader = null;
@@ -2475,7 +2475,7 @@
}
public static BigDecimal getWorkEffortRentalQuantity(GenericValue
workEffort){
- BigDecimal persons = new BigDecimal(1);
+ BigDecimal persons = BigDecimal.ONE;
if (workEffort.get("reservPersons") != null)
persons = workEffort.getBigDecimal("reservPersons");
BigDecimal secondPersonPerc = ZERO;
@@ -2489,7 +2489,7 @@
length =
(workEffort.getTimestamp("estimatedCompletionDate").getTime() -
workEffort.getTimestamp("estimatedStartDate").getTime()) / 86400000;
BigDecimal rentalAdjustment = ZERO;
- if (persons.compareTo(new BigDecimal(1)) == 1) {
+ if (persons.compareTo(BigDecimal.ONE) == 1) {
if (persons.compareTo(new BigDecimal(2)) == 1) {
persons = persons.subtract(new BigDecimal(2));
if(nthPersonPerc.signum() == 1)
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Tue Sep 18 01:30:58 2007
@@ -70,7 +70,7 @@
public static final String resource_error = "OrderErrorUiLabels";
// set some BigDecimal properties
- private static BigDecimal ZERO = new BigDecimal("0");
+ private static BigDecimal ZERO = BigDecimal.ZERO;
private static int decimals = -1;
private static int rounding = -1;
static {
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
(original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Tue Sep 18 01:30:58 2007
@@ -90,7 +90,7 @@
public static final int taxRounding =
UtilNumber.getBigDecimalRoundingMode("salestax.rounding");
public static final int orderDecimals =
UtilNumber.getBigDecimalScale("order.decimals");
public static final int orderRounding =
UtilNumber.getBigDecimalRoundingMode("order.rounding");
- public static final BigDecimal ZERO = (new
BigDecimal("0")).setScale(taxDecimals, taxRounding);
+ public static final BigDecimal ZERO =
BigDecimal.ZERO.setScale(taxDecimals, taxRounding);
/** Service for creating a new order */
public static Map createOrder(DispatchContext ctx, Map context) {
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
Tue Sep 18 01:30:58 2007
@@ -784,7 +784,7 @@
product.add(i, cartItem.getProduct());
amount.add(i, new
BigDecimal(cartItem.getItemSubTotal(itemInfo.quantity)));
price.add(i, new BigDecimal(cartItem.getBasePrice()));
- shipAmt.add(i, new BigDecimal("0.00")); // no per item shipping yet
+ shipAmt.add(i, BigDecimal.ZERO); // no per item shipping yet
}
BigDecimal shipAmount = new BigDecimal(csi.shipEstimate);
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
Tue Sep 18 01:30:58 2007
@@ -67,7 +67,7 @@
public static final int taxCalcScale =
UtilNumber.getBigDecimalScale("salestax.calc.decimals");
public static final int taxFinalScale =
UtilNumber.getBigDecimalScale("salestax.final.decimals");
public static final int taxRounding =
UtilNumber.getBigDecimalRoundingMode("salestax.rounding");
- public static final BigDecimal ZERO = (new
BigDecimal("0")).setScale(scale, rounding);
+ public static final BigDecimal ZERO = BigDecimal.ZERO.setScale(scale,
rounding);
public static final BigDecimal percentage = (new
BigDecimal("0.01")).setScale(scale, rounding);
private String orderType = "SALES_ORDER"; // default orderType
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/filterorderlist.bsh
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/filterorderlist.bsh?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/filterorderlist.bsh
(original)
+++
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/filterorderlist.bsh
Tue Sep 18 01:30:58 2007
@@ -34,7 +34,7 @@
orderHeader = (GenericValue) ohi.next();
orderReadHelper = OrderReadHelper.getHelper(orderHeader);
backorderQty = orderReadHelper.getOrderBackorderQuantity();
- if (backorderQty.compareTo(new BigDecimal("0")) == 1) {
+ if (backorderQty.compareTo(BigDecimal.ZERO) == 1) {
filterInventoryProblems.add(orderHeader.get("orderId"));
}
}
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
Tue Sep 18 01:30:58 2007
@@ -57,7 +57,7 @@
public class PriceServices {
public static final String module = PriceServices.class.getName();
- public static final BigDecimal ONE_BASE = new BigDecimal("1.000");
+ public static final BigDecimal ONE_BASE = BigDecimal.ONE;
public static final BigDecimal PERCENT_SCALE = new BigDecimal("100.000");
public static final int taxCalcScale =
UtilNumber.getBigDecimalScale("salestax.calc.decimals");
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
(original)
+++
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
Tue Sep 18 01:30:58 2007
@@ -49,7 +49,7 @@
public static final String resource_error = "OrderErrorUiLabels";
public static final int decimals =
UtilNumber.getBigDecimalScale("order.decimals");
public static final int rounding =
UtilNumber.getBigDecimalRoundingMode("order.rounding");
- public static final BigDecimal ZERO = (new
BigDecimal("0")).setScale(decimals, rounding);
+ public static final BigDecimal ZERO = BigDecimal.ZERO.setScale(decimals,
rounding);
public static Map createShipmentEstimate(DispatchContext dctx, Map
context) {
Map result = new HashMap();
Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java
(original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java Tue
Sep 18 01:30:58 2007
@@ -43,7 +43,7 @@
public static final String module = UtilMisc.class.getName();
- public static final BigDecimal ZERO_BD = new BigDecimal(0.0);
+ public static final BigDecimal ZERO_BD = BigDecimal.ZERO;
/**
* Get an iterator from a collection, returning null if collection is null
Modified:
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java?rev=576773&r1=576772&r2=576773&view=diff
==============================================================================
---
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java
(original)
+++
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java
Tue Sep 18 01:30:58 2007
@@ -41,7 +41,7 @@
public static final String module = Calculate.class.getName();
- public static final BigDecimal ZERO = new BigDecimal(0.0);
+ public static final BigDecimal ZERO = BigDecimal.ZERO;
public static final int TYPE_DOUBLE = 1;
public static final int TYPE_FLOAT = 2;
public static final int TYPE_LONG = 3;