@pmcretail/mapper-library 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/pmcretail-mapper-library.umd.js +102 -66
- 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 +88 -67
- package/esm2015/lib/mapper-library.component.js +5 -5
- package/esm2015/lib/mapper-library.module.js +1 -1
- package/esm5/lib/RJ-mapper.class.js +103 -67
- package/esm5/lib/mapper-library.component.js +1 -1
- package/esm5/lib/mapper-library.module.js +1 -1
- package/fesm2015/pmcretail-mapper-library.js +91 -70
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +102 -66
- package/fesm5/pmcretail-mapper-library.js.map +1 -1
- package/lib/RJ-mapper.class.d.ts +5 -0
- package/package.json +1 -1
- package/pmcretail-mapper-library.metadata.json +1 -1
|
@@ -26,4 +26,4 @@ var MapperLibraryComponent = /** @class */ (function () {
|
|
|
26
26
|
return MapperLibraryComponent;
|
|
27
27
|
}());
|
|
28
28
|
export { MapperLibraryComponent };
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFwcGVyLWxpYnJhcnkuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHBtY3JldGFpbC9tYXBwZXItbGlicmFyeS8iLCJzb3VyY2VzIjpbImxpYi9tYXBwZXItbGlicmFyeS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBRWxEO0lBWUU7SUFBZ0IsQ0FBQzs7OztJQUVqQix5Q0FBUTs7O0lBQVI7SUFDQSxDQUFDOztnQkFmRixTQUFTLFNBQUM7b0JBQ1QsUUFBUSxFQUFFLG9CQUFvQjtvQkFDOUIsUUFBUSxFQUFFLHNEQUlUO2lCQUdGOzs7O0lBUUQsNkJBQUM7Q0FBQSxBQWpCRCxJQWlCQztTQVBZLHNCQUFzQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgT25Jbml0IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ2xpYi1tYXBwZXItbGlicmFyeScsXG4gIHRlbXBsYXRlOiBgXG4gICAgPHA+XG4gICAgICBtYXBwZXItbGlicmFyeSB3b3JrcyFcbiAgICA8L3A+XG4gIGAsXG4gIHN0eWxlczogW1xuICBdXG59KVxuZXhwb3J0IGNsYXNzIE1hcHBlckxpYnJhcnlDb21wb25lbnQgaW1wbGVtZW50cyBPbkluaXQge1xuXG4gIGNvbnN0cnVjdG9yKCkgeyB9XG5cbiAgbmdPbkluaXQoKTogdm9pZCB7XG4gIH1cblxufVxuIl19
|
|
@@ -22,4 +22,4 @@ var MapperLibraryModule = /** @class */ (function () {
|
|
|
22
22
|
return MapperLibraryModule;
|
|
23
23
|
}());
|
|
24
24
|
export { MapperLibraryModule };
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFwcGVyLWxpYnJhcnkubW9kdWxlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHBtY3JldGFpbC9tYXBwZXItbGlicmFyeS8iLCJzb3VyY2VzIjpbImxpYi9tYXBwZXItbGlicmFyeS5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBSXBFO0lBQUE7SUFVbUMsQ0FBQzs7Z0JBVm5DLFFBQVEsU0FBQztvQkFDUixZQUFZLEVBQUU7d0JBQ1osc0JBQXNCO3FCQUN2QjtvQkFDRCxPQUFPLEVBQUUsRUFDUjtvQkFDRCxPQUFPLEVBQUU7d0JBQ1Asc0JBQXNCO3FCQUN2QjtpQkFDRjs7SUFDa0MsMEJBQUM7Q0FBQSxBQVZwQyxJQVVvQztTQUF2QixtQkFBbUIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTWFwcGVyTGlicmFyeUNvbXBvbmVudCB9IGZyb20gJy4vbWFwcGVyLWxpYnJhcnkuY29tcG9uZW50JztcblxuXG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW1xuICAgIE1hcHBlckxpYnJhcnlDb21wb25lbnRcbiAgXSxcbiAgaW1wb3J0czogW1xuICBdLFxuICBleHBvcnRzOiBbXG4gICAgTWFwcGVyTGlicmFyeUNvbXBvbmVudFxuICBdXG59KVxuZXhwb3J0IGNsYXNzIE1hcHBlckxpYnJhcnlNb2R1bGUgeyB9XG4iXX0=
|
|
@@ -18,10 +18,10 @@ class MapperLibraryComponent {
|
|
|
18
18
|
MapperLibraryComponent.decorators = [
|
|
19
19
|
{ type: Component, args: [{
|
|
20
20
|
selector: 'lib-mapper-library',
|
|
21
|
-
template: `
|
|
22
|
-
<p>
|
|
23
|
-
mapper-library works!
|
|
24
|
-
</p>
|
|
21
|
+
template: `
|
|
22
|
+
<p>
|
|
23
|
+
mapper-library works!
|
|
24
|
+
</p>
|
|
25
25
|
`
|
|
26
26
|
}] }
|
|
27
27
|
];
|
|
@@ -3484,32 +3484,6 @@ class RJMapperBuilderClass {
|
|
|
3484
3484
|
this.itemCount = 0;
|
|
3485
3485
|
this.largestNumber = 0;
|
|
3486
3486
|
this.rjObject = {};
|
|
3487
|
-
this.paymentTypes = [
|
|
3488
|
-
{
|
|
3489
|
-
paymentType: 'Card',
|
|
3490
|
-
type: 'SEPAY',
|
|
3491
|
-
tenderType: '5',
|
|
3492
|
-
tenderSubType: '8',
|
|
3493
|
-
},
|
|
3494
|
-
{
|
|
3495
|
-
paymentType: 'Cash',
|
|
3496
|
-
type: 'TMC_CASH',
|
|
3497
|
-
tenderType: '1',
|
|
3498
|
-
tenderSubType: '0'
|
|
3499
|
-
},
|
|
3500
|
-
{
|
|
3501
|
-
paymentType: 'PDQ',
|
|
3502
|
-
type: 'Unintegrated',
|
|
3503
|
-
tenderType: '2',
|
|
3504
|
-
tenderSubType: '8'
|
|
3505
|
-
},
|
|
3506
|
-
{
|
|
3507
|
-
paymentType: 'Gift Card',
|
|
3508
|
-
type: 'TMC_GIFTCARD',
|
|
3509
|
-
tenderType: '5',
|
|
3510
|
-
tenderSubType: '8'
|
|
3511
|
-
}
|
|
3512
|
-
];
|
|
3513
3487
|
if (transactionDoc) {
|
|
3514
3488
|
this.transactionDocument = transactionDoc;
|
|
3515
3489
|
}
|
|
@@ -3542,6 +3516,8 @@ class RJMapperBuilderClass {
|
|
|
3542
3516
|
}
|
|
3543
3517
|
this.initilizeItemCount();
|
|
3544
3518
|
this.setLineNumberForProducts();
|
|
3519
|
+
this.createdAt = this.getdate(this.transactionDocument.createdAt);
|
|
3520
|
+
this.updatedAt = this.getdate(this.transactionDocument.updatedAt);
|
|
3545
3521
|
}
|
|
3546
3522
|
/**
|
|
3547
3523
|
* @template THIS
|
|
@@ -3550,9 +3526,9 @@ class RJMapperBuilderClass {
|
|
|
3550
3526
|
*/
|
|
3551
3527
|
getPosbasketInfo() {
|
|
3552
3528
|
(/** @type {?} */ (this)).rjObject['Keyword'] = (/** @type {?} */ (this)).generateKeyword();
|
|
3553
|
-
(/** @type {?} */ (this)).rjObject['ID'] = (/** @type {?} */ (this)).generateId((/** @type {?} */ (this)).
|
|
3529
|
+
(/** @type {?} */ (this)).rjObject['ID'] = (/** @type {?} */ (this)).generateId((/** @type {?} */ (this)).createdAt);
|
|
3554
3530
|
(/** @type {?} */ (this)).rjObject['XMLSchemaVersion'] = '2';
|
|
3555
|
-
(/** @type {?} */ (this)).rjObject['LastUpdated'] = (/** @type {?} */ (this)).
|
|
3531
|
+
(/** @type {?} */ (this)).rjObject['LastUpdated'] = (/** @type {?} */ (this)).updatedAt;
|
|
3556
3532
|
(/** @type {?} */ (this)).rjObject['MajorVersion'] = (/** @type {?} */ (this)).majorVersion;
|
|
3557
3533
|
(/** @type {?} */ (this)).rjObject['MinorVersion'] = (/** @type {?} */ (this)).minorVersion;
|
|
3558
3534
|
(/** @type {?} */ (this)).rjObject['ManifestVersion'] = (/** @type {?} */ (this)).manifestVersion;
|
|
@@ -3570,7 +3546,7 @@ class RJMapperBuilderClass {
|
|
|
3570
3546
|
getheaderInfo() {
|
|
3571
3547
|
(/** @type {?} */ (this)).rjObject['Header'] = {};
|
|
3572
3548
|
(/** @type {?} */ (this)).rjObject['Header'].TimeZoneOffset = (/** @type {?} */ (this)).convertToString((/** @type {?} */ (this)).generateTimezoneoffset((/** @type {?} */ (this)).transactionDocument.createdAt));
|
|
3573
|
-
(/** @type {?} */ (this)).rjObject['Header'].DateTimeCreated = (/** @type {?} */ (this)).
|
|
3549
|
+
(/** @type {?} */ (this)).rjObject['Header'].DateTimeCreated = (/** @type {?} */ (this)).createdAt;
|
|
3574
3550
|
(/** @type {?} */ (this)).rjObject['Header'].OriginatedBy = {};
|
|
3575
3551
|
(/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.DeviceID = (/** @type {?} */ (this)).deviceId;
|
|
3576
3552
|
(/** @type {?} */ (this)).rjObject['Header'].OriginatedBy.CashierID = (/** @type {?} */ (this)).cashierId;
|
|
@@ -3587,7 +3563,7 @@ class RJMapperBuilderClass {
|
|
|
3587
3563
|
(/** @type {?} */ (this)).rjObject['Header'].TradingRegionID = (/** @type {?} */ (this)).tradingRegionId;
|
|
3588
3564
|
(/** @type {?} */ (this)).rjObject['Header'].Eurozone = " "; //unknown
|
|
3589
3565
|
(/** @type {?} */ (this)).rjObject['Header'].EuroBaseExchangeRate = ""; //unknown
|
|
3590
|
-
(/** @type {?} */ (this)).rjObject['Header'].PrintableName =
|
|
3566
|
+
(/** @type {?} */ (this)).rjObject['Header'].PrintableName = (/** @type {?} */ (this)).transactionDocument.userName; //unknown
|
|
3591
3567
|
return (/** @type {?} */ (this));
|
|
3592
3568
|
}
|
|
3593
3569
|
/**
|
|
@@ -3720,7 +3696,7 @@ class RJMapperBuilderClass {
|
|
|
3720
3696
|
obj['NetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
|
|
3721
3697
|
obj['EffectiveNetValue'] = element.discountAmount < 0 ? element.discountAmount : -element.discountAmount;
|
|
3722
3698
|
obj['Description'] = element.reasonCode;
|
|
3723
|
-
obj['UserID'] = (/** @type {?} */ (this)).transactionDocument.
|
|
3699
|
+
obj['UserID'] = (/** @type {?} */ (this)).transactionDocument.userName;
|
|
3724
3700
|
obj['ReasonCodeID'] = element.reasonCode;
|
|
3725
3701
|
obj['DiscountType'] = element.discountType.toUpperCase() == DISCOUNTTYPE.PERCENT.toUpperCase() ? 0 : 1; // todo - compare values
|
|
3726
3702
|
obj['RoundingRule'] = 2;
|
|
@@ -3754,8 +3730,8 @@ class RJMapperBuilderClass {
|
|
|
3754
3730
|
obj.EffectiveNetValue = 0;
|
|
3755
3731
|
obj.Description = data.percentageDiscountReasonName ? data.percentageDiscountReasonName : data.priceOverrideReasonName;
|
|
3756
3732
|
obj.DeviceID = this.deviceId;
|
|
3757
|
-
obj.UserID = this.
|
|
3758
|
-
obj.DateTimeCreated = this.
|
|
3733
|
+
obj.UserID = this.transactionDocument.userName;
|
|
3734
|
+
obj.DateTimeCreated = this.updatedAt;
|
|
3759
3735
|
obj.AuthorisingUserID = this.userId;
|
|
3760
3736
|
obj.ReasonCodeID = data.percentageDiscountReasonCode ? data.percentageDiscountReasonCode : data.priceOverrideReasonCode;
|
|
3761
3737
|
obj.ModifiedLineNumber = lineNo;
|
|
@@ -3770,10 +3746,10 @@ class RJMapperBuilderClass {
|
|
|
3770
3746
|
*/
|
|
3771
3747
|
getTrailerInfo() {
|
|
3772
3748
|
(/** @type {?} */ (this)).rjObject['Trailer'] = {};
|
|
3773
|
-
(/** @type {?} */ (this)).rjObject.Trailer.DateTimeCompleted = (/** @type {?} */ (this)).
|
|
3749
|
+
(/** @type {?} */ (this)).rjObject.Trailer.DateTimeCompleted = (/** @type {?} */ (this)).updatedAt;
|
|
3774
3750
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy = {};
|
|
3775
|
-
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId;
|
|
3776
|
-
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
|
|
3751
|
+
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.DeviceID = (/** @type {?} */ (this)).deviceId;
|
|
3752
|
+
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.CashierID = (/** @type {?} */ (this)).cashierId;
|
|
3777
3753
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.StoreID = (/** @type {?} */ (this)).transactionDocument.storeId;
|
|
3778
3754
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.BranchID = (/** @type {?} */ (this)).branchId;
|
|
3779
3755
|
(/** @type {?} */ (this)).rjObject.Trailer.CompletedBy.TerminalNumber = (/** @type {?} */ (this)).transactionDocument.terminalId;
|
|
@@ -3871,7 +3847,7 @@ class RJMapperBuilderClass {
|
|
|
3871
3847
|
* @param {?} x
|
|
3872
3848
|
* @return {?}
|
|
3873
3849
|
*/
|
|
3874
|
-
x => x.
|
|
3850
|
+
x => x.name.toUpperCase() === element.paymentType.toUpperCase()));
|
|
3875
3851
|
if (element.paymentType.toUpperCase() === 'GIFT CARD') {
|
|
3876
3852
|
/** @type {?} */
|
|
3877
3853
|
let obj = {
|
|
@@ -3879,13 +3855,10 @@ class RJMapperBuilderClass {
|
|
|
3879
3855
|
LineNumber: (/** @type {?} */ (this)).generateLineNumber(),
|
|
3880
3856
|
NetValue: (/** @type {?} */ (this)).convertToString(-1 * (/** @type {?} */ (this)).removeDecimal((Math.round(element.amount)))),
|
|
3881
3857
|
EffectiveNetValue: (/** @type {?} */ (this)).convertToString(-1 * (/** @type {?} */ (this)).removeDecimal((Math.round(element.amount)))),
|
|
3882
|
-
Description: (/** @type {?} */ (this)).getDescription(value[0].
|
|
3883
|
-
//todo
|
|
3858
|
+
Description: (/** @type {?} */ (this)).getDescription(value[0].name, element),
|
|
3884
3859
|
DeviceID: (/** @type {?} */ (this)).deviceId,
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
//todo
|
|
3888
|
-
DateTimeCreated: (/** @type {?} */ (this)).transactionDocument.updatedAt,
|
|
3860
|
+
UserID: (/** @type {?} */ (this)).transactionDocument.userName,
|
|
3861
|
+
DateTimeCreated: (/** @type {?} */ (this)).updatedAt,
|
|
3889
3862
|
TenderType: value[0].tenderType,
|
|
3890
3863
|
TenderSubType: value[0].tenderSubType,
|
|
3891
3864
|
TenderAmount: (/** @type {?} */ (this)).convertToString(-1 * (/** @type {?} */ (this)).removeDecimal((Math.round(element.amount)))),
|
|
@@ -3907,13 +3880,10 @@ class RJMapperBuilderClass {
|
|
|
3907
3880
|
//todo
|
|
3908
3881
|
NetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
3909
3882
|
EffectiveNetValue: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
3910
|
-
Description: (/** @type {?} */ (this)).getDescription(value[0].
|
|
3911
|
-
//todo
|
|
3883
|
+
Description: (/** @type {?} */ (this)).getDescription(value[0].name, element),
|
|
3912
3884
|
DeviceID: (/** @type {?} */ (this)).deviceId,
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
//todo
|
|
3916
|
-
DateTimeCreated: (/** @type {?} */ (this)).transactionDocument.updatedAt,
|
|
3885
|
+
UserID: (/** @type {?} */ (this)).transactionDocument.userName,
|
|
3886
|
+
DateTimeCreated: (/** @type {?} */ (this)).updatedAt,
|
|
3917
3887
|
TenderType: value[0].tenderType,
|
|
3918
3888
|
TenderSubType: value[0].tenderSubType,
|
|
3919
3889
|
TenderAmount: JSON.stringify(-1 * (Math.round(element.amount))),
|
|
@@ -4126,7 +4096,7 @@ class RJMapperBuilderClass {
|
|
|
4126
4096
|
* @return {THIS}
|
|
4127
4097
|
*/
|
|
4128
4098
|
setCashierID(value) {
|
|
4129
|
-
(/** @type {?} */ (this)).cashierId =
|
|
4099
|
+
(/** @type {?} */ (this)).cashierId = ((/** @type {?} */ (this)).transactionDocument && (/** @type {?} */ (this)).transactionDocument.userName) ? (/** @type {?} */ (this)).transactionDocument.userName : '';
|
|
4130
4100
|
return (/** @type {?} */ (this));
|
|
4131
4101
|
}
|
|
4132
4102
|
/**
|
|
@@ -4179,6 +4149,16 @@ class RJMapperBuilderClass {
|
|
|
4179
4149
|
(/** @type {?} */ (this)).branchId = value;
|
|
4180
4150
|
return (/** @type {?} */ (this));
|
|
4181
4151
|
}
|
|
4152
|
+
/**
|
|
4153
|
+
* @template THIS
|
|
4154
|
+
* @this {THIS}
|
|
4155
|
+
* @param {?} value
|
|
4156
|
+
* @return {THIS}
|
|
4157
|
+
*/
|
|
4158
|
+
setPaymentDetails(value) {
|
|
4159
|
+
(/** @type {?} */ (this)).paymentTypes = value;
|
|
4160
|
+
return (/** @type {?} */ (this));
|
|
4161
|
+
}
|
|
4182
4162
|
/**
|
|
4183
4163
|
* @param {?} date
|
|
4184
4164
|
* @return {?}
|
|
@@ -4226,6 +4206,12 @@ class RJMapperBuilderClass {
|
|
|
4226
4206
|
returnProduct(element, lineDiscount) {
|
|
4227
4207
|
/** @type {?} */
|
|
4228
4208
|
let obj = {};
|
|
4209
|
+
/** @type {?} */
|
|
4210
|
+
let taxTotal = this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
|
|
4211
|
+
* @param {?} item
|
|
4212
|
+
* @return {?}
|
|
4213
|
+
*/
|
|
4214
|
+
(item) => item.itemLineId == element['itemLineId']));
|
|
4229
4215
|
obj['XMLSchemaVersion'] = this.xmlSchemaVersion;
|
|
4230
4216
|
obj['LineNumber'] = element['itemLineId'];
|
|
4231
4217
|
obj['NetValue'] = this.removeDecimal(element['refundedTotal']);
|
|
@@ -4233,7 +4219,7 @@ class RJMapperBuilderClass {
|
|
|
4233
4219
|
obj['Description'] = element['description'];
|
|
4234
4220
|
obj['DeviceID'] = this.transactionDocument['terminalId'];
|
|
4235
4221
|
obj['UserID'] = this.userId;
|
|
4236
|
-
obj['DateTimeCreated'] = this.
|
|
4222
|
+
obj['DateTimeCreated'] = this.createdAt;
|
|
4237
4223
|
obj['ExtendedValue'] = this.removeDecimal(element['totalLinePrice'] * -1);
|
|
4238
4224
|
obj['UnitPrice'] = this.removeDecimal(element['price']);
|
|
4239
4225
|
obj['Quantity'] = element['refundedQuantity'] < 0 ? element['refundedQuantity'].toFixed(1) : -element['refundedQuantity'].toFixed(1);
|
|
@@ -4256,15 +4242,8 @@ class RJMapperBuilderClass {
|
|
|
4256
4242
|
obj['MMGroupID'] = this.getAttributes();
|
|
4257
4243
|
obj['CustomerDetails'] = ""; // todo - blank
|
|
4258
4244
|
obj['TotalPromotionSaving'] = element['promotionAmount'] || -1; // TODO
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
let taxTotal = this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
|
|
4262
|
-
* @param {?} item
|
|
4263
|
-
* @return {?}
|
|
4264
|
-
*/
|
|
4265
|
-
(item) => item.itemLineId == element['itemLineId']));
|
|
4266
|
-
obj['OriginalTaxAmount'] = taxTotal.taxLineTotal < 0 ? this.removeDecimal(taxTotal.taxLineTotal) : this.removeDecimal(-taxTotal.taxLineTotal); //todo
|
|
4267
|
-
obj['taxAmount'] = taxTotal.taxLineTotal < 0 ? this.removeDecimal(taxTotal.taxLineTotal) : this.removeDecimal(-taxTotal.taxLineTotal);
|
|
4245
|
+
obj['OriginalTaxAmount'] = this.convertToString(this.getoriginltax(element, taxTotal.VAT) * -1);
|
|
4246
|
+
obj['taxAmount'] = taxTotal.taxLineTotal < 0 ? (taxTotal.taxLineTotal) : (-taxTotal.taxLineTotal);
|
|
4268
4247
|
if (lineDiscount) {
|
|
4269
4248
|
if (lineDiscount.percentageDiscountReasonName && lineDiscount.percentageDiscountReasonCode) {
|
|
4270
4249
|
// line discount
|
|
@@ -4321,10 +4300,8 @@ class RJMapperBuilderClass {
|
|
|
4321
4300
|
EffectiveNetValue: this.removeDecimal(element.totalLinePrice),
|
|
4322
4301
|
Description: element.description,
|
|
4323
4302
|
DeviceID: this.deviceId,
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
//to do,
|
|
4327
|
-
DateTimeCreated: this.transactionDocument.createdAt,
|
|
4303
|
+
UserID: this.transactionDocument.userName,
|
|
4304
|
+
DateTimeCreated: this.createdAt,
|
|
4328
4305
|
ExtendedValue: this.removeDecimal(element.price),
|
|
4329
4306
|
UnitPrice: this.removeDecimal(element.price),
|
|
4330
4307
|
MMGroupID: this.getAttributes(),
|
|
@@ -4339,8 +4316,8 @@ class RJMapperBuilderClass {
|
|
|
4339
4316
|
(item) => item.itemLineId == element['itemLineId'])).VATCode,
|
|
4340
4317
|
TaxModifiable: 1,
|
|
4341
4318
|
//todo
|
|
4342
|
-
OriginalTaxAmount:
|
|
4343
|
-
TaxAmount:
|
|
4319
|
+
OriginalTaxAmount: this.convertToString(this.getoriginltax(element, taxTotal.VAT)),
|
|
4320
|
+
TaxAmount: this.convertToString(taxTotal.taxLineTotal),
|
|
4344
4321
|
OriginalTaxAmountSet: 1,
|
|
4345
4322
|
//todo
|
|
4346
4323
|
ProductID: element.SKU,
|
|
@@ -4385,6 +4362,18 @@ class RJMapperBuilderClass {
|
|
|
4385
4362
|
}
|
|
4386
4363
|
return obj;
|
|
4387
4364
|
}
|
|
4365
|
+
/**
|
|
4366
|
+
* @param {?} element
|
|
4367
|
+
* @param {?} VAT
|
|
4368
|
+
* @return {?}
|
|
4369
|
+
*/
|
|
4370
|
+
getoriginltax(element, VAT) {
|
|
4371
|
+
/** @type {?} */
|
|
4372
|
+
let pricebeforetax = (element.price * 100) / (100 + VAT);
|
|
4373
|
+
/** @type {?} */
|
|
4374
|
+
let originaltax = element.price - pricebeforetax;
|
|
4375
|
+
return originaltax;
|
|
4376
|
+
}
|
|
4388
4377
|
/**
|
|
4389
4378
|
* @param {?} value
|
|
4390
4379
|
* @return {?}
|
|
@@ -4441,6 +4430,28 @@ class RJMapperBuilderClass {
|
|
|
4441
4430
|
return "";
|
|
4442
4431
|
}
|
|
4443
4432
|
}
|
|
4433
|
+
/**
|
|
4434
|
+
* @param {?} date
|
|
4435
|
+
* @return {?}
|
|
4436
|
+
*/
|
|
4437
|
+
getdate(date) {
|
|
4438
|
+
/** @type {?} */
|
|
4439
|
+
let offset = this.generateTimezoneoffset(date) * -1;
|
|
4440
|
+
/** @type {?} */
|
|
4441
|
+
let offsetHours = Math.abs(Math.floor(offset / 60));
|
|
4442
|
+
/** @type {?} */
|
|
4443
|
+
let offsetMinutes = Math.abs(offset) - offsetHours * 60;
|
|
4444
|
+
/** @type {?} */
|
|
4445
|
+
let offsetSign = '+';
|
|
4446
|
+
if (offset < 0) {
|
|
4447
|
+
offsetSign = '-';
|
|
4448
|
+
}
|
|
4449
|
+
/** @type {?} */
|
|
4450
|
+
let newdate = date.substring(0, 19);
|
|
4451
|
+
/** @type {?} */
|
|
4452
|
+
let x = (newdate + offsetSign + offsetHours + ':' + offsetMinutes).toString();
|
|
4453
|
+
return x;
|
|
4454
|
+
}
|
|
4444
4455
|
}
|
|
4445
4456
|
if (false) {
|
|
4446
4457
|
/**
|
|
@@ -4553,6 +4564,16 @@ if (false) {
|
|
|
4553
4564
|
* @private
|
|
4554
4565
|
*/
|
|
4555
4566
|
RJMapperBuilderClass.prototype.branchId;
|
|
4567
|
+
/**
|
|
4568
|
+
* @type {?}
|
|
4569
|
+
* @private
|
|
4570
|
+
*/
|
|
4571
|
+
RJMapperBuilderClass.prototype.createdAt;
|
|
4572
|
+
/**
|
|
4573
|
+
* @type {?}
|
|
4574
|
+
* @private
|
|
4575
|
+
*/
|
|
4576
|
+
RJMapperBuilderClass.prototype.updatedAt;
|
|
4556
4577
|
/**
|
|
4557
4578
|
* @type {?}
|
|
4558
4579
|
* @private
|