Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021610Openbravo ERP09. Financial managementpublic2012-09-11 16:002012-09-14 14:58
Xpand-IT 
dmiguelez 
normalmajoralways
closedfixed 
107
3.0MP13 
 
dmiguelez
Advanced Payables and Receivables Mngmt
No
0021610: Wrong Outstanding Amount adding Payment to Invoice
Outstanding in Payment Plan tab is greater than Outstanding Amount in Add Payment pop up
- Create an Invoice that has a total gross amount of 1000€
- Click on Add Payment button and add a payment of 600€ for the new Invoice
- Go to Payment In and delete the new Payment (you can go to it through Payment Details)
- Refresh Payment Plan and verify that received field is 0
- Click on Add Payment button

Outstanding amount is now 400€ and it should be 1000€
amount column from fin_payment_scheduledetail table should be updated when the Payment In is deleted
No tags attached.
diff Fix.diff (3,038) 2012-09-14 09:13
https://issues.openbravo.com/file_download.php?file_id=5572&type=bug
Issue History
2012-09-11 16:00Xpand-ITNew Issue
2012-09-11 16:00Xpand-ITAssigned To => dmiguelez
2012-09-11 16:00Xpand-ITModules => Advanced Payables and Receivables Mngmt
2012-09-11 16:01Xpand-ITIssue Monitored: Xpand-IT
2012-09-11 19:55dmiguelezNote Added: 0052007
2012-09-11 19:55dmiguelezStatusnew => feedback
2012-09-11 20:07Xpand-ITNote Added: 0052008
2012-09-12 19:34dmiguelezNote Added: 0052039
2012-09-13 12:42Xpand-ITNote Added: 0052055
2012-09-13 13:31dmiguelezNote Added: 0052068
2012-09-13 13:36Xpand-ITNote Added: 0052069
2012-09-13 17:05dmiguelezNote Added: 0052080
2012-09-13 17:29Xpand-ITNote Added: 0052082
2012-09-13 17:55dmiguelezNote Added: 0052085
2012-09-13 18:44Xpand-ITNote Added: 0052089
2012-09-13 19:02dmiguelezNote Added: 0052090
2012-09-13 19:14Xpand-ITNote Added: 0052091
2012-09-14 09:12dmiguelezNote Added: 0052101
2012-09-14 09:13dmiguelezFile Added: Fix.diff
2012-09-14 14:58dmiguelezClosed by => dmiguelez
2012-09-14 14:58dmiguelezNote Added: 0052145
2012-09-14 14:58dmiguelezStatusfeedback => closed
2012-09-14 14:58dmiguelezResolutionopen => fixed

Notes
(0052007)
dmiguelez   
2012-09-11 19:55   
Hi,

I've been trying to reproduce the Issue, but I don't understand how you were able to delete the Payment.
If I try to delete it, an error message is shown because it has linked items. The same happens if I try to delete the Payment Line.
Even if I reactivate the Payment first, I am not able to delete neither the Payment nor the Payment Lines

I've checked this in MP13 and on our latest code, with the same result.

If you could give me more information about this I would really appreciate it and we will be able to help you with this Issue.

Thanks a lot.
(0052008)
Xpand-IT   
2012-09-11 20:07   
Hi,

After the payment was made, I went to Payment In, reactivated the Payment In and I was able to delete the Payment In.
Doing that the Payment Details disappeared.

Regards
(0052039)
dmiguelez   
2012-09-12 19:34   
Hi again,

I am still unable to delete a Payment In that has Payment Lines in MP13 or above.
What I see is that the Lines below the Payment are not properly refreshed, but by refreshing the Window I see that the line is still there.

Also in Invoice || Payment Plan || Payment Plan Details the line associated to the Payment is still there.

The Payment is in Awaiting Payment Status, but the Payment Line still remains there, so when trying to add a Payment to the Invoice, it recognizes that there is a Payment Line related, therefore it only allows to add a Payment of 400.

Can you check please that for you it works as I described?
If not, when deleting the Payment does it not show any error message?

Thanks a lot.
(0052055)
Xpand-IT   
2012-09-13 12:42   
I don't know why or if it should not happen, but I can delete a Payment In even if it has lines. I don't get any error.

