@pmcretail/mapper-library 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/pmcretail-mapper-library.umd.js +40 -59
- package/bundles/pmcretail-mapper-library.umd.js.map +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js.map +1 -1
- package/esm2015/lib/WebReturnSalesforceMapper.class.js +41 -60
- package/esm2015/lib/mapper-library.component.js +5 -5
- package/esm2015/lib/mapper-library.module.js +1 -1
- package/esm5/lib/WebReturnSalesforceMapper.class.js +41 -60
- package/esm5/lib/mapper-library.component.js +1 -1
- package/esm5/lib/mapper-library.module.js +1 -1
- package/fesm2015/pmcretail-mapper-library.js +44 -63
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +40 -59
- package/fesm5/pmcretail-mapper-library.js.map +1 -1
- package/package.json +1 -1
|
@@ -7863,66 +7863,47 @@
|
|
|
7863
7863
|
*/
|
|
7864
7864
|
function (txDoc, promotion) {
|
|
7865
7865
|
var _this = this;
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
* @return {?}
|
|
7896
|
-
*/
|
|
7897
|
-
function (p) {
|
|
7898
|
-
if (promotion.itemLineIds && promotion.itemLineIds.includes(p.itemLineId) && !p.giftCard) {
|
|
7899
|
-
p = _this.validateProductItemDiscount(p);
|
|
7900
|
-
/** @type {?} */
|
|
7901
|
-
var productContributionInTotal = _this.numberUtilService.trimTo2Decimal2(p.itemDiscounts.trnDiscountsPortion) +
|
|
7902
|
-
_this.numberUtilService.trimTo2Decimal2(p.itemDiscounts.trnPromotionsPortion) -
|
|
7903
|
-
_this.numberUtilService.trimTo2Decimal2(p.itemDiscounts.refundPortion);
|
|
7904
|
-
total += (p.total - _this.numberUtilService.trimTo2Decimal2(productContributionInTotal));
|
|
7905
|
-
}
|
|
7906
|
-
}));
|
|
7907
|
-
console.log("ebasket: trnsactionPromotion: " + JSON.stringify(promotion) + ", selected products total: " + total);
|
|
7908
|
-
txDoc.basket.products.forEach((/**
|
|
7909
|
-
* @param {?} product
|
|
7910
|
-
* @return {?}
|
|
7911
|
-
*/
|
|
7912
|
-
function (product) {
|
|
7913
|
-
product = _this.validateProductItemDiscount(product);
|
|
7866
|
+
console.log("ebasket: transactionPromotionProductPortionCalc: trnsactionPromotion: " + JSON.stringify(promotion));
|
|
7867
|
+
if (promotion.type === PROMOTION_TYPE.COUPON && promotion.subLevelType === PROMOTION_LEVEL.LINE) {
|
|
7868
|
+
txDoc.basket.products.forEach((/**
|
|
7869
|
+
* @param {?} product
|
|
7870
|
+
* @return {?}
|
|
7871
|
+
*/
|
|
7872
|
+
function (product) {
|
|
7873
|
+
product = _this.validateProductItemDiscount(product);
|
|
7874
|
+
if (promotion.trigger && promotion.trigger.length > 0) {
|
|
7875
|
+
promotion.trigger.forEach((/**
|
|
7876
|
+
* @param {?} t
|
|
7877
|
+
* @return {?}
|
|
7878
|
+
*/
|
|
7879
|
+
function (t) {
|
|
7880
|
+
if (t.itemLineId === product.itemLineId.toString()) {
|
|
7881
|
+
product.itemDiscounts.trnPromotionsPortion += t.promotionAmount;
|
|
7882
|
+
}
|
|
7883
|
+
}));
|
|
7884
|
+
}
|
|
7885
|
+
}));
|
|
7886
|
+
}
|
|
7887
|
+
else {
|
|
7888
|
+
txDoc.basket.products.forEach((/**
|
|
7889
|
+
* @param {?} product
|
|
7890
|
+
* @return {?}
|
|
7891
|
+
*/
|
|
7892
|
+
function (product) {
|
|
7893
|
+
product = _this.validateProductItemDiscount(product);
|
|
7894
|
+
if (promotion.itemLineIds.includes(+product.itemLineId)) {
|
|
7914
7895
|
/** @type {?} */
|
|
7915
|
-
var
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
}
|
|
7925
|
-
}
|
|
7896
|
+
var productItem = _this.orderDetails.product_items.find((/**
|
|
7897
|
+
* @param {?} productItem
|
|
7898
|
+
* @return {?}
|
|
7899
|
+
*/
|
|
7900
|
+
function (productItem) { return productItem.product_id === product.SKU; }));
|
|
7901
|
+
/** @type {?} */
|
|
7902
|
+
var transactionPromotionPortion = (productItem && productItem.price_after_item_discount && productItem.price_after_order_discount) ?
|
|
7903
|
+
(productItem.price_after_item_discount - productItem.price_after_order_discount) : 0;
|
|
7904
|
+
product.itemDiscounts.trnPromotionsPortion += _this.numberUtilService.trimTo2Decimal2(transactionPromotionPortion);
|
|
7905
|
+
}
|
|
7906
|
+
}));
|
|
7926
7907
|
}
|
|
7927
7908
|
return txDoc;
|
|
7928
7909
|
};
|