You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2007/06/18 02:15:37 UTC
svn commit: r548144 -
/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
Author: hansbak
Date: Sun Jun 17 17:15:36 2007
New Revision: 548144
URL: http://svn.apache.org/viewvc?view=rev&rev=548144
Log:
add bigdecimal versions of invoicetotals.
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
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?view=diff&rev=548144&r1=548143&r2=548144
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java Sun Jun 17 17:15:36 2007
@@ -88,6 +88,9 @@
}
public static double getInvoiceTaxTotal(GenericValue invoice) {
+ return getInvoiceTaxTotalBd(invoice).doubleValue();
+ }
+ public static BigDecimal getInvoiceTaxTotalBd(GenericValue invoice) {
BigDecimal invoiceTaxTotal = ZERO;
BigDecimal ONE = new BigDecimal("1");
@@ -117,12 +120,15 @@
invoiceTaxTotal = invoiceTaxTotal.add(amount.multiply(quantity)).setScale(decimals + 1, rounding);
}
}
- return invoiceTaxTotal.setScale(decimals, rounding).doubleValue();
+ return invoiceTaxTotal.setScale(decimals, rounding);
}
public static double getInvoiceNoTaxTotal(GenericValue invoice) {
return getInvoiceTotalBd(invoice).doubleValue() - getInvoiceTaxTotal(invoice);
+ }
+ public static BigDecimal getInvoiceNoTaxTotalBd(GenericValue invoice) {
+ return getInvoiceTotalBd(invoice).subtract(getInvoiceTaxTotalBd(invoice));
}
/**