Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034432Openbravo ERP09. Financial managementpublic2016-11-08 17:072017-06-08 17:12
maite 
collazoandy4 
urgentminoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
No
0034432: Accounting information should be grouped by invoice when posting payment/transaction/reconciliation
At the moment, accounting information is not properly grouped when posting a payment related with one invoice but several orders. Accounting info is split by order when it is not necessary and confusing for end user
1. Register Sales Order for any org and business partner using "immediate" invoice terms
2. Register another Sales Order for same org and business partner using "immediate" invoice terms
3. Register Sales invoice for same org and business partner. Run "create lines from" process and select previous orders. Process invoice
4. Run "Add payment" process to pay the invoice
5. Navigate to created payment and post it. Realize that "receivables" account is affected by invoice's total amount (which is correct) but if you navigate to "detail" (or check accounting information in Accounting tab) you will see 2 lines (each one per order's amount) instead of one line
No tags attached.
related to design defect 0019567 closed dmiguelez Openbravo ERP Not grouped Transaction accounting entry when order amount is higher than invoice amount 
blocks defect 0036124 closed nonofrancisco Modules Accounting information should be grouped by invoice when posting a remittance. 
Issue History
2016-11-08 17:07maiteNew Issue
2016-11-08 17:07maiteAssigned To => Triage Finance
2016-11-08 17:07maiteModules => Core
2016-11-08 17:07maiteResolution time => 1480374000
2016-11-08 17:07maiteTriggers an Emergency Pack => No
2016-11-08 17:08maiteRelationship addedrelated to 0019567
2016-11-08 18:38aferrazAssigned ToTriage Finance => markmm82
2016-11-10 17:19markmm82Statusnew => scheduled
2016-11-11 15:08markmm82Assigned Tomarkmm82 => alekosmp86
2016-11-16 21:35alekosmp86Note Added: 0091614
2016-11-16 21:39alekosmp86Note Edited: 0091614bug_revision_view_page.php?bugnote_id=0091614#r13789
2016-12-02 14:39maiteResolution time1480374000 => 1482966000
2016-12-02 14:39maiteSeveritymajor => minor
2016-12-20 20:02alekosmp86Note Edited: 0091614bug_revision_view_page.php?bugnote_id=0091614#r14091
2016-12-20 20:02hgbotCheckin
2016-12-20 20:02hgbotNote Added: 0092870
2016-12-20 20:02hgbotStatusscheduled => resolved
2016-12-20 20:02hgbotResolutionopen => fixed
2016-12-20 20:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/92ddb12457b27b4771c134c27b10a386782df912 [^]
2016-12-20 20:07markmm82Review Assigned To => markmm82
2016-12-20 20:07markmm82Note Added: 0092871
2016-12-20 20:07markmm82Statusresolved => closed
2016-12-20 20:07markmm82Fixed in Version => 3.0PR17Q1
2016-12-21 10:53aferrazStatusclosed => new
2016-12-21 10:53aferrazResolutionfixed => open
2016-12-21 10:53aferrazFixed in Version3.0PR17Q1 =>
2016-12-21 10:53aferrazStatusnew => scheduled
2016-12-21 11:04hgbotCheckin
2016-12-21 11:04hgbotNote Added: 0092896
2016-12-21 11:04aferrazNote Deleted: 0092871
2016-12-21 14:48hudsonbotCheckin
2016-12-21 14:48hudsonbotNote Added: 0092905
2016-12-21 20:51hudsonbotCheckin
2016-12-21 20:51hudsonbotNote Added: 0092924
2017-01-04 13:45psanjuanNote Added: 0093173
2017-01-04 14:21psanjuanNote Added: 0093174
2017-01-04 14:27psanjuanNote Edited: 0093174bug_revision_view_page.php?bugnote_id=0093174#r14209
2017-01-04 14:37psanjuanNote Edited: 0093174bug_revision_view_page.php?bugnote_id=0093174#r14210
2017-01-04 14:40psanjuanNote Added: 0093175
2017-01-04 14:42psanjuanNote Added: 0093176
2017-01-04 14:42psanjuanNote Added: 0093177
2017-01-04 14:43psanjuanNote Added: 0093178
2017-01-04 14:45psanjuanNote Edited: 0093177bug_revision_view_page.php?bugnote_id=0093177#r14212
2017-01-04 14:46psanjuanNote Edited: 0093178bug_revision_view_page.php?bugnote_id=0093178#r14214
2017-01-04 14:47psanjuanNote Added: 0093179
2017-01-04 14:48psanjuanNote Added: 0093180
2017-01-04 14:48psanjuanNote Added: 0093181
2017-01-04 14:49psanjuanNote Added: 0093182
2017-04-20 15:32collazoandy4Assigned Toalekosmp86 => collazoandy4
2017-05-29 12:39psanjuanNote Added: 0096851
2017-05-29 12:41psanjuanRelationship addedrelated to 0036124
2017-05-29 12:42psanjuanNote Edited: 0096851bug_revision_view_page.php?bugnote_id=0096851#r15231
2017-06-02 11:29hgbotCheckin
2017-06-02 11:29hgbotNote Added: 0097097
2017-06-02 11:29hgbotStatusscheduled => resolved
2017-06-02 11:29hgbotResolutionopen => fixed
2017-06-02 11:29hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/92ddb12457b27b4771c134c27b10a386782df912 [^] => http://code.openbravo.com/erp/devel/pi/rev/28835f34e4380877ef3c616065aeacb9af770d3f [^]
2017-06-02 11:29hgbotCheckin
2017-06-02 11:29hgbotNote Added: 0097098
2017-06-02 11:30aferrazReview Assigned Tomarkmm82 => aferraz
2017-06-02 11:30aferrazNote Added: 0097099
2017-06-02 11:30aferrazStatusresolved => closed
2017-06-02 11:30aferrazFixed in Version => 3.0PR17Q3
2017-06-08 17:12hudsonbotCheckin
2017-06-08 17:12hudsonbotNote Added: 0097235
2017-06-08 17:12hudsonbotCheckin
2017-06-08 17:12hudsonbotNote Added: 0097236
2017-06-19 16:38aferrazRelationship replacedblocks 0036124

