Openbravo Issue Tracking System - Retail Modules
View Issue Details
0032461Retail ModulesDiscounts and Promotionspublic2016-03-11 12:312016-03-18 15:29
malsasua 
jorge-garcia 
immediatemajoralways
closedfixed 
20Community Appliance
pi 
RR16Q2 
marvintm
No
0032461: Database discounts functions are wrong defined: exception are not managed
The database discounts functions (for example: https://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/file/1ab09dd431c2/src-db/database/model/functions/OBDISC_XY_GIFT.xml [^]) are not managing the exceptions
- Launch a Oracle instance
  1) Go to ERP
  2) Navigate to window Discounts and Promotions
  3) Select record Big Lantern -> gift small one, and go to Product tab
  4) Uncheck Gift Product checkbox from Torch mini record and save it
  5) Go to Sales Order window
  6) Create a sale with lines:
   --> Line 1: Basecamp lantern, qty 1
   --> Line 2: Torch mini, qty 1
  7) Save the sales order and tap Book button
  8) Select book, and click button OK.
  9) Check a "no data found" error is raised.

- Try steps 1 to 8 in a postgres instance and check that in step 9, no error is raised.
code of type:

EXCEPTION
WHEN OTHERS THEN
  v_ResultStr:= '@ERROR=' || SQLERRM;
  RAISE NOTICE '%',v_ResultStr ;
  -- ROLLBACK;
  IF(p_PInstance_ID IS NOT NULL) THEN
    PERFORM AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
  END IF;
-- RAISE EXCEPTION '%', v_ResultStr ; --OBTG:-20100--


should be added to the function

It is needed to review also other functions on the module.
No tags attached.
diff buyXgiftYfix.diff (700) 2016-03-16 15:49
https://issues.openbravo.com/file_download.php?file_id=9175&type=bug
Issue History
2016-03-11 12:31malsasuaNew Issue
2016-03-11 12:31malsasuaAssigned To => Retail
2016-03-11 12:31malsasuaTriggers an Emergency Pack => No
2016-03-11 13:00egoitzResolution time => 1427839200
2016-03-11 13:00egoitzSeverityminor => major
2016-03-11 13:00egoitzProposed Solution updated
2016-03-11 14:00OrekariaStatusnew => acknowledged
2016-03-14 15:54marvintmResolution time1427839200 => 1459461600
2016-03-15 08:55egoitzResolution time1459461600 => 1458169200
2016-03-15 08:55egoitzPriorityhigh => immediate
2016-03-15 11:07jorge-garciaStatusacknowledged => scheduled
2016-03-15 11:07jorge-garciaAssigned ToRetail => jorge-garcia
2016-03-15 17:41jorge-garciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11450#r11450
2016-03-16 15:49jorge-garciaFile Added: buyXgiftYfix.diff
2016-03-18 11:52hgbotCheckin
2016-03-18 11:52hgbotNote Added: 0085222
2016-03-18 11:52hgbotStatusscheduled => resolved
2016-03-18 11:52hgbotResolutionopen => fixed
2016-03-18 11:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/41e788c55a5a011d69369812c9fa10bf4e23522b [^]
2016-03-18 15:29marvintmReview Assigned To => marvintm
2016-03-18 15:29marvintmStatusresolved => closed
2016-03-18 15:29marvintmFixed in Version => RR16Q2

Notes
(0085222)
hgbot   
2016-03-18 11:52   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 41e788c55a5a011d69369812c9fa10bf4e23522b
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Mar 15 17:48:20 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/41e788c55a5a011d69369812c9fa10bf4e23522b [^]

Fixed issue 32461: Database discounts functions are wrong defined: exception
are not managed

The problem in this case is that in Oracle a exception is raised, and in
Postgres no exception is raised.

The solution is to manage exceptions in this function, either in Postgres and
Oracle.

---
M src-db/database/model/functions/OBDISC_XY_GIFT.xml
---