---
 .../js/hooks/hookObidcoPreAddCouponHook.js    | 26 ++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/web/org.openbravo.retail.chequecadeau/js/hooks/hookObidcoPreAddCouponHook.js b/web/org.openbravo.retail.chequecadeau/js/hooks/hookObidcoPreAddCouponHook.js
index 6065ae9..4910589 100644
--- a/web/org.openbravo.retail.chequecadeau/js/hooks/hookObidcoPreAddCouponHook.js
+++ b/web/org.openbravo.retail.chequecadeau/js/hooks/hookObidcoPreAddCouponHook.js
@@ -7,7 +7,7 @@
  ************************************************************************************
  */
 
-/*global */
+/*global OB */
 
 (function() {
   OB.UTIL.HookManager.registerHook('obidcoPreAddCouponHook', function(
@@ -18,14 +18,34 @@
       var procesValidateDate = new OB.DS.Process(
         'org.openbravo.retail.chequecadeau.hooks.ValidateChequeCadeauBarcode'
       );
+      var barcodeInPayments = function(payments, barCode) {
+        var result = _.find(payments, payment => {
+          return _.find(payment.get('coupons'), coupon => {
+            return (
+              OB.DCUTIL.getCouponProperty(coupon, 'ccgsBarcode') === barCode
+            );
+          });
+        });
+        return !OB.UTIL.isNullOrUndefined(result);
+      };
       procesValidateDate.exec(
         {
           coupon: args.coupon.attributes
         },
         function(data) {
-          if (data && data.duplicated) {
+          var me = args.digitalCouponWindow,
+            receiptPayments = [];
+          _.forEach(OB.MobileApp.model.orderList.models, receipt => {
+            receiptPayments = receiptPayments.concat(
+              receipt.get('payments').models
+            );
+          });
+          data = data || {};
+          data.duplicated =
+            data.duplicated ||
+            barcodeInPayments(receiptPayments, args.coupon.get('ccgsBarcode'));
+          if (data.duplicated) {
             args.cancellation = true;
-            var me = args.digitalCouponWindow;
             me.hide();
             OB.UTIL.showConfirmation.display(
               OB.I18N.getLabel('OBMOBC_Error'),
-- 
2.28.0