Notes
(0091614)
alekosmp86   
2016-11-16 21:35   
(edited on: 2016-12-20 20:02)
Test Plan:

Go to Sales Order screen
   Create a new document:
      Org: F&B US Inc.
      BP: Sleep Well Hotels, Co.
      Invoice Terms: Inmediate
   Go to Lines tab and add a new one:
      Product: Ale Beer
      Quantity: 10
      Net Unit Price: 2.04
      Tax: Sales exempt
   Remove discounts if exists
   Run Book process
      Notice that Total Gross Amount = Total Net Amount = 20.40

   Create another sales order using the following configuration:
   Org: F&B US Inc.
      BP: Sleep Well Hotels, Co.
      Invoice Terms: Inmediate
   Go to Lines tab and add a new one:
      Product: Ale Beer
      Quantity: 20
      Net Unit Price: 2.04
      Tax: Sales exempt
   Remove discounts if exists
   Run Book process
      Notice that Total Gross Amount = Total Net Amount = 40.80

Go to Sales Invoice screen
   Create a new document
      BP: Sleep Well Hotels, Co.
   Run process "Create lines from" and select the orders created in the previous steps.
   Complete the invoice:
      Notice Total Gross Amount = Total Net Amount = 61.20 (20.40 + 40.80)
   Run Add Payment to pay the invoice, select the line with both orders and complete.

Go to Payment In screen and select the document generated from the previous step and post it.
    Check posting looks like:
    61.20 (It depends on the financial account configuration) DEBIT
    61.20 (1130 - Accounts Receivable) CREDIT
    Notice that the order's amounts has been grouped into a single line

Once the document is posted, you can go back to the created Payment In, move to Accounting tab and notice that the lines from the orders' amount has been merged, now showing the total amount instead of one line per order's amount = 61.20.

