Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039268Openbravo ERP09. Financial managementpublic2018-09-11 16:462018-09-27 16:26
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q4 
Sandrahuguet
Core
No
0039268: Wrong accounting entry when reversing a prepayment against an order that was later invoiced
Wrong accounting entry when reversing a prepayment against an order that was later invoiced
As system admin role:
   Set Reverse Payment field from Payment In - Header tab

Compile the window and restart tomcat

As group admin role:
   Create a Sales Order
   Add a Payment in against it
   Post it (depending on the configuration you should post the financial account transaction or the reconciliation) and check customer prepayment account is used
   Create the related Sales Invoice
   Post it and check customer prepayment account is used and balanced
   Reverse the Payment In
   Post it and check customer prepayment account is used again
   Add a new Payment In
   Post it and check customer receivables account is used
   Both accounts get unbalanced
Check if the reverse payment is not considered a prepayment as the order is already invoiced the problem is solved.

Reverse payment should not be considered a prepayment as there is already an invoice book.

Correct posting should be:
- Order - no posting
- Pre-payment
121.00 (In transit account, for instance) DEBIT
121.00 (Customer Prepayment) CREDIT

- Invoice
121.00 (Customer Prepayment) DEBIT
100.00 (Product Revenue) CREDIT
21.00 (Tax Credit ) Credit

- Reverse payment (this is the one that need to be fixed, and do not be considered as prepayment, because there is already an invoice related booked, therefore for this one the value of is prepayment = no)
121.00 (Customer Balance) DEBIT
121.00 (In transit account, for instance) CREDIT

- Therefore new payment posting will be correct.
121.00 (In transit account, for instance) DEBIT
121.00 (Customer Balance) CREDIT
No tags attached.
Issue History
2018-09-11 16:46ngarciaNew Issue
2018-09-11 16:46ngarciaAssigned To => Triage Finance
2018-09-11 16:46ngarciaModules => Core
2018-09-11 16:46ngarciaResolution time => 1538431200
2018-09-11 16:46ngarciaTriggers an Emergency Pack => No
2018-09-11 17:20ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17619#r17619
2018-09-11 17:20ngarciaProposed Solution updated
2018-09-11 17:21ngarciaIssue Monitored: networkb
2018-09-11 17:23rafarodaIssue Monitored: rafaroda
2018-09-11 17:36SandrahuguetAssigned ToTriage Finance => markmm82
2018-09-11 22:30markmm82Statusnew => scheduled
2018-09-14 18:23markmm82Note Added: 0106788
2018-09-17 13:25psanjuanProposed Solution updated
2018-09-17 13:27psanjuanProposed Solution updated
2018-09-17 15:10markmm82Note Deleted: 0106788
2018-09-17 16:12markmm82Note Added: 0106808
2018-09-26 17:59hgbotCheckin
2018-09-26 17:59hgbotNote Added: 0107040
2018-09-26 17:59hgbotStatusscheduled => resolved
2018-09-26 17:59hgbotResolutionopen => fixed
2018-09-26 17:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/37eea9b878d6e7fcd0d9fbe67ac9ce5ab044f25d [^]
2018-09-26 18:00SandrahuguetReview Assigned To => Sandrahuguet
2018-09-26 18:00SandrahuguetNote Added: 0107041
2018-09-26 18:00SandrahuguetStatusresolved => closed
2018-09-26 18:00SandrahuguetFixed in Version => 3.0PR18Q4
2018-09-27 16:26hudsonbotCheckin
2018-09-27 16:26hudsonbotNote Added: 0107054

Notes
(0106808)
markmm82   
2018-09-17 16:12   
Test Plan:
As system admin role:
   Set displayed the Reverse Payment field from Payment In - Header tab

Compile the window and restart tomcat

As group admin role:
   Create a Sales Order for Alimentos y Supermercados bp.
   Add a Payment in against it
   Post it and check the posting looks like:
     - Pre-payment
     121.00 (In transit account, for instance) DEBIT
     121.00 (Customer Prepayment) CREDIT
   
   Create the related Sales Invoice.
   Post it and check customer prepayment account is used and balanced
     121.00 (Customer Prepayment) DEBIT
     100.00 (Product Revenue) CREDIT
     21.00 (Tax Credit ) Credit
      
   Reverse the Payment In
   Post it and check it is not considered a prepayment.
     121.00 (Customer Balance) DEBIT
     121.00 (In transit account, for instance) CREDIT

   Add a new Payment In
   Post it and check customer receivables account is used
     121.00 (In transit account, for instance) DEBIT
     121.00 (Customer Balance) CREDIT
   All accounts get balanced
(0107040)
hgbot   
2018-09-26 17:59   
Repository: erp/devel/pi
Changeset: 37eea9b878d6e7fcd0d9fbe67ac9ce5ab044f25d
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Sep 25 09:44:32 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/37eea9b878d6e7fcd0d9fbe67ac9ce5ab044f25d [^]

Fixes issue 39268: Wrong accounting entry when reversing a prepayment against an
order that was later invoiced

In those cases the reversed payment was considered as prepayment and it was wrong
as the order is invoiced. To fix it the reversed payment detail is set as it is not
a prepayment in this case.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0107041)
Sandrahuguet   
2018-09-26 18:00   
code review + testing OK
(0107054)
hudsonbot   
2018-09-27 16:26   
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/d8242c6b0bfe [^]
Maturity status: Test