@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.
@@ -4743,7 +4743,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
4743
4743
  (/** @type {?} */ (this)).rjObject['Header'].TradingRegionID = (/** @type {?} */ (this)).tradingRegionId;
4744
4744
  (/** @type {?} */ (this)).rjObject['Header'].Eurozone = " "; //unknown
4745
4745
  (/** @type {?} */ (this)).rjObject['Header'].EuroBaseExchangeRate = ""; //unknown
4746
- (/** @type {?} */ (this)).rjObject['Header'].PrintableName = ""; //unknown
4746
+ (/** @type {?} */ (this)).rjObject['Header'].PrintableName = (/** @type {?} */ (this)).transactionDocument.userName; //unknown
4747
4747
  return (/** @type {?} */ (this));
4748
4748
  };
4749
4749
  /**
@@ -4888,7 +4888,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
4888
4888
  obj['NetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
4889
4889
  obj['EffectiveNetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
4890
4890
  obj['Description'] = element.reasonCode;
4891
- obj['UserID'] = (/** @type {?} */ (_this)).transactionDocument.basket.userId;
4891
+ obj['UserID'] = (/** @type {?} */ (_this)).transactionDocument.userName;
4892
4892
  obj['ReasonCodeID'] = element.reasonCode;
4893
4893
  obj['DiscountType'] = element.discountType.toUpperCase() == DISCOUNTTYPE.PERCENT.toUpperCase() ? 0 : 1; // todo - compare values
4894
4894
  obj['RoundingRule'] = 2;
@@ -4927,7 +4927,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
4927
4927
  obj.EffectiveNetValue = 0;
4928
4928
  obj.Description = data.percentageDiscountReasonName ? data.percentageDiscountReasonName : data.priceOverrideReasonName;
4929
4929
  obj.DeviceID = this.deviceId;
4930
- obj.UserID = this.userId;
4930
+ obj.UserID = this.transactionDocument.userName;
4931
4931
  obj.DateTimeCreated = this.updatedAt;
4932
4932
  obj.AuthorisingUserID = this.userId;
4933
4933
  obj.ReasonCodeID = data.percentageDiscountReasonCode ? data.percentageDiscountReasonCode : data.priceOverrideReasonCode;
@@ -4951,8 +4951,8 @@ var RJMapperBuilderClass = /** @class */ (function () {
4951
4951
  (/** @type {?} */ (this)).rjObject['Trailer'] = {};
4952
4952
  (/** @type {?} */ (this)).rjObject.Trailer.DateTimeCompleted = (/** @type {?} */ (this)).updatedAt;
4953
4953
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy = {};
4954
- (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId; //todo
4955
- (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId; //todo
4954
+ (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId;
4955
+ (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
4956
4956
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
4957
4957
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.BranchID = (/** @type {?} */ (this)).branchId;
4958
4958
  (/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).transactionDocument.terminalId;
@@ -5062,17 +5062,15 @@ var RJMapperBuilderClass = /** @class */ (function () {
5062
5062
  var obj = {
5063
5063
  XMLSchemaVersion: (/** @type {?} */ (_this)).xmlSchemaVersion,
5064
5064
  LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
5065
- NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (Math.round(element.amount))),
5066
- EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (Math.round(element.amount))),
5065
+ NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
5066
+ EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
5067
5067
  Description: (/** @type {?} */ (_this)).getDescription(value[0].name, element),
5068
5068
  DeviceID: (/** @type {?} */ (_this)).deviceId,
5069
- //todo
5070
- UserID: (/** @type {?} */ (_this)).userId,
5071
- //todo
5069
+ UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
5072
5070
  DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
5073
5071
  TenderType: value[0].tenderType,
5074
5072
  TenderSubType: value[0].tenderSubType,
5075
- TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (Math.round(element.amount))),
5073
+ TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
5076
5074
  CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
5077
5075
  CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
5078
5076
  GiftVoucherSalesAllowed: '',
@@ -5093,9 +5091,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
5093
5091
  EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
5094
5092
  Description: (/** @type {?} */ (_this)).getDescription(value[0].name, element),
5095
5093
  DeviceID: (/** @type {?} */ (_this)).deviceId,
5096
- //todo
5097
- UserID: (/** @type {?} */ (_this)).userId,
5098
- //todo
5094
+ UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
5099
5095
  DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
5100
5096
  TenderType: value[0].tenderType,
5101
5097
  TenderSubType: value[0].tenderSubType,
@@ -5414,7 +5410,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
5414
5410
  * @return {THIS}
5415
5411
  */
5416
5412
  function (value) {
5417
- (/** @type {?} */ (this)).cashierId = value;
5413
+ (/** @type {?} */ (this)).cashierId = ((/** @type {?} */ (this)).transactionDocument && (/** @type {?} */ (this)).transactionDocument.userName) ? (/** @type {?} */ (this)).transactionDocument.userName : '';
5418
5414
  return (/** @type {?} */ (this));
5419
5415
  };
5420
5416
  /**
@@ -5678,9 +5674,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
5678
5674
  EffectiveNetValue: this.removeDecimal(element.totalLinePrice),
5679
5675
  Description: element.description,
5680
5676
  DeviceID: this.deviceId,
5681
- //to do
5682
- UserID: this.userId,
5683
- //to do,
5677
+ UserID: this.transactionDocument.userName,
5684
5678
  DateTimeCreated: this.createdAt,
5685
5679
  ExtendedValue: this.removeDecimal(element.price),
5686
5680
  UnitPrice: this.removeDecimal(element.price),