taxtank-core 0.3.0 → 0.4.1
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 +195 -70
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/bank-account.collection.js +3 -3
- package/esm2015/lib/collections/bank-transaction.collection.js +3 -3
- package/esm2015/lib/collections/client-movement.collection.js +3 -3
- package/esm2015/lib/collections/client-portfolio-report.collection.js +3 -3
- package/esm2015/lib/collections/client.collection.js +3 -3
- package/esm2015/lib/collections/collection-dictionary.js +1 -1
- package/esm2015/lib/collections/collection.js +75 -0
- package/esm2015/lib/collections/depreciation-forecast.collection.js +5 -5
- package/esm2015/lib/collections/depreciation.collection.js +8 -3
- package/esm2015/lib/collections/employee.collection.js +3 -3
- package/esm2015/lib/collections/income-source.collection.js +3 -3
- package/esm2015/lib/collections/loan.collection.js +3 -3
- package/esm2015/lib/collections/message-document.collection.js +3 -3
- package/esm2015/lib/collections/message.collection.js +3 -3
- package/esm2015/lib/collections/property.collection.js +3 -3
- package/esm2015/lib/collections/service-price.collection.js +3 -3
- package/esm2015/lib/collections/service-subscription.collection.js +3 -3
- package/esm2015/lib/collections/tax-return-category-item.collection.js +3 -3
- package/esm2015/lib/collections/tax-review.collection.js +3 -3
- package/esm2015/lib/collections/transaction-allocation.collection.js +3 -3
- package/esm2015/lib/collections/transaction.collection.js +3 -3
- package/esm2015/lib/collections/user-event-setting.collection.js +3 -3
- package/esm2015/lib/db/Enums/chart-accounts-metadata-list.enum.js +2 -1
- package/esm2015/lib/models/data-table/data-table.js +6 -4
- package/esm2015/lib/models/depreciation/depreciation.js +5 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +17 -14
- package/esm2015/lib/models/logbook/vehicle-claim.js +7 -1
- package/esm2015/lib/models/transaction/transaction.js +11 -2
- package/esm2015/lib/services/pdf/pdf.service.js +39 -6
- package/esm2015/lib/services/property/property-category-movement.service.js +47 -0
- package/esm2015/lib/services/property/property.service.js +12 -1
- package/esm2015/lib/services/xlsx/xlsx.service.js +1 -1
- package/esm2015/public-api.js +3 -2
- package/fesm2015/taxtank-core.js +160 -54
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/bank-account.collection.d.ts +2 -2
- package/lib/collections/bank-transaction.collection.d.ts +2 -2
- package/lib/collections/client-movement.collection.d.ts +2 -2
- package/lib/collections/client-portfolio-report.collection.d.ts +2 -2
- package/lib/collections/client.collection.d.ts +2 -2
- package/lib/collections/collection-dictionary.d.ts +2 -2
- package/lib/collections/{abstract.collection.d.ts → collection.d.ts} +3 -9
- package/lib/collections/depreciation-forecast.collection.d.ts +2 -2
- package/lib/collections/depreciation.collection.d.ts +3 -2
- package/lib/collections/employee.collection.d.ts +2 -2
- package/lib/collections/income-source.collection.d.ts +2 -2
- package/lib/collections/loan.collection.d.ts +2 -2
- package/lib/collections/message-document.collection.d.ts +2 -2
- package/lib/collections/message.collection.d.ts +2 -2
- package/lib/collections/property.collection.d.ts +2 -2
- package/lib/collections/service-price.collection.d.ts +2 -2
- package/lib/collections/service-subscription.collection.d.ts +2 -2
- package/lib/collections/tax-return-category-item.collection.d.ts +2 -2
- package/lib/collections/tax-review.collection.d.ts +2 -2
- package/lib/collections/transaction-allocation.collection.d.ts +2 -2
- package/lib/collections/transaction.collection.d.ts +2 -2
- package/lib/collections/user-event-setting.collection.d.ts +2 -2
- package/lib/db/Enums/chart-accounts-metadata-list.enum.d.ts +1 -0
- package/lib/models/data-table/data-table.d.ts +2 -2
- package/lib/models/depreciation/depreciation.d.ts +1 -0
- package/lib/models/event/app-event-type.enum.d.ts +16 -13
- package/lib/models/logbook/vehicle-claim.d.ts +4 -0
- package/lib/models/transaction/transaction.d.ts +3 -0
- package/lib/services/pdf/pdf.service.d.ts +10 -1
- package/lib/services/property/property-category-movement.service.d.ts +15 -0
- package/lib/services/property/property.service.d.ts +4 -0
- package/lib/services/xlsx/xlsx.service.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -1
- package/esm2015/lib/collections/abstract.collection.js +0 -83
package/fesm2015/taxtank-core.js
CHANGED
|
@@ -824,9 +824,9 @@ class CollectionDictionary {
|
|
|
824
824
|
|
|
825
825
|
const DEFAULT_INDEX = 'other';
|
|
826
826
|
/**
|
|
827
|
-
* collection
|
|
827
|
+
* Base collection class. Contains common properties and methods for all collections
|
|
828
828
|
*/
|
|
829
|
-
class
|
|
829
|
+
class Collection {
|
|
830
830
|
constructor(items = []) {
|
|
831
831
|
this.items = items;
|
|
832
832
|
}
|
|
@@ -860,14 +860,6 @@ class AbstractCollection {
|
|
|
860
860
|
get length() {
|
|
861
861
|
return this.items.length;
|
|
862
862
|
}
|
|
863
|
-
/**
|
|
864
|
-
* method returns amount of fields from passed items
|
|
865
|
-
* @param field Name of field for calculation
|
|
866
|
-
* @param items (optional) Array of items need to be calculated. All collection's items by default
|
|
867
|
-
*/
|
|
868
|
-
getSummary(field, items = this.toArray()) {
|
|
869
|
-
return items.reduce((sum, item) => sum += item[field], 0);
|
|
870
|
-
}
|
|
871
863
|
/**
|
|
872
864
|
* Get list of items ids
|
|
873
865
|
*/
|
|
@@ -922,7 +914,7 @@ const TYPE_LOAN = [
|
|
|
922
914
|
/**
|
|
923
915
|
* Collection of bank accounts.
|
|
924
916
|
*/
|
|
925
|
-
class BankAccountCollection extends
|
|
917
|
+
class BankAccountCollection extends Collection {
|
|
926
918
|
/**
|
|
927
919
|
* get list of bank accounts with passed types
|
|
928
920
|
*/
|
|
@@ -1066,7 +1058,7 @@ const TRANSACTION_TRANSFER_DELAY = 96 * 3600 * 1000;
|
|
|
1066
1058
|
* @TODO find way to accept interface with allocation instead of bankTransaction to prevent wrong usage
|
|
1067
1059
|
* because all amounts calculates with allocated amounts but not from bank transactions amounts.
|
|
1068
1060
|
*/
|
|
1069
|
-
class BankTransactionCollection extends
|
|
1061
|
+
class BankTransactionCollection extends Collection {
|
|
1070
1062
|
getAmount() {
|
|
1071
1063
|
return this.sumBy('amount');
|
|
1072
1064
|
}
|
|
@@ -1172,7 +1164,7 @@ class BankTransactionCollection extends AbstractCollection {
|
|
|
1172
1164
|
}
|
|
1173
1165
|
}
|
|
1174
1166
|
|
|
1175
|
-
class ClientCollection extends
|
|
1167
|
+
class ClientCollection extends Collection {
|
|
1176
1168
|
}
|
|
1177
1169
|
|
|
1178
1170
|
var FirmTypeEnum;
|
|
@@ -1181,7 +1173,7 @@ var FirmTypeEnum;
|
|
|
1181
1173
|
FirmTypeEnum[FirmTypeEnum["ADVISOR"] = 2] = "ADVISOR";
|
|
1182
1174
|
})(FirmTypeEnum || (FirmTypeEnum = {}));
|
|
1183
1175
|
|
|
1184
|
-
class EmployeeCollection extends
|
|
1176
|
+
class EmployeeCollection extends Collection {
|
|
1185
1177
|
get accountant() {
|
|
1186
1178
|
var _a;
|
|
1187
1179
|
return (_a = this.items.filter((user) => user.employeeDetails.firm.type === FirmTypeEnum.ACCOUNTANT)[0]) !== null && _a !== void 0 ? _a : null;
|
|
@@ -1194,7 +1186,7 @@ class EmployeeCollection extends AbstractCollection {
|
|
|
1194
1186
|
/**
|
|
1195
1187
|
* Collection of tax review
|
|
1196
1188
|
*/
|
|
1197
|
-
class ClientMovementCollection extends
|
|
1189
|
+
class ClientMovementCollection extends Collection {
|
|
1198
1190
|
get active() {
|
|
1199
1191
|
return new ClientMovementCollection(this.items.filter((clientMovement) => !clientMovement.dateTo));
|
|
1200
1192
|
}
|
|
@@ -1222,7 +1214,7 @@ class ClientMovementCollection extends AbstractCollection {
|
|
|
1222
1214
|
/**
|
|
1223
1215
|
* Collection of employee clients tax summary information
|
|
1224
1216
|
*/
|
|
1225
|
-
class ClientPortfolioReportCollection extends
|
|
1217
|
+
class ClientPortfolioReportCollection extends Collection {
|
|
1226
1218
|
get marketValue() {
|
|
1227
1219
|
return this.sumBy('marketValue');
|
|
1228
1220
|
}
|
|
@@ -1265,7 +1257,7 @@ var TankTypeEnum;
|
|
|
1265
1257
|
TankTypeEnum[TankTypeEnum["OTHER"] = 3] = "OTHER";
|
|
1266
1258
|
})(TankTypeEnum || (TankTypeEnum = {}));
|
|
1267
1259
|
|
|
1268
|
-
class DepreciationCollection extends
|
|
1260
|
+
class DepreciationCollection extends Collection {
|
|
1269
1261
|
/**
|
|
1270
1262
|
* Get total amount of all depreciations in the collection
|
|
1271
1263
|
*/
|
|
@@ -1282,6 +1274,11 @@ class DepreciationCollection extends AbstractCollection {
|
|
|
1282
1274
|
return sum + depreciation.getClaimAmountByYear(year);
|
|
1283
1275
|
}, 0);
|
|
1284
1276
|
}
|
|
1277
|
+
getCurrentYearForecastAmount() {
|
|
1278
|
+
return this.items.reduce((sum, depreciation) => {
|
|
1279
|
+
return sum + depreciation.getCurrentYearForecastAmount();
|
|
1280
|
+
}, 0);
|
|
1281
|
+
}
|
|
1285
1282
|
get assetValue() {
|
|
1286
1283
|
return this.sumBy('assetValue');
|
|
1287
1284
|
}
|
|
@@ -1331,7 +1328,7 @@ class DepreciationCollection extends AbstractCollection {
|
|
|
1331
1328
|
/**
|
|
1332
1329
|
* Collection of depreciations
|
|
1333
1330
|
*/
|
|
1334
|
-
class DepreciationForecastCollection extends
|
|
1331
|
+
class DepreciationForecastCollection extends Collection {
|
|
1335
1332
|
filterByYear(financialYear) {
|
|
1336
1333
|
return new DepreciationForecastCollection(this.items.filter((forecast) => forecast.financialYear === financialYear));
|
|
1337
1334
|
}
|
|
@@ -1339,17 +1336,17 @@ class DepreciationForecastCollection extends AbstractCollection {
|
|
|
1339
1336
|
return this.items.reduce((sum, item) => sum + item.getClaimAmountByMonth(month), 0);
|
|
1340
1337
|
}
|
|
1341
1338
|
get amount() {
|
|
1342
|
-
return this.
|
|
1339
|
+
return this.sumBy('amount');
|
|
1343
1340
|
}
|
|
1344
1341
|
get claimAmount() {
|
|
1345
|
-
return this.
|
|
1342
|
+
return this.sumBy('claimAmount');
|
|
1346
1343
|
}
|
|
1347
1344
|
}
|
|
1348
1345
|
|
|
1349
1346
|
/**
|
|
1350
1347
|
* Collection of income sources
|
|
1351
1348
|
*/
|
|
1352
|
-
class IncomeSourceCollection extends
|
|
1349
|
+
class IncomeSourceCollection extends Collection {
|
|
1353
1350
|
filterByTank(tank) {
|
|
1354
1351
|
return this.items.filter((incomeSource) => {
|
|
1355
1352
|
switch (tank) {
|
|
@@ -1382,7 +1379,7 @@ class IncomeSourceCollection extends AbstractCollection {
|
|
|
1382
1379
|
}
|
|
1383
1380
|
}
|
|
1384
1381
|
|
|
1385
|
-
class LoanCollection extends
|
|
1382
|
+
class LoanCollection extends Collection {
|
|
1386
1383
|
/**
|
|
1387
1384
|
* Get new collection of loans filtered by bank accounts ids
|
|
1388
1385
|
* @param ids list of bank accounts ids for filter
|
|
@@ -1546,7 +1543,7 @@ class LogbookCollection {
|
|
|
1546
1543
|
}
|
|
1547
1544
|
}
|
|
1548
1545
|
|
|
1549
|
-
class MessageCollection extends
|
|
1546
|
+
class MessageCollection extends Collection {
|
|
1550
1547
|
getFirstUnreadMessage(user) {
|
|
1551
1548
|
return this.items.find((message) => {
|
|
1552
1549
|
return !message.isRead() && message.isFromEmployee() !== user.isEmployee();
|
|
@@ -1569,7 +1566,7 @@ class MessageCollection extends AbstractCollection {
|
|
|
1569
1566
|
/**
|
|
1570
1567
|
* Collection of MessageDocument instances
|
|
1571
1568
|
*/
|
|
1572
|
-
class MessageDocumentCollection extends
|
|
1569
|
+
class MessageDocumentCollection extends Collection {
|
|
1573
1570
|
/**
|
|
1574
1571
|
* get list of documents which are not attached to any message
|
|
1575
1572
|
*/
|
|
@@ -1578,7 +1575,7 @@ class MessageDocumentCollection extends AbstractCollection {
|
|
|
1578
1575
|
}
|
|
1579
1576
|
}
|
|
1580
1577
|
|
|
1581
|
-
class PropertyCollection extends
|
|
1578
|
+
class PropertyCollection extends Collection {
|
|
1582
1579
|
/**
|
|
1583
1580
|
* Get new property collection filtered by category id
|
|
1584
1581
|
* @param id id of category for filter
|
|
@@ -1647,7 +1644,7 @@ class PropertyCollection extends AbstractCollection {
|
|
|
1647
1644
|
}
|
|
1648
1645
|
}
|
|
1649
1646
|
|
|
1650
|
-
class ServicePriceCollection extends
|
|
1647
|
+
class ServicePriceCollection extends Collection {
|
|
1651
1648
|
get work() {
|
|
1652
1649
|
return this.items.filter((price) => price.product.isWork())[0];
|
|
1653
1650
|
}
|
|
@@ -1656,7 +1653,7 @@ class ServicePriceCollection extends AbstractCollection {
|
|
|
1656
1653
|
}
|
|
1657
1654
|
}
|
|
1658
1655
|
|
|
1659
|
-
class ServiceSubscriptionCollection extends
|
|
1656
|
+
class ServiceSubscriptionCollection extends Collection {
|
|
1660
1657
|
get individual() {
|
|
1661
1658
|
return this.items.filter((subscription) => subscription.isIndividual())[0];
|
|
1662
1659
|
}
|
|
@@ -1711,7 +1708,7 @@ var TaxReturnCategorySectionEnum;
|
|
|
1711
1708
|
/**
|
|
1712
1709
|
* collection for tax return category items
|
|
1713
1710
|
*/
|
|
1714
|
-
class TaxReturnCategoryItemCollection extends
|
|
1711
|
+
class TaxReturnCategoryItemCollection extends Collection {
|
|
1715
1712
|
/**
|
|
1716
1713
|
* Work income
|
|
1717
1714
|
*/
|
|
@@ -1849,7 +1846,7 @@ class TaxReturnCategoryItemCollection extends AbstractCollection {
|
|
|
1849
1846
|
/**
|
|
1850
1847
|
* Collection of tax review
|
|
1851
1848
|
*/
|
|
1852
|
-
class TaxReviewCollection extends
|
|
1849
|
+
class TaxReviewCollection extends Collection {
|
|
1853
1850
|
/**
|
|
1854
1851
|
* Get tax reviews items with SENT & COMPLETED statuses
|
|
1855
1852
|
*/
|
|
@@ -1899,7 +1896,7 @@ class TaxReviewCollection extends AbstractCollection {
|
|
|
1899
1896
|
}
|
|
1900
1897
|
}
|
|
1901
1898
|
|
|
1902
|
-
class TransactionAllocationCollection extends
|
|
1899
|
+
class TransactionAllocationCollection extends Collection {
|
|
1903
1900
|
get amount() {
|
|
1904
1901
|
return this.sumBy('amount');
|
|
1905
1902
|
}
|
|
@@ -1940,7 +1937,7 @@ class TransactionAllocationCollection extends AbstractCollection {
|
|
|
1940
1937
|
/**
|
|
1941
1938
|
* Collection of transactions
|
|
1942
1939
|
*/
|
|
1943
|
-
class TransactionCollection extends
|
|
1940
|
+
class TransactionCollection extends Collection {
|
|
1944
1941
|
/**
|
|
1945
1942
|
* Get total amount of all transactions in the collection
|
|
1946
1943
|
*/
|
|
@@ -2059,7 +2056,7 @@ class TransactionCollection extends AbstractCollection {
|
|
|
2059
2056
|
/**
|
|
2060
2057
|
* Collection of user event settings
|
|
2061
2058
|
*/
|
|
2062
|
-
class UserEventSettingCollection extends
|
|
2059
|
+
class UserEventSettingCollection extends Collection {
|
|
2063
2060
|
getConfigurableBy(field) {
|
|
2064
2061
|
return new UserEventSettingCollection(this.items.filter((setting) => setting[field] !== null));
|
|
2065
2062
|
}
|
|
@@ -2263,6 +2260,7 @@ var ChartAccountsMetadataListEnum;
|
|
|
2263
2260
|
(function (ChartAccountsMetadataListEnum) {
|
|
2264
2261
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_INSTALMENTS"] = 4] = "TAX_INSTALMENTS";
|
|
2265
2262
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["FRANKING_CREDIT"] = 5] = "FRANKING_CREDIT";
|
|
2263
|
+
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["ELIGIBLE_FOR_REDUCTION"] = 6] = "ELIGIBLE_FOR_REDUCTION";
|
|
2266
2264
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["SHARE_PERCENTAGE"] = 7] = "SHARE_PERCENTAGE";
|
|
2267
2265
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_OFFSETS"] = 8] = "TAX_OFFSETS";
|
|
2268
2266
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["HOURS"] = 11] = "HOURS";
|
|
@@ -4176,6 +4174,10 @@ class Depreciation extends Depreciation$1 {
|
|
|
4176
4174
|
var _a;
|
|
4177
4175
|
return (_a = this.currentYearForecast) === null || _a === void 0 ? void 0 : _a.claimPercent;
|
|
4178
4176
|
}
|
|
4177
|
+
getCurrentYearForecastAmount() {
|
|
4178
|
+
var _a;
|
|
4179
|
+
return ((_a = this.currentYearForecast) === null || _a === void 0 ? void 0 : _a.amount) || 0;
|
|
4180
|
+
}
|
|
4179
4181
|
isBuildingAtCost() {
|
|
4180
4182
|
return this.chartAccounts.id === ChartAccountsListEnum.BUILDING_AT_COST;
|
|
4181
4183
|
}
|
|
@@ -4303,6 +4305,9 @@ class Transaction extends Transaction$1 {
|
|
|
4303
4305
|
get frankingCredit() {
|
|
4304
4306
|
return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.FRANKING_CREDIT);
|
|
4305
4307
|
}
|
|
4308
|
+
get eligibleForReduction() {
|
|
4309
|
+
return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.ELIGIBLE_FOR_REDUCTION);
|
|
4310
|
+
}
|
|
4306
4311
|
get untaxedElement() {
|
|
4307
4312
|
return this.getMetadataFieldValue(ChartAccountsMetadataListEnum.UNTAXED_ELEMENT);
|
|
4308
4313
|
}
|
|
@@ -4313,6 +4318,12 @@ class Transaction extends Transaction$1 {
|
|
|
4313
4318
|
get isTransfer() {
|
|
4314
4319
|
return this.operation === TransactionOperationEnum.TRANSFER;
|
|
4315
4320
|
}
|
|
4321
|
+
get debit() {
|
|
4322
|
+
return this.isDebit() ? Math.abs(this.amount) : null;
|
|
4323
|
+
}
|
|
4324
|
+
get credit() {
|
|
4325
|
+
return this.isCredit() ? Math.abs(this.amount) : null;
|
|
4326
|
+
}
|
|
4316
4327
|
/**
|
|
4317
4328
|
* Get value of transaction metadata field
|
|
4318
4329
|
* @param field for which value should be returned
|
|
@@ -4336,7 +4347,7 @@ class Transaction extends Transaction$1 {
|
|
|
4336
4347
|
(this.transactions
|
|
4337
4348
|
.reduce((sum, transaction) => sum + Math.abs(transaction.amount), 0) * modifier);
|
|
4338
4349
|
case this.isWorkTank():
|
|
4339
|
-
return this.amount + ((this.tax + this.frankingCredit - this.taxFreeComponent) * modifier);
|
|
4350
|
+
return this.amount + ((this.tax + this.frankingCredit - this.taxFreeComponent - this.eligibleForReduction) * modifier);
|
|
4340
4351
|
default:
|
|
4341
4352
|
return this.amount || 0;
|
|
4342
4353
|
}
|
|
@@ -4994,9 +5005,11 @@ class DataTable {
|
|
|
4994
5005
|
if (!column.total) {
|
|
4995
5006
|
return '';
|
|
4996
5007
|
}
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
.
|
|
5008
|
+
const totalValue = collection.items.reduce((sum, item) => {
|
|
5009
|
+
// check if current collection item has value. If not - don't add it to the sum
|
|
5010
|
+
return item[column.key] !== null ? sum + Number(item[column.key]) : sum;
|
|
5011
|
+
}, null);
|
|
5012
|
+
return (totalValue !== null && totalValue !== void 0 ? totalValue : '-').toString();
|
|
5000
5013
|
});
|
|
5001
5014
|
}
|
|
5002
5015
|
}
|
|
@@ -5200,19 +5213,22 @@ var AppEventTypeEnum;
|
|
|
5200
5213
|
AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 19] = "NOTIFICATION_ADDED";
|
|
5201
5214
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 20] = "PROPERTY_UPDATED_WITH_DOCUMENT";
|
|
5202
5215
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 21] = "PROPERTY_DOCUMENT_ADDED";
|
|
5203
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5204
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5205
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5206
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5207
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5208
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5209
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5210
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5211
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5212
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5213
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5214
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5215
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
5216
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 22] = "PROPERTY_MOVEMENT_CREATED";
|
|
5217
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 23] = "PROPERTY_MOVEMENT_UPDATED";
|
|
5218
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 24] = "PROPERTY_MOVEMENT_DELETED";
|
|
5219
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_OWNER_UPDATED"] = 25] = "PROPERTY_OWNER_UPDATED";
|
|
5220
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 26] = "PROPERTY_SUBSCRIPTION_ADDED";
|
|
5221
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 27] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
5222
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 28] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
5223
|
+
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 29] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
5224
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 30] = "TAX_REVIEW_UPDATED";
|
|
5225
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 31] = "TRANSACTION_CREATED";
|
|
5226
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 32] = "TRANSACTION_DELETED";
|
|
5227
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 33] = "TRANSACTION_UPDATED";
|
|
5228
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 34] = "TRANSACTIONS_CREATED";
|
|
5229
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 35] = "USER_UPDATED";
|
|
5230
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 36] = "VEHICLE_CLAIM_UPDATED";
|
|
5231
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 37] = "VEHICLE_CLAIM_CREATED";
|
|
5216
5232
|
})(AppEventTypeEnum || (AppEventTypeEnum = {}));
|
|
5217
5233
|
|
|
5218
5234
|
var IconsFileEnum;
|
|
@@ -5379,6 +5395,12 @@ class VehicleClaim extends VehicleClaim$1 {
|
|
|
5379
5395
|
get isLogbookMethod() {
|
|
5380
5396
|
return this.method === VehicleClaimMethodEnum.LOGBOOK;
|
|
5381
5397
|
}
|
|
5398
|
+
/**
|
|
5399
|
+
* Claim amount for Kms method
|
|
5400
|
+
*/
|
|
5401
|
+
getKmsClaimAmount(vehicleClaimRate) {
|
|
5402
|
+
return +(this.kilometers * vehicleClaimRate).toFixed(2);
|
|
5403
|
+
}
|
|
5382
5404
|
}
|
|
5383
5405
|
|
|
5384
5406
|
class ServiceNotification {
|
|
@@ -8420,14 +8442,47 @@ class PdfService {
|
|
|
8420
8442
|
document.save(`${fileName}.pdf`);
|
|
8421
8443
|
}
|
|
8422
8444
|
/**
|
|
8445
|
+
* @Todo rename when all DataTable dependent methods will be cleared-up
|
|
8446
|
+
*/
|
|
8447
|
+
exportTables(tables, title, fileName) {
|
|
8448
|
+
const document = this.generateFromTables(tables, title);
|
|
8449
|
+
document.save(`${fileName}.pdf`);
|
|
8450
|
+
}
|
|
8451
|
+
/**
|
|
8452
|
+
* @Todo rename when all DataTable dependent methods will be cleared-up
|
|
8453
|
+
*/
|
|
8454
|
+
generateFromTables(tables, title) {
|
|
8455
|
+
const pdf = new jsPDF();
|
|
8456
|
+
// set document title
|
|
8457
|
+
pdf.setFontSize(PDF_CONFIG.text.fontSize)
|
|
8458
|
+
.setFont(PDF_CONFIG.text.fontName, PDF_CONFIG.text.fontStyle, PDF_CONFIG.text.fontWeight)
|
|
8459
|
+
.text(title, PDF_CONFIG.text.positionX, PDF_CONFIG.text.positionY);
|
|
8460
|
+
tables.forEach((table) => {
|
|
8461
|
+
// coords of last table
|
|
8462
|
+
const lastTableCoords = pdf['lastAutoTable'].finalY || PDF_CONFIG.contentCoords.marginTop;
|
|
8463
|
+
// table options
|
|
8464
|
+
const options = {
|
|
8465
|
+
html: table,
|
|
8466
|
+
startY: lastTableCoords + PDF_CONFIG.contentTitleCoords.marginTop,
|
|
8467
|
+
footStyles: {
|
|
8468
|
+
fillColor: PDF_CONFIG.text.fillColor,
|
|
8469
|
+
textColor: PDF_CONFIG.text.textColor
|
|
8470
|
+
}
|
|
8471
|
+
};
|
|
8472
|
+
autoTable(pdf, options);
|
|
8473
|
+
});
|
|
8474
|
+
return pdf;
|
|
8475
|
+
}
|
|
8476
|
+
/**
|
|
8477
|
+
* @Todo remove/refactor when all DataTable dependent methods will be cleared-up
|
|
8423
8478
|
* Generate PDF file from provided data
|
|
8424
8479
|
*/
|
|
8425
8480
|
generatePdfFile(tables, title) {
|
|
8426
8481
|
const pdf = new jsPDF();
|
|
8427
|
-
// set document
|
|
8428
|
-
pdf.setFontSize(PDF_CONFIG.text.fontSize)
|
|
8429
|
-
|
|
8430
|
-
|
|
8482
|
+
// set document font params
|
|
8483
|
+
pdf.setFontSize(PDF_CONFIG.text.fontSize)
|
|
8484
|
+
.setFont(PDF_CONFIG.text.fontName, PDF_CONFIG.text.fontStyle, PDF_CONFIG.text.fontWeight)
|
|
8485
|
+
.text(title, PDF_CONFIG.text.positionX, PDF_CONFIG.text.positionY);
|
|
8431
8486
|
tables.forEach((table) => {
|
|
8432
8487
|
// coords of last table
|
|
8433
8488
|
const lastTableCoords = pdf['lastAutoTable'].finalY || PDF_CONFIG.contentCoords.marginTop;
|
|
@@ -8511,6 +8566,8 @@ class PropertyService extends BaseRestService {
|
|
|
8511
8566
|
listenEvents() {
|
|
8512
8567
|
this.listenCoOwnerInviteAccepted();
|
|
8513
8568
|
this.listenServiceSubscriptionUpdated();
|
|
8569
|
+
// @TODO Alex: consider to refactor property movements logic similar to client-movements
|
|
8570
|
+
this.listenMovementsChanged();
|
|
8514
8571
|
}
|
|
8515
8572
|
/**
|
|
8516
8573
|
* Update cache when owner invitation accepted
|
|
@@ -8524,6 +8581,15 @@ class PropertyService extends BaseRestService {
|
|
|
8524
8581
|
listenServiceSubscriptionUpdated() {
|
|
8525
8582
|
this.eventDispatcherService.on(AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(() => this.resetCache());
|
|
8526
8583
|
}
|
|
8584
|
+
/**
|
|
8585
|
+
* Update cache when property category changed
|
|
8586
|
+
*/
|
|
8587
|
+
listenMovementsChanged() {
|
|
8588
|
+
// @TODO change dispatcher logic to work with multiple events
|
|
8589
|
+
this.eventDispatcherService.on(AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED).subscribe(() => this.resetCache());
|
|
8590
|
+
this.eventDispatcherService.on(AppEventTypeEnum.PROPERTY_MOVEMENT_UPDATED).subscribe(() => this.resetCache());
|
|
8591
|
+
this.eventDispatcherService.on(AppEventTypeEnum.PROPERTY_MOVEMENT_DELETED).subscribe(() => this.resetCache());
|
|
8592
|
+
}
|
|
8527
8593
|
update(property) {
|
|
8528
8594
|
return super.update(property).pipe(map((updatedProperty) => {
|
|
8529
8595
|
if (property.documentFile) {
|
|
@@ -8774,6 +8840,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
8774
8840
|
}]
|
|
8775
8841
|
}] });
|
|
8776
8842
|
|
|
8843
|
+
class PropertyCategoryMovementService extends BaseRestService {
|
|
8844
|
+
constructor() {
|
|
8845
|
+
super(...arguments);
|
|
8846
|
+
this.modelClass = PropertyCategoryMovement;
|
|
8847
|
+
this.url = 'properties/category-movements';
|
|
8848
|
+
}
|
|
8849
|
+
add(model) {
|
|
8850
|
+
return super.add(model).pipe(map((newMovement) => {
|
|
8851
|
+
// @TODO Alex: we need to teach restService to dispatch events + limit list of methods (not all services have all 4 or even more considering batch requests) + collections
|
|
8852
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED, null));
|
|
8853
|
+
return newMovement;
|
|
8854
|
+
}));
|
|
8855
|
+
}
|
|
8856
|
+
update(model) {
|
|
8857
|
+
return super.update(model).pipe(map((updatedMovement) => {
|
|
8858
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED, null));
|
|
8859
|
+
return updatedMovement;
|
|
8860
|
+
}));
|
|
8861
|
+
}
|
|
8862
|
+
delete(model) {
|
|
8863
|
+
return super.delete(model).pipe(map(() => {
|
|
8864
|
+
this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED, null));
|
|
8865
|
+
}));
|
|
8866
|
+
}
|
|
8867
|
+
// @TODO Alex: Move to collection
|
|
8868
|
+
getByPropertyId(id) {
|
|
8869
|
+
return this.get().pipe(map((movements) => {
|
|
8870
|
+
return movements.filter((movement) => movement.property.id === id);
|
|
8871
|
+
}));
|
|
8872
|
+
}
|
|
8873
|
+
}
|
|
8874
|
+
PropertyCategoryMovementService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PropertyCategoryMovementService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
8875
|
+
PropertyCategoryMovementService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PropertyCategoryMovementService, providedIn: 'root' });
|
|
8876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: PropertyCategoryMovementService, decorators: [{
|
|
8877
|
+
type: Injectable,
|
|
8878
|
+
args: [{
|
|
8879
|
+
providedIn: 'root'
|
|
8880
|
+
}]
|
|
8881
|
+
}] });
|
|
8882
|
+
|
|
8777
8883
|
/**
|
|
8778
8884
|
* Class for work with Property Documents
|
|
8779
8885
|
*/
|
|
@@ -10272,5 +10378,5 @@ function taxReviewFilterPredicate(data, filter) {
|
|
|
10272
10378
|
* Generated bundle index. Do not edit.
|
|
10273
10379
|
*/
|
|
10274
10380
|
|
|
10275
|
-
export {
|
|
10381
|
+
export { Address, AddressService, AddressTypeEnum, AlphabetColorsEnum, AppEvent, AppEventTypeEnum, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Bank, BankAccount, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasiqJob, BasiqService, BasiqToken, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CapitalProjectService, ChartAccounts, ChartAccountsCategoryEnum, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartData, ChartSerie, Chat, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientInvite, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, DEFAULT_VEHICLE_EXPENSE, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, DataTable, DataTableColumn, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationReceipt, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSalaryEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JwtService, Loan, LoanBankTypeEnum, LoanCollection, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookCollection, LogbookPeriod, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, Notification, NotificationService, Occupation, OccupationService, OwnershipFilterOptionsEnum, PdfService, Phone, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCapitalCost, PropertyCapitalCostService, PropertyCategory, PropertyCategoryMovement, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyOwner, PropertyOwnerAccessEnum, PropertyOwnerService, PropertyOwnerStatusEnum, PropertyService, PropertySold, PropertySoldService, PropertySubscription, PropertyValuation, RegistrationInvite, RegistrationInviteStatusEnum, SUBSCRIPTION_DESCRIPTION, SUBSCRIPTION_TITLE, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentStatusEnum, ServicePrice, ServicePriceCollection, ServicePriceRecurringIntervalEnum, ServicePriceTypeEnum, ServiceProduct, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, SpareDocumentSpareTypeEnum, SseService, SubscriptionService, SubscriptionTypeEnum, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxReturnCategoryItem, TaxReturnCategoryItemCollection, TaxReturnCategoryItemDetails, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReview, TaxReviewCollection, TaxReviewHistoryService, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionCalculationService, TransactionCollection, TransactionMetadata, TransactionOperationEnum, TransactionReceipt, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserMedicareExemptionEnum, UserRolesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, Vehicle, VehicleClaim, VehicleClaimMethodEnum, VehicleLogbook, VehicleLogbookPurposeEnum, WORK_TANK_LOGBOOK_PURPOSE_OPTIONS, WorkTankService, XlsxService, cloneDeep, compare, compareMatOptions, createDate, displayMatOptions, enumToList, getDocIcon, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate };
|
|
10276
10382
|
//# sourceMappingURL=taxtank-core.js.map
|