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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043380
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] Remittancemajoralways2020-03-02 11:442020-03-13 09:15
Reportersanti_lozanoView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionc4ade9832d94
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned Todmiguelez
Regression introduced in release
Summary

0043380: Remittance of a payment out using credit gets unbalance and posts on Suspense Balancing account

DescriptionIf you try to create a remittance for a payment that is using credit, the post is using a suspense balancing account. It happens because it seems that there is no code to add the payment line related to the credit, then it manages it as an unbalance. Notice that the payment out can be posted correctly
Steps To Reproduce:::: REPRODUCE ::::

* Download an Openbravo tip instance locally
* Go to module management and install modules: “Remittances infrastructure” and “SEPA Credit Transfer Customer-to-Bank” (rebuild the application)
* With role F&B International Group Admin go to window Enterprise module management, select both installed modules, then click OK
* Go to General Ledger Configuration window, select F&B International Group US/A/US Dollar, go to Active Tables tab. Set tables REM_Remittance, REM_RemittanceLine_Cancel and REM_RemittanceLine_Return as active
* Go to window Remittance Type, select SEPA Credit Transfer Customer-to-Bank (pain.001.001.003), go to Accounting tab. Create a new one: Organization = *, General Ledger = F&B International Group US/A/US Dollar, Settlement Account = 8052, Sent Account = 4920
* Go to Financial Account window, select Bank – Account 1, go to Payment Method tab. Add payment method SEPA Credit Transfer Customer-to-Bank with Payment Out Allowed
* Go to Purchase Order, create a new one: Organization = F&B US East Coast, Business Partner = Be Soft Drinker, Inc., Payment Method = SEPA Credit Transfer Customer-to-Bank. On Lines tab add one with: Product = Cola, Ordered Quantity = 20 (Total Net Amount should be 11.00 as Net Unit Price is 0.55)
* Book the Purchase Order
* Go to Payment Out window, create a new one: Organization = F&B US East Coast, Business Partner = Be Soft Drinker, Inc., Generated Credit = 5. Click on button Add Details, then on Done (without selecting anything, Description should be updated “Amount left as credit: 5”)
* Go back to the Purchase Order, refresh the window. Click on button Add Payment, select the credit line created on Credit To Use section, Action Regarding Document = Process Made Payment(s), then click on Done (a message will show the Document No. of the new payment that has been created)
* Go to Remittance window, create a new one: Organization = F&B US East Coast, Remittance Type = SEPA Credit Transfer Customer-to-Bank (pain.001.001.003), Financial Account = Bank – Account 1 – USD, Name = Test 001
* Click on button Select Payments, then on Done
* Click on button Process, then OK
* Click on Post button. A window with the posting has been opened (Journal Entries Report), notice that the Debit is using the Suspense Balancing account (account 9999 configured at window General Ledger Configuration, tab General Accounts)
* Go to window Settle / Protest Remittances, select the created one, add Accounting Date for today, click on Settle. Go to Remittance window tab Settled, click on button Post. Notice that here is also using the Suspense Balancing Accounting

:::: DEBUG ::::

1) Once here you could stop eclipse and run it again with the following breakpoints
AcctServer.java line 1168
m_fact[index] = createFact(m_as[index], conn, con, vars);
AcctServer.java line 1206
m_fact[index].balanceSource(conn);
2) You can run Eclipse on debug mode, go to Remittance window, tab Settled, click on Unpost, select Delete accounting entry then OK
3) Now click on Post again, click on F8 to go to the second breakpoint, click on F5 to enter to the second breakpoint method. Here (Fact.java) on line 466, 471, 476, adds a new line (variables: this > m_lines) with the Suspense Balancing account, as the previous lines were not balanced because the credit line was missing
4) Click on F8 to end it. Repeat process 2 to go to the first breakpoint. Step Into it now (F5), here (DOCREMRemittanceCancel.java) the lines (variables: fact > m_lines) are added, on line 174, 257, notice that the credit line is not added (there is no code for it) then it happens the unbalance seen before (step 3)
5) More comments on this:
5.1) notice that if there exists multicurrency the line that adds the Suspense Balance account is on DOCREMRemittanceCancel.java (from line 270)
5.2) notice that we are working with settled remittances here, if we were working with other types the java class could be DOCREMRemittance.java or other

:::: MORE ::::

* you can see that the payment out can be posted correctly
* on Financial Account window, select Bank – Account 1, tab Payment Method and the SEPA Credit Transfer Customer-to-Bank, set Upon Payment Use = In Transit Payment Account
* go to the Payment Out window and post it
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0118234)
santi_lozano (developer)
2020-03-02 11:49

