Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021053Openbravo ERP07. Sales managementpublic2012-07-12 17:082012-07-13 11:57
mirurita 
mirurita 
urgentmajoralways
closedfixed 
5
pi 
3.0MP133.0MP13 
Core
No
0021053: C_INVOICELINE_TRG2: price including taxes logic not working in the trigger
Price including taxes functionality in C_INVOICELINE_TRG2 is not working properly when DELETE action is triggered.

v_istaxincluded variable is only initialized on INSERTING action

 IF INSERTING OR v_Insert THEN
   SELECT C_BPartner_ID, dateInvoiced, priceprecision, i.M_PriceList_ID,p.istaxincluded
    INTO v_BPartner_ID, v_DateInvoiced, v_Precision, v_PriceList_ID, v_istaxincluded
    ...

but then the variable is used inside DELETE action
CASE v_istaxincluded
                       WHEN 'Y' THEN grandtotal - v_oldgrossamt

this condition will never be satisfied because v_istaxincluded is NULL at this point.
1. Enter as F&B Internation Group Admin role
2. Go to Price List window
3. Edit "Tarifa de Ventas" record by marking it as Including Taxes
4. Go to Sales Invoice window
5. Create a new document for "Alimentos y Supermercados" business partner. Add a discount
6. Create a new line for "Agua sin gas 1L"
7. Book the order
8. Total gross amount is: 1.38
9. Reactivate the sales invoice. realize that the total gross amount is = 1.38
1. Assign value to v_istaxincluded also on DELETE action
2. Assign proper value to v_oldgrossamt
No tags attached.
Issue History
2012-07-12 17:08miruritaNew Issue
2012-07-12 17:08miruritaAssigned To => mirurita
2012-07-12 17:08miruritaModules => Core
2012-07-12 17:11hgbotCheckin
2012-07-12 17:11hgbotNote Added: 0050535
2012-07-12 17:11hgbotStatusnew => resolved
2012-07-12 17:11hgbotResolutionopen => fixed
2012-07-12 17:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/745fd4a939d1971b93a248ada1427b7fb07c5d30 [^]
2012-07-13 11:42psarobeSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=3630#r3630
2012-07-13 11:57psarobeNote Added: 0050551
2012-07-13 11:57psarobeStatusresolved => closed
2012-07-13 11:57psarobeFixed in Version => 3.0MP13

Notes
(0050535)
hgbot   
2012-07-12 17:11   
Repository: erp/devel/pi
Changeset: 745fd4a939d1971b93a248ada1427b7fb07c5d30
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Thu Jul 12 17:11:01 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/745fd4a939d1971b93a248ada1427b7fb07c5d30 [^]

Fixes issue 21053: C_INVOICELINE_TRG2: PIT logic not working

---
M src-db/database/model/triggers/C_INVOICELINE_TRG2.xml
---
(0050551)
psarobe   
2012-07-13 11:57   
works fine