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 2008/12/29 09:16:59 UTC

svn commit: r729837 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: invoice/InvoiceWorker.java payment/PaymentWorker.java

Author: hansbak
Date: Mon Dec 29 00:16:58 2008
New Revision: 729837

URL: http://svn.apache.org/viewvc?rev=729837&view=rev
Log:
change to more correct coding

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.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?rev=729837&r1=729836&r2=729837&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 Mon Dec 29 00:16:58 2008
@@ -63,7 +63,7 @@
     }
 
     public static BigDecimal getInvoiceTotalBd(GenericDelegator delegator, String invoiceId) {
-        return getInvoiceTotalBd(delegator, invoiceId, true);
+        return getInvoiceTotalBd(delegator, invoiceId, Boolean.TRUE);
     }
 
     public static BigDecimal getInvoiceTotalBd(GenericDelegator delegator, String invoiceId, Boolean actualCurrency) {
@@ -134,10 +134,10 @@
     }
     
     public static double getInvoiceNoTaxTotal(GenericValue invoice) {
-        return getInvoiceTotalBd(invoice, true).doubleValue() - getInvoiceTaxTotal(invoice);
+        return getInvoiceTotalBd(invoice, Boolean.TRUE).doubleValue() - getInvoiceTaxTotal(invoice);
     }
     public static BigDecimal getInvoiceNoTaxTotalBd(GenericValue invoice) {
-        return getInvoiceTotalBd(invoice, true).subtract(getInvoiceTaxTotalBd(invoice));
+        return getInvoiceTotalBd(invoice, Boolean.TRUE).subtract(getInvoiceTaxTotalBd(invoice));
     }
     
     /**
@@ -146,11 +146,11 @@
      * @return the invoice total as double
      */
     public static double getInvoiceTotal(GenericValue invoice) {
-        return getInvoiceTotalBd(invoice, true).doubleValue();
+        return getInvoiceTotalBd(invoice, Boolean.TRUE).doubleValue();
     }
         
     public static BigDecimal getInvoiceTotalBd(GenericValue invoice) {
-        return getInvoiceTotalBd(invoice, true);
+        return getInvoiceTotalBd(invoice, Boolean.TRUE);
     }
         
     public static BigDecimal getInvoiceTotalBd(GenericValue invoice, Boolean actualCurrency) {
@@ -387,7 +387,7 @@
         return InvoiceWorker.getInvoiceTotalBd(delegator, invoiceId).subtract(getInvoiceAppliedBd(delegator, invoiceId));
     }
     public static BigDecimal getInvoiceNotApplied(GenericValue invoice) {
-        return InvoiceWorker.getInvoiceTotalBd(invoice, true).subtract(getInvoiceAppliedBd(invoice));
+        return InvoiceWorker.getInvoiceTotalBd(invoice, Boolean.TRUE).subtract(getInvoiceAppliedBd(invoice));
     }
     public static BigDecimal getInvoiceNotApplied(GenericValue invoice, Boolean actualCurrency) {
         return InvoiceWorker.getInvoiceTotalBd(invoice, actualCurrency).subtract(getInvoiceAppliedBd(invoice, actualCurrency));
@@ -400,7 +400,7 @@
      * @return
      */
     public static BigDecimal getInvoiceNotApplied(GenericValue invoice, Timestamp asOfDateTime) {
-        return InvoiceWorker.getInvoiceTotalBd(invoice, true).subtract(getInvoiceAppliedBd(invoice, asOfDateTime));
+        return InvoiceWorker.getInvoiceTotalBd(invoice, Boolean.TRUE).subtract(getInvoiceAppliedBd(invoice, asOfDateTime));
     }
 
     
@@ -414,7 +414,7 @@
     }
 
     public static BigDecimal getInvoiceAppliedBd(GenericDelegator delegator, String invoiceId) {
-        return getInvoiceAppliedBd(delegator, invoiceId, UtilDateTime.nowTimestamp(), true);
+        return getInvoiceAppliedBd(delegator, invoiceId, UtilDateTime.nowTimestamp(), Boolean.TRUE);
     }
     
     /**
@@ -479,7 +479,7 @@
         return getInvoiceAppliedBd(invoice.getDelegator(), invoice.getString("invoiceId"), UtilDateTime.nowTimestamp(), actualCurrency);
     }
     public static BigDecimal getInvoiceAppliedBd(GenericValue invoice, Timestamp asOfDateTime) {
-        return getInvoiceAppliedBd(invoice.getDelegator(), invoice.getString("invoiceId"), asOfDateTime, true);
+        return getInvoiceAppliedBd(invoice.getDelegator(), invoice.getString("invoiceId"), asOfDateTime, Boolean.TRUE);
     }
     public static BigDecimal getInvoiceAppliedBd(GenericValue invoice) {
         return getInvoiceAppliedBd(invoice, UtilDateTime.nowTimestamp());

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=729837&r1=729836&r2=729837&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 Mon Dec 29 00:16:58 2008
@@ -70,7 +70,7 @@
         try {
             List paymentMethods = delegator.findByAnd("PaymentMethod", UtilMisc.toMap("partyId", partyId));
 
-            if (!showOld) paymentMethods = EntityUtil.filterByDate(paymentMethods, true);
+            if (!showOld) paymentMethods = EntityUtil.filterByDate(paymentMethods, Boolean.TRUE);
             Iterator pmIter = paymentMethods.iterator();
 
             while (pmIter.hasNext()) {
@@ -118,7 +118,7 @@
         GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
         Map results = new HashMap();
         
-        Boolean tryEntity = true;
+        Boolean tryEntity = Boolean.TRUE;
         if (request.getAttribute("_ERROR_MESSAGE_") != null) tryEntity = false;
 
         String donePage = request.getParameter("DONE_PAGE");
@@ -323,7 +323,7 @@
                     GenericValue paymentApplication = (GenericValue) p.next();
                     BigDecimal amountApplied = paymentApplication.getBigDecimal("amountApplied");
                     // check currency invoice and if different convert amount applied for display
-                    if (!actual && paymentApplication.get("invoiceId") != null && payment.get("actualCurrencyAmount") != null && payment.get("actualCurrencyUomId") != null) {
+                    if (actual.equals(Boolean.FALSE) && paymentApplication.get("invoiceId") != null && payment.get("actualCurrencyAmount") != null && payment.get("actualCurrencyUomId") != null) {
                         GenericValue invoice = paymentApplication.getRelatedOne("Invoice");
                         if (payment.getString("actualCurrencyUomId").equals(invoice.getString("currencyUomId"))) {
                                amountApplied = amountApplied.multiply(payment.getBigDecimal("amount")).divide(payment.getBigDecimal("actualCurrencyAmount"),new MathContext(100));
@@ -345,7 +345,7 @@
         return payment.getBigDecimal("amount").subtract(getPaymentAppliedBd(payment)).setScale(decimals,rounding);
     }
     public static BigDecimal getPaymentNotAppliedBd(GenericValue payment, Boolean actual) {
-    	if (actual && UtilValidate.isNotEmpty(payment.getBigDecimal("actualCurrencyAmount"))) {
+    	if (actual.equals(Boolean.TRUE) && UtilValidate.isNotEmpty(payment.getBigDecimal("actualCurrencyAmount"))) {
     		return payment.getBigDecimal("actualCurrencyAmount").subtract(getPaymentAppliedBd(payment, actual)).setScale(decimals,rounding);
     	}
    		return payment.getBigDecimal("amount").subtract(getPaymentAppliedBd(payment)).setScale(decimals,rounding);