taxtank-core 0.10.7 → 0.12.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 +1631 -1346
- 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/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/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/pdf/pdf-settings.js +10 -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 +6 -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 +12 -12
- package/esm2015/lib/validators/at-least-one.validator.js +11 -0
- package/esm2015/lib/validators/index.js +2 -0
- package/esm2015/public-api.js +14 -2
- package/fesm2015/taxtank-core.js +1408 -1106
- 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/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/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/pdf/pdf-settings.d.ts +9 -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 +0 -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 +3 -2
- 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 +13 -1
- package/esm2015/lib/collections/logbook.collection.js +0 -97
- package/lib/collections/logbook.collection.d.ts +0 -19
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AccountSetupItem } from '../models/account-setup/account-setup-item';
|
|
2
|
+
import { Collection } from './collection';
|
|
3
|
+
export declare class AccountSetupItemCollection extends Collection<AccountSetupItem> {
|
|
4
|
+
constructor(items: AccountSetupItem[]);
|
|
5
|
+
isCompleted(): boolean;
|
|
6
|
+
}
|
|
@@ -14,10 +14,6 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
|
14
14
|
getCloseBalanceByYear(year?: number): number;
|
|
15
15
|
getCurrentYearForecastAmount(): number;
|
|
16
16
|
get closeBalance(): number;
|
|
17
|
-
/**
|
|
18
|
-
* Get new depreciations collections filtered by tank type
|
|
19
|
-
*/
|
|
20
|
-
getByTankType(tankType: TankTypeEnum): DepreciationCollection;
|
|
21
17
|
getByPropertiesIds(ids: number[]): DepreciationCollection;
|
|
22
18
|
getWithCapitalProject(): DepreciationCollection;
|
|
23
19
|
getWithoutCapitalProject(): DepreciationCollection;
|
|
@@ -29,6 +25,11 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
|
29
25
|
getWrittenOffDepreciations(): DepreciationCollection;
|
|
30
26
|
getLowValuePoolDepreciations(): DepreciationCollection;
|
|
31
27
|
getCapitalProjects(): DepreciationCapitalProject[];
|
|
28
|
+
/**
|
|
29
|
+
* Get a new collection of depreciations related to vehicles
|
|
30
|
+
*/
|
|
31
|
+
getVehicleDepreciations(): DepreciationCollection;
|
|
32
|
+
getByTankType(tankType: TankTypeEnum): this;
|
|
32
33
|
/**
|
|
33
34
|
* Create TransactionCollection from depreciation items
|
|
34
35
|
*/
|
|
@@ -2,6 +2,7 @@ import { Collection } from './collection';
|
|
|
2
2
|
import { Transaction } from '../models/transaction/transaction';
|
|
3
3
|
import { TransactionAllocationCollection } from './transaction-allocation.collection';
|
|
4
4
|
import { ChartAccountsCategoryEnum } from '../db/Enums/chart-accounts-category.enum';
|
|
5
|
+
import { TankTypeEnum } from '../db/Enums/tank-type.enum';
|
|
5
6
|
/**
|
|
6
7
|
* Collection of transactions
|
|
7
8
|
*/
|
|
@@ -68,4 +69,12 @@ export declare class TransactionCollection extends Collection<Transaction> {
|
|
|
68
69
|
getDebitTransactions(): TransactionCollection;
|
|
69
70
|
getCreditTransactions(): TransactionCollection;
|
|
70
71
|
getByAllocations(allocations: TransactionAllocationCollection): TransactionCollection;
|
|
72
|
+
/**
|
|
73
|
+
* Get transactions related to Vehicle category
|
|
74
|
+
*/
|
|
75
|
+
getVehicleTransactions(): this;
|
|
76
|
+
/**
|
|
77
|
+
* Get new transaction collection filtered by tank type
|
|
78
|
+
*/
|
|
79
|
+
getByTankType(tankType: TankTypeEnum): this;
|
|
71
80
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VehicleLogbook } from '../models/logbook/vehicle-logbook';
|
|
2
|
+
import { LogbookPeriod } from '../models/logbook/logbook-period';
|
|
3
|
+
import { Collection } from './collection';
|
|
4
|
+
export declare class VehicleLogbookCollection extends Collection<VehicleLogbook> {
|
|
5
|
+
/**
|
|
6
|
+
* Check if we can calculate the best period
|
|
7
|
+
*/
|
|
8
|
+
isBestPeriodExist(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get collection of non-personal logbooks (work-related, sole-related).
|
|
11
|
+
*/
|
|
12
|
+
getBusinessLogbooks(): this;
|
|
13
|
+
/**
|
|
14
|
+
* Logbook Period is the best when it has the biggest amount of work kilometers
|
|
15
|
+
* Best period duration is defined as LOGBOOK_PERIOD_DURATION (12 weeks) by the ATO
|
|
16
|
+
*/
|
|
17
|
+
getBestPeriod(): LogbookPeriod;
|
|
18
|
+
/**
|
|
19
|
+
* Calculate total kilometers traveled
|
|
20
|
+
*/
|
|
21
|
+
getKlms(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Calculate work usage (percent of business-related kilometers from total kilometers)
|
|
24
|
+
*/
|
|
25
|
+
getWorkUsage(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Get LOGBOOK_PERIOD_DURATION date range from passed start date
|
|
28
|
+
*/
|
|
29
|
+
private getPeriodRange;
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collection } from './collection';
|
|
2
|
+
import { Vehicle } from '../models/logbook/vehicle';
|
|
3
|
+
import { VehicleLogbookCollection } from './vehicle-logbook.collection';
|
|
4
|
+
export declare class VehicleCollection extends Collection<Vehicle> {
|
|
5
|
+
getLogbooks(): VehicleLogbookCollection;
|
|
6
|
+
}
|
|
@@ -6,14 +6,15 @@ export declare enum ChartAccountsListEnum {
|
|
|
6
6
|
BUILDING_AT_COST = 304,
|
|
7
7
|
MANAGEMENT_FEES_PLATFORM_FEES = 656,
|
|
8
8
|
KLMS_TRAVELLED_FOR_WORK = 24,
|
|
9
|
+
KLMS_TRAVELLED = 683,
|
|
9
10
|
DIRECTOR_FEES = 6,
|
|
10
11
|
SALARY_OR_WAGES = 2,
|
|
11
12
|
VEHICLES = 25,
|
|
12
13
|
COMMERCIAL_VEHICLES = 26,
|
|
14
|
+
VEHICLE_LOAN_INTEREST = 37,
|
|
15
|
+
VEHICLE_LOAN_PRINCIPAL = 38,
|
|
13
16
|
TAX_INSTALMENTS = 662,
|
|
14
17
|
INTEREST_EARNED = 22,
|
|
15
18
|
TRUST_INCOME = 567,
|
|
16
|
-
TAX_OFFSETS_N_R_A_S = 571
|
|
17
|
-
VEHICLE_LOAN_INTEREST = 37,
|
|
18
|
-
VEHICLE_LOAN_PRINCIPAL = 38
|
|
19
|
+
TAX_OFFSETS_N_R_A_S = 571
|
|
19
20
|
}
|
|
@@ -5,8 +5,8 @@ import { User } from './user';
|
|
|
5
5
|
import { Occupation } from './occupation';
|
|
6
6
|
import { Address } from './address';
|
|
7
7
|
import { Phone } from './phone';
|
|
8
|
+
import { ClientIncomeTypes } from './client-income-types';
|
|
8
9
|
export declare class ClientDetails {
|
|
9
|
-
id?: number;
|
|
10
10
|
isAustralianResident?: boolean;
|
|
11
11
|
taxFileNumber?: string;
|
|
12
12
|
workDepreciationCalculation?: ClientDetailsWorkDepreciationCalculationEnum;
|
|
@@ -19,7 +19,10 @@ export declare class ClientDetails {
|
|
|
19
19
|
pensionersTax?: boolean;
|
|
20
20
|
workingHolidayMaker?: ClientDetailsWorkingHolidayMakerEnum;
|
|
21
21
|
dateOfBirth?: Date;
|
|
22
|
+
abn?: number;
|
|
23
|
+
isGST?: boolean;
|
|
22
24
|
capitalLoss?: number;
|
|
25
|
+
id?: number;
|
|
23
26
|
deletedAt?: Date;
|
|
24
27
|
createdAt?: Date;
|
|
25
28
|
updatedAt?: Date;
|
|
@@ -27,4 +30,5 @@ export declare class ClientDetails {
|
|
|
27
30
|
occupation?: Occupation;
|
|
28
31
|
addresses?: Address[];
|
|
29
32
|
phones?: Phone[];
|
|
33
|
+
incomeTypes?: ClientIncomeTypes;
|
|
30
34
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ClientDetails } from './client-details';
|
|
2
|
+
export declare class ClientIncomeTypes {
|
|
3
|
+
salary?: boolean;
|
|
4
|
+
rental?: boolean;
|
|
5
|
+
soleTrader?: boolean;
|
|
6
|
+
dividends?: boolean;
|
|
7
|
+
other?: boolean;
|
|
8
|
+
id?: number;
|
|
9
|
+
deletedAt?: Date;
|
|
10
|
+
clientDetails?: ClientDetails;
|
|
11
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VehicleClaimMethodEnum } from '../Enums/vehicle-claim-method.enum';
|
|
2
2
|
import { User } from './user';
|
|
3
|
+
import { TankTypeEnum } from '../Enums/tank-type.enum';
|
|
3
4
|
export declare class VehicleClaim {
|
|
4
5
|
financialYear?: number;
|
|
5
6
|
method?: VehicleClaimMethodEnum;
|
|
@@ -8,4 +9,5 @@ export declare class VehicleClaim {
|
|
|
8
9
|
isManual?: boolean;
|
|
9
10
|
id?: number;
|
|
10
11
|
user?: User;
|
|
12
|
+
tankType?: TankTypeEnum;
|
|
11
13
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { User } from './user';
|
|
2
2
|
import { VehicleLogbook } from './vehicle-logbook';
|
|
3
|
+
import { TankTypeEnum } from '../Enums/tank-type.enum';
|
|
3
4
|
export declare class Vehicle {
|
|
4
5
|
name?: string;
|
|
5
6
|
id?: number;
|
|
6
7
|
user?: User;
|
|
7
8
|
logbook?: VehicleLogbook[];
|
|
9
|
+
tankType?: TankTypeEnum;
|
|
8
10
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { ClientIncomeTypes } from '../../models/client/client-income-types';
|
|
3
|
+
export declare class ClientIncomeTypesForm extends AbstractForm {
|
|
4
|
+
private clientIncomeTypes;
|
|
5
|
+
constructor(clientIncomeTypes: ClientIncomeTypes);
|
|
6
|
+
submit(): object;
|
|
7
|
+
}
|
package/lib/forms/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './abstract.form';
|
|
2
|
+
export * from './client/client-income-types.form';
|
|
2
3
|
export * from './login/login.form';
|
|
3
4
|
export * from './register/register-client.form';
|
|
4
5
|
export * from './register/register-firm.form';
|
|
5
6
|
export * from './user/password.form';
|
|
6
7
|
export * from './user/reset-password.form';
|
|
8
|
+
export * from './vehicle/vehicle.form';
|
|
9
|
+
export * from './vehicle/vehicle-claim.form';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { VehicleClaim } from '../../models/logbook/vehicle-claim';
|
|
3
|
+
import { VehicleLogbookCollection } from '../../collections/vehicle-logbook.collection';
|
|
4
|
+
export declare class VehicleClaimForm extends AbstractForm {
|
|
5
|
+
private vehicleClaim;
|
|
6
|
+
private logbooks;
|
|
7
|
+
constructor(vehicleClaim: VehicleClaim, logbooks: VehicleLogbookCollection);
|
|
8
|
+
/**
|
|
9
|
+
* Check if vehicle claim method changed
|
|
10
|
+
*/
|
|
11
|
+
isMethodChanged(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Check if KLMs method selected
|
|
14
|
+
*/
|
|
15
|
+
isKLMsMethod(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check if Logbook method selected
|
|
18
|
+
*/
|
|
19
|
+
isLogbookMethod(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Check if user selected manual calculation
|
|
22
|
+
*/
|
|
23
|
+
isManual(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @TODO save model, add generics and handle it in AbstractForm
|
|
26
|
+
*/
|
|
27
|
+
submit(): VehicleClaim;
|
|
28
|
+
private setIsManualState;
|
|
29
|
+
/**
|
|
30
|
+
* Handle method field value changes.
|
|
31
|
+
* Set work usage value depended of selected method.
|
|
32
|
+
*/
|
|
33
|
+
private listenMethodChanges;
|
|
34
|
+
/**
|
|
35
|
+
* Handle isManual field value changes.
|
|
36
|
+
* Enable/disable fields depended of isManual value
|
|
37
|
+
*/
|
|
38
|
+
private listenIsManualChanges;
|
|
39
|
+
/**
|
|
40
|
+
* Set automatic calculated values depended of current method for non-manual vehicle claim
|
|
41
|
+
*/
|
|
42
|
+
private setValues;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { Vehicle } from '../../models/logbook/vehicle';
|
|
3
|
+
import { VehicleClaim } from '../../models/logbook/vehicle-claim';
|
|
4
|
+
export declare class VehicleForm extends AbstractForm {
|
|
5
|
+
private vehicle;
|
|
6
|
+
constructor(vehicle: Vehicle);
|
|
7
|
+
/**
|
|
8
|
+
* @TODO save model, add generics and handle it in AbstractForm
|
|
9
|
+
*/
|
|
10
|
+
submit(): VehicleClaim;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChartAccounts } from '../models/chart-accounts/chart-accounts';
|
|
2
|
+
import { ITank } from './tank.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Interface with common transactions fields and methods
|
|
5
|
+
* @TODO remove I prefix in all interfaces. Naming issue: need to get common name for transaction and depreciation or
|
|
6
|
+
* rename Transaction class or cut transaction-related logic from Depreciation and never work with Depreciation as with Transaction.
|
|
7
|
+
* @TODO add more common fields from Transaction and Depreciation if required
|
|
8
|
+
*/
|
|
9
|
+
export interface Expense extends ITank {
|
|
10
|
+
amount: number;
|
|
11
|
+
chartAccounts: ChartAccounts;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum list of all possible account setup items. Using with [ACCOUNT_SETUP_ITEMS]{@link ACCOUNT_SETUP_ITEMS}
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AccountSetupItemsEnum {
|
|
5
|
+
SALARY = 0,
|
|
6
|
+
OTHER_INCOME = 1,
|
|
7
|
+
PROPERTY = 2,
|
|
8
|
+
BANK_FEEDS = 3,
|
|
9
|
+
WORK_LOGBOOK = 4,
|
|
10
|
+
SOLE_INCOME = 5,
|
|
11
|
+
TRANSACTION = 6
|
|
12
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ChartAccounts as ChartAccountsBase } from '../../db/Models/chart-accounts';
|
|
2
2
|
import { ChartAccountsHeading } from './chart-accounts-heading';
|
|
3
3
|
import { ChartAccountsMetadata } from './chart-accounts-metadata';
|
|
4
|
+
import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
|
|
5
|
+
import { ChartAccountsValue } from './chart-accounts-value';
|
|
4
6
|
export declare class ChartAccounts extends ChartAccountsBase {
|
|
5
7
|
heading: ChartAccountsHeading;
|
|
6
8
|
metadata: ChartAccountsMetadata[];
|
|
@@ -12,6 +14,14 @@ export declare class ChartAccounts extends ChartAccountsBase {
|
|
|
12
14
|
* Check if chart accounts id is related for 'Klms travelled for work' category
|
|
13
15
|
*/
|
|
14
16
|
isKlmsForWork(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if chart accounts id is related for 'Klms travelled for sole' category
|
|
19
|
+
*/
|
|
20
|
+
isKlmsForSole(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Check if accounts id is related for KLMs category related to passed tank type
|
|
23
|
+
*/
|
|
24
|
+
isKLMsByTankType(tankType: TankTypeEnum): boolean;
|
|
15
25
|
/**
|
|
16
26
|
* Check if chart accounts id is related for 'NRAS Tax Offset' category
|
|
17
27
|
*/
|
|
@@ -64,4 +74,12 @@ export declare class ChartAccounts extends ChartAccountsBase {
|
|
|
64
74
|
* Check if transaction chart account is work related car expenses
|
|
65
75
|
*/
|
|
66
76
|
isVehicleLoanExpense(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Get chart accounts value for current financial year
|
|
79
|
+
*/
|
|
80
|
+
getCurrentYearValue(): ChartAccountsValue;
|
|
81
|
+
/**
|
|
82
|
+
* Get chart accounts value by financial year
|
|
83
|
+
*/
|
|
84
|
+
getValueByYear(year: number): ChartAccountsValue;
|
|
67
85
|
}
|
|
@@ -4,11 +4,11 @@ import { DepreciationCapitalProject } from './depreciation-capital-project';
|
|
|
4
4
|
import { DepreciationForecast } from './depreciation-forecast';
|
|
5
5
|
import { ChartAccounts } from '../chart-accounts/chart-accounts';
|
|
6
6
|
import { BankTransaction } from '../bank/bank-transaction';
|
|
7
|
-
import { ITank } from '../../interfaces/tank.interface';
|
|
8
7
|
import { IReceipt } from '../../interfaces/receipt.interface';
|
|
9
8
|
import { IAsset } from '../../interfaces/asset.interface';
|
|
10
9
|
import { Transaction } from '../transaction/transaction';
|
|
11
|
-
|
|
10
|
+
import { Expense } from '../../interfaces/expense.interface';
|
|
11
|
+
export declare class Depreciation extends DepreciationBase implements Expense, IReceipt {
|
|
12
12
|
static WRITTEN_OFF_THRESHOLD: number;
|
|
13
13
|
static LOW_VALUE_POOL_THRESHOLD: number;
|
|
14
14
|
purchaseDate: Date;
|
|
@@ -22,6 +22,10 @@ export declare class Depreciation extends DepreciationBase implements ITank, IRe
|
|
|
22
22
|
bankTransaction: BankTransaction;
|
|
23
23
|
type: DepreciationTypeEnum;
|
|
24
24
|
receipt: IAsset;
|
|
25
|
+
/**
|
|
26
|
+
* @TODO remove after ? signs removed from db models
|
|
27
|
+
*/
|
|
28
|
+
amount: number;
|
|
25
29
|
isCapital(): boolean;
|
|
26
30
|
isBorrowingExpense(): boolean;
|
|
27
31
|
isAsset(): boolean;
|
|
@@ -36,5 +36,8 @@ export declare enum AppEventTypeEnum {
|
|
|
36
36
|
TRANSACTIONS_CREATED = 34,
|
|
37
37
|
USER_UPDATED = 35,
|
|
38
38
|
VEHICLE_CLAIM_UPDATED = 36,
|
|
39
|
-
VEHICLE_CLAIM_CREATED = 37
|
|
39
|
+
VEHICLE_CLAIM_CREATED = 37,
|
|
40
|
+
VEHICLE_LOGBOOK_CREATED = 38,
|
|
41
|
+
VEHICLE_LOGBOOK_UPDATED = 39,
|
|
42
|
+
VEHICLE_LOGBOOK_DELETED = 40
|
|
40
43
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { VehicleClaim as VehicleClaimBase } from '../../db/Models/vehicle-claim';
|
|
2
2
|
import { VehicleClaimMethodEnum } from '../../db/Enums/vehicle-claim-method.enum';
|
|
3
|
+
import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
|
|
4
|
+
import { Transaction } from '../transaction/transaction';
|
|
5
|
+
import { TransactionCollection } from '../../collections/transaction.collection';
|
|
3
6
|
export declare class VehicleClaim extends VehicleClaimBase {
|
|
4
7
|
kmsLimit: number;
|
|
5
8
|
financialYear: number;
|
|
@@ -11,9 +14,23 @@ export declare class VehicleClaim extends VehicleClaimBase {
|
|
|
11
14
|
* get amount of kilometres per week
|
|
12
15
|
*/
|
|
13
16
|
get averageWeeklyTraveledKms(): number;
|
|
14
|
-
|
|
17
|
+
isLogbookMethod(): boolean;
|
|
18
|
+
isKLMsMethod(): boolean;
|
|
19
|
+
isWorkTank(): boolean;
|
|
20
|
+
isSoleTank(): boolean;
|
|
15
21
|
/**
|
|
16
|
-
* Claim amount for
|
|
22
|
+
* Claim amount for KLMs method. Exists only for KLMs method.
|
|
17
23
|
*/
|
|
18
|
-
|
|
24
|
+
getKLMsClaimAmount(vehicleClaimRate: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Get logbook claim amount. Exists only for logbook method.
|
|
27
|
+
* ClaimAmount = WorkUsage * transaction/depreciation amount
|
|
28
|
+
*/
|
|
29
|
+
getLogbookClaimAmount(transactions: TransactionCollection): number;
|
|
30
|
+
/**
|
|
31
|
+
* Create KLMs transaction based on vehicle claim and vehicle claim rate
|
|
32
|
+
* @TODO handle on backend: Create klms transaction when vhicle claim created
|
|
33
|
+
*/
|
|
34
|
+
toTransaction(vehicleClaimRate: number): Transaction;
|
|
35
|
+
getKlmsChartAccountsIdByTankType(tankType?: TankTypeEnum): number;
|
|
19
36
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { VehicleLogbook as VehicleLogbookBase } from '../../db/Models/vehicle-logbook';
|
|
2
2
|
export declare class VehicleLogbook extends VehicleLogbookBase {
|
|
3
3
|
date: Date;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Get amount of kilometers in this logbook
|
|
6
|
+
*/
|
|
7
|
+
getKlms(): number;
|
|
8
|
+
/**
|
|
9
|
+
* Check if logbook is business-related
|
|
10
|
+
*/
|
|
11
|
+
isBusiness(): boolean;
|
|
6
12
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Vehicle as VehicleBase } from '../../db/Models/vehicle';
|
|
2
2
|
import { VehicleLogbook } from './vehicle-logbook';
|
|
3
|
+
import { VehicleLogbookCollection } from '../../collections/vehicle-logbook.collection';
|
|
3
4
|
export declare class Vehicle extends VehicleBase {
|
|
4
5
|
logbook: VehicleLogbook[];
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
get lastLogbook(): VehicleLogbook | {
|
|
10
|
-
odometerEnd: number;
|
|
11
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* Get vehicle's logbooks as collection
|
|
8
|
+
*/
|
|
9
|
+
getLogbooks(): VehicleLogbookCollection;
|
|
12
10
|
}
|
|
@@ -9,10 +9,10 @@ import { TransactionMetadata } from './transaction-metadata';
|
|
|
9
9
|
import { Loan } from '../loan/loan';
|
|
10
10
|
import { TransactionAllocation } from './transaction-allocation';
|
|
11
11
|
import { IReceipt } from '../../interfaces/receipt.interface';
|
|
12
|
-
import { ITank } from '../../interfaces/tank.interface';
|
|
13
12
|
import { TransactionAllocationCollection } from '../../collections/transaction-allocation.collection';
|
|
14
13
|
import { Depreciation } from '../depreciation/depreciation';
|
|
15
|
-
|
|
14
|
+
import { Expense } from '../../interfaces/expense.interface';
|
|
15
|
+
export declare class Transaction extends TransactionBase implements Expense, IReceipt {
|
|
16
16
|
transactions: Transaction[];
|
|
17
17
|
property: Property;
|
|
18
18
|
receipt: TransactionReceipt;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BankAccountService } from '../http/bank/bank-account/bank-account.service';
|
|
2
|
+
import { ClientIncomeTypesService } from '../http/firm/client-income/client-income-types.service';
|
|
3
|
+
import { IncomeSourceService } from '../http/income-source/income-source.service';
|
|
4
|
+
import { PropertyService } from '../http/property/property.service';
|
|
5
|
+
import { TransactionAllocationService } from '../http/transaction/transaction-allocation/transaction-allocation.service';
|
|
6
|
+
import { Observable, ReplaySubject } from 'rxjs';
|
|
7
|
+
import { AccountSetupItemCollection } from '../../collections/account-setup-item.collection';
|
|
8
|
+
import { VehicleClaimService } from '../http/vehicle/vehicle-claim.service';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* Service handling user's account setup process.
|
|
12
|
+
* Checks required steps and their completion
|
|
13
|
+
*/
|
|
14
|
+
export declare class AccountSetupService {
|
|
15
|
+
private clientIncomeTypesService;
|
|
16
|
+
private propertyService;
|
|
17
|
+
private incomeSourceService;
|
|
18
|
+
private bankAccountsService;
|
|
19
|
+
private transactionAllocationService;
|
|
20
|
+
private vehicleClaimService;
|
|
21
|
+
cache: AccountSetupItemCollection;
|
|
22
|
+
cacheSubject: ReplaySubject<AccountSetupItemCollection>;
|
|
23
|
+
constructor(clientIncomeTypesService: ClientIncomeTypesService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService);
|
|
24
|
+
/**
|
|
25
|
+
* Get list of account setup items for current user
|
|
26
|
+
*/
|
|
27
|
+
get(): Observable<AccountSetupItemCollection>;
|
|
28
|
+
/**
|
|
29
|
+
* Get a single AccountSetupItem and check it's completion
|
|
30
|
+
*/
|
|
31
|
+
private create;
|
|
32
|
+
/**
|
|
33
|
+
* Get batch of requests to get list of required AccountSetupItem's.
|
|
34
|
+
* Some items are optional and depends of user's client income types
|
|
35
|
+
*/
|
|
36
|
+
private createBatch;
|
|
37
|
+
/**
|
|
38
|
+
* @TODO work with collection when services refactored
|
|
39
|
+
*/
|
|
40
|
+
private getIncomeSourcesByType;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccountSetupService, never>;
|
|
42
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AccountSetupService>;
|
|
43
|
+
}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { BankAccount as BankAccountBase } from '../../../../db/Models/bank-account';
|
|
4
3
|
import { RestService } from '../../rest/rest.service';
|
|
5
4
|
import { BankAccount } from '../../../../models/bank/bank-account';
|
|
6
|
-
import {
|
|
5
|
+
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Service that handling user's bank accounts logic
|
|
10
9
|
*/
|
|
11
|
-
export declare class BankAccountService extends RestService<BankAccountBase, BankAccount> {
|
|
12
|
-
protected http: HttpClient;
|
|
13
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
14
|
-
protected environment: any;
|
|
10
|
+
export declare class BankAccountService extends RestService<BankAccountBase, BankAccount> implements IEventListener {
|
|
15
11
|
url: string;
|
|
16
12
|
modelClass: typeof BankAccount;
|
|
17
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
18
13
|
/**
|
|
19
14
|
* Listen system notifications and update cache when got basiq notification received
|
|
20
15
|
*/
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { BankConnection as BankConnectionBase } from '../../../../db/Models/bank-connection';
|
|
4
|
-
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
5
3
|
import { BankConnection } from '../../../../models/bank/bank-connection';
|
|
6
4
|
import { RestService } from '../../rest/rest.service';
|
|
5
|
+
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* BankConnection means user account at specific bank (usually each user has only one at the same bank)
|
|
10
9
|
* service handles BankConnection management
|
|
11
10
|
*/
|
|
12
|
-
export declare class BankConnectionService extends RestService<BankConnectionBase, BankConnection> {
|
|
13
|
-
protected http: HttpClient;
|
|
14
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
15
|
-
protected environment: any;
|
|
11
|
+
export declare class BankConnectionService extends RestService<BankConnectionBase, BankConnection> implements IEventListener {
|
|
16
12
|
modelClass: typeof BankConnection;
|
|
17
13
|
url: string;
|
|
18
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
19
14
|
listenEvents(): void;
|
|
20
15
|
post(bankConnection: BankConnection): Observable<BankConnection>;
|
|
21
16
|
listenToAddedBankAccounts(): void;
|