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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034992
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2017-01-18 11:292017-04-01 12:07
ReportermaiteView Statuspublic 
Assigned Tocollazoandy4 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revision321aa371a03d
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarkmm82
Web browser
ModulesAdvanced Payables and Receivables Mngmt
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034992: Payment Plan deleted when Voiding an invoice which is prepaid via sales order

DescriptionWhen an invoice related with a prepaid order is voided, payment plan info is deleted instead of creating a dummy payment

Moreover, in case prepaid amount is higher than invoice's amount POSTING error is found
Steps To Reproduce1. Register Sales Order and add line for any product, qty=3, price=50 and tax=exempt. Process order with a total amount of 150
2. Run "Add payment" process from sales order and register prepayment for total amount of 150
3. Register Sales Invoice for same org and BP. Run "Create lines from" process and select previous order. Edit line to only invoice qty=1 and process invoice with total amount of 50. Post invoice and realize that accounting entry is correct
4. Run "Void" process from this invoice. Navigate to payment plan info and realize that no record exists
5. Access to Reversed Invoice and realize that also no info is found in Payment Plan tab.
6. Additionally, try to post this reserved invoice and "Process failed during execution" will be received (or Suspense account will be used in case it is configured)
TagsNo tags attached.
Attached Files? file icon 34992.sql [^] (10,402 bytes) 2017-03-21 12:36

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00309713.0PR16Q1 closedaferraz When voiding an unpaid invoice, payment schedule details should be canceled instead of deleted 
causes defect 0036297 closedcollazoandy4 Wrong schedule details information when Voiding an invoice which is prepaid via sales order 

-  Notes
(0093983)
psanjuan (manager)
2017-02-01 12:17

Issue verified.
(0093986)
psanjuan (manager)
2017-02-01 13:20
edited on: 2017-02-09 12:58

Proposed Solution

Create a sales order for F&B España, Alimentos y Supermercados business partner.
Go to lines and select a product.
Enter Qty = 3, Net Unit Price = 50.00 and VAT = exempt 0%
Book the order and pay it. Check that Total Gross Amount = 150.00

Go to the payment in created and make sure that it has only one line with below
data:

Order number 10000237
Invoice empty
Invoiced Amount = Invoiced Amount = Received Amount = 150.00

Post it and verify that below posting is shown:
150.00 (5555) Partidas Pendientes Aplicación DEBIT
150.00 (4380) Anticipo de clientes CREDIT

Go to Sales Invoice window and create a new one for F&B España, Alimentos y Supermercados business partner. Use Create Lines From and select the order just created.

Go to lines and change Qty to 1. Complete the invoice.

Verify that:
- Payment Complete = Yes - this is OK
- Prepayment Amount = 150.00 - This is OK, but once the invoice is completed, it should changed to 50.00 because that is really the amount prepaid for the invoice.

Posting the invoice. Verify posting looks like the one below, which is OK.
50.00 (4380) Anticipo de clientes DEBIT
50.00 (7000) Venta de Mercaderias CREDIT

Write down sales invoice number, for instance 219. Void invoice 219.
Check that a reverse invoice has been created.

Verify that original invoice (invoice being voided 219) has below information:

- Payment Complete = Yes
- Prepayment Amount = 0.00

Go to Payment Plan tab and verify that it is not empty, because:

A "dummy" (zero) payment has been created for an amount = 0.00, including two lines, one line related to the invoice (+50.00) and the other one related to the reverse invoice (-50.00).

Payment Plan tab has below info:
Number of payments = 1
Expected Amount = 50.00
Received Amount = 50.00
Outstanding Amount = 0.00

Navigate to the reverse invoice for instance 10.

Verify that:
- Payment Complete = yes
- Prepayment Amount = 0.00

Add payment button is shown for the reverse invoice, while it should NOT be possible and in fact it is not possible to pay this reverse invoice anymore.
Payment button should not be there.

Navigate to Payment Plan tab of the reverse invoice. Verify it does have dummy payment related with below informaction:

Number of payments = 1
Expected Amount = -50.00
Received Amount = -50.00
Outstanding Amount = 0.00

Go the the original order, payment plan tab and verify that below information is shown:
Expected Amount = 150.00
Received Amount = 150.00
Outstanding Amount = 0.00

Go to Payment details and verify there is only one line with below info:

Expected Amount = 150.00
Received Amount = 150.00
Write-off Amount = 0.00


Post the reverse invoice and verify that below posting is shown:

