@pmcretail/mapper-library 0.0.37 → 0.0.38

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.
@@ -6950,14 +6950,13 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
6950
6950
  (/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
6951
6951
  (/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = Number((/** @type {?} */ (this)).document.total_qty_ordered ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered) : 0);
6952
6952
  (/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = Number((/** @type {?} */ (this)).document.base_total_refunded ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded) : 0);
6953
- // basket line discount
6954
- (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'] = [];
6955
- /** @type {?} */
6956
- var lineDiscount = {
6957
- itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id) : 0,
6958
- discountAmount: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.discount_amount) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.discount_amount)) : 0
6959
- };
6960
- (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'].push(lineDiscount);
6953
+ // // basket line discount
6954
+ // this.webReturnObject.basket['lineDiscount'] = [];
6955
+ // let lineDiscount = {
6956
+ // itemLineId: (this.document.items && this.document.items.item && this.document.items.item.item_id) ? this.getText(this.document.items.item.item_id) : 0,
6957
+ // discountAmount: (this.document.items && this.document.items.item && this.document.items.item.discount_amount) ? Number(this.getText(this.document.items.item.discount_amount)) : 0
6958
+ // }
6959
+ // this.webReturnObject.basket['lineDiscount'].push(lineDiscount);
6961
6960
  // basket transaction discount
6962
6961
  (/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'] = [];
6963
6962
  /** @type {?} */
@@ -6981,13 +6980,14 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
6981
6980
  /** @type {?} */
6982
6981
  var refundQty = (/** @type {?} */ (_this)).getText(element.qty_refunded) ? Number((/** @type {?} */ (_this)).getText(element.qty_refunded)) : 0;
6983
6982
  /** @type {?} */
6984
- var price = (/** @type {?} */ (_this)).getText(element.base_original_price) ? Number((/** @type {?} */ (_this)).getText(element.base_original_price)) : 0;
6983
+ var price = (/** @type {?} */ (_this)).getText(element.price_incl_tax) ? Number((/** @type {?} */ (_this)).getText(element.price_incl_tax)) : 0;
6985
6984
  product = {
6986
6985
  description: (element.name) ? (/** @type {?} */ (_this)).getText(element.name) : '',
6987
6986
  SKU: (element.sku) ? (/** @type {?} */ (_this)).getText(element.sku) : '',
6988
6987
  quantity: (element.qty_ordered) ? Number((/** @type {?} */ (_this)).getText(element.qty_ordered)) : 0,
6989
6988
  refundedQuantity: (element.qty_refunded) ? Number((/** @type {?} */ (_this)).getText(element.qty_refunded)) : 0,
6990
- price: (element.original_price) ? Number((/** @type {?} */ (_this)).getText(element.original_price)) : 0,
6989
+ //price: (element.original_price) ? Number(this.getText(element.original_price)) : 0,
6990
+ price: price,
6991
6991
  itemLineId: (element.item_id) ? Number((/** @type {?} */ (_this)).getText(element.item_id)) : 0,
6992
6992
  // totalLinePrice: (element.row_invoiced) ? Number(this.getText(element.row_invoiced)) : 0,
6993
6993
  totalLinePrice: ((qty - refundQty) * price),
@@ -7003,13 +7003,14 @@ var WebReturnMapperBuilderClass = /** @class */ (function () {
7003
7003
  /** @type {?} */
7004
7004
  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;
7005
7005
  /** @type {?} */
7006
- 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;
7006
+ var price = ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.price_incl_tax) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.price_incl_tax)) : 0;
7007
7007
  product = {
7008
7008
  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) : '',
7009
7009
  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) : '',
7010
7010
  quantity: ((/** @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,
7011
7011
  refundedQuantity: ((/** @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,
7012
- 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,
7012
+ // price: (this.document.items && this.document.items.item && this.document.items.item.original_price) ? Number(this.getText(this.document.items.item.original_price)) : 0,
7013
+ price: price,
7013
7014
  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,
7014
7015
  // totalLinePrice: (this.document.items && this.document.items.item && this.document.items.item.row_invoiced) ? Number(this.getText(this.document.items.item.row_invoiced)) : 0,
7015
7016
  totalLinePrice: ((qty - refundQty) * price),