taxtank-core 0.27.3 → 0.27.6
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 +448 -163
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/chart-accounts.collection.js +3 -3
- package/esm2015/lib/collections/transaction/transaction.collection.js +5 -2
- package/esm2015/lib/collections/vehicle/vehicle-claim.collection.js +2 -4
- package/esm2015/lib/collections/vehicle/vehicle-logbook.collection.js +15 -30
- package/esm2015/lib/db/Enums/depreciation-calculation.enum.js +2 -1
- package/esm2015/lib/db/Enums/sole-invoice-statuses.enum.js +8 -0
- package/esm2015/lib/db/Enums/sole-invoice-template-tax-type.enum.js +7 -0
- package/esm2015/lib/db/Models/chart-accounts/chart-accounts.js +1 -1
- package/esm2015/lib/db/Models/sole/sole-invoice-template.js +1 -1
- package/esm2015/lib/db/Models/sole/sole-invoice.js +1 -1
- package/esm2015/lib/db/Models/user/user.js +1 -1
- package/esm2015/lib/forms/abstract.form.js +11 -5
- package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +6 -10
- package/esm2015/lib/forms/bank/bank-account/bank-account-allocation.form.js +6 -3
- package/esm2015/lib/forms/sole/index.js +3 -1
- package/esm2015/lib/forms/sole/sole-business-allocations.form.js +2 -1
- package/esm2015/lib/forms/sole/sole-invoice-item.form.js +43 -0
- package/esm2015/lib/forms/sole/sole-invoice-template.form.js +6 -4
- package/esm2015/lib/forms/sole/sole-invoice.form.js +51 -0
- package/esm2015/lib/forms/vehicle/vehicle-claim-details.form.js +3 -7
- package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +8 -2
- package/esm2015/lib/forms/vehicle/vehicle-logbook.form.js +22 -15
- package/esm2015/lib/models/account-setup/account-setup-items.const.js +2 -2
- package/esm2015/lib/models/bank/bank-account.js +4 -1
- package/esm2015/lib/models/chart-accounts/chart-accounts.js +9 -9
- package/esm2015/lib/models/endpoint/endpoints.const.js +5 -1
- package/esm2015/lib/models/financial-year/financial-year.js +2 -1
- package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +2 -2
- package/esm2015/lib/models/sole/sole-details.js +3 -1
- package/esm2015/lib/models/sole/sole-invoice-item.js +8 -1
- package/esm2015/lib/models/sole/sole-invoice-template.js +15 -4
- package/esm2015/lib/models/sole/sole-invoice.js +55 -2
- package/esm2015/lib/models/transaction/transaction.js +3 -3
- package/esm2015/lib/models/vehicle/logbook-period.js +2 -1
- package/esm2015/lib/models/vehicle/vehicle-claim-details.js +12 -11
- package/esm2015/lib/models/vehicle/vehicle-claim.js +14 -13
- package/esm2015/lib/models/vehicle/vehicle-logbook.js +18 -5
- package/esm2015/lib/services/account-setup/account-setup.service.js +2 -2
- package/esm2015/lib/services/affiliate/rewardful/rewardful.service.js +34 -0
- package/esm2015/lib/services/http/depreciation/depreciation.service.js +1 -2
- package/esm2015/lib/services/http/sole/index.js +2 -1
- package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +21 -0
- package/esm2015/lib/services/http/transaction/transaction.service.js +1 -2
- package/esm2015/lib/services/http/vehicle/vehicle-claim-details.service.js +7 -6
- package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +10 -10
- package/esm2015/lib/services/index.js +2 -1
- package/esm2015/public-api.js +3 -1
- package/fesm2015/taxtank-core.js +379 -139
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/chart-accounts.collection.d.ts +2 -2
- package/lib/collections/transaction/transaction.collection.d.ts +2 -2
- package/lib/collections/vehicle/vehicle-claim.collection.d.ts +1 -3
- package/lib/collections/vehicle/vehicle-logbook.collection.d.ts +4 -9
- package/lib/db/Enums/depreciation-calculation.enum.d.ts +1 -0
- package/lib/db/Enums/sole-invoice-statuses.enum.d.ts +6 -0
- package/lib/db/Enums/sole-invoice-template-tax-type.enum.d.ts +5 -0
- package/lib/db/Models/chart-accounts/chart-accounts.d.ts +1 -0
- package/lib/db/Models/sole/sole-invoice-template.d.ts +2 -1
- package/lib/db/Models/sole/sole-invoice.d.ts +2 -1
- package/lib/db/Models/user/user.d.ts +1 -0
- package/lib/forms/abstract.form.d.ts +3 -1
- package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +1 -3
- package/lib/forms/bank/bank-account/bank-account-allocation.form.d.ts +4 -2
- package/lib/forms/sole/index.d.ts +2 -0
- package/lib/forms/sole/sole-business-allocations.form.d.ts +1 -0
- package/lib/forms/sole/sole-invoice-item.form.d.ts +10 -0
- package/lib/forms/sole/sole-invoice-template.form.d.ts +3 -2
- package/lib/forms/sole/sole-invoice.form.d.ts +14 -0
- package/lib/forms/vehicle/vehicle-claim-details.form.d.ts +1 -6
- package/lib/forms/vehicle/vehicle-claim.form.d.ts +3 -0
- package/lib/forms/vehicle/vehicle-logbook.form.d.ts +4 -0
- package/lib/models/bank/bank-account.d.ts +2 -0
- package/lib/models/chart-accounts/chart-accounts.d.ts +6 -6
- package/lib/models/financial-year/financial-year.d.ts +1 -0
- package/lib/models/sole/sole-details.d.ts +2 -0
- package/lib/models/sole/sole-invoice-item.d.ts +2 -0
- package/lib/models/sole/sole-invoice-template.d.ts +5 -1
- package/lib/models/sole/sole-invoice.d.ts +12 -0
- package/lib/models/transaction/transaction.d.ts +2 -2
- package/lib/models/vehicle/logbook-period.d.ts +1 -0
- package/lib/models/vehicle/vehicle-claim-details.d.ts +8 -2
- package/lib/models/vehicle/vehicle-claim.d.ts +6 -4
- package/lib/models/vehicle/vehicle-logbook.d.ts +8 -4
- package/lib/services/affiliate/rewardful/rewardful.service.d.ts +13 -0
- package/lib/services/http/sole/index.d.ts +1 -0
- package/lib/services/http/sole/sole-invoice/sole-invoice.service.d.ts +11 -0
- package/lib/services/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -2,7 +2,7 @@ import { Collection } from './collection';
|
|
|
2
2
|
import { ChartAccounts } from '../models/chart-accounts/chart-accounts';
|
|
3
3
|
export declare class ChartAccountsCollection extends Collection<ChartAccounts> {
|
|
4
4
|
/**
|
|
5
|
-
* Get '
|
|
5
|
+
* Get 'Kms travelled for work' related chart account value
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
getVehicleKmsRate(year?: number): number;
|
|
8
8
|
}
|
|
@@ -86,9 +86,9 @@ export declare class TransactionCollection extends ExportableCollection<Transact
|
|
|
86
86
|
/**
|
|
87
87
|
* Get list of vehicle transactions filtered by vehicle claim
|
|
88
88
|
*/
|
|
89
|
-
getByVehicleClaim(vehicleClaim
|
|
89
|
+
getByVehicleClaim(vehicleClaim?: VehicleClaim): this;
|
|
90
90
|
/**
|
|
91
|
-
* Get list of vehicle transactions except
|
|
91
|
+
* Get list of vehicle transactions except KMS transactions
|
|
92
92
|
*/
|
|
93
93
|
getLogbookTransactions(): this;
|
|
94
94
|
}
|
|
@@ -3,12 +3,10 @@ import { VehicleClaim } from '../../models';
|
|
|
3
3
|
export declare class VehicleClaimCollection extends Collection<VehicleClaim> {
|
|
4
4
|
/**
|
|
5
5
|
* Get remaining kilometers limit. Total limit ({@link VehicleClaim.totalKmsLimit}) - claimed kilometers from other vehicle claims
|
|
6
|
-
* @param claim may not exist when user come to vehicle claim page 1st time and not created claim yet
|
|
7
6
|
*/
|
|
8
|
-
|
|
7
|
+
getKmsLimitForClaim(claim?: VehicleClaim): number;
|
|
9
8
|
/**
|
|
10
9
|
* Get remaining work usage limit. Total limit ({@link VehicleClaim.totalWorkUsagePercent}) - claimed percent from other vehicle claims
|
|
11
|
-
* @param claim may not exist when user come to vehicle claim page 1st time and not created claim yet
|
|
12
10
|
*/
|
|
13
11
|
getWorkUsageLimitForClaim(claim?: VehicleClaim): number;
|
|
14
12
|
}
|
|
@@ -2,7 +2,7 @@ import { Collection } from '../collection';
|
|
|
2
2
|
import { LogbookPeriod, VehicleClaim, VehicleLogbook } from '../../models';
|
|
3
3
|
export declare class VehicleLogbookCollection extends Collection<VehicleLogbook> {
|
|
4
4
|
/**
|
|
5
|
-
* Best period may be calculated only when user has logbooks minimum for
|
|
5
|
+
* Best period may be calculated only when user has logbooks minimum for VehicleLogbook.bestPeriodWeeks
|
|
6
6
|
* @TODO Vik: Best period: move this and related logic to backend
|
|
7
7
|
*/
|
|
8
8
|
isBestPeriodExist(): boolean;
|
|
@@ -12,8 +12,8 @@ export declare class VehicleLogbookCollection extends Collection<VehicleLogbook>
|
|
|
12
12
|
*/
|
|
13
13
|
getClaimableLogbooks(): this;
|
|
14
14
|
/**
|
|
15
|
-
* Logbook Period
|
|
16
|
-
* Best period duration is defined as
|
|
15
|
+
* Get Logbook Period with the biggest work usage percent
|
|
16
|
+
* Best period duration is defined as VehicleLogbook.bestPeriodWeeks by the ATO
|
|
17
17
|
* @TODO Vik: Best period: move this and related logic to backend
|
|
18
18
|
*/
|
|
19
19
|
getBestPeriod(): LogbookPeriod;
|
|
@@ -26,13 +26,8 @@ export declare class VehicleLogbookCollection extends Collection<VehicleLogbook>
|
|
|
26
26
|
* @TODO Alex: TT-2089 replace with getter
|
|
27
27
|
*/
|
|
28
28
|
getWorkUsage(): number;
|
|
29
|
-
/**
|
|
30
|
-
* Get LOGBOOK_PERIOD_DURATION date range from passed start date
|
|
31
|
-
* @TODO Vik: Best period: move this and related logic to backend
|
|
32
|
-
*/
|
|
33
|
-
private getPeriodRange;
|
|
34
29
|
/**
|
|
35
30
|
* Get list of logbooks related to passed vehicle claim
|
|
36
31
|
*/
|
|
37
|
-
getByVehicleClaim(
|
|
32
|
+
getByVehicleClaim(vehicleClaim: VehicleClaim): this;
|
|
38
33
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SoleBusiness } from './sole-business';
|
|
2
2
|
import { BankAccount } from '../bank/bank-account';
|
|
3
3
|
import { AbstractModel } from '../abstract-model';
|
|
4
|
+
import { SoleInvoiceTemplateTaxTypeEnum } from '../../Enums/sole-invoice-template-tax-type.enum';
|
|
4
5
|
export declare class SoleInvoiceTemplate extends AbstractModel {
|
|
5
6
|
name?: string;
|
|
6
|
-
|
|
7
|
+
taxType?: SoleInvoiceTemplateTaxTypeEnum;
|
|
7
8
|
term?: number;
|
|
8
9
|
id?: number;
|
|
9
10
|
business?: SoleBusiness;
|
|
@@ -4,12 +4,13 @@ import { SoleInvoiceItem } from './sole-invoice-item';
|
|
|
4
4
|
import { SoleContact } from './sole-contact';
|
|
5
5
|
import { SoleInvoiceTemplate } from './sole-invoice-template';
|
|
6
6
|
import { AbstractModel } from '../abstract-model';
|
|
7
|
+
import { SoleInvoiceStatusesEnum } from '../../Enums/sole-invoice-statuses.enum';
|
|
7
8
|
export declare class SoleInvoice extends AbstractModel {
|
|
8
9
|
number?: string;
|
|
9
10
|
dateFrom?: Date;
|
|
10
11
|
dateTo?: Date;
|
|
11
12
|
id?: number;
|
|
12
|
-
status?:
|
|
13
|
+
status?: SoleInvoiceStatusesEnum;
|
|
13
14
|
user?: User;
|
|
14
15
|
business?: SoleBusiness;
|
|
15
16
|
items?: SoleInvoiceItem[];
|
|
@@ -3,7 +3,7 @@ import { EventEmitter, Type } from '@angular/core';
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstract form class
|
|
5
5
|
* @TODO rename to AbstractFormGroup
|
|
6
|
-
* @TODO Alex: refactor: check and improve logic
|
|
6
|
+
* @TODO Alex TT-2190: refactor: check and improve logic
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class AbstractForm<Model> extends FormGroup {
|
|
9
9
|
/**
|
|
@@ -22,6 +22,7 @@ export declare abstract class AbstractForm<Model> extends FormGroup {
|
|
|
22
22
|
[key: string]: AbstractControl;
|
|
23
23
|
}, model?: Model, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null);
|
|
24
24
|
get saved(): boolean;
|
|
25
|
+
get currentValue(): Model;
|
|
25
26
|
/**
|
|
26
27
|
* Check validation and return a new instance of generic model.
|
|
27
28
|
* Merge form value to initial object
|
|
@@ -34,4 +35,5 @@ export declare abstract class AbstractForm<Model> extends FormGroup {
|
|
|
34
35
|
markAsUnsaved(): void;
|
|
35
36
|
markAsSaved(): void;
|
|
36
37
|
private createModelInstance;
|
|
38
|
+
private listenValueChanges;
|
|
37
39
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { BankAccount } from '../../../models/bank/bank-account';
|
|
2
2
|
import { BankConnection } from '../../../models/bank/bank-connection';
|
|
3
|
-
import { IEventListener } from '../../../interfaces/event-listener.interface';
|
|
4
3
|
import { BankAccountAllocationForm } from './bank-account-allocation.form';
|
|
5
4
|
/**
|
|
6
5
|
* Form is using for single manual bank account creation (not Basiq)
|
|
7
6
|
*/
|
|
8
|
-
export declare class BankAccountAddManualForm extends BankAccountAllocationForm
|
|
7
|
+
export declare class BankAccountAddManualForm extends BankAccountAllocationForm {
|
|
9
8
|
private connection;
|
|
10
9
|
static accountNumberPattern: string;
|
|
11
10
|
constructor(connection: BankConnection);
|
|
12
|
-
listenEvents(): void;
|
|
13
11
|
/**
|
|
14
12
|
* Add/Remove loan form depends on selected bank account type
|
|
15
13
|
*/
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AbstractForm } from '../../abstract.form';
|
|
2
2
|
import { BankAccount } from '../../../models/bank/bank-account';
|
|
3
|
-
|
|
3
|
+
import { IEventListener } from '../../../interfaces/event-listener.interface';
|
|
4
|
+
export declare class BankAccountAllocationForm extends AbstractForm<BankAccount> implements IEventListener {
|
|
4
5
|
private bankAccount?;
|
|
5
6
|
constructor(bankAccount?: BankAccount);
|
|
6
|
-
|
|
7
|
+
listenEvents(): void;
|
|
8
|
+
listenTankTypeChanges(): void;
|
|
7
9
|
}
|
|
@@ -3,4 +3,6 @@ export * from './sole-business-allocations.form';
|
|
|
3
3
|
export * from './sole-contact.form';
|
|
4
4
|
export * from './sole-depreciation-method.form';
|
|
5
5
|
export * from './sole-details.form';
|
|
6
|
+
export * from './sole-invoice.form';
|
|
7
|
+
export * from './sole-invoice-item.form';
|
|
6
8
|
export * from './sole-invoice-template.form';
|
|
@@ -3,6 +3,7 @@ import { SoleBusinessAllocation } from '../../models';
|
|
|
3
3
|
/**
|
|
4
4
|
* Form array with bank account business allocations
|
|
5
5
|
* @TODO create AbstractFormArray
|
|
6
|
+
* @TODO Alex/Vik (TT-2184): copypasted from bank-account-properties.form, improve logic and create common parent class maybe
|
|
6
7
|
*/
|
|
7
8
|
export declare class SoleBusinessAllocationsForm extends FormArray {
|
|
8
9
|
constructor(businessAllocations?: SoleBusinessAllocation[]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { SoleInvoiceItem, SoleInvoiceTemplate } from '../../models';
|
|
3
|
+
import { IEventListener } from '../../interfaces/event-listener.interface';
|
|
4
|
+
export declare class SoleInvoiceItemForm extends AbstractForm<SoleInvoiceItem> implements IEventListener {
|
|
5
|
+
private template;
|
|
6
|
+
constructor(item: SoleInvoiceItem);
|
|
7
|
+
listenEvents(): void;
|
|
8
|
+
onTemplateChanged(template: SoleInvoiceTemplate): void;
|
|
9
|
+
private listenChartAccountsChanges;
|
|
10
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbstractForm } from '../abstract.form';
|
|
2
|
-
import { SoleInvoiceTemplate } from '../../models';
|
|
2
|
+
import { SoleDetails, SoleInvoiceTemplate } from '../../models';
|
|
3
3
|
export declare class SoleInvoiceTemplateForm extends AbstractForm<SoleInvoiceTemplate> {
|
|
4
|
-
|
|
4
|
+
private soleDetails;
|
|
5
|
+
constructor(invoiceTemplate: SoleInvoiceTemplate, soleDetails: SoleDetails);
|
|
5
6
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { SoleInvoice } from '../../models';
|
|
3
|
+
import { FormArray } from '@angular/forms';
|
|
4
|
+
import { IEventListener } from '../../interfaces/event-listener.interface';
|
|
5
|
+
export declare class SoleInvoiceForm extends AbstractForm<SoleInvoice> implements IEventListener {
|
|
6
|
+
constructor(invoice: SoleInvoice);
|
|
7
|
+
get items(): FormArray;
|
|
8
|
+
listenEvents(): void;
|
|
9
|
+
addItem(): void;
|
|
10
|
+
removeItem(index: number): void;
|
|
11
|
+
submit(data?: object): SoleInvoice;
|
|
12
|
+
private listenTemplateChanges;
|
|
13
|
+
private updateItemsForm;
|
|
14
|
+
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { AbstractForm } from '../abstract.form';
|
|
2
2
|
import { VehicleClaimDetails } from '../../models';
|
|
3
|
-
import { VehicleLogbookCollection } from '../../collections';
|
|
4
3
|
/**
|
|
5
4
|
* Add/Edit vehicle claim details form
|
|
6
5
|
*/
|
|
7
6
|
export declare class VehicleClaimDetailsForm extends AbstractForm<VehicleClaimDetails> {
|
|
8
|
-
|
|
9
|
-
* @param vehicleClaimDetails required because we create a new details with prefilled data (like Financial year)
|
|
10
|
-
* @param logbooks required for isManual field disabled state management
|
|
11
|
-
*/
|
|
12
|
-
constructor(vehicleClaimDetails: VehicleClaimDetails, logbooks: VehicleLogbookCollection);
|
|
7
|
+
constructor(vehicleClaimDetails: VehicleClaimDetails, isBestPeriodExist: boolean);
|
|
13
8
|
}
|
|
@@ -5,9 +5,12 @@ import { VehicleClaimDetails } from '../../models';
|
|
|
5
5
|
* Add/Edit Vehicle Claim form
|
|
6
6
|
*/
|
|
7
7
|
export declare class VehicleClaimForm extends AbstractForm<VehicleClaim> {
|
|
8
|
+
private vehicleClaim;
|
|
9
|
+
private details;
|
|
8
10
|
/**
|
|
9
11
|
* @param vehicleClaim required even for the new claim, because claim needs business for sole tank
|
|
10
12
|
* @param details required for form controls disabled state management
|
|
11
13
|
*/
|
|
12
14
|
constructor(vehicleClaim: VehicleClaim, details: VehicleClaimDetails);
|
|
15
|
+
getAverageWeeklyKMS(): number;
|
|
13
16
|
}
|
|
@@ -17,4 +17,8 @@ export declare class VehicleLogbookForm extends AbstractForm<VehicleLogbook> {
|
|
|
17
17
|
* @param logbooks list of all logbooks related to current logbook's vehicle. Required for form fields validation and disabled state management
|
|
18
18
|
*/
|
|
19
19
|
constructor(logbook: VehicleLogbook, logbooks: VehicleLogbookCollection);
|
|
20
|
+
/**
|
|
21
|
+
* Set logbook validators and disable state depends of initial logbook and its place in the whole list
|
|
22
|
+
*/
|
|
23
|
+
private updateStateAndValidators;
|
|
20
24
|
}
|
|
@@ -6,6 +6,7 @@ import { BankAccountBalance } from '../../db/Models/bank/bank-account-balance';
|
|
|
6
6
|
import { BankAccountProperty } from './bank-account-property';
|
|
7
7
|
import { BankConnection } from './bank-connection';
|
|
8
8
|
import { SoleBusinessAllocation } from '../sole';
|
|
9
|
+
import { Bank } from './bank';
|
|
9
10
|
export declare class BankAccount extends BankAccountBase {
|
|
10
11
|
bankAccountProperties: BankAccountProperty[];
|
|
11
12
|
businessAllocations: SoleBusinessAllocation[];
|
|
@@ -13,6 +14,7 @@ export declare class BankAccount extends BankAccountBase {
|
|
|
13
14
|
loan: Loan;
|
|
14
15
|
bankConnection: BankConnection;
|
|
15
16
|
type: BankAccountTypeEnum;
|
|
17
|
+
get bank(): Bank;
|
|
16
18
|
/**
|
|
17
19
|
* Get current opening balance amount
|
|
18
20
|
*/
|
|
@@ -11,17 +11,17 @@ export declare class ChartAccounts extends ChartAccountsBase {
|
|
|
11
11
|
*/
|
|
12
12
|
toString(): string;
|
|
13
13
|
/**
|
|
14
|
-
* Check if chart accounts id is related for '
|
|
14
|
+
* Check if chart accounts id is related for 'Kms travelled for work' category
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
isKmsForWork(): boolean;
|
|
17
17
|
/**
|
|
18
|
-
* Check if chart accounts id is related for '
|
|
18
|
+
* Check if chart accounts id is related for 'Kms travelled for sole' category
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
isKmsForSole(): boolean;
|
|
21
21
|
/**
|
|
22
|
-
* Check if accounts id is related for
|
|
22
|
+
* Check if accounts id is related for KMs category related to passed tank type
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
isKMsByTankType(tankType: TankTypeEnum): boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Check if chart accounts id is related for 'NRAS Tax Offset' category
|
|
27
27
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SoleDetails as SoleDetailsBase } from '../../db/Models/sole/sole-details';
|
|
2
2
|
import { User } from '../user/user';
|
|
3
3
|
export declare class SoleDetails extends SoleDetailsBase {
|
|
4
|
+
static GSTPercentMultiplier: number;
|
|
5
|
+
static GSTPercentDivider: number;
|
|
4
6
|
user: User;
|
|
5
7
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { SoleBusiness } from './sole-business';
|
|
2
2
|
import { BankAccount } from '../bank/bank-account';
|
|
3
3
|
import { SoleInvoiceTemplate as SoleInvoiceTemplateBase } from '../../db/Models/sole/sole-invoice-template';
|
|
4
|
+
import { SoleInvoiceTemplateTaxTypeEnum } from '../../db/Enums/sole-invoice-template-tax-type.enum';
|
|
4
5
|
export declare class SoleInvoiceTemplate extends SoleInvoiceTemplateBase {
|
|
5
6
|
business: SoleBusiness;
|
|
6
7
|
bankAccount: BankAccount;
|
|
7
|
-
|
|
8
|
+
taxType: SoleInvoiceTemplateTaxTypeEnum;
|
|
9
|
+
isNoTax(): boolean;
|
|
10
|
+
isTaxExclusive(): boolean;
|
|
11
|
+
isTaxInclusive(): boolean;
|
|
8
12
|
}
|
|
@@ -4,6 +4,7 @@ import { SoleBusiness } from './sole-business';
|
|
|
4
4
|
import { SoleInvoiceItem } from './sole-invoice-item';
|
|
5
5
|
import { SoleContact } from './sole-contact';
|
|
6
6
|
import { SoleInvoiceTemplate } from './sole-invoice-template';
|
|
7
|
+
import { SoleInvoiceStatusesEnum } from '../../db/Enums/sole-invoice-statuses.enum';
|
|
7
8
|
export declare class SoleInvoice extends SoleInvoiceBase {
|
|
8
9
|
dateFrom: Date;
|
|
9
10
|
dateTo: Date;
|
|
@@ -12,4 +13,15 @@ export declare class SoleInvoice extends SoleInvoiceBase {
|
|
|
12
13
|
items: SoleInvoiceItem[];
|
|
13
14
|
payer: SoleContact;
|
|
14
15
|
template: SoleInvoiceTemplate;
|
|
16
|
+
status: SoleInvoiceStatusesEnum;
|
|
17
|
+
get amount(): number;
|
|
18
|
+
getGSTItems(): SoleInvoiceItem[];
|
|
19
|
+
getGSTItemsAmount(): number;
|
|
20
|
+
get subtotal(): number;
|
|
21
|
+
get GSTAmount(): number;
|
|
22
|
+
get total(): number;
|
|
23
|
+
isDraft(): boolean;
|
|
24
|
+
isCancelled(): boolean;
|
|
25
|
+
isPending(): boolean;
|
|
26
|
+
isPaid(): boolean;
|
|
15
27
|
}
|
|
@@ -38,9 +38,9 @@ export declare class Transaction extends TransactionBase implements Expense, IRe
|
|
|
38
38
|
isPersonal(): boolean;
|
|
39
39
|
get chartAccountsCategories(): ChartAccountsCategoryEnum[];
|
|
40
40
|
/**
|
|
41
|
-
* Check if transaction has '
|
|
41
|
+
* Check if transaction has 'Kms travelled for work' chart accounts category
|
|
42
42
|
*/
|
|
43
|
-
get
|
|
43
|
+
get isKmsChartAccountsCategory(): boolean;
|
|
44
44
|
/**
|
|
45
45
|
* Get transaction date
|
|
46
46
|
*/
|
|
@@ -3,6 +3,7 @@ import { VehicleClaim } from './vehicle-claim';
|
|
|
3
3
|
/**
|
|
4
4
|
* Class contains traveled kilometers and work usage percent in 12 weeks date range
|
|
5
5
|
* @TODO Vik: Best period: move this and related logic to backend
|
|
6
|
+
* @TODO Alex: check if we need this class when calculation refactored with backend
|
|
6
7
|
*/
|
|
7
8
|
export declare class LogbookPeriod {
|
|
8
9
|
from: Date;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { VehicleClaimDetails as VehicleClaimDetailsBase } from '../../db/Models/vehicle/vehicle-claim-details';
|
|
2
2
|
import { User } from '../user/user';
|
|
3
|
+
import { VehicleClaimDetailsMethodEnum } from '../../db/Enums/vehicle-claim-details-method.enum';
|
|
3
4
|
export declare class VehicleClaimDetails extends VehicleClaimDetailsBase {
|
|
5
|
+
/**
|
|
6
|
+
* Init default values for the new instances
|
|
7
|
+
*/
|
|
8
|
+
isManual: boolean;
|
|
9
|
+
method: VehicleClaimDetailsMethodEnum;
|
|
10
|
+
financialYear: number;
|
|
4
11
|
user: User;
|
|
5
12
|
isLogbookMethod(): boolean;
|
|
6
|
-
|
|
7
|
-
static create(): VehicleClaimDetails;
|
|
13
|
+
isKmsMethod(): boolean;
|
|
8
14
|
}
|
|
@@ -14,18 +14,20 @@ export declare class VehicleClaim extends VehicleClaimBase {
|
|
|
14
14
|
static totalWorkUsagePercent: number;
|
|
15
15
|
details: VehicleClaimDetails;
|
|
16
16
|
business: SoleBusiness;
|
|
17
|
+
kilometers: number;
|
|
18
|
+
workUsage: number;
|
|
17
19
|
isWorkTank(): boolean;
|
|
18
20
|
isSoleTank(): boolean;
|
|
19
21
|
get tankType(): TankTypeEnum;
|
|
20
22
|
/**
|
|
21
|
-
* Claim amount for
|
|
23
|
+
* Claim amount for KMs method. Exists only for KMs method.
|
|
22
24
|
*/
|
|
23
|
-
|
|
25
|
+
getKMSClaimAmount(vehicleClaimRate: number): number;
|
|
24
26
|
/**
|
|
25
27
|
* Get logbook claim amount. Exists only for logbook method.
|
|
26
28
|
* ClaimAmount = WorkUsage * transaction/depreciation amount
|
|
27
29
|
*/
|
|
28
30
|
getLogbookClaimAmount(transactions: TransactionCollection): number;
|
|
29
|
-
|
|
30
|
-
static
|
|
31
|
+
getAverageWeeklyKMS(): number;
|
|
32
|
+
static getKMSChartAccountsIdByTankType(tankType: TankTypeEnum): number;
|
|
31
33
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { VehicleLogbook as VehicleLogbookBase } from '../../db/Models/vehicle/vehicle-logbook';
|
|
2
2
|
import { SoleBusiness } from '../sole';
|
|
3
3
|
import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
|
|
4
|
+
import { DateRange } from 'moment-range';
|
|
4
5
|
export declare class VehicleLogbook extends VehicleLogbookBase {
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The logbook period is a minimum continuous period of 12 weeks." © Nicole Kelly
|
|
7
|
+
* Logbook period duration in weeks.
|
|
8
|
+
* https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/211517441/Logbook+Vehicle
|
|
9
9
|
*/
|
|
10
|
-
static
|
|
10
|
+
static bestPeriodWeeks: number;
|
|
11
11
|
date: Date;
|
|
12
12
|
business: SoleBusiness;
|
|
13
13
|
get kilometers(): number;
|
|
14
14
|
get tankType(): TankTypeEnum;
|
|
15
15
|
isWorkTank(): boolean;
|
|
16
16
|
isSoleTank(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Get logbook period date range from logbook date and weeksInPeriod duration
|
|
19
|
+
*/
|
|
20
|
+
getPeriod(): DateRange;
|
|
17
21
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Service to work with Rewardful (affiliate program) API
|
|
5
|
+
* https://developers.rewardful.com/javascript-api/overview#executing-code-when-rewardful-loads
|
|
6
|
+
*/
|
|
7
|
+
export declare class RewardfulService {
|
|
8
|
+
private environment;
|
|
9
|
+
constructor(environment: any);
|
|
10
|
+
getReferralCode(): Observable<string>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RewardfulService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RewardfulService>;
|
|
13
|
+
}
|
|
@@ -3,4 +3,5 @@ export * from './sole-business-activity/sole-business-activity.service';
|
|
|
3
3
|
export * from './sole-contact/sole-contact.service';
|
|
4
4
|
export * from './sole-depreciation-method/sole-depreciation-method.service';
|
|
5
5
|
export * from './sole-details/sole-details.service';
|
|
6
|
+
export * from './sole-invoice/sole-invoice.service';
|
|
6
7
|
export * from './sole-invoice-template/sole-invoice-template.service';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RestService } from '../../rest/rest.service';
|
|
2
|
+
import { SoleInvoice as SoleInvoiceBase } from '../../../../db/Models/sole/sole-invoice';
|
|
3
|
+
import { SoleInvoice } from '../../../../models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SoleInvoiceService extends RestService<SoleInvoiceBase, SoleInvoice> {
|
|
6
|
+
modelClass: typeof SoleInvoice;
|
|
7
|
+
url: string;
|
|
8
|
+
isHydra: boolean;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SoleInvoiceService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SoleInvoiceService>;
|
|
11
|
+
}
|
package/lib/services/index.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -100,6 +100,8 @@ export * from './lib/db/Enums/salary-forecast-frequency.enum';
|
|
|
100
100
|
export * from './lib/db/Enums/service-notification-status.enum';
|
|
101
101
|
export * from './lib/db/Enums/service-notification-type.enum';
|
|
102
102
|
export * from './lib/db/Enums/sole-depreciation-method.enum';
|
|
103
|
+
export * from './lib/db/Enums/sole-invoice-statuses.enum';
|
|
104
|
+
export * from './lib/db/Enums/sole-invoice-template-tax-type.enum';
|
|
103
105
|
export * from './lib/db/Enums/subscription/service-payment-status.enum';
|
|
104
106
|
export * from './lib/db/Enums/subscription/service-price-recurring-interval.enum';
|
|
105
107
|
export * from './lib/db/Enums/subscription/service-price-type.enum';
|