Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0024768 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 09. Financial management | minor | always | 2013-09-13 12:56 | 2013-10-22 23:42 | |||
Reporter | vmromanos | View Status | public | |||||
Assigned To | dmiguelez | |||||||
Priority | high | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | 0c6559f88e5a | ||||
Projection | none | ETA | none | Target Version | 3.0MP29 | |||
OS | Linux 32 bit | Database | PostgreSQL | Java version | 1.6.0_12 | |||
OS Version | Debian 5.0 | Database version | 8.3.8 | Ant version | 1.7.0 | |||
Product Version | pi | SCM revision | ||||||
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 | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0061167) vmromanos (viewer) 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 (viewer) 2013-10-22 10:02 |
Code Review + Testing - OK. |
(0061859) hudsonbot (viewer) 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 |
![]() |
|||
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 |
Copyright © 2000 - 2009 MantisBT Group |