taxtank-core 0.28.15 → 0.28.18
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/taxtank-core.umd.js +75 -37
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +2 -2
- package/esm2015/lib/db/Models/property/property-forecast.js +1 -1
- package/esm2015/lib/db/Models/property/property.js +1 -1
- package/esm2015/lib/forms/sole/sole-business.form.js +8 -3
- package/esm2015/lib/models/chart-accounts/chart-accounts.js +7 -1
- package/esm2015/lib/models/endpoint/endpoints.const.js +6 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +36 -35
- package/esm2015/lib/models/property/property.js +4 -1
- package/esm2015/lib/services/http/property/property.service.js +4 -1
- package/esm2015/lib/services/http/transaction/transaction.service.js +11 -1
- package/fesm2015/taxtank-core.js +70 -37
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/db/Enums/chart-accounts-list.enum.d.ts +2 -2
- package/lib/db/Models/property/property-forecast.d.ts +1 -0
- package/lib/db/Models/property/property.d.ts +0 -1
- package/lib/forms/sole/sole-business.form.d.ts +1 -0
- package/lib/models/chart-accounts/chart-accounts.d.ts +4 -0
- package/lib/models/event/app-event-type.enum.d.ts +35 -34
- package/lib/models/property/property.d.ts +1 -0
- package/lib/services/http/transaction/transaction.service.d.ts +7 -1
- package/package.json +1 -1
|
@@ -577,40 +577,41 @@
|
|
|
577
577
|
AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 26] = "MESSAGE_FILE_DELETED";
|
|
578
578
|
AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 27] = "NOTIFICATION_ADDED";
|
|
579
579
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DEPRECIATION_CALCULATION_UPDATED"] = 28] = "PROPERTY_DEPRECIATION_CALCULATION_UPDATED";
|
|
580
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
581
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
582
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
583
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
584
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
585
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
586
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
587
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
588
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
589
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
590
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
591
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
592
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
593
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
594
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
595
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
596
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
597
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
598
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
599
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
600
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
601
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
602
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
603
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
604
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
605
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
606
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
607
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
608
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
609
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
610
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
611
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
612
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
613
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
580
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED"] = 29] = "PROPERTY_UPDATED";
|
|
581
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 30] = "PROPERTY_UPDATED_WITH_DOCUMENT";
|
|
582
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 31] = "PROPERTY_DOCUMENT_ADDED";
|
|
583
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 32] = "PROPERTY_MOVEMENT_CREATED";
|
|
584
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 33] = "PROPERTY_MOVEMENT_UPDATED";
|
|
585
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 34] = "PROPERTY_MOVEMENT_DELETED";
|
|
586
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 35] = "PROPERTY_SHARE_UPDATED";
|
|
587
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 36] = "PROPERTY_SALE_ADDED";
|
|
588
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 37] = "PROPERTY_SALE_DELETED";
|
|
589
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 38] = "PROPERTY_SUBSCRIPTION_ADDED";
|
|
590
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 39] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
591
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 40] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
592
|
+
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 41] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
593
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 42] = "SOLE_BUSINESS_CREATED";
|
|
594
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 43] = "SOLE_DEPRECIATION_METHOD_UPDATED";
|
|
595
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 44] = "SOLE_DETAILS_CREATED";
|
|
596
|
+
AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 45] = "SOLE_DETAILS_UPDATED";
|
|
597
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 46] = "TAX_REVIEW_UPDATED";
|
|
598
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 47] = "TRANSACTION_CREATED";
|
|
599
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 48] = "TRANSACTION_DELETED";
|
|
600
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 49] = "TRANSACTION_UPDATED";
|
|
601
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 50] = "TRANSACTION_UPDATED_WITH_RECEIPT";
|
|
602
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 51] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
|
|
603
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 52] = "TRANSACTION_RECEIPT_CREATED";
|
|
604
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 53] = "TRANSACTION_RECEIPT_DELETED";
|
|
605
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 54] = "TRANSACTIONS_CREATED";
|
|
606
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 55] = "USER_UPDATED";
|
|
607
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 56] = "VEHICLE_CLAIM_UPDATED";
|
|
608
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 57] = "VEHICLE_CLAIM_CREATED";
|
|
609
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 58] = "VEHICLE_CLAIM_DETAILS_UPDATED";
|
|
610
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 59] = "VEHICLE_CLAIM_DETAILS_CREATED";
|
|
611
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 60] = "VEHICLE_LOGBOOK_CREATED";
|
|
612
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 61] = "VEHICLE_LOGBOOK_UPDATED";
|
|
613
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 62] = "VEHICLE_LOGBOOK_DELETED";
|
|
614
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 63] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
|
|
614
615
|
})(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
|
|
615
616
|
|
|
616
617
|
var EventDispatcherService = /** @class */ (function () {
|
|
@@ -1063,9 +1064,14 @@
|
|
|
1063
1064
|
SOLE_BUSINESSES_POST: new Endpoint('POST', '\\/sole-businesses'),
|
|
1064
1065
|
SOLE_BUSINESSES_PUT: new Endpoint('PUT', '\\/sole-businesses\\/\\d+'),
|
|
1065
1066
|
SOLE_BUSINESSES_LOSSES_GET: new Endpoint('GET', '\\/sole-business-losses'),
|
|
1067
|
+
SOLE_CONTACTS_POST: new Endpoint('POST', '\\/sole-contacts'),
|
|
1068
|
+
SOLE_CONTACTS_PUT: new Endpoint('PUT', '\\/sole-contacts\\/\\d+'),
|
|
1066
1069
|
BUSINESS_ACTIVITIES_GET: new Endpoint('GET', '\\/sole-business-activities'),
|
|
1067
1070
|
SOLE_DEPRECIATION_METHODS_GET: new Endpoint('GET', '\\/sole-depreciation-methods'),
|
|
1068
1071
|
SOLE_DEPRECIATION_METHODS_PUT: new Endpoint('PUT', '\\/sole-depreciation-methods\\/\\d+'),
|
|
1072
|
+
SOLE_DETAILS_PUT: new Endpoint('PUT', '\\/sole-details\\/\\d+'),
|
|
1073
|
+
SOLE_FORECASTS_POST: new Endpoint('POST', '\\/sole-forecasts'),
|
|
1074
|
+
SOLE_FORECASTS_PUT: new Endpoint('PUT', '\\/sole-forecasts\\/\\d+'),
|
|
1069
1075
|
SOLE_INVOICES_GET: new Endpoint('GET', '\\/sole-invoices'),
|
|
1070
1076
|
SOLE_INVOICES_POST: new Endpoint('POST', '\\/sole-invoices'),
|
|
1071
1077
|
SOLE_INVOICES_PUT: new Endpoint('PUT', '\\/sole-invoices\\/\\d+'),
|
|
@@ -2811,7 +2817,6 @@
|
|
|
2811
2817
|
ChartAccountsListEnum[ChartAccountsListEnum["DIVIDENDS"] = 542] = "DIVIDENDS";
|
|
2812
2818
|
ChartAccountsListEnum[ChartAccountsListEnum["TRANSFER"] = 615] = "TRANSFER";
|
|
2813
2819
|
ChartAccountsListEnum[ChartAccountsListEnum["BUILDING_AT_COST"] = 304] = "BUILDING_AT_COST";
|
|
2814
|
-
ChartAccountsListEnum[ChartAccountsListEnum["MANAGEMENT_FEES_PLATFORM_FEES"] = 656] = "MANAGEMENT_FEES_PLATFORM_FEES";
|
|
2815
2820
|
ChartAccountsListEnum[ChartAccountsListEnum["KLMS_TRAVELLED_FOR_WORK"] = 24] = "KLMS_TRAVELLED_FOR_WORK";
|
|
2816
2821
|
ChartAccountsListEnum[ChartAccountsListEnum["KLMS_TRAVELLED"] = 683] = "KLMS_TRAVELLED";
|
|
2817
2822
|
ChartAccountsListEnum[ChartAccountsListEnum["DIRECTOR_FEES"] = 6] = "DIRECTOR_FEES";
|
|
@@ -2849,6 +2854,7 @@
|
|
|
2849
2854
|
ChartAccountsListEnum[ChartAccountsListEnum["CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH"] = 640] = "CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH";
|
|
2850
2855
|
ChartAccountsListEnum[ChartAccountsListEnum["PERSONAL_EXPENSES"] = 628] = "PERSONAL_EXPENSES";
|
|
2851
2856
|
ChartAccountsListEnum[ChartAccountsListEnum["PERSONAL_INCOME"] = 630] = "PERSONAL_INCOME";
|
|
2857
|
+
ChartAccountsListEnum[ChartAccountsListEnum["PLATFORM_FEES"] = 857] = "PLATFORM_FEES";
|
|
2852
2858
|
})(exports.ChartAccountsListEnum || (exports.ChartAccountsListEnum = {}));
|
|
2853
2859
|
|
|
2854
2860
|
exports.ChartAccountsCategoryEnum = void 0;
|
|
@@ -3086,6 +3092,12 @@
|
|
|
3086
3092
|
ChartAccounts.prototype.isPropertyExpense = function () {
|
|
3087
3093
|
return this.category === exports.ChartAccountsCategoryEnum.PROPERTY_EXPENSE;
|
|
3088
3094
|
};
|
|
3095
|
+
/**
|
|
3096
|
+
* Check if chart accounts is property income
|
|
3097
|
+
*/
|
|
3098
|
+
ChartAccounts.prototype.isPropertyIncome = function () {
|
|
3099
|
+
return this.category === exports.ChartAccountsCategoryEnum.PROPERTY_INCOME;
|
|
3100
|
+
};
|
|
3089
3101
|
ChartAccounts.prototype.isPersonal = function () {
|
|
3090
3102
|
return CHART_ACCOUNTS_CATEGORIES.personal.includes(this.category);
|
|
3091
3103
|
};
|
|
@@ -5379,6 +5391,13 @@
|
|
|
5379
5391
|
enumerable: false,
|
|
5380
5392
|
configurable: true
|
|
5381
5393
|
});
|
|
5394
|
+
Object.defineProperty(Property.prototype, "claimPercent", {
|
|
5395
|
+
get: function () {
|
|
5396
|
+
return this.currentYearForecast.claimPercent;
|
|
5397
|
+
},
|
|
5398
|
+
enumerable: false,
|
|
5399
|
+
configurable: true
|
|
5400
|
+
});
|
|
5382
5401
|
Object.defineProperty(Property.prototype, "sharePercent", {
|
|
5383
5402
|
get: function () {
|
|
5384
5403
|
return this.myShare.percent;
|
|
@@ -12632,6 +12651,9 @@
|
|
|
12632
12651
|
if (property.documentFile) {
|
|
12633
12652
|
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_UPDATED_WITH_DOCUMENT, property));
|
|
12634
12653
|
}
|
|
12654
|
+
else {
|
|
12655
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_UPDATED, property));
|
|
12656
|
+
}
|
|
12635
12657
|
return updatedProperty;
|
|
12636
12658
|
}));
|
|
12637
12659
|
};
|
|
@@ -13163,6 +13185,7 @@
|
|
|
13163
13185
|
this.listenReceiptAdded();
|
|
13164
13186
|
this.listenReceiptDeleted();
|
|
13165
13187
|
this.listenVehicleClaimChanges();
|
|
13188
|
+
this.listenPropertyForecastUpdate();
|
|
13166
13189
|
};
|
|
13167
13190
|
/**
|
|
13168
13191
|
* get list of all user's TaxTank transactions
|
|
@@ -13463,6 +13486,16 @@
|
|
|
13463
13486
|
_this.resetCache();
|
|
13464
13487
|
});
|
|
13465
13488
|
};
|
|
13489
|
+
/**
|
|
13490
|
+
* property forecast includes claimPercent which affects property related expenses
|
|
13491
|
+
* @TODO Alex move to forecast api instead of property
|
|
13492
|
+
*/
|
|
13493
|
+
TransactionService.prototype.listenPropertyForecastUpdate = function () {
|
|
13494
|
+
var _this = this;
|
|
13495
|
+
this.eventDispatcherService.on([exports.AppEventTypeEnum.PROPERTY_UPDATED]).subscribe(function () {
|
|
13496
|
+
_this.resetCache();
|
|
13497
|
+
});
|
|
13498
|
+
};
|
|
13466
13499
|
TransactionService.prototype.replaceInCache = function (transactionToReplace) {
|
|
13467
13500
|
replace(this.cache, transactionToReplace);
|
|
13468
13501
|
this.updateCache();
|
|
@@ -17407,6 +17440,7 @@
|
|
|
17407
17440
|
description: new forms.FormControl(business.description),
|
|
17408
17441
|
website: new forms.FormControl(business.website)
|
|
17409
17442
|
}, business) || this;
|
|
17443
|
+
_this.business = business;
|
|
17410
17444
|
// User have to create income source with new business.
|
|
17411
17445
|
// Income source is not able for edit business
|
|
17412
17446
|
if (!business.id) {
|
|
@@ -17442,6 +17476,9 @@
|
|
|
17442
17476
|
* We take the first forecast because income sources available only for new business, so we have only one forecast
|
|
17443
17477
|
*/
|
|
17444
17478
|
get: function () {
|
|
17479
|
+
if (!this.business.id) {
|
|
17480
|
+
return null;
|
|
17481
|
+
}
|
|
17445
17482
|
return this.get('incomeSource').get('soleForecasts').at(0);
|
|
17446
17483
|
},
|
|
17447
17484
|
enumerable: false,
|
|
@@ -17452,6 +17489,9 @@
|
|
|
17452
17489
|
* We take the first loss because losses available only for new business, so we have only one loss
|
|
17453
17490
|
*/
|
|
17454
17491
|
get: function () {
|
|
17492
|
+
if (!this.business.id) {
|
|
17493
|
+
return null;
|
|
17494
|
+
}
|
|
17455
17495
|
return this.get('losses').at(0);
|
|
17456
17496
|
},
|
|
17457
17497
|
enumerable: false,
|
|
@@ -17459,9 +17499,7 @@
|
|
|
17459
17499
|
});
|
|
17460
17500
|
SoleBusinessForm.prototype.listenNameChanges = function () {
|
|
17461
17501
|
var _this = this;
|
|
17462
|
-
console.log('subs');
|
|
17463
17502
|
this.get('name').valueChanges.subscribe(function (name) {
|
|
17464
|
-
console.log('listenNameChants');
|
|
17465
17503
|
_this.get('incomeSource').get('name').setValue(name);
|
|
17466
17504
|
});
|
|
17467
17505
|
};
|