100.00 (9040) Cuenta de Cuadre (suspense account) DEBIT
50.00 (7000) Venta de Mercaderias DEBIT
150.00 (4380) Anticipo de clientes CREDIT

This is NOT correct. Correct Posting is:

50.00 (7000) Venta de Mercaderias DEBIT
50.00 (4380) Anticipo de clientes CREDIT

(0094104)
collazoandy4 (reporter)
2017-02-06 21:51
edited on: 2017-02-07 14:04

Test Plan

Test Case 1

As F&B International Group Admin
 - Go to sales order and create a new record
    Busines partner: Alimentos y Supermercados business partner.
    Invoice terms: Inmediate

    Create a new line
      Product: Limonade
       Qty = 3
       Net Unit Price = 50.00
       Tax: Ventas exentas
     Remove the line in Basic Discount tab
    Book the order
    Add a payment and pay it
    Check that Total Gross Amount = 150.00

 - Go to Sales Invoice window and create a new record
    Busines partner: Alimentos y Supermercados
    Click on Create Lines From button and select the order just created.
    Edit the created line and change Qty to 1
    Complete the invoice
     Check that
      Payment Complete = Yes
      Prepaymetn Amount = 150.00
    Post the invoice
     Check in Account tab
       50.00 (4380) Anticipo de clientes DEBIT
       50.00 (7000) Venta de Mercaderias CREDIT
    Click on Reactivate button and select Void action and clic Ok button
     Check that
      - Payment Complete = Yes
      - Prepayment Amount = 0.00
      - Go to Payment Plan tab and verify it is empty
 - Go to the created reversed invoice
    Check that
     - Payment Complete = Yes
     - Payment Plan tab it is empty
    Post the reverse invoice
     Check that
      - 50.00 (7000) Venta de Mercaderias DEBIT
      - 50.00 (4380) Anticipo de clientes CREDIT

(0094123)
psanjuan (manager)
2017-02-07 13:35
edited on: 2017-02-09 12:41

Test Case 2

Repeat same test as above for a Purchase Order totally paid (as test case 1) and a Purchase Invoice being modified to 1 unit and then voided.


Test Case 3

Repeat same test as above for partially paid sales orders and purchase orders.

(0094753)
hgbot (developer)
2017-03-04 00:19

Repository: erp/devel/pi
Changeset: 321aa371a03d8177511afed5eb03c4792cfeaa39
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Wed Mar 01 10:45:48 2017 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/321aa371a03d8177511afed5eb03c4792cfeaa39 [^]

Fixes issue 34992: Voiding an invoice which is prepaid via sales order

When a prepaid invoice via sales order was voided the payment plan tab is empty,
the prepayment amount was wrong for both invoices and the created reversed invoice
paid state was also incorrect

Now a new method was created in ProcessInvoice to fix wrong data, the original and
reverse invoice prepayment amount it's 0, the reversal invoice is mark as paid,
also a dummy payment is created and processed for a 0 amount, including two lines,
one line related to the invoice (+50.00) and the other one related to the reverse
invoice (-50.00)

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
---
(0094754)
markmm82 (developer)
2017-03-04 00:21

Code review + Testing OK
(0095269)
hudsonbot (developer)
2017-03-15 20:21

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/54e102bef53e [^]
Maturity status: Test
(0095432)
markmm82 (developer)
2017-03-20 17:42

Code review + Testing OK
(0095565)
hgbot (developer)
2017-03-24 15:33

Repository: erp/devel/pi
Changeset: 41352442cc7ec6d2cc5f8327a8c825fdbfbf28d4
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Mar 23 11:33:43 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/41352442cc7ec6d2cc5f8327a8c825fdbfbf28d4 [^]

Related to issue 34992 and 34589: Code review improvements

Related to 34992: Taken into accounts invoices with negatives prepayments.
Replaced some loops by queries to improve the performance.

Related to 34589: Functionality covered by two loops to validate payment status
has been replaced by a query to improve the performance.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
---
(0095581)
hudsonbot (developer)
2017-03-25 01:51

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/a169bf5db5fd [^]
Maturity status: Test
(0095768)
hgbot (developer)
2017-03-31 13:22

Repository: erp/devel/pi
Changeset: 4690240411138ef7779f411988811cc31ecc2d3e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Mar 31 13:14:06 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4690240411138ef7779f411988811cc31ecc2d3e [^]

Related to issue 34589 & Related to issue 34992: Code review improvements

