
# HG changeset patch
# User Guillermo Gil <guillermo.gil@openbravo.com>
# Date 1493828402 -7200
# Node ID e3f77ec6f89e2d3c5193a87c6925446cc252e5b3
# Parent  faf1c3e2ae9ce75d22c3a225021cf2a3810aed91
AddPropertiesToReturns

diff -r faf1c3e2ae9c -r e3f77ec6f89e web/org.openbravo.retail.returns/js/modalReturnLines.js
--- a/web/org.openbravo.retail.returns/js/modalReturnLines.js	Mon Apr 03 18:23:07 2017 +0530
+++ b/web/org.openbravo.retail.returns/js/modalReturnLines.js	Wed May 03 18:20:02 2017 +0200
@@ -472,6 +472,9 @@
                   _.each(me.args.args.order.receiptLines, function (line) {
                     if (!line.exceedsQuantity) {
                       var createLineFunction = function (prod) {
+                          line.originalOrderLineId = line.lineId;
+                          line.originalDocumentNo = me.args.args.order.documentNo;
+                          line.skipApplyPromotions = true;
                           var order = me.args.args.context.model.get('order');
                           var qty = line.selectedQuantity;
                           if (order.get('orderType') !== 1) {
@@ -482,16 +485,7 @@
                           prod.set('ignoreReturnApproval', ignoreReturnApproval);
                           order.addProductToOrder(prod, qty, {
                             isVerifiedReturn: true
-                          }, {
-                            'originalOrderLineId': line.lineId,
-                            'originalDocumentNo': me.args.args.order.documentNo,
-                            'skipApplyPromotions': true,
-                            'promotions': line.promotions,
-                            'shipmentlineId': line.shipmentlineId,
-                            'relatedLines': line.relatedLines,
-                            'obposEpccode': line.obposEpccode,
-                            'obposSerialNumber': line.obposSerialNumber
-                          }, function () {
+                          }, line, function () {
                             me.args.args.cancelOperation = true;
                             OB.UTIL.HookManager.callbackExecutor(me.args.args, me.args.callbacks);
                             finishOrder();

