Openbravo Issue Tracking System - Retail Modules
View Issue Details
0025384Retail ModulesRetail Widgetspublic2013-12-20 10:182014-01-20 18:32
jecharri 
marvintm 
urgentmajoralways
closedfixed 
5
 
RMP31RMP31 
guilleaer
No
0025384: Widgets can fail under some circumstances
Widgets can fail under some circumstances

If you have orders with Total = 0 and all the lines with grossUnitPrice = 0, retail widgets are going to fail.

The problem is that we are doing the following division:

round((sum(sol.orderedQuantity*sol.grossUnitPrice- tc.cost)/sum(sol.orderedQuantity*sol.grossUnitPrice))*100,2) as grossmarginpercentage
-
round((sum(sol.orderedQuantity*sol.grossUnitPrice- tc.cost)/(case when sum(sol.orderedQuantity*sol.grossUnitPrice) = 0 then 1 else sum(sol.orderedQuantity*sol.grossUnitPrice) end))*100,2) as grossmarginpercentage

The best option can be also to use the NetUnitPrice instead of grossUnitPrice because in some cases clients can configure to work with pricing without taxes and that it can be also a problem
No tags attached.
Issue History
2013-12-20 10:18jecharriNew Issue
2013-12-20 10:18jecharriAssigned To => marvintm
2013-12-20 10:18jecharriResolution time => 1393628400
2013-12-20 10:18jecharriTriggers an Emergency Pack => No
2014-01-14 08:58jecharriProposed Solution updated
2014-01-16 10:09hgbotCheckin
2014-01-16 10:09hgbotNote Added: 0063433
2014-01-16 10:09hgbotStatusnew => resolved
2014-01-16 10:09hgbotResolutionopen => fixed
2014-01-16 10:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.widgets/rev/0bdb22c4bc63e4066ef36d616451cc7ef1ec25aa [^]
2014-01-20 18:32guilleaerReview Assigned To => guilleaer
2014-01-20 18:32guilleaerNote Added: 0063546
2014-01-20 18:32guilleaerStatusresolved => closed
2014-01-20 18:32guilleaerFixed in Version => RMP31

Notes
(0063433)
hgbot   
2014-01-16 10:09   
Repository: erp/pmods/org.openbravo.retail.widgets
Changeset: 0bdb22c4bc63e4066ef36d616451cc7ef1ec25aa
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Thu Jan 16 10:03:43 2014 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.widgets/rev/0bdb22c4bc63e4066ef36d616451cc7ef1ec25aa [^]

Fixed issue 25384: Widgets can fail under some circumstances

---
M src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
---
(0063546)
guilleaer   
2014-01-20 18:32   
Verified