Use lowercase letter in hql to be more readable.
Use ids in where clauses instead of dal objects.
Change in clause with a join in psdQuery query to improve performance.
Use query.list() directly in for statement.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
---
(0095782)
hudsonbot (developer)
2017-04-01 12:07

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/44185ff76d75 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-01-18 11:29 maite New Issue
2017-01-18 11:29 maite Assigned To => Triage Finance
2017-01-18 11:29 maite Modules => Advanced Payables and Receivables Mngmt
2017-01-18 11:29 maite Resolution time => 1486508400
2017-01-18 11:29 maite Triggers an Emergency Pack => No
2017-01-18 11:30 maite Relationship added related to 0030971
2017-01-18 11:30 maite Issue Monitored: networkb
2017-01-18 21:15 markmm82 Assigned To Triage Finance => collazoandy4
2017-01-26 15:54 markmm82 Assigned To collazoandy4 => AtulOpenbravo
2017-01-26 16:13 collazoandy4 Assigned To AtulOpenbravo => collazoandy4
2017-01-26 16:21 collazoandy4 Status new => scheduled
2017-02-01 12:17 psanjuan Note Added: 0093983
2017-02-01 13:20 psanjuan Note Added: 0093986
2017-02-01 13:24 psanjuan Note Edited: 0093986 View Revisions
2017-02-01 13:35 psanjuan Note Edited: 0093986 View Revisions
2017-02-01 13:38 psanjuan Note Edited: 0093986 View Revisions
2017-02-01 13:44 psanjuan Note Edited: 0093986 View Revisions
2017-02-01 13:46 psanjuan Note Edited: 0093986 View Revisions
2017-02-06 21:51 collazoandy4 Note Added: 0094104
2017-02-07 13:35 psanjuan Note Added: 0094123
2017-02-07 13:59 psanjuan Note Edited: 0094123 View Revisions
2017-02-07 14:04 psanjuan Note Edited: 0094104 View Revisions
2017-02-07 14:06 psanjuan Note Edited: 0094123 View Revisions
2017-02-09 12:25 psanjuan Note Added: 0094173
2017-02-09 12:40 psanjuan Note Edited: 0094123 View Revisions
2017-02-09 12:41 psanjuan Note Edited: 0093986 View Revisions
2017-02-09 12:41 psanjuan Note Deleted: 0094173
2017-02-09 12:41 psanjuan Note Edited: 0094123 View Revisions
2017-02-09 12:44 psanjuan Note Edited: 0093986 View Revisions
2017-02-09 12:53 psanjuan Note Edited: 0093986 View Revisions
2017-02-09 12:58 psanjuan Note Edited: 0093986 View Revisions
2017-03-04 00:19 hgbot Checkin
2017-03-04 00:19 hgbot Note Added: 0094753
2017-03-04 00:19 hgbot Status scheduled => resolved
2017-03-04 00:19 hgbot Resolution open => fixed
2017-03-04 00:19 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/321aa371a03d8177511afed5eb03c4792cfeaa39 [^]
2017-03-04 00:21 markmm82 Review Assigned To => markmm82
2017-03-04 00:21 markmm82 Note Added: 0094754
2017-03-04 00:21 markmm82 Status resolved => closed
2017-03-04 00:21 markmm82 Fixed in Version => 3.0PR17Q2
2017-03-06 11:05 maite Status closed => new
2017-03-06 11:05 maite Resolution fixed => open
2017-03-06 11:05 maite Fixed in Version 3.0PR17Q2 =>
2017-03-15 20:21 hudsonbot Checkin
2017-03-15 20:21 hudsonbot Note Added: 0095269
2017-03-20 17:38 markmm82 Status new => scheduled
2017-03-20 17:41 markmm82 Status scheduled => resolved
2017-03-20 17:41 markmm82 Resolution open => fixed
2017-03-20 17:42 markmm82 Note Added: 0095432
2017-03-20 17:42 markmm82 Status resolved => closed
2017-03-20 17:42 markmm82 Fixed in Version => 3.0PR17Q2
2017-03-21 12:36 aferraz File Added: 34992.sql
2017-03-24 15:33 hgbot Checkin
2017-03-24 15:33 hgbot Note Added: 0095565
2017-03-25 01:51 hudsonbot Checkin
2017-03-25 01:51 hudsonbot Note Added: 0095581
2017-03-31 13:22 hgbot Checkin
2017-03-31 13:22 hgbot Note Added: 0095768
2017-04-01 12:07 hudsonbot Checkin
2017-04-01 12:07 hudsonbot Note Added: 0095782
2017-06-20 13:10 maite Relationship added causes 0036297


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker