# HG changeset patch
# User Miguel A. Alsasua <miguel.alsasua@openbravo.com>
# Date 1548212563 -3600
# Node ID 8956197ccc27b624fab5fa0cf0e378afff084117
# Parent  9bdc23ff02fbfda85e2d904b095d71f451148b3f
fix issue div by qtyOffer 0

diff --git a/web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js b/web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js
--- a/web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js
+++ b/web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js
@@ -117,7 +117,8 @@
             if (promotion.percentage !== undefined) {
               discountAmount += actualPrice * promotion.percentage / 100;
             } else {
-              discountAmount += OB.DEC.div(promotion.amt, promotion.qtyOffer);
+	      discountAmount +=  (promotion.qtyOffer === 0? promotion.amt: OB.DEC.div(promotion.amt, promotion.qtyOffer));
+              //discountAmount += OB.DEC.div(promotion.amt, promotion.qtyOffer);
             }
             if (OB.Model.Discounts.discountRules[promotion.discountType].isManual) {
               checkDiscount = true;