(0092870)
hgbot   
2016-12-20 20:02   
Repository: erp/devel/pi
Changeset: 92ddb12457b27b4771c134c27b10a386782df912
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Wed Nov 16 12:42:05 2016 -0600
URL: http://code.openbravo.com/erp/devel/pi/rev/92ddb12457b27b4771c134c27b10a386782df912 [^]

Fixes issue 34432: Accounting information is grouped by invoice when posting

Accounting information was not properly grouped when posting a payment related
with one invoice created from several orders. Accounting info was splitted by
order when this is not necessary and confusing for end user.

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
---
(0092896)
hgbot   
2016-12-21 11:04   
Repository: erp/devel/pi
Changeset: b6cf90d3df8986c5b174312fbb44d155cbe521c8
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Dec 21 10:52:39 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b6cf90d3df8986c5b174312fbb44d155cbe521c8 [^]

Related to issue 34432: Backout changeset 92ddb12457b2

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
---
(0092905)
hudsonbot   
2016-12-21 14:48   
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/3ac66db84fc1 [^]
Maturity status: Test
(0092924)
hudsonbot   
2016-12-21 20: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/abc21394bfb8 [^]
Maturity status: Test
(0093173)
psanjuan   
2017-01-04 13:45   
Issue verified.
(0093174)
psanjuan   
2017-01-04 14:21   
(edited on: 2017-01-04 14:37)
Test Case 1 - Two sales orders included in an invoice. Same amount. Invoice paid. Payment In posted.

Go to Business partner window, search Alimentos y Supermercados bp and change Invoice Terms to Inmediate. Remove Basic Discount.

Go to Financial Account window, select Cuenta de Banco financial account, and navigate to Payment Method tab. Select "Transferencia". In Section Payment In, make sure there is an account in "Upon Receipt Use". Save setup.

Go to Sales Order window and create a new one for F&B España, Alimentos y Supermercados business partner.

Go to lines and add a new one:
Product: Cerveza Ale 0.5L
Quantity: 5
Net Unit Price: 1
Tax: Ventas Exentas

Book the order.

Check that Total Gross Amount = Total Net Amount = 5.00

Create another sales order for F&B España, Alimentos y Supermercados business partner.

Go to lines and add a new one:
Product: Cerveza Ale 0.5L
Quantity: 30
Net Unit Price: 1
Tax: Ventas Exentas

Check that Total Gross Amount = Total Net Amount = 30.00

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

Check that Invoice Total Gross Amount = Total Net Amount = 35.00

Run Add Payment from the invoice to pay it. Press Done.

Go to Payment In screen and select the document generated from the previous step and post it.

Check posting looks like:
35.00 (In transit account) DEBIT
35.00 (43000 - Accounts Receivable) CREDIT

Click on "Details" - Check that same posting is shown, therefore accounts receivable entry lines have been group in just one line does not split by order but just invoice. (Description to be improved as before).

Repeat same test as above for:
- negative sales order
- positive and negative purchase orders

Test Case 2 - Two sales orders included in an invoice. Same amount. Invoice paid. FA Transaction posted.

Repeat same test as above for:
- negative sales order
- positive and negative purchase orders

Test Case 3 - Two sales orders included in an invoice. Same amount. Invoice paid. Reconciliation posted.

Repeat same test as above for:
- negative sales order
- positive and negative purchase orders.

(0093175)
psanjuan   
2017-01-04 14:40   
Test Case 4 - Two sales orders included in an invoice. Different amount (Increased). Invoice paid. Payment In posted.

Repeat same test as above for:
- negative sales order
- positive and negative purchase orders.
- FA transaction posted
- Reconciliation posted

Test Case 5 - Two sales orders included in an invoice. Different amount (Decreased). Invoice paid. Payment In posted.

