@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.
@@ -18,10 +18,10 @@ class MapperLibraryComponent {
18
18
  MapperLibraryComponent.decorators = [
19
19
  { type: Component, args: [{
20
20
  selector: 'lib-mapper-library',
21
- template: `
22
- <p>
23
- mapper-library works!
24
- </p>
21
+ template: `
22
+ <p>
23
+ mapper-library works!
24
+ </p>
25
25
  `
26
26
  }] }
27
27
  ];
@@ -5478,14 +5478,13 @@ class WebReturnMapperBuilderClass {
5478
5478
  (/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
5479
5479
  (/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = Number((/** @type {?} */ (this)).document.total_qty_ordered ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered) : 0);
5480
5480
  (/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = Number((/** @type {?} */ (this)).document.base_total_refunded ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded) : 0);
5481
- // basket line discount
5482
- (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'] = [];
5483
- /** @type {?} */
5484
- let lineDiscount = {
5485
- 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,
5486
- 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
5487
- };
5488
- (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'].push(lineDiscount);
5481
+ // // basket line discount
5482
+ // this.webReturnObject.basket['lineDiscount'] = [];
5483
+ // let lineDiscount = {
5484
+ // itemLineId: (this.document.items && this.document.items.item && this.document.items.item.item_id) ? this.getText(this.document.items.item.item_id) : 0,
5485
+ // discountAmount: (this.document.items && this.document.items.item && this.document.items.item.discount_amount) ? Number(this.getText(this.document.items.item.discount_amount)) : 0
5486
+ // }
5487
+ // this.webReturnObject.basket['lineDiscount'].push(lineDiscount);
5489
5488
  // basket transaction discount
5490
5489
  (/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'] = [];
5491
5490
  /** @type {?} */
@@ -5509,13 +5508,14 @@ class WebReturnMapperBuilderClass {
5509
5508
  /** @type {?} */
5510
5509
  let refundQty = (/** @type {?} */ (this)).getText(element.qty_refunded) ? Number((/** @type {?} */ (this)).getText(element.qty_refunded)) : 0;
5511
5510
  /** @type {?} */
5512
- let price = (/** @type {?} */ (this)).getText(element.base_original_price) ? Number((/** @type {?} */ (this)).getText(element.base_original_price)) : 0;
5511
+ let price = (/** @type {?} */ (this)).getText(element.price_incl_tax) ? Number((/** @type {?} */ (this)).getText(element.price_incl_tax)) : 0;
5513
5512
  product = {
5514
5513
  description: (element.name) ? (/** @type {?} */ (this)).getText(element.name) : '',
5515
5514
  SKU: (element.sku) ? (/** @type {?} */ (this)).getText(element.sku) : '',
5516
5515
  quantity: (element.qty_ordered) ? Number((/** @type {?} */ (this)).getText(element.qty_ordered)) : 0,
5517
5516
  refundedQuantity: (element.qty_refunded) ? Number((/** @type {?} */ (this)).getText(element.qty_refunded)) : 0,
5518
- price: (element.original_price) ? Number((/** @type {?} */ (this)).getText(element.original_price)) : 0,
5517
+ //price: (element.original_price) ? Number(this.getText(element.original_price)) : 0,
5518
+ price: price,
5519
5519
  itemLineId: (element.item_id) ? Number((/** @type {?} */ (this)).getText(element.item_id)) : 0,
5520
5520
  // totalLinePrice: (element.row_invoiced) ? Number(this.getText(element.row_invoiced)) : 0,
5521
5521
  totalLinePrice: ((qty - refundQty) * price),
@@ -5531,13 +5531,14 @@ class WebReturnMapperBuilderClass {
5531
5531
  /** @type {?} */
5532
5532
  let 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;
5533
5533
  /** @type {?} */
5534
- let 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;
5534
+ let 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;
5535
5535
  product = {
5536
5536
  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) : '',
5537
5537
  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) : '',
5538
5538
  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,
5539
5539
  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,
5540
- 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,
5540
+ // price: (this.document.items && this.document.items.item && this.document.items.item.original_price) ? Number(this.getText(this.document.items.item.original_price)) : 0,
5541
+ price: price,
5541
5542
  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,
5542
5543
  // totalLinePrice: (this.document.items && this.document.items.item && this.document.items.item.row_invoiced) ? Number(this.getText(this.document.items.item.row_invoiced)) : 0,
5543
5544
  totalLinePrice: ((qty - refundQty) * price),