@pmcretail/mapper-library 0.0.18 → 0.0.20
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.
- package/bundles/pmcretail-mapper-library.umd.js +164 -92
- package/bundles/pmcretail-mapper-library.umd.js.map +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js.map +1 -1
- package/esm2015/lib/RJ-mapper.class.js +101 -85
- package/esm2015/lib/mapper-library.model.js +3 -1
- package/esm5/lib/RJ-mapper.class.js +163 -93
- package/esm5/lib/mapper-library.model.js +3 -1
- package/fesm2015/pmcretail-mapper-library.js +102 -84
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +164 -92
- package/fesm5/pmcretail-mapper-library.js.map +1 -1
- package/lib/RJ-mapper.class.d.ts +4 -2
- package/lib/mapper-library.model.d.ts +1 -0
- package/package.json +1 -1
- package/pmcretail-mapper-library.metadata.json +1 -1
|
@@ -860,6 +860,8 @@ if (false) {
|
|
|
860
860
|
TProduct.prototype.leadTime;
|
|
861
861
|
/** @type {?|undefined} */
|
|
862
862
|
TProduct.prototype.lineDiscount;
|
|
863
|
+
/** @type {?|undefined} */
|
|
864
|
+
TProduct.prototype.attributes;
|
|
863
865
|
}
|
|
864
866
|
/**
|
|
865
867
|
* @record
|
|
@@ -4896,6 +4898,8 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
4896
4898
|
/** @type {?} */
|
|
4897
4899
|
var obj = {};
|
|
4898
4900
|
obj['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
4901
|
+
obj['DeviceID'] = (/** @type {?} */ (_this)).deviceId;
|
|
4902
|
+
obj['DateTimeCreated'] = (/** @type {?} */ (_this)).updatedAt;
|
|
4899
4903
|
obj['NetValue'] = (/** @type {?} */ (_this)).convertToString(element.discountAmount * -1);
|
|
4900
4904
|
obj['EffectiveNetValue'] = (/** @type {?} */ (_this)).convertToString(element.discountAmount * -1);
|
|
4901
4905
|
obj['Description'] = element.reasonDisplayText;
|
|
@@ -4965,12 +4969,13 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
4965
4969
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
|
|
4966
4970
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
|
|
4967
4971
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.BranchID = (/** @type {?} */ (this)).branchId;
|
|
4968
|
-
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).
|
|
4972
|
+
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).terminalNumber;
|
|
4973
|
+
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TransactionNumber = (/** @type {?} */ (this)).transactionNumber;
|
|
4969
4974
|
(/** @type {?} */ (this)).rjObject.Trailer.Total = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.basketTotal * 100);
|
|
4970
4975
|
(/** @type {?} */ (this)).rjObject.Trailer.ItemCount = (/** @type {?} */ (this)).itemCount; //gives total count for product
|
|
4971
4976
|
(/** @type {?} */ (this)).rjObject.Trailer.ItemQuantity = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.totalItems);
|
|
4972
4977
|
(/** @type {?} */ (this)).rjObject.Trailer.NetItemQuantity = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.totalItems);
|
|
4973
|
-
(/** @type {?} */ (this)).rjObject.Trailer.TaxTotal = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.VATTotal);
|
|
4978
|
+
(/** @type {?} */ (this)).rjObject.Trailer.TaxTotal = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).removeDecimal((/** @type {?} */ (this)).transactionDocument.basketSummary.VATTotal));
|
|
4974
4979
|
(/** @type {?} */ (this)).rjObject.Trailer.SequenceDeviceID = (/** @type {?} */ (this)).deviceId;
|
|
4975
4980
|
(/** @type {?} */ (this)).rjObject.Trailer.SequenceNumber = 'snsn'; //static for now
|
|
4976
4981
|
(/** @type {?} */ (this)).rjObject['Trailer']['TaxItem'] = [];
|
|
@@ -4982,12 +4987,12 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
4982
4987
|
/** @type {?} */
|
|
4983
4988
|
var obj = {};
|
|
4984
4989
|
obj['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
4985
|
-
obj['TaxRate'] = element.
|
|
4986
|
-
obj['TaxableTotal'] = (/** @type {?} */ (_this)).convertToString(element.taxableAmount);
|
|
4987
|
-
obj['TaxTotal'] = (/** @type {?} */ (_this)).convertToString(element.taxLineTotal);
|
|
4990
|
+
obj['TaxRate'] = (/** @type {?} */ (_this)).convertToString(element.VATCode);
|
|
4991
|
+
obj['TaxableTotal'] = (/** @type {?} */ (_this)).convertToString((/** @type {?} */ (_this)).removeDecimal(element.taxableAmount));
|
|
4992
|
+
obj['TaxTotal'] = (/** @type {?} */ (_this)).convertToString((/** @type {?} */ (_this)).removeDecimal((/** @type {?} */ (_this)).removeDecimal(element.taxLineTotal)));
|
|
4988
4993
|
obj['TaxDescription'] = (/** @type {?} */ (_this)).convertToString(element.VATCode);
|
|
4989
4994
|
obj['TaxIncluded'] = '1';
|
|
4990
|
-
obj['TaxPercentage'] = element.VAT.toFixed(2);
|
|
4995
|
+
obj['TaxPercentage'] = (/** @type {?} */ (_this)).addDecimal(element.VAT.toFixed(2)).toFixed(2);
|
|
4991
4996
|
(/** @type {?} */ (_this)).rjObject['Trailer']['TaxItem'].push(obj);
|
|
4992
4997
|
}));
|
|
4993
4998
|
if ((/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0 || (/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0) {
|
|
@@ -5025,7 +5030,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5025
5030
|
* @param {?} item
|
|
5026
5031
|
* @return {?}
|
|
5027
5032
|
*/
|
|
5028
|
-
function (item) { return item.itemLineId == element.itemLineId; })).VATCode;
|
|
5033
|
+
function (item) { return item.itemLineId == element.itemLineId; })).VATCode;
|
|
5029
5034
|
(/** @type {?} */ (_this)).rjObject['Trailer']['PromotionItem'].push(obj);
|
|
5030
5035
|
}));
|
|
5031
5036
|
}
|
|
@@ -5037,7 +5042,6 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5037
5042
|
function (element) {
|
|
5038
5043
|
/** @type {?} */
|
|
5039
5044
|
var obj = {};
|
|
5040
|
-
console.log('element');
|
|
5041
5045
|
obj['PromotionID'] = element.promotionId;
|
|
5042
5046
|
obj['PromotionSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5043
5047
|
obj['PromotionQuantity'] = "1";
|
|
@@ -5131,15 +5135,15 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5131
5135
|
XMLSchemaVersion: "1",
|
|
5132
5136
|
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5133
5137
|
//todo
|
|
5134
|
-
NetValue:
|
|
5135
|
-
EffectiveNetValue:
|
|
5138
|
+
NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal(Math.round(element.amount))),
|
|
5139
|
+
EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal(Math.round(element.amount))),
|
|
5136
5140
|
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5137
5141
|
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5138
5142
|
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5139
5143
|
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5140
5144
|
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5141
5145
|
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5142
|
-
TenderAmount:
|
|
5146
|
+
TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal(Math.round(element.amount))),
|
|
5143
5147
|
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5144
5148
|
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5145
5149
|
IncludeInTransactionTotalCheck: "1",
|
|
@@ -5156,15 +5160,15 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5156
5160
|
var obj = {
|
|
5157
5161
|
XMLSchemaVersion: (/** @type {?} */ (_this)).xmlSchemaVersion,
|
|
5158
5162
|
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5159
|
-
NetValue:
|
|
5160
|
-
EffectiveNetValue:
|
|
5163
|
+
NetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5164
|
+
EffectiveNetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5161
5165
|
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5162
5166
|
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5163
5167
|
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5164
5168
|
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5165
5169
|
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5166
5170
|
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5167
|
-
TenderAmount:
|
|
5171
|
+
TenderAmount: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5168
5172
|
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5169
5173
|
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5170
5174
|
GiftVoucherSalesAllowed: '',
|
|
@@ -5180,15 +5184,15 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5180
5184
|
var obj1 = {
|
|
5181
5185
|
XMLSchemaVersion: "1",
|
|
5182
5186
|
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5183
|
-
NetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5184
|
-
EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5187
|
+
NetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5188
|
+
EffectiveNetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5185
5189
|
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5186
5190
|
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5187
5191
|
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5188
5192
|
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5189
5193
|
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5190
5194
|
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5191
|
-
TenderAmount: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5195
|
+
TenderAmount: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5192
5196
|
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5193
5197
|
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5194
5198
|
IncludeInTransactionTotalCheck: "1",
|
|
@@ -5291,6 +5295,27 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5291
5295
|
return element.paymentType;
|
|
5292
5296
|
}
|
|
5293
5297
|
};
|
|
5298
|
+
/**
|
|
5299
|
+
* @param {?} attributes
|
|
5300
|
+
* @return {?}
|
|
5301
|
+
*/
|
|
5302
|
+
RJMapperBuilderClass.prototype.getMMGROUPID = /**
|
|
5303
|
+
* @param {?} attributes
|
|
5304
|
+
* @return {?}
|
|
5305
|
+
*/
|
|
5306
|
+
function (attributes) {
|
|
5307
|
+
if (attributes && attributes.length > 0) {
|
|
5308
|
+
/** @type {?} */
|
|
5309
|
+
var filterValue = attributes.filter((/**
|
|
5310
|
+
* @param {?} attribute
|
|
5311
|
+
* @return {?}
|
|
5312
|
+
*/
|
|
5313
|
+
function (attribute) { return attribute.name === "MMGROUPID"; }));
|
|
5314
|
+
if (filterValue && filterValue.length > 0) {
|
|
5315
|
+
return filterValue[0].value;
|
|
5316
|
+
}
|
|
5317
|
+
}
|
|
5318
|
+
};
|
|
5294
5319
|
/**
|
|
5295
5320
|
* @template THIS
|
|
5296
5321
|
* @this {THIS}
|
|
@@ -5318,6 +5343,17 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5318
5343
|
function (value) {
|
|
5319
5344
|
return value * 100;
|
|
5320
5345
|
};
|
|
5346
|
+
/**
|
|
5347
|
+
* @param {?} value
|
|
5348
|
+
* @return {?}
|
|
5349
|
+
*/
|
|
5350
|
+
RJMapperBuilderClass.prototype.addDecimal = /**
|
|
5351
|
+
* @param {?} value
|
|
5352
|
+
* @return {?}
|
|
5353
|
+
*/
|
|
5354
|
+
function (value) {
|
|
5355
|
+
return value / 100;
|
|
5356
|
+
};
|
|
5321
5357
|
/**
|
|
5322
5358
|
* @template THIS
|
|
5323
5359
|
* @this {THIS}
|
|
@@ -5588,6 +5624,22 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5588
5624
|
(/** @type {?} */ (this)).branchId = value;
|
|
5589
5625
|
return (/** @type {?} */ (this));
|
|
5590
5626
|
};
|
|
5627
|
+
/**
|
|
5628
|
+
* @template THIS
|
|
5629
|
+
* @this {THIS}
|
|
5630
|
+
* @param {?} value
|
|
5631
|
+
* @return {THIS}
|
|
5632
|
+
*/
|
|
5633
|
+
RJMapperBuilderClass.prototype.setSalesPersonName = /**
|
|
5634
|
+
* @template THIS
|
|
5635
|
+
* @this {THIS}
|
|
5636
|
+
* @param {?} value
|
|
5637
|
+
* @return {THIS}
|
|
5638
|
+
*/
|
|
5639
|
+
function (value) {
|
|
5640
|
+
(/** @type {?} */ (this)).salesPersonName = value;
|
|
5641
|
+
return (/** @type {?} */ (this));
|
|
5642
|
+
};
|
|
5591
5643
|
/**
|
|
5592
5644
|
* @param {?} date
|
|
5593
5645
|
* @return {?}
|
|
@@ -5689,17 +5741,18 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5689
5741
|
function (item) { return item.itemLineId == element['itemLineId']; })).VATCode;
|
|
5690
5742
|
obj['DisplayTaxCode'] = ''; // todo
|
|
5691
5743
|
obj['ProductAttributes'] = ''; //todo - not required
|
|
5692
|
-
obj['Perishable'] = this.
|
|
5693
|
-
obj['MMGroupID'] = this.getCaregories(element);
|
|
5744
|
+
obj['Perishable'] = this.getMMGROUPID(element.attributes);
|
|
5745
|
+
//obj['MMGroupID'] = this.getCaregories(element);
|
|
5746
|
+
obj['MMGroupID'] = this.getMMGROUPID(element.attributes);
|
|
5694
5747
|
obj['CustomerDetails'] = ""; // todo - blank
|
|
5695
5748
|
obj['TotalPromotionSaving'] = element['promotionAmount'] || -1; // TODO
|
|
5696
|
-
obj['OriginalTaxAmount'] = this.convertToString(this.getOriginalTax(element, taxTotal.VAT) * -1);
|
|
5697
|
-
obj['taxAmount'] = taxTotal.taxLineTotal < 0 ? (taxTotal.taxLineTotal) : (-taxTotal.taxLineTotal);
|
|
5749
|
+
obj['OriginalTaxAmount'] = this.convertToString((this.removeDecimal(this.getOriginalTax(element, taxTotal.VAT) * -1)).toFixed(2));
|
|
5750
|
+
obj['taxAmount'] = this.removeDecimal(taxTotal.taxLineTotal < 0 ? (taxTotal.taxLineTotal) : (-taxTotal.taxLineTotal));
|
|
5698
5751
|
if (lineDiscount) {
|
|
5699
5752
|
if (lineDiscount.percentageDiscountReasonName && lineDiscount.percentageDiscountReasonCode) {
|
|
5700
5753
|
// line discount
|
|
5701
5754
|
obj['Discount'] = {};
|
|
5702
|
-
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.
|
|
5755
|
+
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.discountAmount) * -1;
|
|
5703
5756
|
obj['Discount'].ModifierDateTime = obj.DateTimeCreated;
|
|
5704
5757
|
obj['Discount'].ModifierReasonID = lineDiscount.percentageDiscountReasonCode;
|
|
5705
5758
|
obj['Discount'].ModifierDescription = lineDiscount.percentageDiscountReasonName;
|
|
@@ -5828,10 +5881,10 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5828
5881
|
DateTimeCreated: this.createdAt,
|
|
5829
5882
|
ExtendedValue: this.removeDecimal(element.price),
|
|
5830
5883
|
UnitPrice: this.removeDecimal(element.price),
|
|
5831
|
-
MMGroupID: this.getCaregories(element),
|
|
5832
|
-
Quantity: element.quantity
|
|
5833
|
-
SalespersonID: this.transactionDocument.
|
|
5834
|
-
SalespersonName: this.
|
|
5884
|
+
//MMGroupID: this.getCaregories(element),
|
|
5885
|
+
Quantity: element.quantity,
|
|
5886
|
+
SalespersonID: this.transactionDocument.userName,
|
|
5887
|
+
SalespersonName: this.salesPersonName,
|
|
5835
5888
|
TaxCode: this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
|
|
5836
5889
|
* @param {?} item
|
|
5837
5890
|
* @return {?}
|
|
@@ -5839,21 +5892,22 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5839
5892
|
function (item) { return item.itemLineId == element['itemLineId']; })).VATCode,
|
|
5840
5893
|
TaxModifiable: "1",
|
|
5841
5894
|
//todo
|
|
5842
|
-
OriginalTaxAmount: this.convertToString(this.getOriginalTax(element, taxTotal.VAT)),
|
|
5843
|
-
TaxAmount: this.convertToString(taxTotal.taxLineTotal),
|
|
5895
|
+
OriginalTaxAmount: this.convertToString((this.removeDecimal(this.getOriginalTax(element, taxTotal.VAT)).toFixed(2))),
|
|
5896
|
+
TaxAmount: this.convertToString(this.removeDecimal(taxTotal.taxLineTotal)),
|
|
5844
5897
|
OriginalTaxAmountSet: "1",
|
|
5845
5898
|
//todo
|
|
5846
5899
|
ProductID: element.SKU,
|
|
5847
5900
|
HandKeyed: "1",
|
|
5848
5901
|
//todo
|
|
5849
5902
|
CustomerDetails: "",
|
|
5850
|
-
Perishable: this.
|
|
5903
|
+
Perishable: this.getMMGROUPID(element.attributes),
|
|
5904
|
+
MMGroupID: this.getMMGROUPID(element.attributes)
|
|
5851
5905
|
};
|
|
5852
5906
|
if (lineDiscount) {
|
|
5853
5907
|
if (lineDiscount.percentageDiscountReasonName && lineDiscount.percentageDiscountReasonCode) {
|
|
5854
5908
|
// line discount
|
|
5855
5909
|
obj['Discount'] = {};
|
|
5856
|
-
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.
|
|
5910
|
+
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.discountAmount) * -1;
|
|
5857
5911
|
obj['Discount'].ModifierDateTime = obj.DateTimeCreated;
|
|
5858
5912
|
obj['Discount'].ModifierReasonID = lineDiscount.percentageDiscountReasonCode;
|
|
5859
5913
|
obj['Discount'].ModifierDescription = lineDiscount.percentageDiscountReasonName;
|
|
@@ -5901,7 +5955,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
5901
5955
|
/** @type {?} */
|
|
5902
5956
|
var discountAmount = _this.convertToString(e.discountAmount * -1);
|
|
5903
5957
|
discountObj.XMLSchemaVersion = _this.xmlSchemaVersion;
|
|
5904
|
-
discountObj.DiscountedValue = -(_this.getDiscountedValue(element.totalLinePrice, e.discountAmount)
|
|
5958
|
+
discountObj.DiscountedValue = -(_this.getDiscountedValue(element.totalLinePrice, e.discountAmount));
|
|
5905
5959
|
discountObj.BasketDiscountLineNumber = _this.getLineNumber(e, discountAmount);
|
|
5906
5960
|
obj['BasketDiscountModifier'].push(discountObj);
|
|
5907
5961
|
}
|
|
@@ -6024,7 +6078,7 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
6024
6078
|
*/
|
|
6025
6079
|
function (price, discountAmount) {
|
|
6026
6080
|
/** @type {?} */
|
|
6027
|
-
var DiscountedValue = (price * discountAmount) / this.transactionDocument.basketSummary.saleTotal;
|
|
6081
|
+
var DiscountedValue = ((price * discountAmount) / this.transactionDocument.basketSummary.saleTotal) * 100;
|
|
6028
6082
|
return DiscountedValue;
|
|
6029
6083
|
};
|
|
6030
6084
|
/**
|
|
@@ -6081,68 +6135,81 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
6081
6135
|
}));
|
|
6082
6136
|
return x;
|
|
6083
6137
|
};
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
}
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
function (x) { return x.parentId != ''; }));
|
|
6131
|
-
/** @type {?} */
|
|
6132
|
-
var value = categories.filter((/**
|
|
6133
|
-
* @param {?} x
|
|
6134
|
-
* @return {?}
|
|
6135
|
-
*/
|
|
6136
|
-
function (x) { return x.id != x.parentId; }));
|
|
6137
|
-
MMGroupId = value[0].name;
|
|
6138
|
-
}
|
|
6139
|
-
return MMGroupId;
|
|
6140
|
-
};
|
|
6138
|
+
// getAttributes(){
|
|
6139
|
+
// let name: string | any[] = []
|
|
6140
|
+
// this.transactionDocument.basket.products.forEach((element: any) => {
|
|
6141
|
+
// if (element && element.attributes && element.attributes.length > 0) {
|
|
6142
|
+
// name = element.attributes.filter((x: any) => x.name.toUpperCase() === element.name.toUpperCase());
|
|
6143
|
+
// }
|
|
6144
|
+
// });
|
|
6145
|
+
// if (name.length > 0) {
|
|
6146
|
+
// return name[0].value
|
|
6147
|
+
// }
|
|
6148
|
+
// else{
|
|
6149
|
+
// return ""
|
|
6150
|
+
// }
|
|
6151
|
+
// }
|
|
6152
|
+
// getCaregories(element) {
|
|
6153
|
+
// let MMGroupId = " ";
|
|
6154
|
+
// if (element.categories && element.categories.length > 0) {
|
|
6155
|
+
// let categories = element.categories.filter((x) => x.parentId != '');
|
|
6156
|
+
// let value = categories.filter((x) => x.id != x.parentId);
|
|
6157
|
+
// MMGroupId = value[0].name;
|
|
6158
|
+
// }
|
|
6159
|
+
// return MMGroupId;
|
|
6160
|
+
// }
|
|
6161
|
+
// getAttributes(){
|
|
6162
|
+
// let name: string | any[] = []
|
|
6163
|
+
// this.transactionDocument.basket.products.forEach((element: any) => {
|
|
6164
|
+
// if (element && element.attributes && element.attributes.length > 0) {
|
|
6165
|
+
// name = element.attributes.filter((x: any) => x.name.toUpperCase() === element.name.toUpperCase());
|
|
6166
|
+
// }
|
|
6167
|
+
// });
|
|
6168
|
+
// if (name.length > 0) {
|
|
6169
|
+
// return name[0].value
|
|
6170
|
+
// }
|
|
6171
|
+
// else{
|
|
6172
|
+
// return ""
|
|
6173
|
+
// }
|
|
6174
|
+
// }
|
|
6175
|
+
// getCaregories(element) {
|
|
6176
|
+
// let MMGroupId = " ";
|
|
6177
|
+
// if (element.categories && element.categories.length > 0) {
|
|
6178
|
+
// let categories = element.categories.filter((x) => x.parentId != '');
|
|
6179
|
+
// let value = categories.filter((x) => x.id != x.parentId);
|
|
6180
|
+
// MMGroupId = value[0].name;
|
|
6181
|
+
// }
|
|
6182
|
+
// return MMGroupId;
|
|
6183
|
+
// }
|
|
6141
6184
|
/**
|
|
6142
6185
|
* @param {?} date
|
|
6143
6186
|
* @return {?}
|
|
6144
6187
|
*/
|
|
6145
|
-
RJMapperBuilderClass.prototype.getDate =
|
|
6188
|
+
RJMapperBuilderClass.prototype.getDate =
|
|
6189
|
+
// getAttributes(){
|
|
6190
|
+
// let name: string | any[] = []
|
|
6191
|
+
// this.transactionDocument.basket.products.forEach((element: any) => {
|
|
6192
|
+
// if (element && element.attributes && element.attributes.length > 0) {
|
|
6193
|
+
// name = element.attributes.filter((x: any) => x.name.toUpperCase() === element.name.toUpperCase());
|
|
6194
|
+
// }
|
|
6195
|
+
// });
|
|
6196
|
+
// if (name.length > 0) {
|
|
6197
|
+
// return name[0].value
|
|
6198
|
+
// }
|
|
6199
|
+
// else{
|
|
6200
|
+
// return ""
|
|
6201
|
+
// }
|
|
6202
|
+
// }
|
|
6203
|
+
// getCaregories(element) {
|
|
6204
|
+
// let MMGroupId = " ";
|
|
6205
|
+
// if (element.categories && element.categories.length > 0) {
|
|
6206
|
+
// let categories = element.categories.filter((x) => x.parentId != '');
|
|
6207
|
+
// let value = categories.filter((x) => x.id != x.parentId);
|
|
6208
|
+
// MMGroupId = value[0].name;
|
|
6209
|
+
// }
|
|
6210
|
+
// return MMGroupId;
|
|
6211
|
+
// }
|
|
6212
|
+
/**
|
|
6146
6213
|
* @param {?} date
|
|
6147
6214
|
* @return {?}
|
|
6148
6215
|
*/
|
|
@@ -6200,10 +6267,10 @@ var RJMapperBuilderClass = /** @class */ (function () {
|
|
|
6200
6267
|
/** @type {?} */
|
|
6201
6268
|
var quantity;
|
|
6202
6269
|
if (this.transactionDocument.unreferencedRefund) {
|
|
6203
|
-
quantity = element['quantity'] < 0 ? element['quantity']
|
|
6270
|
+
quantity = element['quantity'] < 0 ? element['quantity'] : (-element['quantity']);
|
|
6204
6271
|
}
|
|
6205
6272
|
else {
|
|
6206
|
-
quantity = element['refundedQuantity'] < 0 ? element['refundedQuantity']
|
|
6273
|
+
quantity = element['refundedQuantity'] < 0 ? element['refundedQuantity'] : (-element['refundedQuantity']);
|
|
6207
6274
|
}
|
|
6208
6275
|
return quantity;
|
|
6209
6276
|
};
|
|
@@ -6325,6 +6392,11 @@ if (false) {
|
|
|
6325
6392
|
* @private
|
|
6326
6393
|
*/
|
|
6327
6394
|
RJMapperBuilderClass.prototype.updatedAt;
|
|
6395
|
+
/**
|
|
6396
|
+
* @type {?}
|
|
6397
|
+
* @private
|
|
6398
|
+
*/
|
|
6399
|
+
RJMapperBuilderClass.prototype.salesPersonName;
|
|
6328
6400
|
/**
|
|
6329
6401
|
* @type {?}
|
|
6330
6402
|
* @private
|