taxtank-core 0.21.9 → 0.21.12

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.
Files changed (60) hide show
  1. package/bundles/taxtank-core.umd.js +238 -150
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/db/Enums/chart-accounts-heading-list.enum.js +8 -1
  4. package/esm2015/lib/db/Models/bank/bank-account.js +1 -1
  5. package/esm2015/lib/db/Models/depreciation/depreciation.js +1 -1
  6. package/esm2015/lib/db/Models/sole/sole-business-allocation.js +4 -0
  7. package/esm2015/lib/db/Models/sole/sole-business-loss.js +4 -0
  8. package/esm2015/lib/db/Models/sole/sole-business.js +4 -0
  9. package/esm2015/lib/db/Models/sole/sole-contact.js +4 -0
  10. package/esm2015/lib/db/Models/sole/sole-forecast.js +1 -1
  11. package/esm2015/lib/db/Models/sole/sole-invoice-item.js +4 -0
  12. package/esm2015/lib/db/Models/sole/sole-invoice-template.js +4 -0
  13. package/esm2015/lib/db/Models/sole/sole-invoice.js +4 -0
  14. package/esm2015/lib/db/Models/transaction/transaction.js +1 -1
  15. package/esm2015/lib/db/Models/vehicle/vehicle-claim.js +1 -1
  16. package/esm2015/lib/db/Models/vehicle/vehicle.js +1 -1
  17. package/esm2015/lib/forms/abstract.form.js +6 -1
  18. package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +9 -42
  19. package/esm2015/lib/forms/bank/bank-account/bank-account-allocation.form.js +31 -0
  20. package/esm2015/lib/forms/bank/bank-account/bank-account-import.form.js +4 -30
  21. package/esm2015/lib/forms/bank/bank-account/bank-account-properties.form.js +28 -7
  22. package/esm2015/lib/forms/index.js +2 -1
  23. package/esm2015/lib/forms/report/my-tax/my-tax-deductions.form.js +9 -3
  24. package/esm2015/lib/models/bank/bank-account.js +14 -4
  25. package/esm2015/lib/models/logbook/vehicle-claim.js +6 -3
  26. package/esm2015/lib/models/report/my-tax/my-tax-deductions/deduction-fields.const.js +10 -4
  27. package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +15 -15
  28. package/esm2015/lib/models/report/my-tax/my-tax-estimate/my-tax-estimate.js +3 -3
  29. package/esm2015/lib/models/report/my-tax/my-tax-interest/my-tax-interest.js +2 -2
  30. package/esm2015/lib/models/report/my-tax/my-tax-rent/my-tax-rent.js +33 -9
  31. package/esm2015/lib/services/event/sse.service.js +2 -1
  32. package/esm2015/lib/validators/fields-sum.validator.js +26 -0
  33. package/fesm2015/taxtank-core.js +221 -145
  34. package/fesm2015/taxtank-core.js.map +1 -1
  35. package/lib/db/Enums/chart-accounts-heading-list.enum.d.ts +7 -0
  36. package/lib/db/Models/bank/bank-account.d.ts +2 -2
  37. package/lib/db/Models/depreciation/depreciation.d.ts +2 -0
  38. package/lib/db/Models/sole/sole-business-allocation.d.ts +9 -0
  39. package/lib/db/Models/sole/sole-business-loss.d.ts +9 -0
  40. package/lib/db/Models/sole/sole-business.d.ts +26 -0
  41. package/lib/db/Models/sole/sole-contact.d.ts +17 -0
  42. package/lib/db/Models/sole/sole-invoice-item.d.ts +12 -0
  43. package/lib/db/Models/sole/sole-invoice-template.d.ts +10 -0
  44. package/lib/db/Models/sole/sole-invoice.d.ts +18 -0
  45. package/lib/db/Models/transaction/transaction.d.ts +2 -0
  46. package/lib/db/Models/vehicle/vehicle-claim.d.ts +2 -2
  47. package/lib/db/Models/vehicle/vehicle.d.ts +0 -2
  48. package/lib/forms/abstract.form.d.ts +4 -0
  49. package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +2 -6
  50. package/lib/forms/bank/bank-account/bank-account-allocation.form.d.ts +7 -0
  51. package/lib/forms/bank/bank-account/bank-account-import.form.d.ts +2 -8
  52. package/lib/forms/bank/bank-account/bank-account-properties.form.d.ts +1 -0
  53. package/lib/forms/index.d.ts +1 -0
  54. package/lib/forms/report/my-tax/my-tax-deductions.form.d.ts +1 -1
  55. package/lib/models/bank/bank-account.d.ts +2 -0
  56. package/lib/models/logbook/vehicle-claim.d.ts +1 -0
  57. package/lib/models/report/my-tax/my-tax-rent/my-tax-rent.d.ts +11 -1
  58. package/lib/services/event/sse.service.d.ts +1 -0
  59. package/lib/validators/fields-sum.validator.d.ts +8 -0
  60. package/package.json +1 -1
