@pmcretail/mapper-library 0.0.18 → 0.0.19
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 +165 -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 +102 -85
- package/esm2015/lib/mapper-library.model.js +3 -1
- package/esm5/lib/RJ-mapper.class.js +164 -93
- package/esm5/lib/mapper-library.model.js +3 -1
- package/fesm2015/pmcretail-mapper-library.js +103 -84
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +165 -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
|
@@ -1080,6 +1080,8 @@
|
|
|
1080
1080
|
TProduct.prototype.leadTime;
|
|
1081
1081
|
/** @type {?|undefined} */
|
|
1082
1082
|
TProduct.prototype.lineDiscount;
|
|
1083
|
+
/** @type {?|undefined} */
|
|
1084
|
+
TProduct.prototype.attributes;
|
|
1083
1085
|
}
|
|
1084
1086
|
/**
|
|
1085
1087
|
* @record
|
|
@@ -5116,6 +5118,8 @@
|
|
|
5116
5118
|
/** @type {?} */
|
|
5117
5119
|
var obj = {};
|
|
5118
5120
|
obj['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5121
|
+
obj['DeviceID'] = (/** @type {?} */ (_this)).deviceId;
|
|
5122
|
+
obj['DateTimeCreated'] = (/** @type {?} */ (_this)).updatedAt;
|
|
5119
5123
|
obj['NetValue'] = (/** @type {?} */ (_this)).convertToString(element.discountAmount * -1);
|
|
5120
5124
|
obj['EffectiveNetValue'] = (/** @type {?} */ (_this)).convertToString(element.discountAmount * -1);
|
|
5121
5125
|
obj['Description'] = element.reasonDisplayText;
|
|
@@ -5185,12 +5189,13 @@
|
|
|
5185
5189
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
|
|
5186
5190
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
|
|
5187
5191
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.BranchID = (/** @type {?} */ (this)).branchId;
|
|
5188
|
-
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).
|
|
5192
|
+
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).terminalNumber;
|
|
5193
|
+
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TransactionNumber = (/** @type {?} */ (this)).transactionNumber;
|
|
5189
5194
|
(/** @type {?} */ (this)).rjObject.Trailer.Total = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.basketTotal * 100);
|
|
5190
5195
|
(/** @type {?} */ (this)).rjObject.Trailer.ItemCount = (/** @type {?} */ (this)).itemCount; //gives total count for product
|
|
5191
5196
|
(/** @type {?} */ (this)).rjObject.Trailer.ItemQuantity = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.totalItems);
|
|
5192
5197
|
(/** @type {?} */ (this)).rjObject.Trailer.NetItemQuantity = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.totalItems);
|
|
5193
|
-
(/** @type {?} */ (this)).rjObject.Trailer.TaxTotal = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).transactionDocument.basketSummary.VATTotal);
|
|
5198
|
+
(/** @type {?} */ (this)).rjObject.Trailer.TaxTotal = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).removeDecimal((/** @type {?} */ (this)).transactionDocument.basketSummary.VATTotal));
|
|
5194
5199
|
(/** @type {?} */ (this)).rjObject.Trailer.SequenceDeviceID = (/** @type {?} */ (this)).deviceId;
|
|
5195
5200
|
(/** @type {?} */ (this)).rjObject.Trailer.SequenceNumber = 'snsn'; //static for now
|
|
5196
5201
|
(/** @type {?} */ (this)).rjObject['Trailer']['TaxItem'] = [];
|
|
@@ -5202,12 +5207,12 @@
|
|
|
5202
5207
|
/** @type {?} */
|
|
5203
5208
|
var obj = {};
|
|
5204
5209
|
obj['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5205
|
-
obj['TaxRate'] = element.
|
|
5206
|
-
obj['TaxableTotal'] = (/** @type {?} */ (_this)).convertToString(element.taxableAmount);
|
|
5207
|
-
obj['TaxTotal'] = (/** @type {?} */ (_this)).convertToString(element.taxLineTotal);
|
|
5210
|
+
obj['TaxRate'] = (/** @type {?} */ (_this)).convertToString(element.VATCode);
|
|
5211
|
+
obj['TaxableTotal'] = (/** @type {?} */ (_this)).convertToString((/** @type {?} */ (_this)).removeDecimal(element.taxableAmount));
|
|
5212
|
+
obj['TaxTotal'] = (/** @type {?} */ (_this)).convertToString((/** @type {?} */ (_this)).removeDecimal((/** @type {?} */ (_this)).removeDecimal(element.taxLineTotal)));
|
|
5208
5213
|
obj['TaxDescription'] = (/** @type {?} */ (_this)).convertToString(element.VATCode);
|
|
5209
5214
|
obj['TaxIncluded'] = '1';
|
|
5210
|
-
obj['TaxPercentage'] = element.VAT.toFixed(2);
|
|
5215
|
+
obj['TaxPercentage'] = (/** @type {?} */ (_this)).addDecimal(element.VAT.toFixed(2)).toFixed(2);
|
|
5211
5216
|
(/** @type {?} */ (_this)).rjObject['Trailer']['TaxItem'].push(obj);
|
|
5212
5217
|
}));
|
|
5213
5218
|
if ((/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0 || (/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0) {
|
|
@@ -5245,7 +5250,7 @@
|
|
|
5245
5250
|
* @param {?} item
|
|
5246
5251
|
* @return {?}
|
|
5247
5252
|
*/
|
|
5248
|
-
function (item) { return item.itemLineId == element.itemLineId; })).VATCode;
|
|
5253
|
+
function (item) { return item.itemLineId == element.itemLineId; })).VATCode;
|
|
5249
5254
|
(/** @type {?} */ (_this)).rjObject['Trailer']['PromotionItem'].push(obj);
|
|
5250
5255
|
}));
|
|
5251
5256
|
}
|
|
@@ -5257,7 +5262,6 @@
|
|
|
5257
5262
|
function (element) {
|
|
5258
5263
|
/** @type {?} */
|
|
5259
5264
|
var obj = {};
|
|
5260
|
-
console.log('element');
|
|
5261
5265
|
obj['PromotionID'] = element.promotionId;
|
|
5262
5266
|
obj['PromotionSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5263
5267
|
obj['PromotionQuantity'] = "1";
|
|
@@ -5346,20 +5350,21 @@
|
|
|
5346
5350
|
(/** @type {?} */ (_this)).rjObject[element.externalTenderKey].push(obj);
|
|
5347
5351
|
}
|
|
5348
5352
|
else {
|
|
5353
|
+
debugger;
|
|
5349
5354
|
/** @type {?} */
|
|
5350
5355
|
var obj1 = {
|
|
5351
5356
|
XMLSchemaVersion: "1",
|
|
5352
5357
|
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5353
5358
|
//todo
|
|
5354
|
-
NetValue:
|
|
5355
|
-
EffectiveNetValue:
|
|
5359
|
+
NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal(Math.round(element.amount))),
|
|
5360
|
+
EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal(Math.round(element.amount))),
|
|
5356
5361
|
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5357
5362
|
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5358
5363
|
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5359
5364
|
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5360
5365
|
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5361
5366
|
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5362
|
-
TenderAmount:
|
|
5367
|
+
TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal(Math.round(element.amount))),
|
|
5363
5368
|
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5364
5369
|
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5365
5370
|
IncludeInTransactionTotalCheck: "1",
|
|
@@ -5376,15 +5381,15 @@
|
|
|
5376
5381
|
var obj = {
|
|
5377
5382
|
XMLSchemaVersion: (/** @type {?} */ (_this)).xmlSchemaVersion,
|
|
5378
5383
|
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5379
|
-
NetValue:
|
|
5380
|
-
EffectiveNetValue:
|
|
5384
|
+
NetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5385
|
+
EffectiveNetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5381
5386
|
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5382
5387
|
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5383
5388
|
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5384
5389
|
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5385
5390
|
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5386
5391
|
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5387
|
-
TenderAmount:
|
|
5392
|
+
TenderAmount: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5388
5393
|
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5389
5394
|
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5390
5395
|
GiftVoucherSalesAllowed: '',
|
|
@@ -5400,15 +5405,15 @@
|
|
|
5400
5405
|
var obj1 = {
|
|
5401
5406
|
XMLSchemaVersion: "1",
|
|
5402
5407
|
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5403
|
-
NetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5404
|
-
EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5408
|
+
NetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5409
|
+
EffectiveNetValue: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5405
5410
|
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5406
5411
|
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5407
5412
|
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5408
5413
|
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5409
5414
|
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5410
5415
|
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5411
|
-
TenderAmount: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5416
|
+
TenderAmount: JSON.stringify(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5412
5417
|
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5413
5418
|
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5414
5419
|
IncludeInTransactionTotalCheck: "1",
|
|
@@ -5511,6 +5516,27 @@
|
|
|
5511
5516
|
return element.paymentType;
|
|
5512
5517
|
}
|
|
5513
5518
|
};
|
|
5519
|
+
/**
|
|
5520
|
+
* @param {?} attributes
|
|
5521
|
+
* @return {?}
|
|
5522
|
+
*/
|
|
5523
|
+
RJMapperBuilderClass.prototype.getMMGROUPID = /**
|
|
5524
|
+
* @param {?} attributes
|
|
5525
|
+
* @return {?}
|
|
5526
|
+
*/
|
|
5527
|
+
function (attributes) {
|
|
5528
|
+
if (attributes && attributes.length > 0) {
|
|
5529
|
+
/** @type {?} */
|
|
5530
|
+
var filterValue = attributes.filter((/**
|
|
5531
|
+
* @param {?} attribute
|
|
5532
|
+
* @return {?}
|
|
5533
|
+
*/
|
|
5534
|
+
function (attribute) { return attribute.name === "MMGROUPID"; }));
|
|
5535
|
+
if (filterValue && filterValue.length > 0) {
|
|
5536
|
+
return filterValue[0].value;
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
};
|
|
5514
5540
|
/**
|
|
5515
5541
|
* @template THIS
|
|
5516
5542
|
* @this {THIS}
|
|
@@ -5538,6 +5564,17 @@
|
|
|
5538
5564
|
function (value) {
|
|
5539
5565
|
return value * 100;
|
|
5540
5566
|
};
|
|
5567
|
+
/**
|
|
5568
|
+
* @param {?} value
|
|
5569
|
+
* @return {?}
|
|
5570
|
+
*/
|
|
5571
|
+
RJMapperBuilderClass.prototype.addDecimal = /**
|
|
5572
|
+
* @param {?} value
|
|
5573
|
+
* @return {?}
|
|
5574
|
+
*/
|
|
5575
|
+
function (value) {
|
|
5576
|
+
return value / 100;
|
|
5577
|
+
};
|
|
5541
5578
|
/**
|
|
5542
5579
|
* @template THIS
|
|
5543
5580
|
* @this {THIS}
|
|
@@ -5808,6 +5845,22 @@
|
|
|
5808
5845
|
(/** @type {?} */ (this)).branchId = value;
|
|
5809
5846
|
return (/** @type {?} */ (this));
|
|
5810
5847
|
};
|
|
5848
|
+
/**
|
|
5849
|
+
* @template THIS
|
|
5850
|
+
* @this {THIS}
|
|
5851
|
+
* @param {?} value
|
|
5852
|
+
* @return {THIS}
|
|
5853
|
+
*/
|
|
5854
|
+
RJMapperBuilderClass.prototype.setSalesPersonName = /**
|
|
5855
|
+
* @template THIS
|
|
5856
|
+
* @this {THIS}
|
|
5857
|
+
* @param {?} value
|
|
5858
|
+
* @return {THIS}
|
|
5859
|
+
*/
|
|
5860
|
+
function (value) {
|
|
5861
|
+
(/** @type {?} */ (this)).salesPersonName = value;
|
|
5862
|
+
return (/** @type {?} */ (this));
|
|
5863
|
+
};
|
|
5811
5864
|
/**
|
|
5812
5865
|
* @param {?} date
|
|
5813
5866
|
* @return {?}
|
|
@@ -5909,17 +5962,18 @@
|
|
|
5909
5962
|
function (item) { return item.itemLineId == element['itemLineId']; })).VATCode;
|
|
5910
5963
|
obj['DisplayTaxCode'] = ''; // todo
|
|
5911
5964
|
obj['ProductAttributes'] = ''; //todo - not required
|
|
5912
|
-
obj['Perishable'] = this.
|
|
5913
|
-
obj['MMGroupID'] = this.getCaregories(element);
|
|
5965
|
+
obj['Perishable'] = this.getMMGROUPID(element.attributes);
|
|
5966
|
+
//obj['MMGroupID'] = this.getCaregories(element);
|
|
5967
|
+
obj['MMGroupID'] = this.getMMGROUPID(element.attributes);
|
|
5914
5968
|
obj['CustomerDetails'] = ""; // todo - blank
|
|
5915
5969
|
obj['TotalPromotionSaving'] = element['promotionAmount'] || -1; // TODO
|
|
5916
|
-
obj['OriginalTaxAmount'] = this.convertToString(this.getOriginalTax(element, taxTotal.VAT) * -1);
|
|
5917
|
-
obj['taxAmount'] = taxTotal.taxLineTotal < 0 ? (taxTotal.taxLineTotal) : (-taxTotal.taxLineTotal);
|
|
5970
|
+
obj['OriginalTaxAmount'] = this.convertToString((this.removeDecimal(this.getOriginalTax(element, taxTotal.VAT) * -1)).toFixed(2));
|
|
5971
|
+
obj['taxAmount'] = this.removeDecimal(taxTotal.taxLineTotal < 0 ? (taxTotal.taxLineTotal) : (-taxTotal.taxLineTotal));
|
|
5918
5972
|
if (lineDiscount) {
|
|
5919
5973
|
if (lineDiscount.percentageDiscountReasonName && lineDiscount.percentageDiscountReasonCode) {
|
|
5920
5974
|
// line discount
|
|
5921
5975
|
obj['Discount'] = {};
|
|
5922
|
-
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.
|
|
5976
|
+
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.discountAmount) * -1;
|
|
5923
5977
|
obj['Discount'].ModifierDateTime = obj.DateTimeCreated;
|
|
5924
5978
|
obj['Discount'].ModifierReasonID = lineDiscount.percentageDiscountReasonCode;
|
|
5925
5979
|
obj['Discount'].ModifierDescription = lineDiscount.percentageDiscountReasonName;
|
|
@@ -6048,10 +6102,10 @@
|
|
|
6048
6102
|
DateTimeCreated: this.createdAt,
|
|
6049
6103
|
ExtendedValue: this.removeDecimal(element.price),
|
|
6050
6104
|
UnitPrice: this.removeDecimal(element.price),
|
|
6051
|
-
MMGroupID: this.getCaregories(element),
|
|
6052
|
-
Quantity: element.quantity
|
|
6053
|
-
SalespersonID: this.transactionDocument.
|
|
6054
|
-
SalespersonName: this.
|
|
6105
|
+
//MMGroupID: this.getCaregories(element),
|
|
6106
|
+
Quantity: element.quantity,
|
|
6107
|
+
SalespersonID: this.transactionDocument.userName,
|
|
6108
|
+
SalespersonName: this.salesPersonName,
|
|
6055
6109
|
TaxCode: this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
|
|
6056
6110
|
* @param {?} item
|
|
6057
6111
|
* @return {?}
|
|
@@ -6059,21 +6113,22 @@
|
|
|
6059
6113
|
function (item) { return item.itemLineId == element['itemLineId']; })).VATCode,
|
|
6060
6114
|
TaxModifiable: "1",
|
|
6061
6115
|
//todo
|
|
6062
|
-
OriginalTaxAmount: this.convertToString(this.getOriginalTax(element, taxTotal.VAT)),
|
|
6063
|
-
TaxAmount: this.convertToString(taxTotal.taxLineTotal),
|
|
6116
|
+
OriginalTaxAmount: this.convertToString((this.removeDecimal(this.getOriginalTax(element, taxTotal.VAT)).toFixed(2))),
|
|
6117
|
+
TaxAmount: this.convertToString(this.removeDecimal(taxTotal.taxLineTotal)),
|
|
6064
6118
|
OriginalTaxAmountSet: "1",
|
|
6065
6119
|
//todo
|
|
6066
6120
|
ProductID: element.SKU,
|
|
6067
6121
|
HandKeyed: "1",
|
|
6068
6122
|
//todo
|
|
6069
6123
|
CustomerDetails: "",
|
|
6070
|
-
Perishable: this.
|
|
6124
|
+
Perishable: this.getMMGROUPID(element.attributes),
|
|
6125
|
+
MMGroupID: this.getMMGROUPID(element.attributes)
|
|
6071
6126
|
};
|
|
6072
6127
|
if (lineDiscount) {
|
|
6073
6128
|
if (lineDiscount.percentageDiscountReasonName && lineDiscount.percentageDiscountReasonCode) {
|
|
6074
6129
|
// line discount
|
|
6075
6130
|
obj['Discount'] = {};
|
|
6076
|
-
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.
|
|
6131
|
+
obj['Discount'].ModifierValue = this.removeDecimal(lineDiscount.discountAmount) * -1;
|
|
6077
6132
|
obj['Discount'].ModifierDateTime = obj.DateTimeCreated;
|
|
6078
6133
|
obj['Discount'].ModifierReasonID = lineDiscount.percentageDiscountReasonCode;
|
|
6079
6134
|
obj['Discount'].ModifierDescription = lineDiscount.percentageDiscountReasonName;
|
|
@@ -6121,7 +6176,7 @@
|
|
|
6121
6176
|
/** @type {?} */
|
|
6122
6177
|
var discountAmount = _this.convertToString(e.discountAmount * -1);
|
|
6123
6178
|
discountObj.XMLSchemaVersion = _this.xmlSchemaVersion;
|
|
6124
|
-
discountObj.DiscountedValue = -(_this.getDiscountedValue(element.totalLinePrice, e.discountAmount)
|
|
6179
|
+
discountObj.DiscountedValue = -(_this.getDiscountedValue(element.totalLinePrice, e.discountAmount));
|
|
6125
6180
|
discountObj.BasketDiscountLineNumber = _this.getLineNumber(e, discountAmount);
|
|
6126
6181
|
obj['BasketDiscountModifier'].push(discountObj);
|
|
6127
6182
|
}
|
|
@@ -6244,7 +6299,7 @@
|
|
|
6244
6299
|
*/
|
|
6245
6300
|
function (price, discountAmount) {
|
|
6246
6301
|
/** @type {?} */
|
|
6247
|
-
var DiscountedValue = (price * discountAmount) / this.transactionDocument.basketSummary.saleTotal;
|
|
6302
|
+
var DiscountedValue = ((price * discountAmount) / this.transactionDocument.basketSummary.saleTotal) * 100;
|
|
6248
6303
|
return DiscountedValue;
|
|
6249
6304
|
};
|
|
6250
6305
|
/**
|
|
@@ -6301,68 +6356,81 @@
|
|
|
6301
6356
|
}));
|
|
6302
6357
|
return x;
|
|
6303
6358
|
};
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
}
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
function (x) { return x.parentId != ''; }));
|
|
6351
|
-
/** @type {?} */
|
|
6352
|
-
var value = categories.filter((/**
|
|
6353
|
-
* @param {?} x
|
|
6354
|
-
* @return {?}
|
|
6355
|
-
*/
|
|
6356
|
-
function (x) { return x.id != x.parentId; }));
|
|
6357
|
-
MMGroupId = value[0].name;
|
|
6358
|
-
}
|
|
6359
|
-
return MMGroupId;
|
|
6360
|
-
};
|
|
6359
|
+
// getAttributes(){
|
|
6360
|
+
// let name: string | any[] = []
|
|
6361
|
+
// this.transactionDocument.basket.products.forEach((element: any) => {
|
|
6362
|
+
// if (element && element.attributes && element.attributes.length > 0) {
|
|
6363
|
+
// name = element.attributes.filter((x: any) => x.name.toUpperCase() === element.name.toUpperCase());
|
|
6364
|
+
// }
|
|
6365
|
+
// });
|
|
6366
|
+
// if (name.length > 0) {
|
|
6367
|
+
// return name[0].value
|
|
6368
|
+
// }
|
|
6369
|
+
// else{
|
|
6370
|
+
// return ""
|
|
6371
|
+
// }
|
|
6372
|
+
// }
|
|
6373
|
+
// getCaregories(element) {
|
|
6374
|
+
// let MMGroupId = " ";
|
|
6375
|
+
// if (element.categories && element.categories.length > 0) {
|
|
6376
|
+
// let categories = element.categories.filter((x) => x.parentId != '');
|
|
6377
|
+
// let value = categories.filter((x) => x.id != x.parentId);
|
|
6378
|
+
// MMGroupId = value[0].name;
|
|
6379
|
+
// }
|
|
6380
|
+
// return MMGroupId;
|
|
6381
|
+
// }
|
|
6382
|
+
// getAttributes(){
|
|
6383
|
+
// let name: string | any[] = []
|
|
6384
|
+
// this.transactionDocument.basket.products.forEach((element: any) => {
|
|
6385
|
+
// if (element && element.attributes && element.attributes.length > 0) {
|
|
6386
|
+
// name = element.attributes.filter((x: any) => x.name.toUpperCase() === element.name.toUpperCase());
|
|
6387
|
+
// }
|
|
6388
|
+
// });
|
|
6389
|
+
// if (name.length > 0) {
|
|
6390
|
+
// return name[0].value
|
|
6391
|
+
// }
|
|
6392
|
+
// else{
|
|
6393
|
+
// return ""
|
|
6394
|
+
// }
|
|
6395
|
+
// }
|
|
6396
|
+
// getCaregories(element) {
|
|
6397
|
+
// let MMGroupId = " ";
|
|
6398
|
+
// if (element.categories && element.categories.length > 0) {
|
|
6399
|
+
// let categories = element.categories.filter((x) => x.parentId != '');
|
|
6400
|
+
// let value = categories.filter((x) => x.id != x.parentId);
|
|
6401
|
+
// MMGroupId = value[0].name;
|
|
6402
|
+
// }
|
|
6403
|
+
// return MMGroupId;
|
|
6404
|
+
// }
|
|
6361
6405
|
/**
|
|
6362
6406
|
* @param {?} date
|
|
6363
6407
|
* @return {?}
|
|
6364
6408
|
*/
|
|
6365
|
-
RJMapperBuilderClass.prototype.getDate =
|
|
6409
|
+
RJMapperBuilderClass.prototype.getDate =
|
|
6410
|
+
// getAttributes(){
|
|
6411
|
+
// let name: string | any[] = []
|
|
6412
|
+
// this.transactionDocument.basket.products.forEach((element: any) => {
|
|
6413
|
+
// if (element && element.attributes && element.attributes.length > 0) {
|
|
6414
|
+
// name = element.attributes.filter((x: any) => x.name.toUpperCase() === element.name.toUpperCase());
|
|
6415
|
+
// }
|
|
6416
|
+
// });
|
|
6417
|
+
// if (name.length > 0) {
|
|
6418
|
+
// return name[0].value
|
|
6419
|
+
// }
|
|
6420
|
+
// else{
|
|
6421
|
+
// return ""
|
|
6422
|
+
// }
|
|
6423
|
+
// }
|
|
6424
|
+
// getCaregories(element) {
|
|
6425
|
+
// let MMGroupId = " ";
|
|
6426
|
+
// if (element.categories && element.categories.length > 0) {
|
|
6427
|
+
// let categories = element.categories.filter((x) => x.parentId != '');
|
|
6428
|
+
// let value = categories.filter((x) => x.id != x.parentId);
|
|
6429
|
+
// MMGroupId = value[0].name;
|
|
6430
|
+
// }
|
|
6431
|
+
// return MMGroupId;
|
|
6432
|
+
// }
|
|
6433
|
+
/**
|
|
6366
6434
|
* @param {?} date
|
|
6367
6435
|
* @return {?}
|
|
6368
6436
|
*/
|
|
@@ -6420,10 +6488,10 @@
|
|
|
6420
6488
|
/** @type {?} */
|
|
6421
6489
|
var quantity;
|
|
6422
6490
|
if (this.transactionDocument.unreferencedRefund) {
|
|
6423
|
-
quantity = element['quantity'] < 0 ? element['quantity']
|
|
6491
|
+
quantity = element['quantity'] < 0 ? element['quantity'] : (-element['quantity']);
|
|
6424
6492
|
}
|
|
6425
6493
|
else {
|
|
6426
|
-
quantity = element['refundedQuantity'] < 0 ? element['refundedQuantity']
|
|
6494
|
+
quantity = element['refundedQuantity'] < 0 ? element['refundedQuantity'] : (-element['refundedQuantity']);
|
|
6427
6495
|
}
|
|
6428
6496
|
return quantity;
|
|
6429
6497
|
};
|
|
@@ -6545,6 +6613,11 @@
|
|
|
6545
6613
|
* @private
|
|
6546
6614
|
*/
|
|
6547
6615
|
RJMapperBuilderClass.prototype.updatedAt;
|
|
6616
|
+
/**
|
|
6617
|
+
* @type {?}
|
|
6618
|
+
* @private
|
|
6619
|
+
*/
|
|
6620
|
+
RJMapperBuilderClass.prototype.salesPersonName;
|
|
6548
6621
|
/**
|
|
6549
6622
|
* @type {?}
|
|
6550
6623
|
* @private
|