Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0015818 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
feature request | [Openbravo ERP] 07. Sales management | minor | always | 2011-01-31 09:56 | 2011-07-20 18:16 | |||||||
Reporter | egoitz | View Status | public | |||||||||
Assigned To | jonalegriaesarte | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | SCM revision | |||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0015818: The c_orderline_trg2 trigger should update the total of the header only if the line amount changes. | |||||||||||
Description | The c_orderline_trg2 trigger should update the total of the header only if the line amount changes. At the moment always is change so it can be a problem if you add some triggers on the c_order table. | |||||||||||
Steps To Reproduce | Add a new trigger in the c_order table that updates the c_bpartner_id of the lines when changing the partner of the header if order has not been completed. -Modify the partner of a order not completed. -The trigger developed is executed and an update on c_orderline is done -The c_orderline_trg2 trigger is executed and an update on the c_order is done -This produces to execute again the trigger developed, but this is blocked so you get an error. | |||||||||||
Proposed Solution | xecute the following order only when the amount of the line has been modifyied. UPDATE C_Order SET TotalLines = TotalLines - v_oldLine + v_newLineNetAmt, GrandTotal = TotalLines - v_oldLine + v_newLineNetAmt + COALESCE(v_taxAmt, 0) -- Updated = SysDate -- Don't update as otherwise it does not save changes WHERE C_Order_ID=old.C_Order_ID; For that you can add the following condition on the where clause of the update: AND (COALESCE(v_oldLine,0) <> COALESCE(v_newLineNetAmt,0) OR GrandTotal <> (TotalLines - v_oldLine + v_newLineNetAmt + COALESCE(v_taxAmt, 0))) | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
Issue History | |||
Date Modified | Username | Field | Change |
2011-01-31 09:56 | egoitz | New Issue | |
2011-01-31 09:56 | egoitz | Assigned To | => adrianromero |
2011-01-31 09:56 | egoitz | Modules | => Core |
2011-06-03 10:58 | dalsasua | Assigned To | adrianromero => dalsasua |
2011-07-20 18:16 | dalsasua | Assigned To | dalsasua => jonalegriaesarte |
Copyright © 2000 - 2009 MantisBT Group |