@pmcretail/mapper-library 0.0.9 → 0.0.10

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.
@@ -4963,7 +4963,7 @@
4963
4963
  (/** @type {?} */ (this)).rjObject['Header'].TradingRegionID = (/** @type {?} */ (this)).tradingRegionId;
4964
4964
  (/** @type {?} */ (this)).rjObject['Header'].Eurozone = " "; //unknown
4965
4965
  (/** @type {?} */ (this)).rjObject['Header'].EuroBaseExchangeRate = ""; //unknown
4966
- (/** @type {?} */ (this)).rjObject['Header'].PrintableName = ""; //unknown
4966
+ (/** @type {?} */ (this)).rjObject['Header'].PrintableName = (/** @type {?} */ (this)).transactionDocument.userName; //unknown
4967
4967
  return (/** @type {?} */ (this));
4968
4968
  };
4969
4969
  /**
@@ -5108,7 +5108,7 @@
5108
5108
  obj['NetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
5109
5109
  obj['EffectiveNetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
5110
5110
  obj['Description'] = element.reasonCode;
5111
- obj['UserID'] = (/** @type {?} */ (_this)).transactionDocument.basket.userId;
5111
+ obj['UserID'] = (/** @type {?} */ (_this)).transactionDocument.userName;
5112
5112
  obj['ReasonCodeID'] = element.reasonCode;
5113
5113
  obj['DiscountType'] = element.discountType.toUpperCase() == DISCOUNTTYPE.PERCENT.toUpperCase() ? 0 : 1; // todo - compare values
5114
5114
  obj['RoundingRule'] = 2;
@@ -5147,7 +5147,7 @@
5147
5147
  obj.EffectiveNetValue = 0;
5148
5148
  obj.Description = data.percentageDiscountReasonName ? data.percentageDiscountReasonName : data.priceOverrideReasonName;
5149
5149
  obj.DeviceID = this.deviceId;
5150
- obj.UserID = this.userId;
5150
+ obj.UserID = this.transactionDocument.userName;
5151
5151
  obj.DateTimeCreated = this.updatedAt;
5152
5152
  obj.AuthorisingUserID = this.userId;
5153
5153
  obj.ReasonCodeID = data.percentageDiscountReasonCode ? data.percentageDiscountReasonCode : data.priceOverrideReasonCode;
@@ -5171,8 +5171,8 @@
5171
5171
  (/** @type {?} */ (this)).rjObject['Trailer'] = {};
5172
5172
  (/** @type {?} */ (this)).rjObject.Trailer.DateTimeCompleted = (/** @type {?} */ (this)).updatedAt;
5173
5173
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy = {};
5174
- (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId; //todo
5175
- (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId; //todo
5174
+ (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId;
5175
+ (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
5176
5176
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
5177
5177
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.BranchID = (/** @type {?} */ (this)).branchId;
5178
5178
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).transactionDocument.terminalId;
@@ -5282,17 +5282,15 @@
5282
5282
  var obj = {
5283
5283
  XMLSchemaVersion: (/** @type {?} */ (_this)).xmlSchemaVersion,
5284
5284
  LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
5285
- NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (Math.round(element.amount))),
5286
- EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (Math.round(element.amount))),
5285
+ NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
5286
+ EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
5287
5287
  Description: (/** @type {?} */ (_this)).getDescription(value[0].name, element),
5288
5288
  DeviceID: (/** @type {?} */ (_this)).deviceId,
5289
- //todo
5290
- UserID: (/** @type {?} */ (_this)).userId,
5291
- //todo
5289
+ UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
5292
5290
  DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
5293
5291
  TenderType: value[0].tenderType,
5294
5292
  TenderSubType: value[0].tenderSubType,
5295
- TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (Math.round(element.amount))),
5293
+ TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
5296
5294
  CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
5297
5295
  CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
5298
5296
  GiftVoucherSalesAllowed: '',
@@ -5313,9 +5311,7 @@
5313
5311
  EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
5314
5312
  Description: (/** @type {?} */ (_this)).getDescription(value[0].name, element),
5315
5313
  DeviceID: (/** @type {?} */ (_this)).deviceId,
5316
- //todo
5317
- UserID: (/** @type {?} */ (_this)).userId,
5318
- //todo
5314
+ UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
5319
5315
  DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
5320
5316
  TenderType: value[0].tenderType,
5321
5317
  TenderSubType: value[0].tenderSubType,
@@ -5634,7 +5630,7 @@
5634
5630
  * @return {THIS}
5635
5631
  */
5636
5632
  function (value) {
5637
- (/** @type {?} */ (this)).cashierId = value;
5633
+ (/** @type {?} */ (this)).cashierId = ((/** @type {?} */ (this)).transactionDocument && (/** @type {?} */ (this)).transactionDocument.userName) ? (/** @type {?} */ (this)).transactionDocument.userName : '';
5638
5634
  return (/** @type {?} */ (this));
5639
5635
  };
5640
5636
  /**
@@ -5898,9 +5894,7 @@
5898
5894
  EffectiveNetValue: this.removeDecimal(element.totalLinePrice),
5899
5895
  Description: element.description,
5900
5896
  DeviceID: this.deviceId,
5901
- //to do
5902
- UserID: this.userId,
5903
- //to do,
5897
+ UserID: this.transactionDocument.userName,
5904
5898
  DateTimeCreated: this.createdAt,
5905
5899
  ExtendedValue: this.removeDecimal(element.price),
5906
5900
  UnitPrice: this.removeDecimal(element.price),