diff --git a/web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js b/web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js
index 676f212..1be7331 100644
--- a/web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js
+++ b/web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js
@@ -60,6 +60,8 @@ OB.Model.Discounts.DISCT = {
         // discounted price should be set in line.discountedLinePrice, but we cannot trust
         // all rules correctly set this info
         var price;
+        var qty = line.getQty();
+        var qtyUsed = 0;
 
         line.calculateGross();
         // in PIT discounts are applied to gross
@@ -81,7 +83,15 @@ OB.Model.Discounts.DISCT = {
               price = OB.DEC.sub(price, (p.amt || 0));
             }
           }
+          qtyUsed = OB.DEC.add(qtyUsed, p.qtyOfferReserved || 0);
         });
+        if (qtyUsed === 0) {
+          price = price || 0;
+        } else if (qtyUsed === line.getQty()) {
+          price = 0;
+        } else {
+          price = OB.DEC.div(OB.DEC.mul(qtyUsed, price), qty)
+        }
         return {
           price: price
         };
@@ -125,6 +135,10 @@ OB.Model.Discounts.DISCT = {
 
         linePrice = getDiscountedLinePrice(l);
 
+        if (linePrice.price <= 0) {
+          return; //continue
+        }
+
         // total for PIT includes taxes and for no PIT does not
         total = OB.DEC.add(total, linePrice.price);
 
diff --git a/web/org.openbravo.retail.discounts.bytotal/js/promotion-freeitemstotal.js b/web/org.openbravo.retail.discounts.bytotal/js/promotion-freeitemstotal.js
index 8c88a8c..076331d 100644
--- a/web/org.openbravo.retail.discounts.bytotal/js/promotion-freeitemstotal.js
+++ b/web/org.openbravo.retail.discounts.bytotal/js/promotion-freeitemstotal.js
@@ -21,6 +21,13 @@ OB.Model.Discounts.discountRules['4755A35B4DA34F6CB08F15462BA123CF'] = {
       return;
     }
 
+    OB.MobileApp.model.receipt.off('calculatingReceipt', null, OB.Model.Discounts.discountRules['4755A35B4DA34F6CB08F15462BA123CF']);
+    OB.MobileApp.model.receipt.on('calculatingReceipt', function () {
+      OB.Model.Discounts.discountRules['4755A35B4DA34F6CB08F15462BA123CF'].discountedUnits = {};
+      receipt.off('calculatingReceipt', null, OB.Model.Discounts.discountRules['4755A35B4DA34F6CB08F15462BA123CF']);
+    }, OB.Model.Discounts.discountRules['4755A35B4DA34F6CB08F15462BA123CF']);
+
+
     OB.Dal.find(OB.Model.FreeProduct, {
       'promotionDiscount': discountRule.get('id')
     }, function (freeProducts) {
@@ -49,10 +56,9 @@ OB.Model.Discounts.discountRules['4755A35B4DA34F6CB08F15462BA123CF'] = {
             var unitsToDiscount, fp, fpId, l = lc.line,
                 discountApplied = false;
 
-
             fp = OB.Model.Discounts.DISCT.isFreeProduct(l.get('product'), freeProducts);
             if (fp) {
-              fpId = fp.get('product');
+              fpId = fp.get('product') + '-' + discountRule.id
 
               // a product can be in more than one line, keep count of how many units
               // have already been discounted