When I delete the Payment In the Payment Plan Details line is also deleted.

If I shouldn't be able to delete the Payment In how can I cancel a wrong payment?

Regards
(0052068)
dmiguelez   
2012-09-13 13:31   
Can you confirm that you are in MP13 or above, please?
Then I will be able to give you a full answer to your questions.
(0052069)
Xpand-IT   
2012-09-13 13:36   
Yes, my version is MP13.

Openbravo 3.0 MP13 Community Edition

Version number: 3.0.17503
Core Revision ID: -
(0052080)
dmiguelez   
2012-09-13 17:05   
Hi,

I've been checking with the Team, and we do not understand how you were able to delete the Payment. Starting MP13, the Payment Lines are stored after Reactivating the Payment, so the user don't loose that information after the reactivation. So you shouldn't be able to delete it.
 
Starting in MP15, when reactivating the Payment, there is an option to delete the Payment Lines if the user wants, and the it will be possible to delete the Payment.

But, in MP13, this option does not exist.
There is a workaround, though. In Payment In Window, select the Payment that you want to delete. Click on Add Details and uncheck the Payment Lines. Then click on Process.
This will Process a Payment that has no lines related to it, so it will generate credit to the selected Business Partner.
Then Reactivate the Payment again, and now you will be able to delete the whole Payment.

But I am still concern with the fact that you were able to delete the Payment. I am unable to reproduce it. Could you try again, please, to delete a Payment after reactivating it and with Payment Lines?
If you still can do it, can you tell me if there are lines in Sales Invoice || Payment Plan || Payment Details?

Thank you very much.
(0052082)
Xpand-IT   
2012-09-13 17:29   
Yes, I tested it some times. I can delete a Payment In/Out after I reactivate it.

As I told you, when I delete the payment the line in Payment Details also disappears.

About the workaround, I think I can't do that due to the issue "0021312: When reactivating a payment, it is not possible to delete all the lines"
https://issues.openbravo.com/view.php?id=21312 [^]

Thanks for the concern
(0052085)
dmiguelez   
2012-09-13 17:55   
Sorry, I forgot that this Issue is still present in MP13.

The steps you need to follow then are:
1. Reactivate the Payment
2. Add some amount in the Amount field in the header, 1$ for example
3. Click Add Details. Uncheck all the lines of the Payment and check the option of "Leave this amount to be used later"
4. Reactivate the Payment again.
5. Now you should be able to delete the Payment

Hopefully this can help you.
Anything you need, don't hesitate to contact us.

As for this Issue, I am sorry, but we are not able to reproduce it. I don't know what's the difference that enables you to delete the Payment, but if you have any hint on what is it, please, let us know so we can address it.

Let me know if the steps above solve your problem, please.

Thanks a lot.
(0052089)
Xpand-IT   
2012-09-13 18:44   
Those steps solve one problem, not the original one.

I'll try to find out why I'm able to delete Payments.

Thanks
(0052090)
dmiguelez   
2012-09-13 19:02   
I've been digging a little bit deeper.

There is an Action Handler in java that should prevent this from happening.

I don't know if you can check this, but it would be really useful to know if in your instance the class FIN_PaymentEventListener.java is present.

Path: openbravo/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_PaymentEventListener.java

Thank you.
(0052091)
Xpand-IT   
2012-09-13 19:14   
I checked it and you are right, I don't have the event folder in my instance.
This should be the problem.

The event folder should be present in MP13, right?

Thanks for the effort
(0052101)
dmiguelez   
2012-09-14 09:12   
Hi,

At least, I found where this Issue comes from.
In MP13 you should not be able to delete the Payments, not because there was an implicit check for it, but because it should exist linked items in the table FIN_ORIG_PAYMSCHED. For some reason, you don't have them.

Either way, this table has been deleted in MP14, there we created the Java class I told you yesterday to check that the user should not be able to delete the Payment.

So, to fix this, I attach the patch that creates this Java class for you, so you have this check to prevent this Issue from happening again.

And when you update to MP14 or later, you do not need to worry, because it is already fixed.

Thanks a lot for all your feedback.
(0052145)
dmiguelez   
2012-09-14 14:58   
Fixed in MP14