It has been reproduced on tip version of Openbravo and also on 19Q3.4 which is the latest Openbravo Confirmed Stable (CS) version (customer has 19Q3.2)
(0118524)
AtulOpenbravo (developer)
2020-03-11 17:03
edited on: 2020-03-12 16:08

Test Plan

1. Install Remittance module and using Enterprise Module Management apply dataset for F&B US Inc organization.
2. Navigate to Account Tree. Select record with name "F&B International Group Account Account"
3. In Element Value tab create two records
  Search Key - Name
  1145 - Remittance Sent
  1155 - Remittance Settled
4. Navigate to Remittance Type window, select record wih name "Printable Remittance"
5. In Accounting Tab add record for General Ledger "F&B International Group US/A/US Dollar"
  Settlement Account - 1145 - Remittance Sent
  Sent Account - 1155 - Remittance Settled
6. Navigate to Financial Account window, select Bank - Account 1's Payment Method Tab.
7. Add record for Payment Method Remittance.
  Make sure for both Payment In and Payment Out, Execution Type: Automatic, Execution Process = In Remittance, Deffered = Yes.
8. Navigate to Purchase Invoice, create invoice for business partner "Be Soft Drinker, Inc." in "F&B US Inc" Organization
with payment method "Remittance", Payment Terms: Immediate.
  In line tab, select
        Product - Cherry Cola
        Quantity - 20
        Price - 0.55
        Tax - Sales Exempt
  Book the Invoice. Realize that Purchase Invoice Total Gross Amount is 11.00
9. Navigate to Purchase Invoice, create invoice for business partner "Be Soft Drinker, Inc." in "F&B US Inc" Organization
with payment method "Remittance", Payment Terms: Immediate.
  In line tab, select
        Product - Cherry Cola
        Quantity - 20
        Price - 0.55
        Tax - Sales Exempt
  Book the Invoice. Realize that Purchase Invoice Total Gross Amount is 11.00
10. Navigate to Payment Out window, create a Prepayment of Amount 5.00 for business partner "Be Soft Drinker, Inc." in "F&B US Inc" Organization
11. Go back to Purchase Invoice for business partner "Be Soft Drinker, Inc." and select any invoice with amount 11.00, click on Add Payment
12. In Invoices/Orders section , select both invoice for the business partner "Be Soft Drinker, Inc." of Amount 11.00 each.
13. In Credit To Use section, select Prepayment of Amount 5.00, process the selection, this creates a Payment Out.
14. Navigate to created Payment Out, realize that Actual Amount for Payment Out is set as 17.00, Used Credit is set as 5.00 and has status Awaiting Execution.
15. Navigate to Purchase Invoice, create invoice for business partner "Fruit & Bio is Life, Inc., Inc." in "F&B US Inc" Organization,
with payment method "Remittance", Payment Terms: Immediate.
  In line tab, select
        Product - Pineapple
        Quantity - 40
        Price - 0.55
        Tax - Sales Exempt
  Book the Invoice. Realize that Purchase Invoice Total Gross Amount is 22.00
16. Navigate to Purchase Invoice, create invoice for business partner "Fruit & Bio is Life, Inc., Inc." in "F&B US Inc" Organization,
with payment method "Remittance", Payment Terms: Immediate.
  In line tab, select
        Product - Pineapple
        Quantity - 20
        Price - 0.55
        Tax - Sales Exempt
  Book the Invoice. Realize that Purchase Invoice Total Gross Amount is 11.00
17. Navigate to Purchase Invoice, create invoice for business partner "Fruit & Bio is Life, Inc., Inc." in "F&B US Inc" Organization,
with payment method "Remittance", , Payment Terms: Immediate.
  In line tab, select
        Product - Pineapple
        Quantity - 10
        Price - 0.55
        Tax - Sales Exempt
  Book the Invoice. Realize that Purchase Invoice Total Gross Amount is 5.50
18. Navigate to Payment Out window, create a Prepayment of Amount 5.00 for business partner "Fruit & Bio is Life, Inc., Inc." in "F&B US Inc" Organization
19. Create another Prepayment of Amount 5.00 for business partner "Fruit & Bio is Life, Inc., Inc." in "F&B US Inc" Organization
20. Navigate to Purchase Invoice for business partner "Fruit & Bio is Life, Inc., Inc." in "F&B US Inc" Organization with Amount 22.00
21. Click on Add Payment and select all the three invoices for partner with amounts 22.00, 11.00 & 5.50 in Invoice/Orders section.
22. In Credit to Use section, select both the prepayment of amount 5.00 each, process the selection, this creates a Payment Out.
23. Navigate to payment out, realize that Used Credit is set as 10.00, Amount is set as 28.50 and has Awaiting Execution status.
24. Navigate to Remittance window, create a new record for Remittance Type: "Printable Remittance", Financial Account : Bank - Account 1
Transaction Date = Expected Date = Today's Date, Name: Test 43380, save record.
25. Click on Select Payments created in Step 13 and Step 22
26. Process the Remittance, Post it, Realize that Posting is as below:

Journal Entries Report

Debitx 60.50 - 2110 Accounts Payables
Credit 45.50 - 1145 Remittance Sent
Credit 15.00 - 1410 Vendor prepayment

Journal Entries Detail Report

Debit Amount

2110 Accounts Payables 11.00 1000003 # Be Soft Drinker, Inc.
2110 Accounts Payables 11.00 1000003 # Be Soft Drinker, Inc.
2110 Accounts Payables 22.00 1000003 # Fruit & Bio is Life, Inc.
2110 Accounts Payables 05.50 1000003 # Fruit & Bio is Life, Inc.
2110 Accounts Payables 11.00 1000003 # Fruit & Bio is Life, Inc.

Credit Amount

1410 Vendor prepayment 05.00 1000003 # Be Soft Drinker, Inc.
1410 Vendor prepayment 10.00 1000003 # Fruit & Bio is Life, Inc.
1145 Remittance Sent 07.66 1000003 # Fruit & Bio is Life, Inc.
1145 Remittance Sent 08.50 1000003 # Be Soft Drinker, Inc.
1145 Remittance Sent 18.67 1000003 # Fruit & Bio is Life, Inc.
1145 Remittance Sent 02.17 1000003 # Fruit & Bio is Life, Inc.
1145 Remittance Sent 08.50 1000003 # Be Soft Drinker, Inc.

Check the below:
Prepayment Amount 5.00 for Be Soft Drinker, Inc. is split into two parts
11.00 - 2.50 = 8.50
11.00 - 2.50 = 8.50

Prepayment Amount 10.00 for Fruit & Bio is Life, Inc. is split into three parts
22.00 - 3.33 = 18.67
11.00 - 3.34 = 07.66
05.50 - 3.33 = 02.17

27. Navigate to Settle / Protest Remittances window.
    Apply filter Organization: F&B US Inc
    Select record for Business Partner "Fruit & Bio is Life, Inc"
    Enter Today's date, click Settle

28. Navigate to Remittance window, select record created in Step 24, In select record in Settle Tab and Post.

**Journal Entries Report

Debitx 28.50 1145-Remittance Sent
Credit 28.50 1155-Remittance Settled

**Journal Entries Detail Report

Debitx 18.67 1145-Remittance Sent-1000709 # Fruit & Bio is Life, Inc.
Debitx 02.17 1145-Remittance Sent-1000709 # Fruit & Bio is Life, Inc.
Debitx 07.66 1145-Remittance Sent-1000709 # Fruit & Bio is Life, Inc.
Credit 28.50 1155-Remittance Settled-1000709 # Fruit & Bio is Life, Inc.


29. Settle / Protest Remittances window.
    Apply filter Organization: F&B US Inc
    Select record for Business Partner "Be Soft Drinker, Inc"
    Enter Today's date, Click Protest

30. Navigate to Remittance window, select record created in Step 24, In select record in Protest Tab and Post.

**Journal Entries Report

Debitx 17.00 1145-Remittance Sent
Debitx 05.00 1410-Vendor prepayment
Credit 22.00 2110-Accounts Payables

**Journal Entries Detail Report

Debitx 05.00 1410-Vendor prepayment-1000708 # Be Soft Drinker, Inc.
Debitx 08.50 1145-Remittance Sent-1000708 # Be Soft Drinker, Inc.
Debitx 08.50 1145-Remittance Sent-1000708 # Be Soft Drinker, Inc.
Credit 11.00 2110-Accounts Payables-1000708 # Be Soft Drinker, Inc.
Credit 11.00 2110-Accounts Payables-1000708 # Be Soft Drinker, Inc.

(0118573)
hgbot (developer)
2020-03-13 09:09

Repository: erp/devel/pi
Changeset: 5214fb3a858dfcce76d38e5a420e494a8741b58d
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Mar 11 14:11:54 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/5214fb3a858dfcce76d38e5a420e494a8741b58d [^]

Related to BUG-43380:Remittance of a payment out using
credit gets unbalance and posts on Suspense Balancing
account