Repeat same test as above for:
- negative sales order
- positive and negative purchase orders.
- FA transaction posted
- Reconciliation posted
(0093176)
psanjuan   
2017-01-04 14:42   
Test Case 6 - Two sales orders included in an invoice. Same Amount. Another two sales orders included in an invoice. Same Amount. Two invoices paid in the same payment. Payment In posted.

Repeat same test as above for:
- negative sales orders
- positive and negative purchase orders
- FA transaction posted
- Reconciliation posted
(0093177)
psanjuan   
2017-01-04 14:42   
(edited on: 2017-01-04 14:45)
Test Case 7 - Two sales orders included in an invoice. Different Amount (Increased). Another two sales orders included in an invoice. Different Amount (Increased). Two invoices paid in the same payment. Payment In posted.

Repeat same test as above for:
- negative sales orders
- positive and negative purchase orders
- FA transaction posted
- Reconciliation posted

(0093178)
psanjuan   
2017-01-04 14:43   
(edited on: 2017-01-04 14:46)
Test Case 8 - Two sales orders included in an invoice. Different Amount (Decreased). Another two sales orders included in an invoice. Different Amount (Decreased). Two invoices paid in the same payment. Payment In posted.

Repeat same test as above for:
- negative sales orders
- positive and negative purchase orders
- FA transaction posted
- Reconciliation posted

(0093179)
psanjuan   
2017-01-04 14:47   
Test Case 9 - Two prepaid orders included in an invoice. Same Amount. Invoice partially paid. Payment IN posted.

Repeat same test as above for:
- negative sales orders
- positive and negative purchase orders
- FA transaction posted
- Reconciliation posted
(0093180)
psanjuan   
2017-01-04 14:48   
Test Case 10 - Two prepaid orders included in an invoice. Different Amount (Increased). Invoice partially paid. Payment IN posted.

Repeat same test as above for:
- negative sales orders
- positive and negative purchase orders
- FA transaction posted
- Reconciliation posted
(0093181)
psanjuan   
2017-01-04 14:48   
Test Case 11 - Two prepaid orders included in an invoice. Different Amount (Decreased). Invoice partially paid. Payment IN posted.

Repeat same test as above for:
- negative sales orders
- positive and negative purchase orders
- FA transaction posted
- Reconciliation posted
(0093182)
psanjuan   
2017-01-04 14:49   
Additional test - Remittance payment posting.
(0096851)
psanjuan   
2017-05-29 12:39   
(edited on: 2017-05-29 12:42)
Test plan above verified and working.

New issue created for remittance module, as this one needs also to be modified.
See issue related: 36124

(0097097)
hgbot   
2017-06-02 11:29   
Repository: erp/devel/pi
Changeset: 28835f34e4380877ef3c616065aeacb9af770d3f
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue May 23 15:51:17 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/28835f34e4380877ef3c616065aeacb9af770d3f [^]

Fixes issue 34432: Accounting information not grouped by invoice when posting

Accounting information was not properly grouped when posting a payment related
with one invoice created from several orders. Accounting info was splitted by
order when this is not necessary and confusing for end user.

Now if there is a previous Payment Detail that belongs to the same Invoice, the amounts
are added.

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
M src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
---
(0097098)
hgbot   
2017-06-02 11:29   
Repository: erp/devel/pi
Changeset: 3c6074899262183666a9bc0864d70166bd31f72c
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jun 01 16:33:07 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3c6074899262183666a9bc0864d70166bd31f72c [^]

Related to issue 34432: Code review improvements

Use BigDecimal.ZERO instead of new BigDecimal(0) and BigDecimal.ONE instead of new BigDecimal(1).
Changed totalAmount = amount.add(totalAmount) with totalAmount = totalAmount.add(amount) which is more understandable.

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
M src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
---
(0097099)
aferraz   
2017-06-02 11:30   
Code review OK
(0097235)
hudsonbot   
2017-06-08 17:12   
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/fda0f16ab470 [^]
Maturity status: Test
(0097236)
hudsonbot   
2017-06-08 17:12   
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/fda0f16ab470 [^]
Maturity status: Test