@pmcretail/mapper-library 0.0.14 → 0.0.16
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 +652 -110
- 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 +334 -110
- package/esm2015/lib/WebReturn-mapper.class.js +236 -0
- package/esm2015/pmcretail-mapper-library.js +2 -2
- package/esm2015/public-api.js +2 -1
- package/esm5/lib/RJ-mapper.class.js +348 -111
- package/esm5/lib/WebReturn-mapper.class.js +305 -0
- package/esm5/pmcretail-mapper-library.js +2 -2
- package/esm5/public-api.js +2 -1
- package/fesm2015/pmcretail-mapper-library.js +570 -110
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +652 -111
- package/fesm5/pmcretail-mapper-library.js.map +1 -1
- package/lib/RJ-mapper.class.d.ts +3 -0
- package/lib/WebReturn-mapper.class.d.ts +19 -0
- package/package.json +1 -1
- package/pmcretail-mapper-library.metadata.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -4956,7 +4956,7 @@
|
|
|
4956
4956
|
(/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.TerminalNumber = (/** @type {?} */ (this)).terminalNumber;
|
|
4957
4957
|
(/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.TransactionNumber = (/** @type {?} */ (this)).transactionNumber;
|
|
4958
4958
|
(/** @type {?} */ (this)).rjObject['Header'].TaxMethodID = (/** @type {?} */ (this)).taxMethodId;
|
|
4959
|
-
(/** @type {?} */ (this)).rjObject['Header'].DynamicStockLookup = (/** @type {?} */ (this)).generateDynamicStockLookUp();
|
|
4959
|
+
(/** @type {?} */ (this)).rjObject['Header'].DynamicStockLookup = (/** @type {?} */ (this)).generateDynamicStockLookUp();
|
|
4960
4960
|
(/** @type {?} */ (this)).rjObject['Header'].BasketLanguageID = (/** @type {?} */ (this)).basketLanguageId; //todo
|
|
4961
4961
|
(/** @type {?} */ (this)).rjObject['Header'].BasketCountryID = (/** @type {?} */ (this)).basketCountryId; //todo
|
|
4962
4962
|
(/** @type {?} */ (this)).rjObject['Header'].BasketCurrencyID = (/** @type {?} */ (this)).transactionDocument.baseCurrency;
|
|
@@ -5210,50 +5210,94 @@
|
|
|
5210
5210
|
obj['TaxPercentage'] = element.VAT.toFixed(2); // todo
|
|
5211
5211
|
(/** @type {?} */ (_this)).rjObject['Trailer']['TaxItem'].push(obj);
|
|
5212
5212
|
}));
|
|
5213
|
-
|
|
5214
|
-
if ((/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0) {
|
|
5213
|
+
if ((/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0 || (/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0) {
|
|
5215
5214
|
(/** @type {?} */ (this)).rjObject['Trailer']['PromotionItem'] = [];
|
|
5216
|
-
(/** @type {?} */ (this)).transactionDocument.basket.linePromotion.
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
*/
|
|
5220
|
-
function (element) {
|
|
5221
|
-
/** @type {?} */
|
|
5222
|
-
var obj = {};
|
|
5223
|
-
obj['PromotionID'] = element.promotionId;
|
|
5224
|
-
obj['PromotionSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5225
|
-
obj['PromotionQuantity'] = ""; // todo - not avaialble
|
|
5226
|
-
obj['PromotionDescription'] = element.displayText;
|
|
5227
|
-
obj['PromotionHit'] = {};
|
|
5228
|
-
obj['PromotionHit']['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5229
|
-
obj['PromotionHit']['HitNumber'] = ""; // todo;
|
|
5230
|
-
obj['PromotionHit']['HitQuantity'] = ""; // todo;
|
|
5231
|
-
obj['PromotionHit']['HitSaving'] = ""; // todo;
|
|
5232
|
-
obj['PromotionHit']['PromotionTrigger'] = {};
|
|
5233
|
-
element.trigger.forEach((/**
|
|
5234
|
-
* @param {?} subElement
|
|
5215
|
+
if ((/** @type {?} */ (this)).transactionDocument.basket.linePromotion.length > 0) {
|
|
5216
|
+
(/** @type {?} */ (this)).transactionDocument.basket.linePromotion.forEach((/**
|
|
5217
|
+
* @param {?} element
|
|
5235
5218
|
* @return {?}
|
|
5236
5219
|
*/
|
|
5237
|
-
function (
|
|
5220
|
+
function (element) {
|
|
5221
|
+
/** @type {?} */
|
|
5222
|
+
var obj = {};
|
|
5223
|
+
obj['PromotionID'] = element.promotionId;
|
|
5224
|
+
obj['PromotionSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5225
|
+
obj['PromotionQuantity'] = "1";
|
|
5226
|
+
obj['PromotionDescription'] = element.displayText;
|
|
5227
|
+
obj['PromotionHit'] = {};
|
|
5228
|
+
obj['PromotionHit']['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5229
|
+
obj['PromotionHit']['HitNumber'] = "1";
|
|
5230
|
+
obj['PromotionHit']['HitQuantity'] = "1";
|
|
5231
|
+
obj['PromotionHit']['HitSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5232
|
+
obj['PromotionHit']['PromotionTrigger'] = {};
|
|
5238
5233
|
/** @type {?} */
|
|
5239
5234
|
var product = (/** @type {?} */ (_this)).transactionDocument.basket.products.find((/**
|
|
5240
5235
|
* @param {?} item
|
|
5241
5236
|
* @return {?}
|
|
5242
5237
|
*/
|
|
5243
|
-
function (item) { return item.itemLineId ==
|
|
5238
|
+
function (item) { return item.itemLineId == element.itemLineId; }));
|
|
5244
5239
|
obj['PromotionHit']['PromotionTrigger']['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5245
5240
|
obj['PromotionHit']['PromotionTrigger']['ProductID'] = product.SKU;
|
|
5246
5241
|
obj['PromotionHit']['PromotionTrigger']['UnitValue'] = (/** @type {?} */ (_this)).convertToString(element.promotionLinePrice / product.quantity);
|
|
5247
|
-
obj['PromotionHit']['PromotionTrigger']['LineNumber'] = (/** @type {?} */ (_this)).
|
|
5248
|
-
obj['PromotionHit']['PromotionTrigger']['Quantity'] = (/** @type {?} */ (_this)).convertToString(
|
|
5242
|
+
obj['PromotionHit']['PromotionTrigger']['LineNumber'] = (/** @type {?} */ (_this)).getNumber(product.SKU);
|
|
5243
|
+
obj['PromotionHit']['PromotionTrigger']['Quantity'] = (/** @type {?} */ (_this)).convertToString(product.quantity.toFixed(1));
|
|
5249
5244
|
obj['PromotionHit']['PromotionTrigger']['TaxCode'] = (/** @type {?} */ (_this)).transactionDocument.basket.taxBreakdown.taxLines.find((/**
|
|
5250
5245
|
* @param {?} item
|
|
5251
5246
|
* @return {?}
|
|
5252
5247
|
*/
|
|
5253
5248
|
function (item) { return item.itemLineId == element.itemLineId; })).VATCode; // todo
|
|
5249
|
+
(/** @type {?} */ (_this)).rjObject['Trailer']['PromotionItem'].push(obj);
|
|
5254
5250
|
}));
|
|
5255
|
-
|
|
5256
|
-
}))
|
|
5251
|
+
}
|
|
5252
|
+
if ((/** @type {?} */ (this)).transactionDocument.basket.transactionPromotion.length > 0) {
|
|
5253
|
+
(/** @type {?} */ (this)).transactionDocument.basket.transactionPromotion.forEach((/**
|
|
5254
|
+
* @param {?} element
|
|
5255
|
+
* @return {?}
|
|
5256
|
+
*/
|
|
5257
|
+
function (element) {
|
|
5258
|
+
/** @type {?} */
|
|
5259
|
+
var obj = {};
|
|
5260
|
+
console.log('element');
|
|
5261
|
+
obj['PromotionID'] = element.promotionId;
|
|
5262
|
+
obj['PromotionSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5263
|
+
obj['PromotionQuantity'] = "1";
|
|
5264
|
+
obj['PromotionDescription'] = element.displayText;
|
|
5265
|
+
obj['PromotionHit'] = {};
|
|
5266
|
+
obj['PromotionHit']['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5267
|
+
obj['PromotionHit']['HitNumber'] = "1";
|
|
5268
|
+
obj['PromotionHit']['HitQuantity'] = "1";
|
|
5269
|
+
obj['PromotionHit']['HitSaving'] = element.promotionAmount < 0 ? element.promotionAmount : -element.promotionAmount;
|
|
5270
|
+
obj['PromotionHit']['PromotionTrigger'] = [];
|
|
5271
|
+
(/** @type {?} */ (_this)).transactionDocument.basket.products.forEach((/**
|
|
5272
|
+
* @param {?} product
|
|
5273
|
+
* @return {?}
|
|
5274
|
+
*/
|
|
5275
|
+
function (product) {
|
|
5276
|
+
/** @type {?} */
|
|
5277
|
+
var promotionTrigger = {};
|
|
5278
|
+
element.itemLineIds.forEach((/**
|
|
5279
|
+
* @param {?} itemLineId
|
|
5280
|
+
* @return {?}
|
|
5281
|
+
*/
|
|
5282
|
+
function (itemLineId) {
|
|
5283
|
+
if (JSON.stringify(itemLineId) === product.itemLineId) {
|
|
5284
|
+
promotionTrigger['XMLSchemaVersion'] = (/** @type {?} */ (_this)).xmlSchemaVersion;
|
|
5285
|
+
promotionTrigger['ProductID'] = product.SKU;
|
|
5286
|
+
promotionTrigger['UnitValue'] = (/** @type {?} */ (_this)).convertToString(element.promotionLinePrice / product.quantity);
|
|
5287
|
+
promotionTrigger['LineNumber'] = (/** @type {?} */ (_this)).getNumber(product.SKU);
|
|
5288
|
+
promotionTrigger['Quantity'] = (/** @type {?} */ (_this)).convertToString(product.quantity);
|
|
5289
|
+
promotionTrigger['TaxCode'] = (/** @type {?} */ (_this)).transactionDocument.basket.taxBreakdown.taxLines.find((/**
|
|
5290
|
+
* @param {?} item
|
|
5291
|
+
* @return {?}
|
|
5292
|
+
*/
|
|
5293
|
+
function (item) { return item.itemLineId == product.itemLineId; })).VATCode;
|
|
5294
|
+
obj['PromotionHit']['PromotionTrigger'].push(promotionTrigger);
|
|
5295
|
+
}
|
|
5296
|
+
}));
|
|
5297
|
+
}));
|
|
5298
|
+
(/** @type {?} */ (_this)).rjObject['Trailer']['PromotionItem'].push(obj);
|
|
5299
|
+
}));
|
|
5300
|
+
}
|
|
5257
5301
|
}
|
|
5258
5302
|
return (/** @type {?} */ (this));
|
|
5259
5303
|
};
|
|
@@ -5269,64 +5313,136 @@
|
|
|
5269
5313
|
*/
|
|
5270
5314
|
function () {
|
|
5271
5315
|
var _this = this;
|
|
5272
|
-
(/** @type {?} */ (this)).rjObject['CashTender'] = [];
|
|
5273
5316
|
if ((/** @type {?} */ (this)).transactionDocument.paymentDetails && (/** @type {?} */ (this)).transactionDocument.paymentDetails.length > 0) {
|
|
5274
5317
|
(/** @type {?} */ (this)).transactionDocument.paymentDetails.forEach((/**
|
|
5275
5318
|
* @param {?} element
|
|
5276
5319
|
* @return {?}
|
|
5277
5320
|
*/
|
|
5278
5321
|
function (element) {
|
|
5279
|
-
if (element.
|
|
5280
|
-
/** @type {?} */
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5322
|
+
if (element.externalTenderKey) {
|
|
5323
|
+
(/** @type {?} */ (_this)).rjObject[element.externalTenderKey] = [];
|
|
5324
|
+
if (element.paymentType.toUpperCase() === 'GIFT CARD') {
|
|
5325
|
+
/** @type {?} */
|
|
5326
|
+
var obj = {
|
|
5327
|
+
XMLSchemaVersion: (/** @type {?} */ (_this)).xmlSchemaVersion,
|
|
5328
|
+
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5329
|
+
NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5330
|
+
EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5331
|
+
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5332
|
+
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5333
|
+
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5334
|
+
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5335
|
+
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5336
|
+
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5337
|
+
TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5338
|
+
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5339
|
+
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5340
|
+
GiftVoucherSalesAllowed: '',
|
|
5341
|
+
//todo
|
|
5342
|
+
AllowRechargeableVoucherSales: '',
|
|
5343
|
+
//todo
|
|
5344
|
+
GiftVoucherID: ''
|
|
5345
|
+
};
|
|
5346
|
+
(/** @type {?} */ (_this)).rjObject[element.externalTenderKey].push(obj);
|
|
5347
|
+
}
|
|
5348
|
+
else {
|
|
5349
|
+
/** @type {?} */
|
|
5350
|
+
var obj1 = {
|
|
5351
|
+
XMLSchemaVersion: "1",
|
|
5352
|
+
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5353
|
+
//todo
|
|
5354
|
+
NetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5355
|
+
EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5356
|
+
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5357
|
+
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5358
|
+
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5359
|
+
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5360
|
+
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5361
|
+
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5362
|
+
TenderAmount: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5363
|
+
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5364
|
+
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5365
|
+
IncludeInTransactionTotalCheck: "1",
|
|
5366
|
+
AllowRechargeableVoucherSales: "1",
|
|
5367
|
+
OpenDrawerAtEnd: "1"
|
|
5368
|
+
};
|
|
5369
|
+
(/** @type {?} */ (_this)).rjObject[element.externalTenderKey].push(obj1);
|
|
5370
|
+
}
|
|
5302
5371
|
}
|
|
5303
5372
|
else {
|
|
5304
|
-
/** @type {?} */
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5373
|
+
(/** @type {?} */ (_this)).rjObject['CashTender'] = [];
|
|
5374
|
+
if (element.paymentType.toUpperCase() === 'GIFT CARD') {
|
|
5375
|
+
/** @type {?} */
|
|
5376
|
+
var obj = {
|
|
5377
|
+
XMLSchemaVersion: (/** @type {?} */ (_this)).xmlSchemaVersion,
|
|
5378
|
+
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5379
|
+
NetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5380
|
+
EffectiveNetValue: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5381
|
+
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5382
|
+
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5383
|
+
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5384
|
+
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5385
|
+
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5386
|
+
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5387
|
+
TenderAmount: (/** @type {?} */ (_this)).convertToString(-1 * (/** @type {?} */ (_this)).removeDecimal((Math.round(element.amount)))),
|
|
5388
|
+
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5389
|
+
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5390
|
+
GiftVoucherSalesAllowed: '',
|
|
5391
|
+
//todo
|
|
5392
|
+
AllowRechargeableVoucherSales: '',
|
|
5393
|
+
//todo
|
|
5394
|
+
GiftVoucherID: ''
|
|
5395
|
+
};
|
|
5396
|
+
(/** @type {?} */ (_this)).rjObject['CashTender'].push(obj);
|
|
5397
|
+
}
|
|
5398
|
+
else {
|
|
5399
|
+
/** @type {?} */
|
|
5400
|
+
var obj1 = {
|
|
5401
|
+
XMLSchemaVersion: "1",
|
|
5402
|
+
LineNumber: (/** @type {?} */ (_this)).generateLineNumber(),
|
|
5403
|
+
NetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5404
|
+
EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5405
|
+
Description: (/** @type {?} */ (_this)).getDescription(element),
|
|
5406
|
+
DeviceID: (/** @type {?} */ (_this)).deviceId,
|
|
5407
|
+
UserID: (/** @type {?} */ (_this)).transactionDocument.userName,
|
|
5408
|
+
DateTimeCreated: (/** @type {?} */ (_this)).updatedAt,
|
|
5409
|
+
TenderType: element.externalTenderType ? element.externalTenderType : '',
|
|
5410
|
+
TenderSubType: element.externalSubTenderType ? element.externalSubTenderType : '',
|
|
5411
|
+
TenderAmount: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
5412
|
+
CurrencyID: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5413
|
+
CurrencyDescription: (/** @type {?} */ (_this)).transactionDocument.baseCurrency,
|
|
5414
|
+
IncludeInTransactionTotalCheck: "1",
|
|
5415
|
+
AllowRechargeableVoucherSales: "1",
|
|
5416
|
+
OpenDrawerAtEnd: "1"
|
|
5417
|
+
};
|
|
5418
|
+
(/** @type {?} */ (_this)).rjObject['CashTender'].push(obj1);
|
|
5419
|
+
}
|
|
5325
5420
|
}
|
|
5326
5421
|
}));
|
|
5327
5422
|
}
|
|
5328
5423
|
return (/** @type {?} */ (this));
|
|
5329
5424
|
};
|
|
5425
|
+
/**
|
|
5426
|
+
* @param {?} productId
|
|
5427
|
+
* @return {?}
|
|
5428
|
+
*/
|
|
5429
|
+
RJMapperBuilderClass.prototype.getNumber = /**
|
|
5430
|
+
* @param {?} productId
|
|
5431
|
+
* @return {?}
|
|
5432
|
+
*/
|
|
5433
|
+
function (productId) {
|
|
5434
|
+
/** @type {?} */
|
|
5435
|
+
var lineNumber;
|
|
5436
|
+
for (var i = 0; i < this.rjObject['ProductSale'].length; i++) {
|
|
5437
|
+
/** @type {?} */
|
|
5438
|
+
var element = this.rjObject['ProductSale'][i];
|
|
5439
|
+
if (JSON.stringify(productId) === JSON.stringify(element.ProductID)) {
|
|
5440
|
+
lineNumber = element.LineNumber;
|
|
5441
|
+
break;
|
|
5442
|
+
}
|
|
5443
|
+
}
|
|
5444
|
+
return lineNumber;
|
|
5445
|
+
};
|
|
5330
5446
|
/**
|
|
5331
5447
|
* @return {?}
|
|
5332
5448
|
*/
|
|
@@ -5794,7 +5910,7 @@
|
|
|
5794
5910
|
obj['DisplayTaxCode'] = ''; // todo
|
|
5795
5911
|
obj['ProductAttributes'] = ''; //todo - not required
|
|
5796
5912
|
obj['Perishable'] = this.getAttributes();
|
|
5797
|
-
obj['MMGroupID'] = this.
|
|
5913
|
+
obj['MMGroupID'] = this.getCaregories(element);
|
|
5798
5914
|
obj['CustomerDetails'] = ""; // todo - blank
|
|
5799
5915
|
obj['TotalPromotionSaving'] = element['promotionAmount'] || -1; // TODO
|
|
5800
5916
|
obj['OriginalTaxAmount'] = this.convertToString(this.getOriginalTax(element, taxTotal.VAT) * -1);
|
|
@@ -5841,7 +5957,7 @@
|
|
|
5841
5957
|
*/
|
|
5842
5958
|
function (e) {
|
|
5843
5959
|
/** @type {?} */
|
|
5844
|
-
var
|
|
5960
|
+
var discountObj = {};
|
|
5845
5961
|
e.itemLineIds.forEach((/**
|
|
5846
5962
|
* @param {?} x
|
|
5847
5963
|
* @return {?}
|
|
@@ -5850,10 +5966,10 @@
|
|
|
5850
5966
|
if (x == element.itemLineId) {
|
|
5851
5967
|
/** @type {?} */
|
|
5852
5968
|
var discountAmount = _this.convertToString(e.discountAmount * -1);
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
obj['BasketDiscountModifier'].push(
|
|
5969
|
+
discountObj.BasketDiscountLineNumber = _this.getLineNumber(e, discountAmount);
|
|
5970
|
+
discountObj.XMLSchemaVersion = _this.xmlSchemaVersion;
|
|
5971
|
+
discountObj.DiscountedValue = _this.getDiscountedValue(element.totalLinePrice, e.discountAmount);
|
|
5972
|
+
obj['BasketDiscountModifier'].push(discountObj);
|
|
5857
5973
|
}
|
|
5858
5974
|
}));
|
|
5859
5975
|
}));
|
|
@@ -5869,6 +5985,35 @@
|
|
|
5869
5985
|
//update the product price
|
|
5870
5986
|
obj['EffectiveNetValue'] = obj.EffectiveNetValue + totaltransactionDiscount;
|
|
5871
5987
|
}
|
|
5988
|
+
if (this.transactionDocument.basket.transactionPromotion.length > 0) {
|
|
5989
|
+
obj['PromotionSaving'] = [];
|
|
5990
|
+
this.transactionDocument.basket.transactionPromotion.forEach((/**
|
|
5991
|
+
* @param {?} transactionPromo
|
|
5992
|
+
* @return {?}
|
|
5993
|
+
*/
|
|
5994
|
+
function (transactionPromo) {
|
|
5995
|
+
/** @type {?} */
|
|
5996
|
+
var promotionObj = {};
|
|
5997
|
+
transactionPromo.itemLineIds.forEach((/**
|
|
5998
|
+
* @param {?} itemLineId
|
|
5999
|
+
* @return {?}
|
|
6000
|
+
*/
|
|
6001
|
+
function (itemLineId) {
|
|
6002
|
+
if (itemLineId == element.itemLineId) {
|
|
6003
|
+
promotionObj.ModifierValue = transactionPromo.promotionAmount;
|
|
6004
|
+
promotionObj.ModifierDateTime = _this.transactionDocument.createdAt;
|
|
6005
|
+
promotionObj.ModifierDescription = transactionPromo.displayText;
|
|
6006
|
+
promotionObj.XMLSchemaVersion = _this.xmlSchemaVersion;
|
|
6007
|
+
promotionObj.PromotionID = transactionPromo.promotionId;
|
|
6008
|
+
promotionObj.PromotionDescription = transactionPromo.displayText;
|
|
6009
|
+
promotionObj.HitNumber = '1';
|
|
6010
|
+
promotionObj.PromotionHitProductQuantity = _this.getQuantity(element);
|
|
6011
|
+
promotionObj.PromotionHitQuantity = _this.getQuantity(element) * -1;
|
|
6012
|
+
obj['PromotionSaving'].push(promotionObj);
|
|
6013
|
+
}
|
|
6014
|
+
}));
|
|
6015
|
+
}));
|
|
6016
|
+
}
|
|
5872
6017
|
return obj;
|
|
5873
6018
|
};
|
|
5874
6019
|
/**
|
|
@@ -5903,8 +6048,7 @@
|
|
|
5903
6048
|
DateTimeCreated: this.createdAt,
|
|
5904
6049
|
ExtendedValue: this.removeDecimal(element.price),
|
|
5905
6050
|
UnitPrice: this.removeDecimal(element.price),
|
|
5906
|
-
MMGroupID: this.
|
|
5907
|
-
//todo
|
|
6051
|
+
MMGroupID: this.getCaregories(element),
|
|
5908
6052
|
Quantity: element.quantity.toFixed(1),
|
|
5909
6053
|
SalespersonID: this.transactionDocument.userId,
|
|
5910
6054
|
SalespersonName: this.transactionDocument.userName,
|
|
@@ -5913,14 +6057,14 @@
|
|
|
5913
6057
|
* @return {?}
|
|
5914
6058
|
*/
|
|
5915
6059
|
function (item) { return item.itemLineId == element['itemLineId']; })).VATCode,
|
|
5916
|
-
TaxModifiable: 1,
|
|
6060
|
+
TaxModifiable: "1",
|
|
5917
6061
|
//todo
|
|
5918
6062
|
OriginalTaxAmount: this.convertToString(this.getOriginalTax(element, taxTotal.VAT)),
|
|
5919
6063
|
TaxAmount: this.convertToString(taxTotal.taxLineTotal),
|
|
5920
|
-
OriginalTaxAmountSet: 1,
|
|
6064
|
+
OriginalTaxAmountSet: "1",
|
|
5921
6065
|
//todo
|
|
5922
6066
|
ProductID: element.SKU,
|
|
5923
|
-
HandKeyed: 1,
|
|
6067
|
+
HandKeyed: "1",
|
|
5924
6068
|
//todo
|
|
5925
6069
|
CustomerDetails: "",
|
|
5926
6070
|
Perishable: this.getAttributes()
|
|
@@ -5967,36 +6111,104 @@
|
|
|
5967
6111
|
*/
|
|
5968
6112
|
function (e) {
|
|
5969
6113
|
/** @type {?} */
|
|
5970
|
-
var
|
|
6114
|
+
var discountObj = {};
|
|
5971
6115
|
e.itemLineIds.forEach((/**
|
|
5972
|
-
* @param {?}
|
|
6116
|
+
* @param {?} itemLineId
|
|
5973
6117
|
* @return {?}
|
|
5974
6118
|
*/
|
|
5975
|
-
function (
|
|
5976
|
-
if (
|
|
6119
|
+
function (itemLineId) {
|
|
6120
|
+
if (itemLineId == element.itemLineId) {
|
|
5977
6121
|
/** @type {?} */
|
|
5978
6122
|
var discountAmount = _this.convertToString(e.discountAmount * -1);
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
obj['BasketDiscountModifier'].push(
|
|
6123
|
+
discountObj.XMLSchemaVersion = _this.xmlSchemaVersion;
|
|
6124
|
+
discountObj.DiscountedValue = -(_this.getDiscountedValue(element.totalLinePrice, e.discountAmount).toFixed(0));
|
|
6125
|
+
discountObj.BasketDiscountLineNumber = _this.getLineNumber(e, discountAmount);
|
|
6126
|
+
obj['BasketDiscountModifier'].push(discountObj);
|
|
5983
6127
|
}
|
|
5984
6128
|
}));
|
|
5985
6129
|
}));
|
|
5986
6130
|
/** @type {?} */
|
|
5987
|
-
var
|
|
6131
|
+
var totaltransactionDiscount_1 = 0;
|
|
5988
6132
|
obj['BasketDiscountModifier'].forEach((/**
|
|
5989
6133
|
* @param {?} value
|
|
5990
6134
|
* @return {?}
|
|
5991
6135
|
*/
|
|
5992
6136
|
function (value) {
|
|
5993
|
-
|
|
6137
|
+
totaltransactionDiscount_1 = totaltransactionDiscount_1 + value.DiscountedValue;
|
|
5994
6138
|
}));
|
|
5995
6139
|
//update the product price
|
|
5996
|
-
obj['EffectiveNetValue'] = obj.EffectiveNetValue +
|
|
6140
|
+
obj['EffectiveNetValue'] = obj.EffectiveNetValue + totaltransactionDiscount_1;
|
|
6141
|
+
}
|
|
6142
|
+
if (this.transactionDocument.basket.transactionPromotion.length > 0 || this.transactionDocument.basket.linePromotion.length > 0) {
|
|
6143
|
+
obj['DistributedPromotionSaving'] = [];
|
|
6144
|
+
if (this.transactionDocument.basket.transactionPromotion.length > 0) {
|
|
6145
|
+
this.transactionDocument.basket.transactionPromotion.forEach((/**
|
|
6146
|
+
* @param {?} e
|
|
6147
|
+
* @return {?}
|
|
6148
|
+
*/
|
|
6149
|
+
function (e) {
|
|
6150
|
+
/** @type {?} */
|
|
6151
|
+
var promotionObj = {};
|
|
6152
|
+
e.itemLineIds.forEach((/**
|
|
6153
|
+
* @param {?} itemLineId
|
|
6154
|
+
* @return {?}
|
|
6155
|
+
*/
|
|
6156
|
+
function (itemLineId) {
|
|
6157
|
+
if (itemLineId == element.itemLineId) {
|
|
6158
|
+
promotionObj.PromotionID = e.promotionId;
|
|
6159
|
+
promotionObj.Hit = '1';
|
|
6160
|
+
promotionObj.Saving = _this.getSaving(element.totalLinePrice, e.promotionAmount);
|
|
6161
|
+
promotionObj.ISaving = _this.getSaving(element.totalLinePrice, e.promotionAmount);
|
|
6162
|
+
obj['DistributedPromotionSaving'].push(promotionObj);
|
|
6163
|
+
}
|
|
6164
|
+
}));
|
|
6165
|
+
}));
|
|
6166
|
+
}
|
|
6167
|
+
if (this.transactionDocument.basket.linePromotion.length > 0) {
|
|
6168
|
+
this.transactionDocument.basket.linePromotion.forEach((/**
|
|
6169
|
+
* @param {?} linePromotion
|
|
6170
|
+
* @return {?}
|
|
6171
|
+
*/
|
|
6172
|
+
function (linePromotion) {
|
|
6173
|
+
/** @type {?} */
|
|
6174
|
+
var promotionObj = {};
|
|
6175
|
+
if (element.itemLineId == linePromotion.itemLineId) {
|
|
6176
|
+
promotionObj.PromotionID = linePromotion.promotionId;
|
|
6177
|
+
promotionObj.Hit = "1";
|
|
6178
|
+
promotionObj.Saving = linePromotion.promotionLinePrice;
|
|
6179
|
+
promotionObj.ISaving = linePromotion.promotionLinePrice;
|
|
6180
|
+
obj['DistributedPromotionSaving'].push(promotionObj);
|
|
6181
|
+
}
|
|
6182
|
+
}));
|
|
6183
|
+
}
|
|
6184
|
+
/** @type {?} */
|
|
6185
|
+
var transactionPromotion_1 = 0;
|
|
6186
|
+
obj['DistributedPromotionSaving'].forEach((/**
|
|
6187
|
+
* @param {?} value
|
|
6188
|
+
* @return {?}
|
|
6189
|
+
*/
|
|
6190
|
+
function (value) {
|
|
6191
|
+
transactionPromotion_1 = transactionPromotion_1 + value.Saving;
|
|
6192
|
+
}));
|
|
6193
|
+
obj['EffectiveNetValue'] = obj.EffectiveNetValue + transactionPromotion_1;
|
|
5997
6194
|
}
|
|
5998
6195
|
return obj;
|
|
5999
6196
|
};
|
|
6197
|
+
/**
|
|
6198
|
+
* @param {?} price
|
|
6199
|
+
* @param {?} promotionAmount
|
|
6200
|
+
* @return {?}
|
|
6201
|
+
*/
|
|
6202
|
+
RJMapperBuilderClass.prototype.getSaving = /**
|
|
6203
|
+
* @param {?} price
|
|
6204
|
+
* @param {?} promotionAmount
|
|
6205
|
+
* @return {?}
|
|
6206
|
+
*/
|
|
6207
|
+
function (price, promotionAmount) {
|
|
6208
|
+
/** @type {?} */
|
|
6209
|
+
var Saving = (price * promotionAmount) / this.transactionDocument.basketSummary.saleTotal;
|
|
6210
|
+
return Saving;
|
|
6211
|
+
};
|
|
6000
6212
|
/**
|
|
6001
6213
|
* @param {?} value
|
|
6002
6214
|
* @param {?} discountAmount
|
|
@@ -6118,6 +6330,34 @@
|
|
|
6118
6330
|
return "";
|
|
6119
6331
|
}
|
|
6120
6332
|
};
|
|
6333
|
+
/**
|
|
6334
|
+
* @param {?} element
|
|
6335
|
+
* @return {?}
|
|
6336
|
+
*/
|
|
6337
|
+
RJMapperBuilderClass.prototype.getCaregories = /**
|
|
6338
|
+
* @param {?} element
|
|
6339
|
+
* @return {?}
|
|
6340
|
+
*/
|
|
6341
|
+
function (element) {
|
|
6342
|
+
/** @type {?} */
|
|
6343
|
+
var MMGroupId = " ";
|
|
6344
|
+
if (element.categories && element.categories.length > 0) {
|
|
6345
|
+
/** @type {?} */
|
|
6346
|
+
var categories = element.categories.filter((/**
|
|
6347
|
+
* @param {?} x
|
|
6348
|
+
* @return {?}
|
|
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
|
+
};
|
|
6121
6361
|
/**
|
|
6122
6362
|
* @param {?} date
|
|
6123
6363
|
* @return {?}
|
|
@@ -6154,21 +6394,18 @@
|
|
|
6154
6394
|
*/
|
|
6155
6395
|
function (transactionPromotion) {
|
|
6156
6396
|
if (transactionPromotion && transactionPromotion.length > 0) {
|
|
6157
|
-
this.rjObject['
|
|
6158
|
-
this.rjObject['
|
|
6159
|
-
this.rjObject['
|
|
6160
|
-
this.rjObject['
|
|
6161
|
-
this.rjObject['
|
|
6162
|
-
this.rjObject['
|
|
6163
|
-
this.rjObject['
|
|
6164
|
-
this.rjObject['
|
|
6165
|
-
this.rjObject['
|
|
6166
|
-
this.rjObject['
|
|
6167
|
-
this.rjObject['
|
|
6168
|
-
this.rjObject['
|
|
6169
|
-
this.rjObject['BasketDiscount']['DiscountPercentage'] = 0; //todo
|
|
6170
|
-
this.rjObject['BasketDiscount']['DiscountedValue'] = 0; //todo
|
|
6171
|
-
this.rjObject['BasketDiscount']['RoundingRule'] = 2;
|
|
6397
|
+
this.rjObject['PromoVoucherItem'] = {};
|
|
6398
|
+
this.rjObject['PromoVoucherItem']['XMLSchemaVersion'] = this.xmlSchemaVersion;
|
|
6399
|
+
this.rjObject['PromoVoucherItem']['LineNumber'] = this.generateLineNumber();
|
|
6400
|
+
this.rjObject['PromoVoucherItem']['NetValue'] = this.removeDecimal(transactionPromotion[0].promotionLinePrice) * -1;
|
|
6401
|
+
this.rjObject['PromoVoucherItem']['EffectiveNetValue'] = this.removeDecimal(transactionPromotion[0].promotionLinePrice) * -1;
|
|
6402
|
+
this.rjObject['PromoVoucherItem']['Description'] = transactionPromotion[0].promotionInfo;
|
|
6403
|
+
this.rjObject['PromoVoucherItem']['DeviceID'] = this.deviceId;
|
|
6404
|
+
this.rjObject['PromoVoucherItem']['UserID'] = this.transactionDocument.userName;
|
|
6405
|
+
this.rjObject['PromoVoucherItem']['DateTimeCreated'] = this.createdAt;
|
|
6406
|
+
this.rjObject['PromoVoucherItem']['ProductId'] = ""; //todo
|
|
6407
|
+
this.rjObject['PromoVoucherItem']['SerialNumber'] = ""; //todo
|
|
6408
|
+
this.rjObject['PromoVoucherItem']['MMGroupId'] = "";
|
|
6172
6409
|
}
|
|
6173
6410
|
};
|
|
6174
6411
|
/**
|
|
@@ -6315,9 +6552,314 @@
|
|
|
6315
6552
|
RJMapperBuilderClass.prototype.rjObject;
|
|
6316
6553
|
}
|
|
6317
6554
|
|
|
6555
|
+
/**
|
|
6556
|
+
* @fileoverview added by tsickle
|
|
6557
|
+
* Generated from: lib/WebReturn-mapper.class.ts
|
|
6558
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6559
|
+
*/
|
|
6560
|
+
var WebReturnMapperBuilderClass = /** @class */ (function () {
|
|
6561
|
+
function WebReturnMapperBuilderClass(document) {
|
|
6562
|
+
this.webReturnObject = {
|
|
6563
|
+
id: '',
|
|
6564
|
+
orgCode: "",
|
|
6565
|
+
storeId: "",
|
|
6566
|
+
storeNodeId: "",
|
|
6567
|
+
storeNodeStructure: "",
|
|
6568
|
+
deviceId: "",
|
|
6569
|
+
terminalId: "",
|
|
6570
|
+
initiatingModule: "",
|
|
6571
|
+
export: false,
|
|
6572
|
+
basket: {},
|
|
6573
|
+
basketSummary: {},
|
|
6574
|
+
baseCurrency: "",
|
|
6575
|
+
customer: {
|
|
6576
|
+
firstName: '',
|
|
6577
|
+
lastName: '',
|
|
6578
|
+
email: '',
|
|
6579
|
+
postCode: '',
|
|
6580
|
+
id: '',
|
|
6581
|
+
billingAddress: {},
|
|
6582
|
+
shippingAddress: {},
|
|
6583
|
+
}
|
|
6584
|
+
};
|
|
6585
|
+
if (document) {
|
|
6586
|
+
this.document = document;
|
|
6587
|
+
}
|
|
6588
|
+
}
|
|
6589
|
+
/**
|
|
6590
|
+
* @template THIS
|
|
6591
|
+
* @this {THIS}
|
|
6592
|
+
* @return {THIS}
|
|
6593
|
+
*/
|
|
6594
|
+
WebReturnMapperBuilderClass.prototype.WebReturnMapper = /**
|
|
6595
|
+
* @template THIS
|
|
6596
|
+
* @this {THIS}
|
|
6597
|
+
* @return {THIS}
|
|
6598
|
+
*/
|
|
6599
|
+
function () {
|
|
6600
|
+
(/** @type {?} */ (this)).webReturnObject['type'] = 'WEB_RETURNS';
|
|
6601
|
+
(/** @type {?} */ (this)).webReturnObject['datetime'] = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.updated_at));
|
|
6602
|
+
(/** @type {?} */ (this)).webReturnObject.baseCurrency = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_currency_code);
|
|
6603
|
+
(/** @type {?} */ (this)).webReturnObject.storeId = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.store_id);
|
|
6604
|
+
(/** @type {?} */ (this)).webReturnObject.subsidiaryId = '1';
|
|
6605
|
+
(/** @type {?} */ (this)).webReturnObject.initiatingModule = 'MAGENTO';
|
|
6606
|
+
(/** @type {?} */ (this)).webReturnObject.createdAt = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.created_at));
|
|
6607
|
+
(/** @type {?} */ (this)).webReturnObject.updatedAt = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.updated_at));
|
|
6608
|
+
(/** @type {?} */ (this)).webReturnObject.export = true;
|
|
6609
|
+
(/** @type {?} */ (this)).webReturnObject.transCompletedAt = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.updated_at));
|
|
6610
|
+
(/** @type {?} */ (this)).webReturnObject['externalTransactionId'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.order_id);
|
|
6611
|
+
// customer
|
|
6612
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['firstName'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.customer_firstname) || '';
|
|
6613
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['lastName'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.customer_lastname) || '';
|
|
6614
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['email'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.customer_email) || '';
|
|
6615
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['postCode'] = '';
|
|
6616
|
+
// Billing address
|
|
6617
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['address1'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.street) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.street) : '';
|
|
6618
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['city'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.city) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.city) : '';
|
|
6619
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['county'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.region) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.region) : '';
|
|
6620
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['postCode'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.postcode) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.postcode) : '';
|
|
6621
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['country'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.country) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.country) : '';
|
|
6622
|
+
// Shipping address
|
|
6623
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['address1'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.street) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.street) : '';
|
|
6624
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['city'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.city) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.city) : '';
|
|
6625
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['county'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.region) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.region) : '';
|
|
6626
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['postCode'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.postcode) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.postcode) : '';
|
|
6627
|
+
(/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['country'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.country) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.country) : '';
|
|
6628
|
+
// basketSummary
|
|
6629
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['discountTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount);
|
|
6630
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['VATTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid);
|
|
6631
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['saleTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_invoiced);
|
|
6632
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid);
|
|
6633
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered);
|
|
6634
|
+
(/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded) || 0;
|
|
6635
|
+
// basket line discount
|
|
6636
|
+
(/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'] = [];
|
|
6637
|
+
/** @type {?} */
|
|
6638
|
+
var lineDiscount = {
|
|
6639
|
+
itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) : 0,
|
|
6640
|
+
discountAmount: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.discount_amount) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.discount_amount) : 0
|
|
6641
|
+
};
|
|
6642
|
+
(/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'].push(lineDiscount);
|
|
6643
|
+
// basket transaction discount
|
|
6644
|
+
(/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'] = [];
|
|
6645
|
+
/** @type {?} */
|
|
6646
|
+
var transactionDiscount = {
|
|
6647
|
+
discountAmount: (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount) || 0
|
|
6648
|
+
};
|
|
6649
|
+
(/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'].push(transactionDiscount);
|
|
6650
|
+
// basket products
|
|
6651
|
+
(/** @type {?} */ (this)).webReturnObject.basket['products'] = [];
|
|
6652
|
+
/** @type {?} */
|
|
6653
|
+
var product = {
|
|
6654
|
+
description: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.name) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.name) : '',
|
|
6655
|
+
SKU: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.sku) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.sku) : '',
|
|
6656
|
+
quantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_ordered) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_ordered) : '',
|
|
6657
|
+
refundedQuantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_refunded) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_refunded) : '',
|
|
6658
|
+
price: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.original_price) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.original_price) : '',
|
|
6659
|
+
itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id) : '',
|
|
6660
|
+
totalLinePrice: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.row_invoiced) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.row_invoiced) : '',
|
|
6661
|
+
};
|
|
6662
|
+
(/** @type {?} */ (this)).webReturnObject.basket['products'].push(product);
|
|
6663
|
+
return (/** @type {?} */ (this));
|
|
6664
|
+
};
|
|
6665
|
+
/**
|
|
6666
|
+
* @template THIS
|
|
6667
|
+
* @this {THIS}
|
|
6668
|
+
* @param {?} deviceId
|
|
6669
|
+
* @return {THIS}
|
|
6670
|
+
*/
|
|
6671
|
+
WebReturnMapperBuilderClass.prototype.deviceId = /**
|
|
6672
|
+
* @template THIS
|
|
6673
|
+
* @this {THIS}
|
|
6674
|
+
* @param {?} deviceId
|
|
6675
|
+
* @return {THIS}
|
|
6676
|
+
*/
|
|
6677
|
+
function (deviceId) {
|
|
6678
|
+
(/** @type {?} */ (this)).webReturnObject.deviceId = deviceId;
|
|
6679
|
+
return (/** @type {?} */ (this));
|
|
6680
|
+
};
|
|
6681
|
+
/**
|
|
6682
|
+
* @template THIS
|
|
6683
|
+
* @this {THIS}
|
|
6684
|
+
* @param {?} terminalId
|
|
6685
|
+
* @return {THIS}
|
|
6686
|
+
*/
|
|
6687
|
+
WebReturnMapperBuilderClass.prototype.terminalId = /**
|
|
6688
|
+
* @template THIS
|
|
6689
|
+
* @this {THIS}
|
|
6690
|
+
* @param {?} terminalId
|
|
6691
|
+
* @return {THIS}
|
|
6692
|
+
*/
|
|
6693
|
+
function (terminalId) {
|
|
6694
|
+
(/** @type {?} */ (this)).webReturnObject.terminalId = terminalId;
|
|
6695
|
+
return (/** @type {?} */ (this));
|
|
6696
|
+
};
|
|
6697
|
+
/**
|
|
6698
|
+
* @template THIS
|
|
6699
|
+
* @this {THIS}
|
|
6700
|
+
* @param {?} orgCode
|
|
6701
|
+
* @return {THIS}
|
|
6702
|
+
*/
|
|
6703
|
+
WebReturnMapperBuilderClass.prototype.orgCode = /**
|
|
6704
|
+
* @template THIS
|
|
6705
|
+
* @this {THIS}
|
|
6706
|
+
* @param {?} orgCode
|
|
6707
|
+
* @return {THIS}
|
|
6708
|
+
*/
|
|
6709
|
+
function (orgCode) {
|
|
6710
|
+
(/** @type {?} */ (this)).webReturnObject.orgCode = orgCode;
|
|
6711
|
+
return (/** @type {?} */ (this));
|
|
6712
|
+
};
|
|
6713
|
+
/**
|
|
6714
|
+
* @template THIS
|
|
6715
|
+
* @this {THIS}
|
|
6716
|
+
* @param {?} storeId
|
|
6717
|
+
* @return {THIS}
|
|
6718
|
+
*/
|
|
6719
|
+
WebReturnMapperBuilderClass.prototype.storeId = /**
|
|
6720
|
+
* @template THIS
|
|
6721
|
+
* @this {THIS}
|
|
6722
|
+
* @param {?} storeId
|
|
6723
|
+
* @return {THIS}
|
|
6724
|
+
*/
|
|
6725
|
+
function (storeId) {
|
|
6726
|
+
(/** @type {?} */ (this)).webReturnObject.storeId = storeId;
|
|
6727
|
+
return (/** @type {?} */ (this));
|
|
6728
|
+
};
|
|
6729
|
+
/**
|
|
6730
|
+
* @template THIS
|
|
6731
|
+
* @this {THIS}
|
|
6732
|
+
* @param {?} storeNodeId
|
|
6733
|
+
* @return {THIS}
|
|
6734
|
+
*/
|
|
6735
|
+
WebReturnMapperBuilderClass.prototype.storeNodeId = /**
|
|
6736
|
+
* @template THIS
|
|
6737
|
+
* @this {THIS}
|
|
6738
|
+
* @param {?} storeNodeId
|
|
6739
|
+
* @return {THIS}
|
|
6740
|
+
*/
|
|
6741
|
+
function (storeNodeId) {
|
|
6742
|
+
(/** @type {?} */ (this)).webReturnObject.storeNodeId = storeNodeId;
|
|
6743
|
+
return (/** @type {?} */ (this));
|
|
6744
|
+
};
|
|
6745
|
+
/**
|
|
6746
|
+
* @template THIS
|
|
6747
|
+
* @this {THIS}
|
|
6748
|
+
* @param {?} storeNodeStructure
|
|
6749
|
+
* @return {THIS}
|
|
6750
|
+
*/
|
|
6751
|
+
WebReturnMapperBuilderClass.prototype.storeNodeStructure = /**
|
|
6752
|
+
* @template THIS
|
|
6753
|
+
* @this {THIS}
|
|
6754
|
+
* @param {?} storeNodeStructure
|
|
6755
|
+
* @return {THIS}
|
|
6756
|
+
*/
|
|
6757
|
+
function (storeNodeStructure) {
|
|
6758
|
+
(/** @type {?} */ (this)).webReturnObject.storeNodeStructure = storeNodeStructure;
|
|
6759
|
+
return (/** @type {?} */ (this));
|
|
6760
|
+
};
|
|
6761
|
+
/**
|
|
6762
|
+
* @template THIS
|
|
6763
|
+
* @this {THIS}
|
|
6764
|
+
* @param {?} docId
|
|
6765
|
+
* @return {THIS}
|
|
6766
|
+
*/
|
|
6767
|
+
WebReturnMapperBuilderClass.prototype.docId = /**
|
|
6768
|
+
* @template THIS
|
|
6769
|
+
* @this {THIS}
|
|
6770
|
+
* @param {?} docId
|
|
6771
|
+
* @return {THIS}
|
|
6772
|
+
*/
|
|
6773
|
+
function (docId) {
|
|
6774
|
+
(/** @type {?} */ (this)).webReturnObject.id = docId;
|
|
6775
|
+
return (/** @type {?} */ (this));
|
|
6776
|
+
};
|
|
6777
|
+
/**
|
|
6778
|
+
* @template THIS
|
|
6779
|
+
* @this {THIS}
|
|
6780
|
+
* @param {?} userID
|
|
6781
|
+
* @return {THIS}
|
|
6782
|
+
*/
|
|
6783
|
+
WebReturnMapperBuilderClass.prototype.updateUserID = /**
|
|
6784
|
+
* @template THIS
|
|
6785
|
+
* @this {THIS}
|
|
6786
|
+
* @param {?} userID
|
|
6787
|
+
* @return {THIS}
|
|
6788
|
+
*/
|
|
6789
|
+
function (userID) {
|
|
6790
|
+
(/** @type {?} */ (this)).webReturnObject.userId = userID;
|
|
6791
|
+
return (/** @type {?} */ (this));
|
|
6792
|
+
};
|
|
6793
|
+
/**
|
|
6794
|
+
* @template THIS
|
|
6795
|
+
* @this {THIS}
|
|
6796
|
+
* @param {?} name
|
|
6797
|
+
* @return {THIS}
|
|
6798
|
+
*/
|
|
6799
|
+
WebReturnMapperBuilderClass.prototype.updateUserName = /**
|
|
6800
|
+
* @template THIS
|
|
6801
|
+
* @this {THIS}
|
|
6802
|
+
* @param {?} name
|
|
6803
|
+
* @return {THIS}
|
|
6804
|
+
*/
|
|
6805
|
+
function (name) {
|
|
6806
|
+
(/** @type {?} */ (this)).webReturnObject.userName = name;
|
|
6807
|
+
return (/** @type {?} */ (this));
|
|
6808
|
+
};
|
|
6809
|
+
/**
|
|
6810
|
+
* @return {?}
|
|
6811
|
+
*/
|
|
6812
|
+
WebReturnMapperBuilderClass.prototype.build = /**
|
|
6813
|
+
* @return {?}
|
|
6814
|
+
*/
|
|
6815
|
+
function () {
|
|
6816
|
+
return this.webReturnObject;
|
|
6817
|
+
};
|
|
6818
|
+
/**
|
|
6819
|
+
* @param {?} obj
|
|
6820
|
+
* @return {?}
|
|
6821
|
+
*/
|
|
6822
|
+
WebReturnMapperBuilderClass.prototype.getText = /**
|
|
6823
|
+
* @param {?} obj
|
|
6824
|
+
* @return {?}
|
|
6825
|
+
*/
|
|
6826
|
+
function (obj) {
|
|
6827
|
+
if (obj) {
|
|
6828
|
+
return obj.text;
|
|
6829
|
+
}
|
|
6830
|
+
};
|
|
6831
|
+
/**
|
|
6832
|
+
* @param {?} date
|
|
6833
|
+
* @return {?}
|
|
6834
|
+
*/
|
|
6835
|
+
WebReturnMapperBuilderClass.prototype.getUTCDateTime = /**
|
|
6836
|
+
* @param {?} date
|
|
6837
|
+
* @return {?}
|
|
6838
|
+
*/
|
|
6839
|
+
function (date) {
|
|
6840
|
+
if (date) {
|
|
6841
|
+
return new Date(date).toISOString();
|
|
6842
|
+
}
|
|
6843
|
+
};
|
|
6844
|
+
return WebReturnMapperBuilderClass;
|
|
6845
|
+
}());
|
|
6846
|
+
if (false) {
|
|
6847
|
+
/**
|
|
6848
|
+
* @type {?}
|
|
6849
|
+
* @private
|
|
6850
|
+
*/
|
|
6851
|
+
WebReturnMapperBuilderClass.prototype.document;
|
|
6852
|
+
/**
|
|
6853
|
+
* @type {?}
|
|
6854
|
+
* @private
|
|
6855
|
+
*/
|
|
6856
|
+
WebReturnMapperBuilderClass.prototype.webReturnObject;
|
|
6857
|
+
}
|
|
6858
|
+
|
|
6318
6859
|
exports.MapperLibraryComponent = MapperLibraryComponent;
|
|
6319
6860
|
exports.MapperLibraryModule = MapperLibraryModule;
|
|
6320
6861
|
exports.RJMapperBuilderClass = RJMapperBuilderClass;
|
|
6862
|
+
exports.WebReturnMapperBuilderClass = WebReturnMapperBuilderClass;
|
|
6321
6863
|
|
|
6322
6864
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6323
6865
|
|