Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0024768
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementminoralways2013-09-13 12:562013-10-22 23:42
ReportervmromanosView Statuspublic 
Assigned Todmiguelez 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision0c6559f88e5a
ProjectionnoneETAnoneTarget Version3.0MP29
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_12
OS VersionDebian 5.0Database version8.3.8Ant version1.7.0
Product VersionpiSCM revision 
Review Assigned Topramakrishnan
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0024768: Payment Monitor NullPointer Exception in method calculateAmounts()

DescriptionThe FIN_PaymentMonitorProcess class contains the public static method updateInvoice() which can be invoked from outside of the class.
This method calls the calculateAmounts() which uses the "logger" variable in some flows. In this case we will get a NullPointer Exception because this variable is set in a non static method [execute()], so it is not initialized at this point if we use the FIN_PaymentMonitorProcess.updateInvoice() method.

Apart from that, the class has hardcoded messages like:
"ERROR Invoice " + invoice.getDocumentNo()
              + ": wrong payment plan info, paid amount is "
              + paymentSchedule.getPaidAmount().toPlainString() + " when it should be "
              + paid.toPlainString()

These messages should be declared in the application dictionary instead.
Steps To ReproduceNot necessary
Proposed SolutionEasiest solution: add if (logger != null) before using the logger. Example:
 if (paymentSchedule.getPaidAmount().compareTo(paid) != 0) {
        if (logger != null) {
          logger.log("ERROR Invoice " + invoice.getDocumentNo()
              + ": wrong payment plan info, paid amount is "
              + paymentSchedule.getPaidAmount().toPlainString() + " when it should be "
              + paid.toPlainString());
        }
        paymentSchedule.setPaidAmount(paid);
        OBDal.getInstance().save(paymentSchedule);
      }

Hardest solution: refactor the class to avoid this kind of problems

Don't forget to add the messages to the Application Dictionary
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00247783.0MP29 closedpramakrishnan Payment Monitor doesn't udpate invoice status when voiding a payment 

-  Notes
(0061167)
vmromanos (developer)
2013-09-16 13:00

See 0024778 for a proposed patch
(0061839)
hgbot (developer)
2013-10-22 10:01

Repository: erp/devel/pi
Changeset: 0c6559f88e5ab2d45a7c1e3a0a5ce801c05127a3
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Oct 21 12:26:36 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/0c6559f88e5ab2d45a7c1e3a0a5ce801c05127a3 [^]

Fixes Issue 24778, Fixes Issue 24768

Payment Monitor doesn't udpate invoice status when voiding a payment
Payment Monitor NullPointer Exception in method calculateAmounts()

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java
---
(0061841)
pramakrishnan (developer)
2013-10-22 10:02

Code Review + Testing - OK.
(0061859)
hudsonbot (developer)
2013-10-22 23:42

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/a362c560793b [^]

Maturity status: Test

- Issue History
Date Modified Username Field Change
2013-09-13 12:56 vmromanos New Issue
2013-09-13 12:56 vmromanos Assigned To => dmiguelez
2013-09-13 12:56 vmromanos Modules => Core
2013-09-13 12:56 vmromanos Triggers an Emergency Pack => No
2013-09-16 12:59 vmromanos Relationship added related to 0024778
2013-09-16 13:00 vmromanos Note Added: 0061167
2013-09-16 13:42 jonalegriaesarte Target Version 3.0MP28 => 3.0MP29
2013-10-22 10:01 hgbot Checkin
2013-10-22 10:01 hgbot Note Added: 0061839
2013-10-22 10:01 hgbot Status new => resolved
2013-10-22 10:01 hgbot Resolution open => fixed
2013-10-22 10:01 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0c6559f88e5ab2d45a7c1e3a0a5ce801c05127a3 [^]
2013-10-22 10:02 pramakrishnan Review Assigned To => pramakrishnan
2013-10-22 10:02 pramakrishnan Note Added: 0061841
2013-10-22 10:02 pramakrishnan Status resolved => closed
2013-10-22 23:42 hudsonbot Checkin
2013-10-22 23:42 hudsonbot Note Added: 0061859


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker