Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0016845 | Openbravo ERP | 07. Sales management | public | 2011-04-19 10:28 | 2011-05-31 16:13 |
|
Reporter | AinhoaPagola | |
Assigned To | jonalegriaesarte | |
Priority | urgent | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | 2.50MP28 | |
Target Version | 2.50MP31 | Fixed in Version | 2.50MP31 | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | OBPS |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0016845: Invoice Total Amount not properly updated when lines are deleted |
Description | The invoice total amount is not properly updated when a line is deleted.
In an invoice with more than one line with the same tax amount, when a line is deleted the Total Amount of the header is not properly updated. |
Steps To Reproduce | With sampledata in Openbravo 2.50:
- Create a new header.
- Create a new line for a product. Set unit price to 100 and taxes 16%.
The header has total amount 116 (correct) and a line is created in the tax tab.
- Create a second line for a product. Set unit price to 100 and taxes to 16.
The header has total amount 232 (correct) and the line in the tax tab is updated to 32
- Delete a line.
The tax tab is properly updated. The header has a total amount of 132, instead of 116. That is, the line net amount is decreased from the total amount, but the taxes are not. |
Proposed Solution | This Bug only reproduces in Openbravo 2.50 PostgreSQL database.
The problem seem to be the order in which two triggers execute:
- C_invoiceline_trg2()
- C_invoicelinestax_trg() (this one should execute first).
|
Additional Information | |
Tags | No tags attached. |
Relationships | depends on | defect | 0017016 | | closed | jonalegriaesarte | Invoice Total Amount not properly updated when lines are deleted | has duplicate | defect | 0012296 | | closed | adrianromero | When removing a line for an Invoice, Total Net Amount and Total Gross Amount keep the old value | has duplicate | defect | 0017117 | 2.50MP30 | closed | adrianromero | When leaving an invoice without lines tax amount still appears in invoice header |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2011-04-19 10:28 | AinhoaPagola | New Issue | |
2011-04-19 10:28 | AinhoaPagola | Assigned To | => AinhoaPagola |
2011-04-19 10:28 | AinhoaPagola | Modules | => Core |
2011-04-19 10:28 | AinhoaPagola | OBNetwork customer | => No |
2011-04-19 10:41 | AinhoaPagola | OBNetwork customer | No => Yes |
2011-04-19 10:45 | AinhoaPagola | Relationship added | related to 0012296 |
2011-04-26 16:18 | dalsasua | Issue Monitored: networkb | |
2011-05-05 08:43 | AinhoaPagola | Status | new => scheduled |
2011-05-05 08:43 | AinhoaPagola | fix_in_branch | => pi |
2011-05-12 14:12 | AinhoaPagola | Relationship added | depends on 0017117 |
2011-05-12 14:12 | AinhoaPagola | Assigned To | AinhoaPagola => jonalegriaesarte |
2011-05-12 14:16 | AinhoaPagola | fix_in_branch | pi => |
2011-05-12 14:16 | AinhoaPagola | Proposed Solution updated | |
2011-05-25 11:42 | adrianromero | version | 2.50MP28 => 3.0RC7 |
2011-05-25 11:42 | adrianromero | Target Version | 2.50MP30 => |
2011-05-25 11:43 | adrianromero | version | 3.0RC7 => 2.50MP28 |
2011-05-25 11:43 | adrianromero | Target Version | => 2.50MP30 |
2011-05-25 11:43 | adrianromero | Type | defect => backport |
2011-05-25 16:44 | adrianromero | Note Added: 0037437 | |
2011-05-25 17:42 | adrianromero | Relationship replaced | has duplicate 0017117 |
2011-05-25 17:44 | adrianromero | Relationship replaced | has duplicate 0012296 |
2011-05-26 09:20 | adrianromero | Target Version | 2.50MP30 => 2.50MP31 |
2011-05-30 13:21 | hgbot | Checkin | |
2011-05-30 13:21 | hgbot | Note Added: 0037723 | |
2011-05-30 13:21 | hgbot | Status | scheduled => resolved |
2011-05-30 13:21 | hgbot | Resolution | open => fixed |
2011-05-30 13:21 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/stable/2.50/rev/255e4e40f94f3a9da49bed0eda2f75a5c1447684 [^] |
2011-05-30 13:21 | hgbot | Checkin | |
2011-05-30 13:21 | hgbot | Note Added: 0037726 | |
2011-05-30 13:21 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/stable/2.50/rev/255e4e40f94f3a9da49bed0eda2f75a5c1447684 [^] => http://code.openbravo.com/erp/stable/2.50/rev/e4fade7cc09c96f53f5b1c78e04bd70e5b76a861 [^] |
2011-05-30 13:22 | hgbot | Checkin | |
2011-05-30 13:22 | hgbot | Note Added: 0037727 | |
2011-05-30 13:32 | adrianromero | Note Added: 0037729 | |
2011-05-31 16:13 | maite | Note Added: 0037832 | |
2011-05-31 16:13 | maite | Status | resolved => closed |
2011-05-31 16:13 | maite | Fixed in Version | => 2.50MP31 |
Notes |
|
|
This issue can be reproduced in Orders and Invoices, for both types: Purchases and Sales
This issue can be reproduced only in PosgreSQL and not in Oracle because in posgresql the trigger in line taxes is executed after the trigger in lines when line taxes are deleted because of the ON DELETE CASCADE option on the line taxes table.
In Oracle the behavior is exactly the opposite and makes the logic work as expected.
The proposed solution is to remove the ON DELETE CASCADE option on the line taxes table and simulate this option in an ON BEFORE trigger in the table lines. |
|
|
(0037723)
|
hgbot
|
2011-05-30 13:21
|
|
Repository: erp/stable/2.50
Changeset: 255e4e40f94f3a9da49bed0eda2f75a5c1447684
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Wed May 25 17:34:14 2011 +0200
URL: http://code.openbravo.com/erp/stable/2.50/rev/255e4e40f94f3a9da49bed0eda2f75a5c1447684 [^]
Fixes issue 0016845: Invoice Total Amount not properly updated when lines are deleted
To execute the triggers in the correct order in postgresql it has been removed the ON DELETE CASCADE option and has been replaced simulating exactly the same logic in the related trigger
---
M src-db/database/model/tables/C_INVOICELINETAX.xml
M src-db/database/model/tables/C_ORDERLINETAX.xml
M src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
---
|
|
|
(0037726)
|
hgbot
|
2011-05-30 13:21
|
|
Repository: erp/stable/2.50
Changeset: e4fade7cc09c96f53f5b1c78e04bd70e5b76a861
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon May 30 13:11:43 2011 +0200
URL: http://code.openbravo.com/erp/stable/2.50/rev/e4fade7cc09c96f53f5b1c78e04bd70e5b76a861 [^]
Fixes issue 0016845: Invoice Total Amount not properly updated when lines are deleted
Adding comments in triggers code
---
M src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml
M src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
---
|
|
|
(0037727)
|
hgbot
|
2011-05-30 13:22
|
|
Repository: erp/stable/api-checks-2.50
Changeset: 9e20363c3c8e470ef43936be77eba563c8f57e0b
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon May 30 13:19:33 2011 +0200
URL: http://code.openbravo.com/erp/stable/api-checks-2.50/rev/9e20363c3c8e470ef43936be77eba563c8f57e0b [^]
False positive. The delete is done in triggers instead of foreign key to force trigger execution. It is changed in issue 0016845: Invoice Total Amount not properly updated when lines are deleted
---
M model/model/tables/C_INVOICELINETAX.xml
M model/model/tables/C_ORDERLINETAX.xml
---
|
|
|
|
* Testing the issue
Kindly follow the steps to test and verify that now the total amount in the header shows the correct value after deleting a line. This must be verified in Orders and Invoices and in Purchases and Sales
Verify also that duplicated issues 12296 and 17117 are also fixed
Because of the changes in triggers, it must also be verified that records can be deleted in invoices and order lines without any issue.
* Other areas affected
No other areas affected appart from the tables involved |
|
|
(0037832)
|
maite
|
2011-05-31 16:13
|
|
|