**Add field to store AmountExcludingCredit used in payment
**Add getter and setter method for AmountExcludingCredit
**Calculate the AmountExcludingCredit for each payment detail
linked with payment, proportionate used credit per
payment detail is separated from each payment detail
amount, in the last payment detail rounding amount
is adjusted.

---
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
M src/org/openbravo/erpCommon/ad_forms/DocLine_FINPayment.java
---
(0118574)
hgbot (developer)
2020-03-13 09:09

Repository: erp/devel/pi
Changeset: c65f62b9ff010cbecde568f8f3fa84063da1600f
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Mar 13 09:08:23 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c65f62b9ff010cbecde568f8f3fa84063da1600f [^]

Related to BUG-43380: Code Review changes.

Added final modifiers to variables

---
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
---
(0118575)
hgbot (developer)
2020-03-13 09:09

Repository: erp/mods/org.openbravo.module.remittance
Changeset: 5f63c2d4f4038920163a4b5cdafbdbd267b2dd47
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Mar 11 22:06:31 2020 +0530
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/5f63c2d4f4038920163a4b5cdafbdbd267b2dd47 [^]

Related to BUG-43380:Apply java formatting

---
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittance.java
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittanceCancel.java
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittanceReturn.java
---
(0118576)
hgbot (developer)
2020-03-13 09:09

Repository: erp/mods/org.openbravo.module.remittance
Changeset: c4ade9832d949a7f69edd8e2c9a1e13481a70efa
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Mar 11 22:04:45 2020 +0530
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/c4ade9832d949a7f69edd8e2c9a1e13481a70efa [^]

Fixes BUG-43380:Remittance of a payment out using credit
gets unbalance and posts on Suspense Balancing account

**Add field to store AmountExcludingCredit used in payment
**Add getter and setter method for AmountExcludingCredit
**Calculate the AmountExcludingCredit for each payment detail
linked with payment, proportionate used credit per
payment detail is separated from each payment detail
amount, in the last payment detail rounding amount
is adjusted.
**Use AmountExcludingCredit as lineAmount for posting

---
M src/org/openbravo/module/remittance/ad_forms/DocLine_REMRemittance.java
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittance.java
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittanceCancel.java
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittanceReturn.java
---
(0118577)
hgbot (developer)
2020-03-13 09:09

Repository: erp/mods/org.openbravo.module.remittance
Changeset: d6f08ee2817cfba47f9ec19ad0ab0d15a67358b0
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Mar 13 09:08:48 2020 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/d6f08ee2817cfba47f9ec19ad0ab0d15a67358b0 [^]

Related to BUG-43380: Code Review changes

Added final modifiers to variables

---
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittance.java
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittanceReturn.java
---
(0118578)
dmiguelez (developer)
2020-03-13 09:15

Code Review + Testing Ok

- Issue History
Date Modified Username Field Change
2020-03-02 11:44 santi_lozano New Issue
2020-03-02 11:44 santi_lozano Assigned To => Triage Finance
2020-03-02 11:44 santi_lozano Resolution time => 1584918000
2020-03-02 11:46 santi_lozano Steps to Reproduce Updated View Revisions
2020-03-02 11:49 santi_lozano Note Added: 0118234
2020-03-02 12:37 Practics Issue Monitored: Practics
2020-03-02 13:26 dmiguelez Assigned To Triage Finance => AtulOpenbravo
2020-03-05 06:40 AtulOpenbravo Status new => scheduled
2020-03-11 17:03 AtulOpenbravo Note Added: 0118524
2020-03-11 17:04 AtulOpenbravo Note Edited: 0118524 View Revisions
2020-03-12 16:08 dmiguelez Note Edited: 0118524 View Revisions
2020-03-13 09:09 hgbot Checkin
2020-03-13 09:09 hgbot Note Added: 0118573
2020-03-13 09:09 hgbot Checkin
2020-03-13 09:09 hgbot Note Added: 0118574
2020-03-13 09:09 hgbot Checkin
2020-03-13 09:09 hgbot Note Added: 0118575
2020-03-13 09:09 hgbot Checkin
2020-03-13 09:09 hgbot Note Added: 0118576
2020-03-13 09:09 hgbot Status scheduled => resolved
2020-03-13 09:09 hgbot Resolution open => fixed
2020-03-13 09:09 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/c4ade9832d949a7f69edd8e2c9a1e13481a70efa [^]
2020-03-13 09:09 hgbot Checkin
2020-03-13 09:09 hgbot Note Added: 0118577
2020-03-13 09:15 dmiguelez Review Assigned To => dmiguelez
2020-03-13 09:15 dmiguelez Note Added: 0118578
2020-03-13 09:15 dmiguelez Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker