taxtank-core 0.10.6 → 0.12.0
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 +1723 -1351
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/account-setup-item.collection.js +11 -0
- package/esm2015/lib/collections/bank-transaction.collection.js +2 -2
- package/esm2015/lib/collections/collection-dictionary.js +4 -4
- package/esm2015/lib/collections/collection.js +4 -1
- package/esm2015/lib/collections/depreciation.collection.js +24 -10
- package/esm2015/lib/collections/transaction-allocation.collection.js +2 -2
- package/esm2015/lib/collections/transaction.collection.js +28 -1
- package/esm2015/lib/collections/vehicle-logbook.collection.js +88 -0
- package/esm2015/lib/collections/vehicle.collection.js +9 -0
- package/esm2015/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.js +3 -1
- package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +4 -3
- package/esm2015/lib/db/Enums/property/property-category-list.enum.js +2 -1
- package/esm2015/lib/db/Enums/user-status.enum.js +1 -2
- package/esm2015/lib/db/Models/client-details.js +1 -1
- package/esm2015/lib/db/Models/client-income-types.js +3 -0
- package/esm2015/lib/db/Models/vehicle-claim.js +1 -1
- package/esm2015/lib/db/Models/vehicle.js +1 -1
- package/esm2015/lib/forms/client/client-income-types.form.js +22 -0
- package/esm2015/lib/forms/index.js +4 -1
- package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +114 -0
- package/esm2015/lib/forms/vehicle/vehicle.form.js +20 -0
- package/esm2015/lib/interfaces/event-listener.interface.js +1 -1
- package/esm2015/lib/interfaces/expense.interface.js +2 -0
- package/esm2015/lib/interfaces/tank.interface.js +1 -1
- package/esm2015/lib/models/account-setup/account-setup-item.js +6 -0
- package/esm2015/lib/models/account-setup/account-setup-items.const.js +44 -0
- package/esm2015/lib/models/account-setup/account-setup-items.enum.js +14 -0
- package/esm2015/lib/models/chart-accounts/chart-accounts-value.js +4 -0
- package/esm2015/lib/models/chart-accounts/chart-accounts.js +34 -1
- package/esm2015/lib/models/client/client-income-types.js +10 -0
- package/esm2015/lib/models/depreciation/depreciation.js +5 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +4 -1
- package/esm2015/lib/models/export/export-data-table.js +6 -0
- package/esm2015/lib/models/logbook/logbook-period.js +8 -1
- package/esm2015/lib/models/logbook/vehicle-claim.js +63 -4
- package/esm2015/lib/models/logbook/vehicle-logbook.js +9 -3
- package/esm2015/lib/models/logbook/vehicle.js +7 -29
- package/esm2015/lib/models/pdf/pdf-config.js +2 -2
- package/esm2015/lib/models/pdf/pdf-orientation.enum.js +6 -0
- package/esm2015/lib/models/transaction/transaction.js +1 -1
- package/esm2015/lib/services/account-setup/account-setup.service.js +109 -0
- package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +6 -15
- package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +6 -15
- package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +6 -15
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +6 -15
- package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +1 -1
- package/esm2015/lib/services/http/chat/chat.service.js +8 -12
- package/esm2015/lib/services/http/chat/message/message.service.js +8 -12
- package/esm2015/lib/services/http/chat/message-document/message-document.service.js +1 -1
- package/esm2015/lib/services/http/depreciation/depreciation.service.js +6 -23
- package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +6 -14
- package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +50 -0
- package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +6 -15
- package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +6 -15
- package/esm2015/lib/services/http/income-source/income-source.service.js +6 -14
- package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +6 -15
- package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +6 -15
- package/esm2015/lib/services/http/loan/loan.service.js +6 -15
- package/esm2015/lib/services/http/property/property-document/property-document.service.js +6 -15
- package/esm2015/lib/services/http/property/property-share/property-share.service.js +6 -15
- package/esm2015/lib/services/http/property/property.service.js +6 -15
- package/esm2015/lib/services/http/rest/rest.service.js +31 -4
- package/esm2015/lib/services/http/service-notification/service-notification.service.js +8 -12
- package/esm2015/lib/services/http/subscription/subscription.service.js +1 -4
- package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +15 -16
- package/esm2015/lib/services/http/tax-review/tax-review.service.js +6 -15
- package/esm2015/lib/services/http/tax-summary/tax-summary.service.js +1 -1
- package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +6 -15
- package/esm2015/lib/services/http/transaction/transaction.service.js +16 -25
- package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +6 -14
- package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +6 -14
- package/esm2015/lib/services/http/vehicle/messages.enum.js +13 -0
- package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +24 -0
- package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +59 -0
- package/esm2015/lib/services/http/vehicle/vehicle.service.js +49 -213
- package/esm2015/lib/services/pdf/pdf.service.js +51 -26
- package/esm2015/lib/services/property/property-holding-costs/property-holding-costs.service.js +53 -0
- package/esm2015/lib/validators/at-least-one.validator.js +11 -0
- package/esm2015/lib/validators/index.js +2 -0
- package/esm2015/public-api.js +16 -2
- package/fesm2015/taxtank-core.js +1536 -1155
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/account-setup-item.collection.d.ts +6 -0
- package/lib/collections/collection.d.ts +1 -0
- package/lib/collections/depreciation.collection.d.ts +5 -4
- package/lib/collections/transaction.collection.d.ts +9 -0
- package/lib/collections/vehicle-logbook.collection.d.ts +30 -0
- package/lib/collections/vehicle.collection.d.ts +6 -0
- package/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.d.ts +3 -1
- package/lib/db/Enums/chart-accounts-list.enum.d.ts +4 -3
- package/lib/db/Enums/property/property-category-list.enum.d.ts +2 -1
- package/lib/db/Enums/user-status.enum.d.ts +1 -2
- package/lib/db/Models/client-details.d.ts +5 -1
- package/lib/db/Models/client-income-types.d.ts +11 -0
- package/lib/db/Models/vehicle-claim.d.ts +2 -0
- package/lib/db/Models/vehicle.d.ts +2 -0
- package/lib/forms/client/client-income-types.form.d.ts +7 -0
- package/lib/forms/index.d.ts +3 -0
- package/lib/forms/vehicle/vehicle-claim.form.d.ts +43 -0
- package/lib/forms/vehicle/vehicle.form.d.ts +11 -0
- package/lib/interfaces/event-listener.interface.d.ts +1 -0
- package/lib/interfaces/expense.interface.d.ts +12 -0
- package/lib/interfaces/tank.interface.d.ts +2 -0
- package/lib/models/account-setup/account-setup-item.d.ts +9 -0
- package/lib/models/account-setup/account-setup-items.const.d.ts +7 -0
- package/lib/models/account-setup/account-setup-items.enum.d.ts +12 -0
- package/lib/models/chart-accounts/chart-accounts-value.d.ts +3 -0
- package/lib/models/chart-accounts/chart-accounts.d.ts +18 -0
- package/lib/models/client/client-income-types.d.ts +7 -0
- package/lib/models/depreciation/depreciation.d.ts +6 -2
- package/lib/models/event/app-event-type.enum.d.ts +4 -1
- package/lib/models/export/export-data-table.d.ts +9 -0
- package/lib/models/logbook/logbook-period.d.ts +4 -0
- package/lib/models/logbook/vehicle-claim.d.ts +20 -3
- package/lib/models/logbook/vehicle-logbook.d.ts +8 -2
- package/lib/models/logbook/vehicle.d.ts +5 -7
- package/lib/models/pdf/pdf-orientation.enum.d.ts +4 -0
- package/lib/models/transaction/transaction.d.ts +2 -2
- package/lib/services/account-setup/account-setup.service.d.ts +43 -0
- package/lib/services/http/bank/bank-account/bank-account.service.d.ts +2 -7
- package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +2 -7
- package/lib/services/http/bank/bank-transaction/bank-transaction.service.d.ts +3 -8
- package/lib/services/http/bank/basiq/basiq.service.d.ts +2 -7
- package/lib/services/http/chat/chat.service.d.ts +4 -7
- package/lib/services/http/chat/message/message.service.d.ts +4 -7
- package/lib/services/http/chat/message-document/message-document.service.d.ts +3 -3
- package/lib/services/http/depreciation/depreciation.service.d.ts +2 -11
- package/lib/services/http/document/document-folder/document-folder.service.d.ts +0 -6
- package/lib/services/http/firm/client-income/client-income-types.service.d.ts +18 -0
- package/lib/services/http/firm/client-movement/client-movement.service.d.ts +2 -7
- package/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.d.ts +2 -7
- package/lib/services/http/income-source/income-source.service.d.ts +0 -6
- package/lib/services/http/income-source/salary-forecast/salary-forecast.service.d.ts +1 -7
- package/lib/services/http/income-source/sole-forecast/sole-forecast.service.d.ts +2 -7
- package/lib/services/http/loan/loan.service.d.ts +2 -7
- package/lib/services/http/property/property-document/property-document.service.d.ts +3 -8
- package/lib/services/http/property/property-share/property-share.service.d.ts +2 -7
- package/lib/services/http/property/property.service.d.ts +2 -7
- package/lib/services/http/rest/rest.service.d.ts +17 -2
- package/lib/services/http/service-notification/service-notification.service.d.ts +4 -7
- package/lib/services/http/subscription/subscription.service.d.ts +0 -1
- package/lib/services/http/tax-review/tax-review-history/tax-review-history.service.d.ts +7 -7
- package/lib/services/http/tax-review/tax-review.service.d.ts +1 -7
- package/lib/services/http/tax-summary/tax-summary.service.d.ts +2 -1
- package/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.d.ts +3 -8
- package/lib/services/http/transaction/transaction.service.d.ts +4 -12
- package/lib/services/http/user/user-event-setting/user-event-setting.service.d.ts +0 -6
- package/lib/services/http/user/user-event-type/user-event-type.service.d.ts +0 -6
- package/lib/services/http/vehicle/messages.enum.d.ts +11 -0
- package/lib/services/http/vehicle/vehicle-claim.service.d.ts +13 -0
- package/lib/services/http/vehicle/vehicle-logbook.service.d.ts +22 -0
- package/lib/services/http/vehicle/vehicle.service.d.ts +17 -80
- package/lib/services/pdf/pdf.service.d.ts +16 -2
- package/lib/services/property/property-holding-costs/property-holding-costs.service.d.ts +24 -0
- package/lib/validators/at-least-one.validator.d.ts +6 -0
- package/lib/validators/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +15 -1
- package/esm2015/lib/collections/logbook.collection.js +0 -97
- package/lib/collections/logbook.collection.d.ts +0 -19
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { Transaction as TransactionBase } from '../../../db/Models/transaction';
|
|
4
|
-
import { HttpClient } from '@angular/common/http';
|
|
5
|
-
import { EventDispatcherService } from '../../event/event-dispatcher.service';
|
|
6
4
|
import { RestService } from '../rest/rest.service';
|
|
7
5
|
import { Transaction } from '../../../models/transaction/transaction';
|
|
8
6
|
import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
|
|
9
7
|
import { ChartAccountsTaxLabelsEnum } from '../../../models/chart-accounts/chart-accounts-tax-labels.enum';
|
|
10
|
-
import { ToastService } from '../../toast/toast.service';
|
|
11
8
|
import * as i0 from "@angular/core";
|
|
12
9
|
/**
|
|
13
10
|
* Service for transactions business logic
|
|
14
11
|
*/
|
|
15
12
|
export declare class TransactionService extends RestService<TransactionBase, Transaction> {
|
|
16
|
-
protected http: HttpClient;
|
|
17
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
18
|
-
protected environment: any;
|
|
19
|
-
protected toastService: ToastService;
|
|
20
13
|
url: string;
|
|
21
14
|
modelClass: typeof Transaction;
|
|
22
15
|
transactionDeleted: EventEmitter<Transaction>;
|
|
23
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
|
|
24
16
|
/**
|
|
25
17
|
* Listen events from Event Dispatcher services
|
|
26
18
|
*/
|
|
@@ -42,6 +34,10 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
|
|
|
42
34
|
* get list of transactions with tank type 'Work'
|
|
43
35
|
*/
|
|
44
36
|
getWorkTransactions(): Observable<Transaction[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Get list of property holding costs (transactions related to vacant land property)
|
|
39
|
+
*/
|
|
40
|
+
getPropertyHoldingCosts(propertyId: number): Observable<Transaction[]>;
|
|
45
41
|
/**
|
|
46
42
|
* get list of taxable transactions with tank type 'Work'
|
|
47
43
|
*/
|
|
@@ -81,10 +77,6 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
|
|
|
81
77
|
* tax type depends of chart account heading or category.
|
|
82
78
|
*/
|
|
83
79
|
getTaxLabel(chartAccounts: ChartAccounts): ChartAccountsTaxLabelsEnum;
|
|
84
|
-
/**
|
|
85
|
-
* Get transactions related to Vehicle category
|
|
86
|
-
*/
|
|
87
|
-
getVehicleTransactions(): Observable<Transaction[]>;
|
|
88
80
|
/**
|
|
89
81
|
* Listen to EventDispatcherService event related to Depreciation changing
|
|
90
82
|
*/
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { UserEventSetting } from '../../../../models/user-event/user-event-setting';
|
|
3
2
|
import { UserEventSetting as UserEventSettingBase } from '../../../../db/Models/user-event-setting';
|
|
4
|
-
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
5
3
|
import { RestService } from '../../rest/rest.service';
|
|
6
4
|
import { Observable } from 'rxjs';
|
|
7
5
|
import * as i0 from "@angular/core";
|
|
8
6
|
export declare class UserEventSettingService extends RestService<UserEventSettingBase, UserEventSetting> {
|
|
9
|
-
protected http: HttpClient;
|
|
10
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
11
|
-
protected environment: any;
|
|
12
7
|
modelClass: typeof UserEventSetting;
|
|
13
8
|
url: string;
|
|
14
9
|
isHydra: boolean;
|
|
15
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
16
10
|
/**
|
|
17
11
|
* Send batch to add/updated settings
|
|
18
12
|
*/
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { UserEventType as UserEventTypeBase } from '../../../../db/Models/user-event-type';
|
|
3
2
|
import { UserEventType } from '../../../../models/user-event/user-event-type';
|
|
4
|
-
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
5
3
|
import { RestService } from '../../rest/rest.service';
|
|
6
4
|
import * as i0 from "@angular/core";
|
|
7
5
|
export declare class UserEventTypeService extends RestService<UserEventTypeBase, UserEventType> {
|
|
8
|
-
protected http: HttpClient;
|
|
9
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
10
|
-
protected environment: any;
|
|
11
6
|
modelClass: typeof UserEventType;
|
|
12
7
|
url: string;
|
|
13
8
|
isHydra: boolean;
|
|
14
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
15
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserEventTypeService, never>;
|
|
16
10
|
static ɵprov: i0.ɵɵInjectableDeclaration<UserEventTypeService>;
|
|
17
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum MessagesEnum {
|
|
2
|
+
VEHICLE_CREATED = "Vehicle created successfully",
|
|
3
|
+
VEHICLE_UPDATED = "Vehicle updated successfully",
|
|
4
|
+
VEHICLE_DELETED = "Vehicle deleted successfully",
|
|
5
|
+
VEHICLE_CLAIM_CREATED = "Vehicle claim created successfully",
|
|
6
|
+
VEHICLE_CLAIM_UPDATED = "Vehicle claim updated successfully",
|
|
7
|
+
VEHICLE_CLAIM_DELETED = "Vehicle claim deleted successfully",
|
|
8
|
+
VEHICLE_LOGBOOK_CREATED = "Vehicle logbook created successfully",
|
|
9
|
+
VEHICLE_LOGBOOK_UPDATED = "Vehicle logbook updated successfully",
|
|
10
|
+
VEHICLE_LOGBOOK_DELETED = "Vehicle logbook deleted successfully"
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VehicleClaim as VehicleClaimBase } from '../../../db/Models/vehicle-claim';
|
|
2
|
+
import { VehicleClaim } from '../../../models/logbook/vehicle-claim';
|
|
3
|
+
import { RestService } from '../rest/rest.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class VehicleClaimService extends RestService<VehicleClaimBase, VehicleClaim> {
|
|
6
|
+
modelClass: typeof VehicleClaim;
|
|
7
|
+
url: string;
|
|
8
|
+
messageCreated: string;
|
|
9
|
+
messageUpdated: string;
|
|
10
|
+
messageDeleted: string;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VehicleClaimService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<VehicleClaimService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VehicleLogbook } from '../../../models/logbook/vehicle-logbook';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
4
|
+
import { EventDispatcherService } from '../../event/event-dispatcher.service';
|
|
5
|
+
import { ToastService } from '../../toast/toast.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Vehicle logbook service. Allows user to add, update or delete vehicle trips
|
|
9
|
+
* @TODO extend rest service after it refactored
|
|
10
|
+
*/
|
|
11
|
+
export declare class VehicleLogbookService {
|
|
12
|
+
private http;
|
|
13
|
+
private eventDispatcherService;
|
|
14
|
+
private environment;
|
|
15
|
+
private toastService;
|
|
16
|
+
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
|
|
17
|
+
add(logbook: VehicleLogbook, vehicleId: number): Observable<VehicleLogbook>;
|
|
18
|
+
update(logbook: VehicleLogbook, vehicleId: number): Observable<any>;
|
|
19
|
+
delete(logbook: VehicleLogbook, vehicleId: number): Observable<void>;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VehicleLogbookService, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<VehicleLogbookService>;
|
|
22
|
+
}
|
|
@@ -1,94 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Observable, ReplaySubject } from 'rxjs';
|
|
3
|
-
import { TransactionService } from '../transaction/transaction.service';
|
|
1
|
+
import { Vehicle as VehicleBase } from '../../../db/Models/vehicle';
|
|
4
2
|
import { Vehicle } from '../../../models/logbook/vehicle';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { IncomePosition } from '../../../models/income-position/income-position';
|
|
8
|
-
import { DepreciationService } from '../depreciation/depreciation.service';
|
|
9
|
-
import { ChartAccountsService } from '../chart-accounts/chart-accounts.service';
|
|
10
|
-
import { EventDispatcherService } from '../../event/event-dispatcher.service';
|
|
3
|
+
import { RestService } from '../rest/rest.service';
|
|
4
|
+
import { IEventListener } from '../../../interfaces/event-listener.interface';
|
|
11
5
|
import * as i0 from "@angular/core";
|
|
12
6
|
/**
|
|
13
7
|
* Service that allows to work with WorkTank operations
|
|
14
|
-
* @TODO separate
|
|
8
|
+
* @TODO separate vehicles and logbooks to different api
|
|
15
9
|
*/
|
|
16
|
-
export declare class VehicleService {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_vehicles: Vehicle[];
|
|
24
|
-
vehiclesSubject: ReplaySubject<Vehicle[]>;
|
|
25
|
-
_vehicleClaim: VehicleClaim;
|
|
26
|
-
vehicleClaimSubject: ReplaySubject<VehicleClaim>;
|
|
27
|
-
_vehicleClaimRate: number;
|
|
28
|
-
vehicleClaimRateSubject: ReplaySubject<number>;
|
|
29
|
-
_vehicleTaxReturn: number;
|
|
30
|
-
vehicleTaxReturnSubject: ReplaySubject<number>;
|
|
31
|
-
_incomePositions: IncomePosition[];
|
|
32
|
-
incomePositionsSubject: ReplaySubject<IncomePosition[]>;
|
|
33
|
-
constructor(http: HttpClient, transactionService: TransactionService, depreciationService: DepreciationService, chartAccountsService: ChartAccountsService, eventDispatcherService: EventDispatcherService, environment: any);
|
|
34
|
-
getVehicles(): Observable<Vehicle[]>;
|
|
10
|
+
export declare class VehicleService extends RestService<VehicleBase, Vehicle> implements IEventListener {
|
|
11
|
+
url: string;
|
|
12
|
+
modelClass: typeof Vehicle;
|
|
13
|
+
messageCreated: string;
|
|
14
|
+
messageUpdated: string;
|
|
15
|
+
messageDeleted: string;
|
|
16
|
+
listenEvents(): void;
|
|
35
17
|
/**
|
|
36
|
-
*
|
|
18
|
+
* Add a new logbook items to the vehicle when a new one created
|
|
37
19
|
*/
|
|
38
|
-
|
|
20
|
+
private listenLogbookAdded;
|
|
39
21
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param claim object which should be added
|
|
22
|
+
* Replace vehicle's logbook with updated instance when logbook item updated
|
|
42
23
|
*/
|
|
43
|
-
|
|
24
|
+
private listenLogbookUpdated;
|
|
44
25
|
/**
|
|
45
|
-
*
|
|
26
|
+
* Remove logbook item from vehicle when logbook deleted
|
|
46
27
|
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Get vehicles tax return for vehicle transactions & depreciations
|
|
50
|
-
*/
|
|
51
|
-
getVehiclesTaxReturn(): Observable<number>;
|
|
52
|
-
/**
|
|
53
|
-
* Update vehicle claim
|
|
54
|
-
* @param claim which should be updated
|
|
55
|
-
*
|
|
56
|
-
* @TODO alex refresh depreciation/transaction cache
|
|
57
|
-
*/
|
|
58
|
-
updateVehicleClaim(claim: VehicleClaim): Observable<any>;
|
|
59
|
-
/**
|
|
60
|
-
* Add new logbook for desired vehicle
|
|
61
|
-
* @param logbook which should be added
|
|
62
|
-
* @param vehicle for which logbook object should be added
|
|
63
|
-
*/
|
|
64
|
-
addLogbook(logbook: VehicleLogbook, vehicle: Vehicle): Observable<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Update logbook
|
|
67
|
-
* @param logbook which should be updated
|
|
68
|
-
* @param vehicle for which logbook object should be updated
|
|
69
|
-
*/
|
|
70
|
-
updateLogbook(logbook: VehicleLogbook, vehicle: Vehicle): Observable<any>;
|
|
71
|
-
/**
|
|
72
|
-
* Delete trip
|
|
73
|
-
* @param logbook for which trip should be deleted
|
|
74
|
-
* @param vehicle for which trip should be deleted
|
|
75
|
-
*/
|
|
76
|
-
deleteTrip(logbook: VehicleLogbook, vehicle: Vehicle): Observable<any>;
|
|
77
|
-
/**
|
|
78
|
-
* Add new vehicle
|
|
79
|
-
* @param vehicle which should be added
|
|
80
|
-
*/
|
|
81
|
-
addVehicle(vehicle: Vehicle): Observable<any>;
|
|
82
|
-
/**
|
|
83
|
-
* Update vehicle
|
|
84
|
-
* @param vehicle which should be updated
|
|
85
|
-
*/
|
|
86
|
-
updateVehicle(vehicle: Vehicle): Observable<any>;
|
|
87
|
-
/**
|
|
88
|
-
* Delete vehicle
|
|
89
|
-
* @param vehicle which should be deleted
|
|
90
|
-
*/
|
|
91
|
-
deleteVehicle(vehicle: Vehicle): Observable<void>;
|
|
28
|
+
private listenLogbookDeleted;
|
|
92
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<VehicleService, never>;
|
|
93
30
|
static ɵprov: i0.ɵɵInjectableDeclaration<VehicleService>;
|
|
94
31
|
}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
import { ExportDataTable } from '../../models/export/export-data-table';
|
|
2
|
+
import { PdfOrientationEnum } from '../../models/pdf/pdf-orientation.enum';
|
|
1
3
|
import * as i0 from "@angular/core";
|
|
2
4
|
export declare class PdfService {
|
|
3
5
|
/**
|
|
4
|
-
* Export file
|
|
6
|
+
* Export file from provided HTML tables
|
|
5
7
|
*/
|
|
6
|
-
exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string): void;
|
|
8
|
+
exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string, orientation: PdfOrientationEnum): void;
|
|
9
|
+
/**
|
|
10
|
+
* Export file from provided array-like table data
|
|
11
|
+
*/
|
|
12
|
+
exportFromDataTables(dataTables: ExportDataTable[], title: string, fileName: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Generate file from array-like table data
|
|
15
|
+
*/
|
|
16
|
+
private generateFromDataTables;
|
|
7
17
|
private generateFromTables;
|
|
18
|
+
/**
|
|
19
|
+
* Set basic options for PDF table
|
|
20
|
+
*/
|
|
21
|
+
private setTableOptions;
|
|
8
22
|
private setDocumentTitle;
|
|
9
23
|
private setDocumentLogo;
|
|
10
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<PdfService, never>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Transaction } from '../../../models/transaction/transaction';
|
|
2
|
+
import { ExportDataTable } from '../../../models/export/export-data-table';
|
|
3
|
+
import { PdfService } from '../../pdf/pdf.service';
|
|
4
|
+
import { TransactionCollection } from '../../../collections/transaction.collection';
|
|
5
|
+
import { CurrencyPipe, DatePipe } from '@angular/common';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Service to work with holding costs (transactions related to vacant land property)
|
|
9
|
+
*/
|
|
10
|
+
export declare class PropertyHoldingCostsService {
|
|
11
|
+
private pdfService;
|
|
12
|
+
private currencyPipe;
|
|
13
|
+
private datePipe;
|
|
14
|
+
url: string;
|
|
15
|
+
modelClass: typeof Transaction;
|
|
16
|
+
constructor(pdfService: PdfService, currencyPipe: CurrencyPipe, datePipe: DatePipe);
|
|
17
|
+
initDataTable(holdingCosts: TransactionCollection): ExportDataTable;
|
|
18
|
+
/**
|
|
19
|
+
* Get data for the exporting table rows
|
|
20
|
+
*/
|
|
21
|
+
private getDataTableRows;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PropertyHoldingCostsService, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PropertyHoldingCostsService>;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './at-least-one.validator';
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './lib/tt-core.module';
|
|
|
6
6
|
* Collections
|
|
7
7
|
*/
|
|
8
8
|
export * from './lib/collections/collection';
|
|
9
|
+
export * from './lib/collections/account-setup-item.collection';
|
|
9
10
|
export * from './lib/collections/bank-account.collection';
|
|
10
11
|
export * from './lib/collections/bank-transaction.collection';
|
|
11
12
|
export * from './lib/collections/client.collection';
|
|
@@ -17,7 +18,6 @@ export * from './lib/collections/depreciation-forecast.collection';
|
|
|
17
18
|
export * from './lib/collections/employee.collection';
|
|
18
19
|
export * from './lib/collections/income-source.collection';
|
|
19
20
|
export * from './lib/collections/loan.collection';
|
|
20
|
-
export * from './lib/collections/logbook.collection';
|
|
21
21
|
export * from './lib/collections/message.collection';
|
|
22
22
|
export * from './lib/collections/message-document.collection';
|
|
23
23
|
export * from './lib/collections/property/property.collection';
|
|
@@ -33,6 +33,8 @@ export * from './lib/collections/tax-review.collection';
|
|
|
33
33
|
export * from './lib/collections/transaction-allocation.collection';
|
|
34
34
|
export * from './lib/collections/transaction.collection';
|
|
35
35
|
export * from './lib/collections/user-event-setting.collection';
|
|
36
|
+
export * from './lib/collections/vehicle.collection';
|
|
37
|
+
export * from './lib/collections/vehicle-logbook.collection';
|
|
36
38
|
/**
|
|
37
39
|
* DB models
|
|
38
40
|
*/
|
|
@@ -80,6 +82,7 @@ export * from './lib/db/Enums/loan-type.enum';
|
|
|
80
82
|
export * from './lib/db/Enums/loan-vehicle-type.enum';
|
|
81
83
|
export * from './lib/db/Enums/phone-type.enum';
|
|
82
84
|
export * from './lib/db/Enums/property/property-depreciation-calculation.enum';
|
|
85
|
+
export * from './lib/db/Enums/property/property-category-list.enum';
|
|
83
86
|
export * from './lib/db/Enums/property/property-share-access.enum';
|
|
84
87
|
export * from './lib/db/Enums/property/property-share-status.enum';
|
|
85
88
|
export * from './lib/db/Enums/registration-invite-status.enum';
|
|
@@ -124,6 +127,7 @@ export * from './lib/db/Enums/property/property-sale/tax-exemption-metadata.enum
|
|
|
124
127
|
/**
|
|
125
128
|
* Models and related enums and consts
|
|
126
129
|
*/
|
|
130
|
+
export * from './lib/models/account-setup/account-setup-item';
|
|
127
131
|
export * from './lib/models/address/address';
|
|
128
132
|
export * from './lib/models/address/country';
|
|
129
133
|
export * from './lib/models/bank/bank';
|
|
@@ -149,11 +153,13 @@ export * from './lib/models/chart-accounts/chart-accounts-depreciation';
|
|
|
149
153
|
export * from './lib/models/chart-accounts/chart-accounts-heading';
|
|
150
154
|
export * from './lib/models/chart-accounts/chart-accounts-metadata';
|
|
151
155
|
export * from './lib/models/chart-accounts/chart-accounts-tax-labels.enum';
|
|
156
|
+
export * from './lib/models/chart-accounts/chart-accounts-value';
|
|
152
157
|
export * from './lib/models/chat/chat';
|
|
153
158
|
export * from './lib/models/chat/chat-view-type.enum';
|
|
154
159
|
export * from './lib/models/chat/message';
|
|
155
160
|
export * from './lib/models/chat/message-document';
|
|
156
161
|
export * from './lib/models/client/client-details';
|
|
162
|
+
export * from './lib/models/client/client-income-types';
|
|
157
163
|
export * from './lib/models/client/client-invite';
|
|
158
164
|
export * from './lib/models/client/client-movement';
|
|
159
165
|
export * from './lib/models/client/client-portfolio-chart-data';
|
|
@@ -177,6 +183,7 @@ export * from './lib/models/endpoint/endpoint';
|
|
|
177
183
|
export * from './lib/models/endpoint/endpoints.const';
|
|
178
184
|
export * from './lib/models/event/app-event';
|
|
179
185
|
export * from './lib/models/event/app-event-type.enum';
|
|
186
|
+
export * from './lib/models/export/export-data-table';
|
|
180
187
|
export * from './lib/models/export/export-format.enum';
|
|
181
188
|
export * from './lib/models/file/icons-file.enum';
|
|
182
189
|
export * from './lib/models/financial-year/financial-year';
|
|
@@ -202,6 +209,7 @@ export * from './lib/models/logbook/vehicle';
|
|
|
202
209
|
export * from './lib/models/logbook/vehicle-claim';
|
|
203
210
|
export * from './lib/models/logbook/vehicle-logbook';
|
|
204
211
|
export * from './lib/models/notification/notification';
|
|
212
|
+
export * from './lib/models/pdf/pdf-orientation.enum';
|
|
205
213
|
export * from './lib/models/phone/phone';
|
|
206
214
|
export * from './lib/models/property/calculation-form-item';
|
|
207
215
|
export * from './lib/models/property/calculation-form-type.enum';
|
|
@@ -266,6 +274,7 @@ export * from './lib/models/user-event/user-event-type';
|
|
|
266
274
|
/**
|
|
267
275
|
* Services
|
|
268
276
|
*/
|
|
277
|
+
export * from './lib/services/account-setup/account-setup.service';
|
|
269
278
|
export * from './lib/services/http/address/address.service';
|
|
270
279
|
export * from './lib/services/asset/assets.service';
|
|
271
280
|
export * from './lib/services/auth/auth.service';
|
|
@@ -291,6 +300,7 @@ export * from './lib/services/http/depreciation/depreciation.service';
|
|
|
291
300
|
export * from './lib/services/http/document/document-folder/document-folder.service';
|
|
292
301
|
export * from './lib/services/http/firm/employee/employee.service';
|
|
293
302
|
export * from './lib/services/http/firm/employee-invite/employee-invite.service';
|
|
303
|
+
export * from './lib/services/http/firm/client-income/client-income-types.service';
|
|
294
304
|
export * from './lib/services/event/event-dispatcher.service';
|
|
295
305
|
export * from './lib/services/event/sse.service';
|
|
296
306
|
export * from './lib/services/http/firm/firm.service';
|
|
@@ -309,6 +319,7 @@ export * from './lib/services/report/property/property-transaction-report.servic
|
|
|
309
319
|
export * from './lib/services/property/corelogic/corelogic.service';
|
|
310
320
|
export * from './lib/services/http/property/property.service';
|
|
311
321
|
export * from './lib/services/property/property-calculation/property-calculation.service';
|
|
322
|
+
export * from './lib/services/property/property-holding-costs/property-holding-costs.service';
|
|
312
323
|
export * from './lib/services/http/property/property-category/property-category.service';
|
|
313
324
|
export * from './lib/services/http/property/property-document/property-document.service';
|
|
314
325
|
export * from './lib/services/http/property/property-share/property-share.service';
|
|
@@ -330,6 +341,8 @@ export * from './lib/services/user/user-switcher.service';
|
|
|
330
341
|
export * from './lib/services/http/user/user-event-setting/user-event-setting.service';
|
|
331
342
|
export * from './lib/services/http/user/user-event-type/user-event-type.service';
|
|
332
343
|
export * from './lib/services/http/vehicle/vehicle.service';
|
|
344
|
+
export * from './lib/services/http/vehicle/vehicle-claim.service';
|
|
345
|
+
export * from './lib/services/http/vehicle/vehicle-logbook.service';
|
|
333
346
|
export * from './lib/services/xlsx/xlsx.service';
|
|
334
347
|
export * from './lib/services/http/property/property-sale/tax-exemption/tax-exemption.service';
|
|
335
348
|
/**
|
|
@@ -350,6 +363,7 @@ export * from './lib/interfaces/exportable.interface';
|
|
|
350
363
|
export * from './lib/interfaces/receipt.interface';
|
|
351
364
|
export * from './lib/interfaces/tank.interface';
|
|
352
365
|
export * from './lib/interfaces/updatable.interface';
|
|
366
|
+
export * from './lib/interfaces/expense.interface';
|
|
353
367
|
/**
|
|
354
368
|
* Functions
|
|
355
369
|
*/
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { FinancialYear } from '../models/financial-year/financial-year';
|
|
2
|
-
import { LogbookPeriod } from '../models/logbook/logbook-period';
|
|
3
|
-
import { plainToClass } from 'class-transformer';
|
|
4
|
-
// Class contain array of vehicle logbooks and calculate the best period for logbook claim method
|
|
5
|
-
export class LogbookCollection {
|
|
6
|
-
constructor(vehicles) {
|
|
7
|
-
// 12 weeks in milliseconds to check logbooks range
|
|
8
|
-
this.logbookClaimRange = 12 * 7 * 24 * 3600 * 1000;
|
|
9
|
-
this.trips = vehicles.map((vehicle) => vehicle.logbook).flat();
|
|
10
|
-
this.financialYear = new FinancialYear();
|
|
11
|
-
this.setInitialBestPeriod();
|
|
12
|
-
}
|
|
13
|
-
// check if summary logbooks date range less than 84 days (12 weeks)
|
|
14
|
-
get isAutomaticLogbookCalculationAllowed() {
|
|
15
|
-
// forbid automatic logbook calculation if no logbook trips exist
|
|
16
|
-
if (!this.trips.length) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
// forbid automatic logbook calculation if logbook trips summary date range less than 12 weeks
|
|
20
|
-
return this.trips.slice(-1)[0].date.getTime() - this.trips[0].date.getTime() >= this.logbookClaimRange;
|
|
21
|
-
}
|
|
22
|
-
get bestPeriod() {
|
|
23
|
-
// don't calculate if not allowed
|
|
24
|
-
if (!this.isAutomaticLogbookCalculationAllowed) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
this.calculateBestPeriod();
|
|
28
|
-
return this._bestPeriod;
|
|
29
|
-
}
|
|
30
|
-
get workTrips() {
|
|
31
|
-
return this.trips.filter((logbook) => logbook.isWork);
|
|
32
|
-
}
|
|
33
|
-
// calculate best period for logbook claim method
|
|
34
|
-
calculateBestPeriod() {
|
|
35
|
-
// set default best period values for real values comparison
|
|
36
|
-
this.setInitialBestPeriod();
|
|
37
|
-
// get best period with each trip date as start date
|
|
38
|
-
this.workTrips.forEach((logbook) => {
|
|
39
|
-
const dateRange = this.getDateRange(logbook.date);
|
|
40
|
-
// get all trips included in current 12 weeks period
|
|
41
|
-
const tripsInRange = this.trips.filter((l) => {
|
|
42
|
-
return l.date >= dateRange.from && l.date <= dateRange.to;
|
|
43
|
-
});
|
|
44
|
-
// get work trips included in current 12 weeks period
|
|
45
|
-
const workTripsInRange = tripsInRange.filter((l) => l.isWork);
|
|
46
|
-
// calculate sum of work kilometers in current 12 weeks range
|
|
47
|
-
const currentRangeKilometers = this.getKilometersAmount(workTripsInRange);
|
|
48
|
-
// overwrite best period with current 12 weeks range if amount of kilometers is bigger
|
|
49
|
-
if (currentRangeKilometers > this._bestPeriod.kilometers) {
|
|
50
|
-
this._bestPeriod = {
|
|
51
|
-
from: dateRange.from,
|
|
52
|
-
to: dateRange.to,
|
|
53
|
-
kilometers: currentRangeKilometers,
|
|
54
|
-
workUsage: this.getLogbooksWorkUsage(tripsInRange, workTripsInRange)
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
getDateRange(from) {
|
|
60
|
-
// set end date after 12 weeks after start date
|
|
61
|
-
let to = new Date(from.getTime() + this.logbookClaimRange);
|
|
62
|
-
// set as period last 12 weeks of current year if period end date after end of current year
|
|
63
|
-
if (to > this.financialYear.endDate) {
|
|
64
|
-
to = this.financialYear.endDate;
|
|
65
|
-
from = new Date(to.getTime() - this.logbookClaimRange);
|
|
66
|
-
}
|
|
67
|
-
return { from, to };
|
|
68
|
-
}
|
|
69
|
-
// calculate kilometers amount for passed trips
|
|
70
|
-
getKilometersAmount(logbooks) {
|
|
71
|
-
if (!logbooks.length) {
|
|
72
|
-
return 0;
|
|
73
|
-
}
|
|
74
|
-
return logbooks.map((logbook) => logbook.odometerEnd - logbook.odometerStart)
|
|
75
|
-
.reduce((prev, next) => prev + Number(next));
|
|
76
|
-
}
|
|
77
|
-
// calculate work usage for passed trips
|
|
78
|
-
getLogbooksWorkUsage(logbooks, workLogbooks) {
|
|
79
|
-
const kilometers = this.getKilometersAmount(logbooks);
|
|
80
|
-
const workKilometers = this.getKilometersAmount(workLogbooks);
|
|
81
|
-
return Math.round(workKilometers / kilometers * 100);
|
|
82
|
-
}
|
|
83
|
-
// set default best period with zero values and fin year start date for comparison in calculation
|
|
84
|
-
setInitialBestPeriod() {
|
|
85
|
-
// set 1st of July of current year as default start date for best period
|
|
86
|
-
const startDate = this.financialYear.startDate;
|
|
87
|
-
// set end custom-date after 12 weeks from start date
|
|
88
|
-
const endDate = new Date(startDate.getTime() + this.logbookClaimRange);
|
|
89
|
-
this._bestPeriod = plainToClass(LogbookPeriod, {
|
|
90
|
-
from: startDate,
|
|
91
|
-
to: endDate,
|
|
92
|
-
kilometers: 0,
|
|
93
|
-
workUsage: 0
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nYm9vay5jb2xsZWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL2NvbGxlY3Rpb25zL2xvZ2Jvb2suY29sbGVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0seUNBQXlDLENBQUM7QUFDeEUsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGtDQUFrQyx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DbGFzcyhMb2dib29rUGVyaW9kLCB7XG4gICAgICBmcm9tOiBzdGFydERhdGUsXG4gICAgICB0bzogZW5kRGF0ZSxcbiAgICAgIGtpbG9tZXRlcnM6IDAsXG4gICAgICB3b3JrVXNhZ2U6IDBcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { VehicleLogbook } from '../models/logbook/vehicle-logbook';
|
|
2
|
-
import { FinancialYear } from '../models/financial-year/financial-year';
|
|
3
|
-
import { LogbookPeriod } from '../models/logbook/logbook-period';
|
|
4
|
-
import { Vehicle } from '../models/logbook/vehicle';
|
|
5
|
-
export declare class LogbookCollection {
|
|
6
|
-
trips: VehicleLogbook[];
|
|
7
|
-
logbookClaimRange: number;
|
|
8
|
-
financialYear: FinancialYear;
|
|
9
|
-
private _bestPeriod;
|
|
10
|
-
constructor(vehicles: Vehicle[]);
|
|
11
|
-
get isAutomaticLogbookCalculationAllowed(): boolean;
|
|
12
|
-
get bestPeriod(): LogbookPeriod;
|
|
13
|
-
private get workTrips();
|
|
14
|
-
private calculateBestPeriod;
|
|
15
|
-
private getDateRange;
|
|
16
|
-
private getKilometersAmount;
|
|
17
|
-
private getLogbooksWorkUsage;
|
|
18
|
-
private setInitialBestPeriod;
|
|
19
|
-
}
|