Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029475Openbravo ERP09. Financial managementpublic2015-03-31 15:362015-06-11 18:02
psanjuan 
AtulOpenbravo 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
pi 
umartirena
Core
No
0029475: Cash VAT post it is not correct in case sales invoice is linked to sales order but with a lower price
Cash VAT post it is not correct in case sales invoice is linked to sales order but with a lower price
Configure F&B España as Cash VAT organization and make sure you do have applied Spanish Cash VAT tax rates.

Create a new business partner in F&B España.

Create a sales order for that BP for a quatity amount = 1 and price = 5.
Book the order.

Create a sales invoice for that BP by using "Create Lines from" feature. Select the order and change the price = 4.

Complete and post the invoice.

Temporary VAT posted is 0.84

Add a payment for that invoice for a later date.

Post the payment and realize that the Temporary VAT moved to Final VAT account is not 0.84 but 1.05 that is the corresponding amount of the Sales order price 5


Same applies in case of making opposite scenario that is a sales order with a price of 5 and a sales invoice with a price of 6. It always takes into account the VAT of the order and that should not be the case as it should be invoice VAT.
Temporary VAT moved to Final VAT account should be the one corresponding to the sales invoice amount/price that is 0.84

Below posting is the correct posting in case "no grouping" option is the one selected

Debit 1.05 € (4720)
Credit 0.21 € (4720)
Debit 0.21 € (4720T)
Credit 1.05 € (4720T)

As final posting should be:
Debit 0.84 € (4720)
Credit 0.84 € (4720T)
No tags attached.
related to defect 00274843.0PR14Q4 closed AtulOpenbravo Openbravo ERP Wrong cash vat lines when payment is automatically created and invoice's amount is higher that order's amount 
related to defect 0033508 closed markmm82 Openbravo ERP Cannot post a Cash VAT payment that pays more than one invoice, Process failed during execution error is shown 
blocks defect 0029703 closed vmromanos Modules Cash VAT post it is not correct in case sales invoice is linked to sales order but with a lower price 
Issue History
2015-03-31 15:36psanjuanNew Issue
2015-03-31 15:36psanjuanAssigned To => Sandrahuguet
2015-03-31 15:36psanjuanModules => Core
2015-03-31 15:36psanjuanTriggers an Emergency Pack => No
2015-03-31 15:36psanjuanRelationship addedrelated to 0027484
2015-03-31 15:43psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8155#r8155
2015-04-01 19:11psanjuanNote Added: 0076342
2015-04-01 19:11psanjuanNote Edited: 0076342bug_revision_view_page.php?bugnote_id=0076342#r8178
2015-04-01 19:43psanjuanNote Edited: 0076342bug_revision_view_page.php?bugnote_id=0076342#r8179
2015-04-14 11:16hgbotCheckin
2015-04-14 11:16hgbotNote Added: 0076513
2015-04-14 11:16hgbotStatusnew => resolved
2015-04-14 11:16hgbotResolutionopen => fixed
2015-04-14 11:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1251373257c76a1b9fb589f6b4139fbd23280a91 [^]
2015-04-14 13:08hgbotCheckin
2015-04-14 13:08hgbotNote Added: 0076522
2015-04-17 13:31umartirenaAssigned ToSandrahuguet => AtulOpenbravo
2015-04-17 13:31umartirenaStatusresolved => new
2015-04-17 13:31umartirenaResolutionfixed => open
2015-04-24 14:56hgbotCheckin
2015-04-24 14:56hgbotNote Added: 0076756
2015-04-24 14:56hgbotCheckin
2015-04-24 14:56hgbotNote Added: 0076757
2015-04-24 14:56hgbotStatusnew => resolved
2015-04-24 14:56hgbotResolutionopen => fixed
2015-04-24 14:56hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/1251373257c76a1b9fb589f6b4139fbd23280a91 [^] => http://code.openbravo.com/erp/devel/pi/rev/41ab0a941f5032995a4dc2cdef49cbeef8bd1e7d [^]
2015-04-27 10:26psanjuanProposed Solution updated
2015-04-27 13:00umartirenaReview Assigned To => umartirena
2015-04-27 13:00umartirenaNote Added: 0076781
2015-04-27 13:00umartirenaStatusresolved => closed
2015-04-27 13:00umartirenaFixed in Version => pi
2015-04-27 13:02umartirenaRelationship addedblocks 0029703
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077123
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077125
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077155
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077156
2015-06-11 18:02ngarciaIssue Monitored: ngarcia
2016-07-26 11:45aferrazRelationship addedrelated to 0033508

Notes
(0076342)
psanjuan   
2015-04-01 19:11   
(edited on: 2015-04-01 19:43)
Verified for both purchase/sales:
- order price same as invoice price
- order price lower than invoice price
- order price higher than invoice price
including just one order/invoice line and more than one

for payment/transaction/reconciliation posting, including remittance settle posting (single payment / no single payment/No grouping /Grouping by invoice).

All case Cash VAT moved from temporary account to final VAT account is correct.

(0076513)
hgbot   
2015-04-14 11:16   
Repository: erp/devel/pi
Changeset: 1251373257c76a1b9fb589f6b4139fbd23280a91
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Dec 01 15:47:20 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/1251373257c76a1b9fb589f6b4139fbd23280a91 [^]

Fixes Issue 29475: Cash VAT post it is not correct in case sales
invoice is linked to sales order but with a lower price

Problem is with Cash Vat Posting when payment schedule detail are merged
As there are differences in Sales Order and Sales Invoice Line prices
there are two payment detail associated and only one payment detail
was being used for cash vat posting as they were merged

---
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
M src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
---
(0076522)
hgbot   
2015-04-14 13:08   
Repository: erp/devel/pi
Changeset: c05d9da39c5822978ba76ed8d5b713a3e41d03fa
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Tue Apr 14 13:07:46 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c05d9da39c5822978ba76ed8d5b713a3e41d03fa [^]

Related to bug 29475: Backed out changeset 1251373257c7

Backed out because causes api-break.

---
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
M src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
---
(0076756)
hgbot   
2015-04-24 14:56   
Repository: erp/devel/pi
Changeset: a382e7ffe1c0d5a09acdba382b8abfb6881b87cb
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Apr 22 17:03:17 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a382e7ffe1c0d5a09acdba382b8abfb6881b87cb [^]

Related to issue 29475: Applied code format before doing any change

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
---
(0076757)
hgbot   
2015-04-24 14:56   
Repository: erp/devel/pi
Changeset: 41ab0a941f5032995a4dc2cdef49cbeef8bd1e7d
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Apr 22 18:09:19 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/41ab0a941f5032995a4dc2cdef49cbeef8bd1e7d [^]

Fixed bug 29475: Cash VAT post incorrect when invoice's price is lower than linked order

When the invoice's price is lower than the linked order's price, the system creates 2 payment details: the first one to pay the order, and another one with the difference.
In this case the accounting process for Payment/Transaction/Reconciliation merges both payment details. However the Cash VAT logic for posting wasn't aware of the merge, creating a wrong posting.

To fix it we first store the merged payment detail id done into the getPaymentDetailWriteOffAndAmount() method. In fact we have created a new getPaymentDetailWriteOffAndAmount() method that has a new parameter with the fieldProvider that represents the processed payment detail id. In this FieldProvider object we store the Merged Payment Detail Id.

The DocLineCashVATReady_PaymentTransactionReconciliation class is now able to receive more than one payment detail, and keep track of all the InvoiceTaxCashVAT_V records associated to these payment details. So we can now link several payment details into the same DocLineCashVATReady_PaymentTransactionReconciliation object, which is exactly what we need to support the extra "merged" payment detail id.

Finally, we ensure the DocLineCashVATReady_PaymentTransactionReconciliation.getInvoiceTaxCashVAT_V() now returns a list of unique InvoiceTaxCashVAT_V records, to avoid duplications in case the setInvoiceTaxCashVAT_V() method has been called several times for the same payment detail id.

---
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
M src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
---
(0076781)
umartirena   
2015-04-27 13:00   
Code Review + Testing OK
(0077123)
hudsonbot   
2015-05-07 22:16   
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/a1817f84bd8b [^]
Maturity status: Test
(0077125)
hudsonbot   
2015-05-07 22:16   
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/a1817f84bd8b [^]
Maturity status: Test
(0077155)
hudsonbot   
2015-05-07 22:16   
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/a1817f84bd8b [^]
Maturity status: Test
(0077156)
hudsonbot   
2015-05-07 22:16   
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/a1817f84bd8b [^]
Maturity status: Test