details:   https://code.openbravo.com/erp/devel/pi/rev/93ff908df5c2
changeset: 20621:93ff908df5c2
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Sun Jun 16 18:27:58 2013 +0530
summary:   Fixes Issue 24043: Recalculate amortization plan not working properly

details:   https://code.openbravo.com/erp/devel/pi/rev/7a75f2ac9e45
changeset: 20622:7a75f2ac9e45
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Thu Jun 20 14:33:25 2013 +0530
summary:   Fixes Issue 24144: The "deposit to" drop down is not listing any 
account

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
 |  8 ++++----
 
src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
                          |  2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 84c10cb30817 -r 7a75f2ac9e45 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
  Thu Jun 20 14:12:47 2013 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
  Thu Jun 20 14:33:25 2013 +0530
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s): Enterprise Intelligence Systems (http://www.eintel.com.au).
  *************************************************************************
@@ -409,7 +409,7 @@
     if (account != null) {
       if (!financialAccounts.contains(account)) {
         strFinancialAccountId = financialAccounts.get(0).getId();
-        if (financialAccounts.get(0).getWriteofflimit() != null) {
+        if (financialAccounts.size() > 0 && 
financialAccounts.get(0).getWriteofflimit() != null) {
           strtypewriteoff = financialAccounts.get(0).getTypewriteoff();
           strAmountwriteoff = 
financialAccounts.get(0).getWriteofflimit().toString();
           xmlDocument.setParameter("strtypewriteoff", strtypewriteoff);
@@ -425,7 +425,7 @@
         }
       }
     } else {
-      if (financialAccounts.get(0).getWriteofflimit() != null) {
+      if (financialAccounts.size() > 0 && 
financialAccounts.get(0).getWriteofflimit() != null) {
         strtypewriteoff = financialAccounts.get(0).getTypewriteoff();
         strAmountwriteoff = 
financialAccounts.get(0).getWriteofflimit().toString();
         xmlDocument.setParameter("strtypewriteoff", strtypewriteoff);
@@ -594,7 +594,7 @@
 
     JSONObject msg = new JSONObject();
     try {
-      if (financialAccount.getWriteofflimit() != null) {
+      if (financialAccount != null && financialAccount.getWriteofflimit() != 
null) {
         msg.put("twriteoff", financialAccount.getTypewriteoff());
         msg.put("awriteoff", financialAccount.getWriteofflimit().toString());
       }
diff -r 84c10cb30817 -r 7a75f2ac9e45 
src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
--- 
a/src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
   Thu Jun 20 14:12:47 2013 +0200
+++ 
b/src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
   Thu Jun 20 14:33:25 2013 +0530
@@ -442,7 +442,7 @@
           proportionalAmount = proportionalAmount.setScale(stdPrecision, 
RoundingMode.HALF_UP);
 
           // Last period. Adjust for avoiding rounding issues.
-          if (new BigDecimal(contPeriods).compareTo(totalPeriods) == 0
+          if (((!isPercentage && new 
BigDecimal(contPeriods).compareTo(totalPeriods) == 0))
               || totalizedAmount.add(proportionalAmount).compareTo(amount) > 
0) {
             proportionalAmount = amount.subtract(totalizedAmount);
             proportionaldPercentage = HUNDRED.subtract(totalizedPercentage);

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to