@@ -12,6 +12,13 @@ export declare enum ChartAccountsHeadingListEnum {
12
12
  HOME_OFFICE_RUNNING = 17,
13
13
  TOOLS_EQUIPMENT = 18,
14
14
  HOME_OFFICE_OCCUPANCY = 19,
15
+ AWARD_OVERTIME_MEAL_ALLOWANCE_EXPENSE = 20,
16
+ NEWSPAPER = 21,
17
+ PRINTING_POSTAGE_STATIONERY = 22,
18
+ SEMINARS_ETC = 23,
19
+ TELEPHONE = 24,
20
+ UNION_FEES = 25,
21
+ OTHER = 26,
15
22
  DONATIONS = 27,
16
23
  PSI = 30,
17
24
  BONUSES = 34,
@@ -1,12 +1,12 @@
1
1
  import { BankAccountStatusEnum } from '../../Enums/bank-account-status.enum';
2
2
  import { BankAccountTypeEnum } from '../../Enums/bank-account-type.enum';
3
- import { TankTypeEnum } from '../../Enums/tank-type.enum';
4
3
  import { BankConnection } from './bank-connection';
5
4
  import { BankAccountProperty } from './bank-account-property';
6
5
  import { BankTransaction } from './bank-transaction';
7
6
  import { BankAccountBalance } from './bank-account-balance';
8
7
  import { Loan } from '../loan/loan';
9
8
  import { AbstractModel } from '../abstract-model';
9
+ import { SoleBusinessAllocation } from '../sole/sole-business-allocation';
10
10
  export declare class BankAccount extends AbstractModel {
11
11
  id?: number;
12
12
  status?: BankAccountStatusEnum;
@@ -15,7 +15,6 @@ export declare class BankAccount extends AbstractModel {
15
15
  accountName?: string;
16
16
  nickname?: string;
17
17
  accountNumber?: string;
18
- tankType?: TankTypeEnum;
19
18
  currentBalance?: number;
20
19
  currency?: string;
21
20
  isManual?: boolean;
@@ -28,6 +27,7 @@ export declare class BankAccount extends AbstractModel {
28
27
  updatedAt?: Date;
29
28
  bankConnection?: BankConnection;
30
29
  bankAccountProperties?: BankAccountProperty[];
30
+ businessAllocations?: SoleBusinessAllocation[];
31
31
  bankTransactions?: BankTransaction[];
32
32
  balances?: BankAccountBalance[];
33
33
  loan?: Loan;
@@ -10,6 +10,7 @@ import { DepreciationReceipt } from './depreciation-receipt';
10
10
  import { DepreciationForecast } from './depreciation-forecast';
11
11
  import { Loan } from '../loan/loan';
12
12
  import { TransactionBase } from '../transaction/transaction-base';
13
+ import { SoleBusiness } from '../sole/sole-business';
13
14
  export declare class Depreciation extends TransactionBase {
14
15
  id?: number;
15
16
  createdAt?: Date;
@@ -39,4 +40,5 @@ export declare class Depreciation extends TransactionBase {
39
40
  loan?: Loan;
40
41
  createdBy?: User;
41
42
  updatedBy?: User;
43
+ business?: SoleBusiness;
42
44
  }
@@ -0,0 +1,9 @@
1
+ import { BankAccount } from '../bank/bank-account';
2
+ import { SoleBusiness } from './sole-business';
3
+ import { AbstractModel } from '../abstract-model';
4
+ export declare class SoleBusinessAllocation extends AbstractModel {
5
+ percent?: number;
6
+ id?: number;
7
+ bankAccount?: BankAccount;
8
+ business?: SoleBusiness;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { SoleBusiness } from './sole-business';
2
+ import { AbstractModel } from '../abstract-model';
3
+ export declare class SoleBusinessLoss extends AbstractModel {
4
+ financialYear?: number;
5
+ amount?: number;
6
+ id?: number;
7
+ deletedAt?: Date;
8
+ business?: SoleBusiness;
9
+ }
@@ -0,0 +1,26 @@
1
+ import { User } from '../user/user';
2
+ import { SoleBusinessAllocation } from './sole-business-allocation';
3
+ import { SoleBusinessLoss } from './sole-business-loss';
4
+ import { SoleInvoice } from './sole-invoice';
5
+ import { SoleInvoiceTemplate } from './sole-invoice-template';
6
+ import { VehicleClaim } from '../vehicle/vehicle-claim';
7
+ import { Transaction } from '../transaction/transaction';
8
+ import { Depreciation } from '../depreciation/depreciation';
9
+ import { AbstractModel } from '../abstract-model';
10
+ export declare class SoleBusiness extends AbstractModel {
11
+ name?: string;
12
+ code?: string;
13
+ description?: string;
14
+ website?: string;
15
+ logo?: string;
16
+ id?: number;
17
+ deletedAt?: Date;
18
+ user?: User;
19
+ allocations?: SoleBusinessAllocation[];
20
+ losses?: SoleBusinessLoss[];
21
+ invoices?: SoleInvoice[];
22
+ invoiceTemplates?: SoleInvoiceTemplate[];
23
+ vehicleClaims?: VehicleClaim[];
24
+ transactions?: Transaction[];
25
+ depreciations?: Depreciation[];
26
+ }
@@ -0,0 +1,17 @@
1
+ import { User } from '../user/user';
2
+ import { Phone } from '../phone';
3
+ import { Address } from '../address';
4
+ import { SoleInvoice } from './sole-invoice';
5
+ import { AbstractModel } from '../abstract-model';
6
+ export declare class SoleContact extends AbstractModel {
7
+ name?: string;
8
+ abn?: number;
9
+ firstName?: string;
10
+ lastName?: string;
11
+ email?: string;
12
+ id?: number;
13
+ user?: User;
14
+ phone?: Phone;
15
+ address?: Address;
16
+ invoices?: SoleInvoice[];
17
+ }
@@ -0,0 +1,12 @@
1
+ import { SoleInvoice } from './sole-invoice';
2
+ import { ChartAccounts } from '../chart-accounts/chart-accounts';
3
+ import { AbstractModel } from '../abstract-model';
4
+ export declare class SoleInvoiceItem extends AbstractModel {
5
+ description?: string;
6
+ quantity?: number;
7
+ price?: number;
8
+ id?: number;
9
+ isGST?: boolean;
10
+ invoice?: SoleInvoice;
11
+ chartAccounts?: ChartAccounts;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { SoleBusiness } from './sole-business';
2
+ import { BankAccount } from '../bank/bank-account';
3
+ import { AbstractModel } from '../abstract-model';
4
+ export declare class SoleInvoiceTemplate extends AbstractModel {
5
+ isTaxIncluded?: boolean;
6
+ term?: number;
7
+ id?: number;
8
+ business?: SoleBusiness;
9
+ bankAccount?: BankAccount;
10
+ }
@@ -0,0 +1,18 @@
1
+ import { User } from '../user/user';
2
+ import { SoleBusiness } from './sole-business';
3
+ import { SoleInvoiceItem } from './sole-invoice-item';
4
+ import { SoleContact } from './sole-contact';
5
+ import { SoleInvoiceTemplate } from './sole-invoice-template';
6
+ import { AbstractModel } from '../abstract-model';
7
+ export declare class SoleInvoice extends AbstractModel {
8
+ number?: string;
9
+ dateFrom?: Date;
10
+ dateTo?: Date;
11
+ id?: number;
12
+ status?: number;
13
+ user?: User;
14
+ business?: SoleBusiness;
15
+ items?: SoleInvoiceItem[];
16
+ payer?: SoleContact;
17
+ template?: SoleInvoiceTemplate;
18
+ }
@@ -11,6 +11,7 @@ import { Loan } from '../loan/loan';
11
11
  import { TransactionBase } from './transaction-base';
12
12
  import { Property } from '../property/property';
13
13
  import { Depreciation } from '../depreciation/depreciation';
14
+ import { SoleBusiness } from '../sole/sole-business';
14
15
  export declare class Transaction extends TransactionBase {
15
16
  id?: number;
16
17
  type?: TransactionTypeEnum;
@@ -40,4 +41,5 @@ export declare class Transaction extends TransactionBase {
40
41
  depreciation?: Depreciation;
41
42
  createdBy?: User;
42
43
  updatedBy?: User;
44
+ business?: SoleBusiness;
43
45
  }
@@ -1,7 +1,7 @@
1
1
  import { VehicleClaimMethodEnum } from '../../Enums/vehicle-claim-method.enum';
2
2
  import { User } from '../user/user';
3
- import { TankTypeEnum } from '../../Enums/tank-type.enum';
4
3
  import { AbstractModel } from '../abstract-model';
4
+ import { SoleBusiness } from '../sole/sole-business';
5
5
  export declare class VehicleClaim extends AbstractModel {
6
6
  financialYear?: number;
7
7
  method?: VehicleClaimMethodEnum;
@@ -10,5 +10,5 @@ export declare class VehicleClaim extends AbstractModel {
10
10
  isManual?: boolean;
11
11
  id?: number;
12
12
  user?: User;
13
- tankType?: TankTypeEnum;
13
+ business?: SoleBusiness;
14
14
  }
@@ -1,11 +1,9 @@
1
1
  import { User } from '../user/user';
2
2
  import { VehicleLogbook } from './vehicle-logbook';
3
- import { TankTypeEnum } from '../../Enums/tank-type.enum';
4
3
  import { AbstractModel } from '../abstract-model';
5
4
  export declare class Vehicle extends AbstractModel {
6
5
  name?: string;
7
6
  id?: number;
8
7
  user?: User;
9
8
  logbook?: VehicleLogbook[];
10
- tankType?: TankTypeEnum;
11
9
  }
@@ -2,6 +2,7 @@ import { AbstractControl, AbstractControlOptions, AsyncValidatorFn, FormGroup, V
2
2
  import { EventEmitter, Type } from '@angular/core';
3
3
  /**
4
4
  * Abstract form class
5
+ * @TODO rename to AbstractFormGroup
5
6
  */
6
7
  export declare abstract class AbstractForm<Model> extends FormGroup {
7
8
  protected modelClass: Type<Model>;
@@ -17,5 +18,8 @@ export declare abstract class AbstractForm<Model> extends FormGroup {
17
18
  * @param data Additional data object which be merged to form value
18
19
  */
19
20
  submit(data?: object): Model;
21
+ addControl(name: string, control: AbstractControl, options?: {
22
+ emitEvent?: boolean;
23
+ }): this;
20
24
  private createModelInstance;
21
25
  }
@@ -1,11 +1,11 @@
1
- import { AbstractForm } from '../../abstract.form';
2
1
  import { BankAccount } from '../../../models/bank/bank-account';
3
2
  import { BankConnection } from '../../../models/bank/bank-connection';
4
3
  import { IEventListener } from '../../../interfaces/event-listener.interface';
4
+ import { BankAccountAllocationForm } from './bank-account-allocation.form';
5
5
  /**
6
6
  * Form is using for single manual bank account creation (not Basiq)
7
7
  */
8
- export declare class BankAccountAddManualForm extends AbstractForm<BankAccount> implements IEventListener {
8
+ export declare class BankAccountAddManualForm extends BankAccountAllocationForm implements IEventListener {
9
9
  private connection;
10
10
  static accountNumberPattern: string;
11
11
  constructor(connection: BankConnection);
@@ -14,10 +14,6 @@ export declare class BankAccountAddManualForm extends AbstractForm<BankAccount>
14
14
  * Add/Remove loan form depends on selected bank account type
15
15
  */
16
16
  private listenTypeChanges;
17
- /**
18
- * Add/Remove bank account properties form depends on selected tank type
19
- */
20
- private listenTankTypeChanges;
21
17
  /**
22
18
  * Attach bank connection to manual bank account
23
19
  */
@@ -0,0 +1,7 @@
1
+ import { AbstractForm } from '../../abstract.form';
2
+ import { BankAccount } from '../../../models/bank/bank-account';
3
+ export declare class BankAccountAllocationForm extends AbstractForm<BankAccount> {
4
+ private bankAccount?;
5
+ constructor(bankAccount?: BankAccount);
6
+ watchTankType(): void;
7
+ }
@@ -1,15 +1,9 @@
1
- import { AbstractForm } from '../../abstract.form';
2
1
  import { BankAccount } from '../../../models/bank/bank-account';
3
- import { IEventListener } from '../../../interfaces/event-listener.interface';
2
+ import { BankAccountAllocationForm } from './bank-account-allocation.form';
4
3
  /**
5
4
  * Form is using for import basiq bank accounts.
6
5
  * Basiq accounts has all data except tank type, properties and loan partially
7
6
  */
8
- export declare class BankAccountImportForm extends AbstractForm<BankAccount> implements IEventListener {
7
+ export declare class BankAccountImportForm extends BankAccountAllocationForm {
9
8
  constructor(bankAccount: BankAccount);
10
- listenEvents(): void;
11
- /**
12
- * Add/Remove bank account properties form depends on selected tank type
13
- */
14
- private listenTankTypeChanges;
15
9
  }
@@ -2,6 +2,7 @@ import { FormArray } from '@angular/forms';
2
2
  import { BankAccountProperty } from '../../../models/bank/bank-account-property';
3
3
  /**
4
4
  * Form array with bank account properties
5
+ * @TODO create AbstractFormArray
5
6
  */
6
7
  export declare class BankAccountPropertiesForm extends FormArray {
7
8
  constructor(bankAccountProperties?: BankAccountProperty[]);
@@ -1,4 +1,5 @@
1
1
  export * from './abstract.form';
2
+ export * from './bank/bank-account/bank-account-allocation.form';
2
3
  export * from './bank/bank-account/bank-account-import.form';
3
4
  export * from './bank/bank-account/bank-account-loan.form';
4
5
  export * from './bank/bank-account/bank-account-add-manual.form';
@@ -1,5 +1,5 @@
1
1
  import { AbstractForm } from '../../abstract.form';
2
- import { MyTaxDeductions } from '../../../models/report/my-tax/my-tax-deductions/my-tax-deductions';
2
+ import { MyTaxDeductions } from '../../../models/report/my-tax';
3
3
  export declare class MyTaxDeductionsForm extends AbstractForm<MyTaxDeductions> {
4
4
  constructor(deductions: MyTaxDeductions);
5
5
  }
@@ -1,6 +1,7 @@
1
1
  import { BankAccount as BankAccountBase } from '../../db/Models/bank/bank-account';
2
2
  import { BankAccountTypeEnum } from '../../db/Enums/bank-account-type.enum';
3
3
  import { Loan } from '../loan/loan';
4
+ import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
4
5
  import { BankAccountBalance } from '../../db/Models/bank/bank-account-balance';
5
6
  import { BankAccountProperty } from './bank-account-property';
6
7
  import { BankConnection } from './bank-connection';
@@ -43,6 +44,7 @@ export declare class BankAccount extends BankAccountBase {
43
44
  * check if bank account related to sole tank
44
45
  */
45
46
  isSoleTank(): boolean;
47
+ get tankType(): TankTypeEnum;
46
48
  /**
47
49
  * Get Bank account property by id
48
50
  * @param id Id of property
@@ -18,6 +18,7 @@ export declare class VehicleClaim extends VehicleClaimBase {
18
18
  isKLMsMethod(): boolean;
19
19
  isWorkTank(): boolean;
20
20
  isSoleTank(): boolean;
21
+ get tankType(): TankTypeEnum;
21
22
  /**
22
23
  * Claim amount for KLMs method. Exists only for KLMs method.
23
24
  */
@@ -1,11 +1,21 @@
1
1
  import { TransactionCollection } from '../../../../collections/transaction/transaction.collection';
2
2
  import { DepreciationCollection } from '../../../../collections/depreciation.collection';
3
+ import { TaxSummary } from '../../../tax-summary/tax-summary';
4
+ import { TaxSummarySection } from '../../../tax-summary/tax-summary-section';
3
5
  export declare class MyTaxRent {
4
6
  propertyExpenses: TransactionCollection;
7
+ taxSummaryPropertySection: TaxSummarySection;
5
8
  grossRentAmount: number;
6
9
  interestDeductionsAmount: number;
7
10
  capitalWorksDeductionsAmount: number;
8
11
  otherRentalDeductionsAmount: number;
9
12
  netRent: number;
10
- constructor(transactions: TransactionCollection, depreciations: DepreciationCollection);
13
+ constructor(transactions: TransactionCollection, depreciations: DepreciationCollection, taxSummary: TaxSummary);
14
+ /**
15
+ * @Todo Vik remove when TT-2009 will be implemented.
16
+ * We use tax summary data here because claim amount from depreciation is different
17
+ * from the claim amount that we get from tax summary (depreciation claim amount is not affected by property share,
18
+ * property contract date, e.t.c.). Details in the TT-2009 task
19
+ */
20
+ private calculateOtherRentalDeductionsAmount;
11
21
  }
@@ -4,6 +4,7 @@ import { JwtService } from '../auth/jwt.service';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
6
  * server sent events service
7
+ * https://symfony.com/doc/current/mercure.html
7
8
  */
8
9
  export declare class SseService {
9
10
  private zone;
@@ -0,0 +1,8 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ /**
3
+ * Validator that check if sum amount of provided fields is greater than provided sum
4
+ * @param field to check in each formArray element
5
+ * @param summary to compare with fields sum
6
+ * @param fieldAlias to show it in error message
7
+ */
8
+ export declare function fieldsSumValidator(field: string, summary?: number, fieldAlias?: string): ValidatorFn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.21.9",
3
+ "version": "0.21.12",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",