@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.
@@ -7170,14 +7170,13 @@
7170
7170
  (/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
7171
7171
  (/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = Number((/** @type {?} */ (this)).document.total_qty_ordered ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered) : 0);
7172
7172
  (/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = Number((/** @type {?} */ (this)).document.base_total_refunded ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded) : 0);
7173
- // basket line discount
7174
- (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'] = [];
7175
- /** @type {?} */
7176
- var lineDiscount = {
7177
- 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,
7178
- 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
7179
- };
7180
- (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'].push(lineDiscount);
7173
+ // // basket line discount
7174
+ // this.webReturnObject.basket['lineDiscount'] = [];
7175
+ // let lineDiscount = {
7176
+ // itemLineId: (this.document.items && this.document.items.item && this.document.items.item.item_id) ? this.getText(this.document.items.item.item_id) : 0,
7177
+ // discountAmount: (this.document.items && this.document.items.item && this.document.items.item.discount_amount) ? Number(this.getText(this.document.items.item.discount_amount)) : 0
7178
+ // }
7179
+ // this.webReturnObject.basket['lineDiscount'].push(lineDiscount);
7181
7180
  // basket transaction discount
7182
7181
  (/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'] = [];
7183
7182
  /** @type {?} */
@@ -7201,13 +7200,14 @@
7201
7200
  /** @type {?} */
7202
7201
  var refundQty = (/** @type {?} */ (_this)).getText(element.qty_refunded) ? Number((/** @type {?} */ (_this)).getText(element.qty_refunded)) : 0;
7203
7202
  /** @type {?} */
7204
- var price = (/** @type {?} */ (_this)).getText(element.base_original_price) ? Number((/** @type {?} */ (_this)).getText(element.base_original_price)) : 0;
7203
+ var price = (/** @type {?} */ (_this)).getText(element.price_incl_tax) ? Number((/** @type {?} */ (_this)).getText(element.price_incl_tax)) : 0;
7205
7204
  product = {
7206
7205
  description: (element.name) ? (/** @type {?} */ (_this)).getText(element.name) : '',
7207
7206
  SKU: (element.sku) ? (/** @type {?} */ (_this)).getText(element.sku) : '',
7208
7207
  quantity: (element.qty_ordered) ? Number((/** @type {?} */ (_this)).getText(element.qty_ordered)) : 0,
7209
7208
  refundedQuantity: (element.qty_refunded) ? Number((/** @type {?} */ (_this)).getText(element.qty_refunded)) : 0,
7210
- price: (element.original_price) ? Number((/** @type {?} */ (_this)).getText(element.original_price)) : 0,
7209
+ //price: (element.original_price) ? Number(this.getText(element.original_price)) : 0,
7210
+ price: price,
7211
7211
  itemLineId: (element.item_id) ? Number((/** @type {?} */ (_this)).getText(element.item_id)) : 0,
7212
7212
  // totalLinePrice: (element.row_invoiced) ? Number(this.getText(element.row_invoiced)) : 0,
7213
7213
  totalLinePrice: ((qty - refundQty) * price),
@@ -7223,13 +7223,14 @@
7223
7223
  /** @type {?} */
7224
7224
  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;
7225
7225
  /** @type {?} */
7226
- 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;
7226
+ 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;
7227
7227
  product = {
7228
7228
  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) : '',
7229
7229
  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) : '',
7230
7230
  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,
7231
7231
  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,
7232
- 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,
7232
+ // price: (this.document.items && this.document.items.item && this.document.items.item.original_price) ? Number(this.getText(this.document.items.item.original_price)) : 0,
7233
+ price: price,
7233
7234
  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,
7234
7235
  // totalLinePrice: (this.document.items && this.document.items.item && this.document.items.item.row_invoiced) ? Number(this.getText(this.document.items.item.row_invoiced)) : 0,
7235
7236
  totalLinePrice: ((qty - refundQty) * price),