Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015818 | Openbravo ERP | 07. Sales management | public | 2011-01-31 09:56 | 2011-07-20 18:16 |
Reporter | egoitz | ||||
Assigned To | jonalegriaesarte | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
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))) | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
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 |
There are no notes attached to this issue. |