Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014851Openbravo ERPZ. Otherspublic2010-10-11 13:102010-12-09 16:06
sureshbabu 
mirurita 
highmajoralways
closedfixed 
5
2.50 
 
Advanced Payables and Receivables Mngmt
No
0014851: Deposit document generted with wrong payment amount (not sure, please go through the steps to reproduce this issue)
System generates Deposit document with wrong payment amount as 348.80, when payment document is generated with below details
Amount : 500 euros
used credit : 10 euros
write off amount : 151.20 euros


For an invoice with amount: 661.20
Precondition: make available credit of 10 euros for Business partner: Red Bunny

1) create and complete a sales invoice for Bp: Red bunny for Invoice amount: 661.20

43000 (Dr) 661.20
70000 (Cr) 661.20

2) Create payment document using payment method having Automatic receipt: unchecked and automatic deposit: Checked. with below details

In header tab enter Amount:500, then click "Add payment details" button

In Add payment window,

Use Available credit: Check
And also select the above invoice details,

3) There will be difference of 151.20 euros, make it as write off amount by selecting "Write off" option and click "Process" button. payment document will get generated successfully. and click post button to post the Journal entries.

69400 (Dr) 151.20
43700 (Dr) 10.00
55500 (Dr) 500.00
43000 (Cr) 661.20





4) Once the payment is completed, a deposit document is generated automatically and navigate to Financial account || transactions tab to check the system generated deposit document details

Error: System wrongly generates deposit amount with amount 348.80 instead of 500 euros.

but when i post the document, i am getting the below journal entries

90400 (Dr) 151.20
57200 (Dr) 348.80
55500 (Cr) 500.00





 
No tags attached.
patch 14851.patch (1,894) 2010-10-13 07:14
https://issues.openbravo.com/file_download.php?file_id=3219&type=bug
Issue History
2010-10-11 13:10sureshbabuNew Issue
2010-10-11 13:10sureshbabuAssigned To => mirurita
2010-10-13 06:44eintelauIssue Monitored: eintelau
2010-10-13 06:53eintelauNote Added: 0031787
2010-10-13 07:14eintelauFile Added: 14851.patch
2010-10-13 07:15eintelauNote Added: 0031788
2010-10-13 17:53miruritaStatusnew => scheduled
2010-10-13 17:53miruritafix_in_branch => pi
2010-10-13 17:54hgbotCheckin
2010-10-13 17:54hgbotNote Added: 0031824
2010-10-13 17:54hgbotStatusscheduled => resolved
2010-10-13 17:54hgbotResolutionopen => fixed
2010-10-13 17:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.advpaymentmngt/rev/91f1797633def34673c1976c7326533132c1e049 [^]
2010-10-14 09:16sureshbabuNote Added: 0031844
2010-10-14 09:16sureshbabuStatusresolved => closed
2010-12-09 16:06anonymoussf_bug_id0 => 3133510

Notes
(0031787)
eintelau   
2010-10-13 06:53   
Hi,
I can confirm that the issue exists in our environment as well. We can reproduce without needing the credit component. i.e. just doing a deposit for less than the expected amount and writing off the difference.

The cause of the issue appears to be lines 107 to 113 in the TransactionsDao class. The transaction sets its deposit/payment amount equal to the amount of the associated FIN_Payment minus the writeoff amount the FIN_Payment. The problem is that the FIN_Payment.Amount value does not include the writeoff amount, so the transaction amount ends up being incorrect.

e.g. This is what should happen
Original Invoice = 1000
Receive Payment of 900 and write off 100
Invoice is marked as fully paid, Payment has amount=900, writoff =100
Deposit transaction is generated for 900 (the amount received)

What actually happens is that the deposit transaction is generated for 900 - 100 = 800.. less than the amount received. This leads to an unbalanced journal and an entry in the suspence balance account.
(0031788)
eintelau   
2010-10-13 07:15   
I've attached a patch that fixes the problem in our environment
(0031824)
hgbot   
2010-10-13 17:54   
Repository: erp/pmods/org.openbravo.advpaymentmngt
Changeset: 91f1797633def34673c1976c7326533132c1e049
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Wed Oct 13 17:54:25 2010 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.advpaymentmngt/rev/91f1797633def34673c1976c7326533132c1e049 [^]

Fixes issue 14851: Deposit document generted with wrong payment amount

---
M src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java
---
(0031844)
sureshbabu   
2010-10-14 09:16   
verified