@pmcretail/mapper-library 0.0.23 → 0.0.25

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.
@@ -6731,6 +6731,12 @@
6731
6731
  * @return {?}
6732
6732
  */
6733
6733
  function (element) {
6734
+ /** @type {?} */
6735
+ var qty = (/** @type {?} */ (_this)).getText(element.qty_ordered) ? Number((/** @type {?} */ (_this)).getText(element.qty_ordered)) : 0;
6736
+ /** @type {?} */
6737
+ var refundQty = (/** @type {?} */ (_this)).getText(element.qty_refunded) ? Number((/** @type {?} */ (_this)).getText(element.qty_refunded)) : 0;
6738
+ /** @type {?} */
6739
+ var price = (/** @type {?} */ (_this)).getText(element.base_original_price) ? Number((/** @type {?} */ (_this)).getText(element.base_original_price)) : 0;
6734
6740
  product = {
6735
6741
  description: (element.name) ? (/** @type {?} */ (_this)).getText(element.name) : '',
6736
6742
  SKU: (element.sku) ? (/** @type {?} */ (_this)).getText(element.sku) : '',
@@ -6739,7 +6745,7 @@
6739
6745
  price: (element.original_price) ? Number((/** @type {?} */ (_this)).getText(element.original_price)) : 0,
6740
6746
  itemLineId: (element.item_id) ? Number((/** @type {?} */ (_this)).getText(element.item_id)) : 0,
6741
6747
  // totalLinePrice: (element.row_invoiced) ? Number(this.getText(element.row_invoiced)) : 0,
6742
- totalLinePrice: ((element.qty_ordered - element.qty_refunded) * element.base_original_price),
6748
+ totalLinePrice: ((qty - refundQty) * price),
6743
6749
  };
6744
6750
  if (product && product.price != 0) {
6745
6751
  (/** @type {?} */ (_this)).webReturnObject.basket['products'].push(product);
@@ -6747,6 +6753,12 @@
6747
6753
  }));
6748
6754
  }
6749
6755
  else {
6756
+ /** @type {?} */
6757
+ var qty = ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_ordered) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_ordered)) : 0;
6758
+ /** @type {?} */
6759
+ var refundQty = ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_refunded) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_refunded)) : 0;
6760
+ /** @type {?} */
6761
+ var price = ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.original_price) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.original_price)) : 0;
6750
6762
  product = {
6751
6763
  description: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.name) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.name) : '',
6752
6764
  SKU: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.sku) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.sku) : '',
@@ -6755,7 +6767,7 @@
6755
6767
  price: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.original_price) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.original_price)) : 0,
6756
6768
  itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id)) : 0,
6757
6769
  // totalLinePrice: (this.document.items && this.document.items.item && this.document.items.item.row_invoiced) ? Number(this.getText(this.document.items.item.row_invoiced)) : 0,
6758
- totalLinePrice: (((/** @type {?} */ (this)).document.items.item.qty_ordered - (/** @type {?} */ (this)).document.items.item.qty_refunded) * (/** @type {?} */ (this)).document.items.item.base_original_price),
6770
+ totalLinePrice: ((qty - refundQty) * price),
6759
6771
  };
6760
6772
  if (product && product.price != 0) {
6761
6773
  (/** @type {?} */ (this)).webReturnObject.basket['products'].push(product);