Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029073Openbravo ERP07. Sales managementpublic2015-02-26 11:292015-03-27 10:25
egoitz 
umartirena 
immediatemajoralways
closedfixed 
5
 
3.0PR15Q2 
eduardo_Argal
Core
No
0029073: Review deleting logic of tax lines in C_INVOICELINE_TRG2
When posting a Sales Invoice, logic for recreating the tax lines should be reviewed in order to modify existing ones instead of deleting and recreating them.
Using PG:
-Enable function statistics:
  -In postgresql.conf set track_functions = all
  -/etc/init.d/postgresql reload
-Create a sales invoice with one line
-Reset pg statistics: select pg_stat_reset();
-Book it
  * Check function calls: select funcname, calls, total_time, self_time from pg_stat_user_functions order by self_time desc
No tags attached.
related to defect 0027338 new dmiguelez Review deleting logic of tax lines in C_ORDERLINE_TRG2 
related to defect 0027160 closed eduardo_Argal C_Order_Post poor performance 
related to defect 0029431 closed umartirena It is not possible to delete an invoice line when using price including taxes 
Issue History
2015-02-26 11:29egoitzNew Issue
2015-02-26 11:29egoitzAssigned To => Sandrahuguet
2015-02-26 11:29egoitzModules => Core
2015-02-26 11:29egoitzResolution time => 1425337200
2015-02-26 11:29egoitzTriggers an Emergency Pack => No
2015-02-26 11:30egoitzRelationship addedrelated to 0027338
2015-02-26 11:50jpcalventeIssue Monitored: jpcalvente
2015-02-26 12:04egoitzTarget Version => 3.0PR15Q2
2015-02-27 11:25dmitry_mezentsevRelationship addedrelated to 0027160
2015-03-23 10:28eduardo_ArgalStatusnew => scheduled
2015-03-23 10:28eduardo_ArgalAssigned ToSandrahuguet => umartirena
2015-03-23 10:28hgbotCheckin
2015-03-23 10:28hgbotNote Added: 0075845
2015-03-23 10:28hgbotStatusscheduled => resolved
2015-03-23 10:28hgbotResolutionopen => fixed
2015-03-23 10:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/35a4e54c3ffc47aa4c1ee6507085032b6ac32ae6 [^]
2015-03-23 10:31eduardo_ArgalReview Assigned To => eduardo_Argal
2015-03-23 10:31eduardo_ArgalNote Added: 0075846
2015-03-23 10:31eduardo_ArgalStatusresolved => closed
2015-03-23 16:24hudsonbotCheckin
2015-03-23 16:24hudsonbotNote Added: 0075884
2015-03-27 10:25umartirenaRelationship addedrelated to 0029431

Notes
(0075845)
hgbot   
2015-03-23 10:28   
Repository: erp/devel/pi
Changeset: 35a4e54c3ffc47aa4c1ee6507085032b6ac32ae6
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Wed Mar 11 13:52:26 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/35a4e54c3ffc47aa4c1ee6507085032b6ac32ae6 [^]

Fixes bug 29073: InvoiceLine tax delete only is done when is needed

C_INVOICELINE_TRG2 has been changed to better manage when Invoice Line taxes are deleted and created again. Instead of doing it on every time an invoiceline is inserted or updated, it will be done when certain values in Invoice Line are changed and this affects in the related Invoice Line Tax record. The result will be the same, because with the previous code when there was no change in the Invoice Line the Invoice Line taxes were recreated with the same values as before, and now will be skipped.

Apart of this previous change, all not used variables have been removed, and in the same way a complete select sentence that was obtaining values that were not used later.

---
M src-db/database/model/triggers/C_INVOICELINE_TRG2.xml
---
(0075846)
eduardo_Argal   
2015-03-23 10:31   
Code Reviewed and tested.
Performance figures in testing (using 4000 lines invoice)

Before: 732696.439;
After: 88269.735;
(0075884)
hudsonbot   
2015-03-23 16:24   
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/b9d952133e76 [^]
Maturity status: Test