Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0015818
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Openbravo ERP] 07. Sales managementminoralways2011-01-31 09:562011-07-20 18:16
ReporteregoitzView Statuspublic 
Assigned Tojonalegriaesarte 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0015818: The c_orderline_trg2 trigger should update the total of the header only if the line amount changes.

DescriptionThe 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 ReproduceAdd 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 Solutionxecute 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)))
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- 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
Powered by Mantis Bugtracker