@pmcretail/mapper-library 0.0.3 → 0.0.5

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.
@@ -4871,7 +4871,6 @@
4871
4871
  */
4872
4872
  var RJMapperBuilderClass = /** @class */ (function () {
4873
4873
  function RJMapperBuilderClass(transactionDoc) {
4874
- this.productQuantity = 0;
4875
4874
  this.itemCount = 0;
4876
4875
  this.largestNumber = 0;
4877
4876
  this.rjObject = {};
@@ -4977,7 +4976,7 @@
4977
4976
  (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.CashierID = (/** @type {?} */ (this)).cashierId;
4978
4977
  (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.CompanyID = (/** @type {?} */ (this)).companyId;
4979
4978
  (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
4980
- (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.BranchID = (/** @type {?} */ (this)).transactionDocument.storeId;
4979
+ (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.BranchID = (/** @type {?} */ (this)).branchId;
4981
4980
  (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.TerminalNumber = (/** @type {?} */ (this)).terminalNumber;
4982
4981
  (/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.TransactionNumber = (/** @type {?} */ (this)).transactionNumber;
4983
4982
  (/** @type {?} */ (this)).rjObject['Header'].TaxMethodID = (/** @type {?} */ (this)).taxMethodId;
@@ -5059,6 +5058,15 @@
5059
5058
  function (element) {
5060
5059
  /** @type {?} */
5061
5060
  var data = (/** @type {?} */ (_this)).returnProduct(element, (element.hasOwnProperty('lineDiscount') ? element.lineDiscount : null));
5061
+ /** @type {?} */
5062
+ var obj = {
5063
+ "OriginalReceiptSupplied": 0,
5064
+ "OriginalBranchID": 0,
5065
+ "OriginalTerminalNumber": 0,
5066
+ "OriginalTransactionNumber": 0,
5067
+ "OriginalCashierNumber": 0
5068
+ };
5069
+ data['Return'] = __assign({}, data['Return'], obj);
5062
5070
  (/** @type {?} */ (_this)).rjObject['ProductReturn'].push(data);
5063
5071
  (/** @type {?} */ (_this)).getModifierItem(element.lineDiscount, element.itemLineId);
5064
5072
  }));
@@ -5077,6 +5085,15 @@
5077
5085
  if (element.refundedQuantity > 0) {
5078
5086
  /** @type {?} */
5079
5087
  var returnProduct = (/** @type {?} */ (_this)).returnProduct(element, (element.hasOwnProperty('lineDiscount') ? element.lineDiscount : null));
5088
+ /** @type {?} */
5089
+ var obj = {
5090
+ "OriginalReceiptSupplied": 0,
5091
+ "OriginalBranchID": 0,
5092
+ "OriginalTerminalNumber": 0,
5093
+ "OriginalTransactionNumber": 0,
5094
+ "OriginalCashierNumber": 0
5095
+ };
5096
+ returnProduct['Return'] = __assign({}, returnProduct['Return'], obj);
5080
5097
  (/** @type {?} */ (_this)).rjObject['ProductReturn'].push(returnProduct);
5081
5098
  }
5082
5099
  else {
@@ -5710,6 +5727,22 @@
5710
5727
  (/** @type {?} */ (this)).basketCurrencyId = value;
5711
5728
  return (/** @type {?} */ (this));
5712
5729
  };
5730
+ /**
5731
+ * @template THIS
5732
+ * @this {THIS}
5733
+ * @param {?} value
5734
+ * @return {THIS}
5735
+ */
5736
+ RJMapperBuilderClass.prototype.setBranchID = /**
5737
+ * @template THIS
5738
+ * @this {THIS}
5739
+ * @param {?} value
5740
+ * @return {THIS}
5741
+ */
5742
+ function (value) {
5743
+ (/** @type {?} */ (this)).branchId = value;
5744
+ return (/** @type {?} */ (this));
5745
+ };
5713
5746
  /**
5714
5747
  * @param {?} date
5715
5748
  * @return {?}
@@ -5862,6 +5895,12 @@
5862
5895
  * @return {?}
5863
5896
  */
5864
5897
  function (element, lineDiscount) {
5898
+ /** @type {?} */
5899
+ var taxTotal = this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
5900
+ * @param {?} item
5901
+ * @return {?}
5902
+ */
5903
+ function (item) { return item.itemLineId == element['itemLineId']; }));
5865
5904
  /** @type {?} */
5866
5905
  var obj = {
5867
5906
  XMLSchemaVersion: this.xmlSchemaVersion,
@@ -5881,14 +5920,15 @@
5881
5920
  Quantity: element.quantity.toFixed(1),
5882
5921
  SalespersonID: this.transactionDocument.userId,
5883
5922
  SalespersonName: this.transactionDocument.userName,
5884
- TaxCode: 0,
5885
- //todo
5923
+ TaxCode: this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
5924
+ * @param {?} item
5925
+ * @return {?}
5926
+ */
5927
+ function (item) { return item.itemLineId == element['itemLineId']; })).VATCode,
5886
5928
  TaxModifiable: 1,
5887
5929
  //todo
5888
- TaxAmount: 0,
5889
- //todo
5890
- OriginalTaxAmount: 0,
5891
- //todo
5930
+ OriginalTaxAmount: taxTotal.taxLineTotal < 0 ? this.removeDecimal(taxTotal.taxLineTotal) : this.removeDecimal(-taxTotal.taxLineTotal),
5931
+ TaxAmount: taxTotal.taxLineTotal < 0 ? this.removeDecimal(taxTotal.taxLineTotal) : this.removeDecimal(-taxTotal.taxLineTotal),
5892
5932
  OriginalTaxAmountSet: 1,
5893
5933
  //todo
5894
5934
  ProductID: element.SKU,
@@ -6007,11 +6047,6 @@
6007
6047
  * @private
6008
6048
  */
6009
6049
  RJMapperBuilderClass.prototype.transactionDocument;
6010
- /**
6011
- * @type {?}
6012
- * @private
6013
- */
6014
- RJMapperBuilderClass.prototype.productQuantity;
6015
6050
  /**
6016
6051
  * @type {?}
6017
6052
  * @private
@@ -6112,6 +6147,11 @@
6112
6147
  * @private
6113
6148
  */
6114
6149
  RJMapperBuilderClass.prototype.largestNumber;
6150
+ /**
6151
+ * @type {?}
6152
+ * @private
6153
+ */
6154
+ RJMapperBuilderClass.prototype.branchId;
6115
6155
  /**
6116
6156
  * @type {?}
6117
6157
  * @private