Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0024768 | Openbravo ERP | 09. Financial management | public | 2013-09-13 12:56 | 2013-10-22 23:42 | |||||||
Reporter | vmromanos | |||||||||||
Assigned To | dmiguelez | |||||||||||
Priority | high | Severity | minor | Reproducibility | always | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 20 | OS Version | Debian 5.0 | ||||||||
Product Version | pi | |||||||||||
Target Version | 3.0MP29 | Fixed in Version | ||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | pramakrishnan | |||||||||||
OBNetwork customer | No | |||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0024768: Payment Monitor NullPointer Exception in method calculateAmounts() | |||||||||||
Description | The 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 Reproduce | Not necessary | |||||||||||
Proposed Solution | Easiest 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 | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
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 | OBNetwork customer | => No | |||||||||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|