@pmcretail/mapper-library 0.0.22 → 0.0.24

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.
@@ -6511,6 +6511,12 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
6511
6511
  * @return {?}
6512
6512
  */
6513
6513
  function (element) {
6514
+ /** @type {?} */
6515
+ var qty = element.qty_ordered ? element.qty_ordered : 0;
6516
+ /** @type {?} */
6517
+ var refundQty = element.qty_refunded ? element.qty_refunded : 0;
6518
+ /** @type {?} */
6519
+ var price = element.base_original_price ? element.base_original_price : 0;
6514
6520
  product = {
6515
6521
  description: (element.name) ? (/** @type {?} */ (_this)).getText(element.name) : '',
6516
6522
  SKU: (element.sku) ? (/** @type {?} */ (_this)).getText(element.sku) : '',
@@ -6519,7 +6525,7 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
6519
6525
  price: (element.original_price) ? Number((/** @type {?} */ (_this)).getText(element.original_price)) : 0,
6520
6526
  itemLineId: (element.item_id) ? Number((/** @type {?} */ (_this)).getText(element.item_id)) : 0,
6521
6527
  // totalLinePrice: (element.row_invoiced) ? Number(this.getText(element.row_invoiced)) : 0,
6522
- totalLinePrice: ((element.qty_ordered - element.qty_refunded) * element.base_original_price) || 0,
6528
+ totalLinePrice: ((qty - refundQty) * price),
6523
6529
  };
6524
6530
  if (product && product.price != 0) {
6525
6531
  (/** @type {?} */ (_this)).webReturnObject.basket['products'].push(product);
@@ -6527,6 +6533,12 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
6527
6533
  }));
6528
6534
  }
6529
6535
  else {
6536
+ /** @type {?} */
6537
+ 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;
6538
+ /** @type {?} */
6539
+ 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;
6540
+ /** @type {?} */
6541
+ 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;
6530
6542
  product = {
6531
6543
  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) : '',
6532
6544
  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) : '',
@@ -6535,7 +6547,7 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
6535
6547
  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,
6536
6548
  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,
6537
6549
  // totalLinePrice: (this.document.items && this.document.items.item && this.document.items.item.row_invoiced) ? Number(this.getText(this.document.items.item.row_invoiced)) : 0,
6538
- totalLinePrice: (((/** @type {?} */ (this)).document.items.item.qty_ordered - (/** @type {?} */ (this)).document.items.item.qty_refunded) * (/** @type {?} */ (this)).document.items.item.base_original_price) || 0,
6550
+ totalLinePrice: ((qty - refundQty) * price),
6539
6551
  };
6540
6552
  if (product && product.price != 0) {
6541
6553
  (/** @type {?} */ (this)).webReturnObject.basket['products'].push(product);