taxtank-core 0.27.5 → 0.28.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.
Files changed (54) hide show
  1. package/bundles/taxtank-core.umd.js +332 -55
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/income-source.collection.js +4 -1
  4. package/esm2015/lib/db/Enums/sole-invoice-statuses.enum.js +8 -0
  5. package/esm2015/lib/db/Enums/sole-invoice-template-tax-type.enum.js +7 -0
  6. package/esm2015/lib/db/Models/chart-accounts/chart-accounts.js +1 -1
  7. package/esm2015/lib/db/Models/sole/sole-business.js +1 -1
  8. package/esm2015/lib/db/Models/sole/sole-invoice-template.js +1 -1
  9. package/esm2015/lib/db/Models/sole/sole-invoice.js +1 -1
  10. package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +6 -10
  11. package/esm2015/lib/forms/sole/index.js +3 -1
  12. package/esm2015/lib/forms/sole/sole-business.form.js +24 -3
  13. package/esm2015/lib/forms/sole/sole-invoice-item.form.js +43 -0
  14. package/esm2015/lib/forms/sole/sole-invoice-template.form.js +5 -3
  15. package/esm2015/lib/forms/sole/sole-invoice.form.js +51 -0
  16. package/esm2015/lib/models/endpoint/endpoints.const.js +5 -1
  17. package/esm2015/lib/models/event/app-event-type.enum.js +21 -20
  18. package/esm2015/lib/models/sole/sole-business.js +5 -1
  19. package/esm2015/lib/models/sole/sole-details.js +3 -1
  20. package/esm2015/lib/models/sole/sole-invoice-item.js +8 -1
  21. package/esm2015/lib/models/sole/sole-invoice-template.js +12 -2
  22. package/esm2015/lib/models/sole/sole-invoice.js +55 -2
  23. package/esm2015/lib/services/http/income-source/income-source.service.js +12 -1
  24. package/esm2015/lib/services/http/sole/index.js +2 -1
  25. package/esm2015/lib/services/http/sole/sole-business/sole-business.service.js +10 -1
  26. package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +21 -0
  27. package/esm2015/public-api.js +3 -1
  28. package/fesm2015/taxtank-core.js +274 -41
  29. package/fesm2015/taxtank-core.js.map +1 -1
  30. package/lib/collections/income-source.collection.d.ts +1 -0
  31. package/lib/db/Enums/sole-invoice-statuses.enum.d.ts +6 -0
  32. package/lib/db/Enums/sole-invoice-template-tax-type.enum.d.ts +5 -0
  33. package/lib/db/Models/chart-accounts/chart-accounts.d.ts +1 -0
  34. package/lib/db/Models/sole/sole-business.d.ts +2 -0
  35. package/lib/db/Models/sole/sole-invoice-template.d.ts +2 -1
  36. package/lib/db/Models/sole/sole-invoice.d.ts +2 -1
  37. package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +1 -3
  38. package/lib/forms/sole/index.d.ts +2 -0
  39. package/lib/forms/sole/sole-business.form.d.ts +2 -0
  40. package/lib/forms/sole/sole-invoice-item.form.d.ts +10 -0
  41. package/lib/forms/sole/sole-invoice-template.form.d.ts +3 -2
  42. package/lib/forms/sole/sole-invoice.form.d.ts +14 -0
  43. package/lib/models/event/app-event-type.enum.d.ts +20 -19
  44. package/lib/models/sole/sole-business.d.ts +2 -0
  45. package/lib/models/sole/sole-details.d.ts +2 -0
  46. package/lib/models/sole/sole-invoice-item.d.ts +2 -0
  47. package/lib/models/sole/sole-invoice-template.d.ts +5 -1
  48. package/lib/models/sole/sole-invoice.d.ts +12 -0
  49. package/lib/services/http/income-source/income-source.service.d.ts +7 -1
  50. package/lib/services/http/sole/index.d.ts +1 -0
  51. package/lib/services/http/sole/sole-business/sole-business.service.d.ts +2 -0
  52. package/lib/services/http/sole/sole-invoice/sole-invoice.service.d.ts +11 -0
  53. package/package.json +1 -1
  54. package/public-api.d.ts +2 -0
@@ -14,6 +14,7 @@ export declare class IncomeSourceCollection extends Collection<IncomeSource> {
14
14
  */
15
15
  filterByTypes(types: IncomeSourceTypeEnum[]): IncomeSource[];
16
16
  getSalary(): IncomeSource[];
17
+ getOther(): IncomeSource[];
17
18
  /**
18
19
  * Get income sources list of forecasts
19
20
  */
@@ -0,0 +1,6 @@
1
+ export declare enum SoleInvoiceStatusesEnum {
2
+ CANCELED = 0,
3
+ DRAFT = 1,
4
+ PENDING = 2,
5
+ PAID = 3
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum SoleInvoiceTemplateTaxTypeEnum {
2
+ EXCLUSIVE = 0,
3
+ INCLUSIVE = 1,
4
+ NONE = 2
5
+ }
@@ -21,4 +21,5 @@ export declare class ChartAccounts extends AbstractModel {
21
21
  values?: ChartAccountsValue[];
22
22
  metadata?: ChartAccountsMetadata[];
23
23
  depreciations?: ChartAccountsDepreciation[];
24
+ isGST?: boolean;
24
25
  }
@@ -9,6 +9,7 @@ import { Depreciation } from '../depreciation/depreciation';
9
9
  import { AbstractModel } from '../abstract-model';
10
10
  import { VehicleLogbook } from '../vehicle/vehicle-logbook';
11
11
  import { SoleBusinessActivity } from './sole-business-activity';
12
+ import { IncomeSource } from '../incomeSource/income-source';
12
13
  export declare class SoleBusiness extends AbstractModel {
13
14
  name?: string;
14
15
  description?: string;
@@ -22,6 +23,7 @@ export declare class SoleBusiness extends AbstractModel {
22
23
  losses?: SoleBusinessLoss[];
23
24
  invoices?: SoleInvoice[];
24
25
  invoiceTemplates?: SoleInvoiceTemplate[];
26
+ incomeSource?: IncomeSource;
25
27
  vehicleClaims?: VehicleClaim[];
26
28
  vehicleLogbooks?: VehicleLogbook[];
27
29
  transactions?: Transaction[];
@@ -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
- isTaxIncluded?: boolean;
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?: number;
13
+ status?: SoleInvoiceStatusesEnum;
13
14
  user?: User;
14
15
  business?: SoleBusiness;
15
16
  items?: SoleInvoiceItem[];
@@ -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 implements IEventListener {
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
  */
@@ -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';
@@ -1,5 +1,7 @@
1
1
  import { AbstractForm } from '../abstract.form';
2
2
  import { SoleBusiness } from '../../models';
3
+ import { FormGroup } from '@angular/forms';
3
4
  export declare class SoleBusinessForm extends AbstractForm<SoleBusiness> {
4
5
  constructor(business?: SoleBusiness);
6
+ get forecastFormGroup(): FormGroup;
5
7
  }
@@ -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
- constructor(invoiceTemplate: SoleInvoiceTemplate);
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
+ }
@@ -40,23 +40,24 @@ export declare enum AppEventTypeEnum {
40
40
  PROPERTY_SUBSCRIPTION_DELETED = 38,
41
41
  PROPERTY_VALUATION_DOCUMENT_CREATED = 39,
42
42
  SERVICE_SUBSCRIPTION_UPDATED = 40,
43
- SOLE_DEPRECIATION_METHOD_UPDATED = 41,
44
- TAX_REVIEW_UPDATED = 42,
45
- TRANSACTION_CREATED = 43,
46
- TRANSACTION_DELETED = 44,
47
- TRANSACTION_UPDATED = 45,
48
- TRANSACTION_UPDATED_WITH_RECEIPT = 46,
49
- TRANSACTION_UPDATED_WITH_DELETED_RECEIPT = 47,
50
- TRANSACTION_RECEIPT_CREATED = 48,
51
- TRANSACTION_RECEIPT_DELETED = 49,
52
- TRANSACTIONS_CREATED = 50,
53
- USER_UPDATED = 51,
54
- VEHICLE_CLAIM_UPDATED = 52,
55
- VEHICLE_CLAIM_CREATED = 53,
56
- VEHICLE_CLAIM_DETAILS_UPDATED = 54,
57
- VEHICLE_CLAIM_DETAILS_CREATED = 55,
58
- VEHICLE_LOGBOOK_CREATED = 56,
59
- VEHICLE_LOGBOOK_UPDATED = 57,
60
- VEHICLE_LOGBOOK_DELETED = 58,
61
- VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED = 59
43
+ SOLE_BUSINESS_CREATED = 41,
44
+ SOLE_DEPRECIATION_METHOD_UPDATED = 42,
45
+ TAX_REVIEW_UPDATED = 43,
46
+ TRANSACTION_CREATED = 44,
47
+ TRANSACTION_DELETED = 45,
48
+ TRANSACTION_UPDATED = 46,
49
+ TRANSACTION_UPDATED_WITH_RECEIPT = 47,
50
+ TRANSACTION_UPDATED_WITH_DELETED_RECEIPT = 48,
51
+ TRANSACTION_RECEIPT_CREATED = 49,
52
+ TRANSACTION_RECEIPT_DELETED = 50,
53
+ TRANSACTIONS_CREATED = 51,
54
+ USER_UPDATED = 52,
55
+ VEHICLE_CLAIM_UPDATED = 53,
56
+ VEHICLE_CLAIM_CREATED = 54,
57
+ VEHICLE_CLAIM_DETAILS_UPDATED = 55,
58
+ VEHICLE_CLAIM_DETAILS_CREATED = 56,
59
+ VEHICLE_LOGBOOK_CREATED = 57,
60
+ VEHICLE_LOGBOOK_UPDATED = 58,
61
+ VEHICLE_LOGBOOK_DELETED = 59,
62
+ VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED = 60
62
63
  }
@@ -9,6 +9,7 @@ import { Depreciation } from '../depreciation/depreciation';
9
9
  import { Transaction } from '../transaction/transaction';
10
10
  import { Photoable } from '../../interfaces/photoable';
11
11
  import { SoleBusinessActivity } from '../../db/Models/sole/sole-business-activity';
12
+ import { IncomeSource } from '../income-source/income-source';
12
13
  export declare class SoleBusiness extends SoleBusinessBase implements Photoable {
13
14
  /**
14
15
  * Maximum number of businesses that a person can have, according to the ATO
@@ -23,6 +24,7 @@ export declare class SoleBusiness extends SoleBusinessBase implements Photoable
23
24
  transactions: Transaction[];
24
25
  depreciations: Depreciation[];
25
26
  activity: SoleBusinessActivity;
27
+ incomeSource: IncomeSource;
26
28
  getPhotoPlaceholder(): string;
27
29
  getPhoto(): string;
28
30
  }
@@ -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
  }
@@ -4,4 +4,6 @@ import { ChartAccounts } from '../chart-accounts/chart-accounts';
4
4
  export declare class SoleInvoiceItem extends SoleInvoiceItemBase {
5
5
  invoice: SoleInvoice;
6
6
  chartAccounts: ChartAccounts;
7
+ isGST: boolean;
8
+ get amount(): number;
7
9
  }
@@ -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
- isTaxIncluded: boolean;
6
6
  business: SoleBusiness;
7
7
  bankAccount: BankAccount;
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
  }
@@ -5,15 +5,17 @@ import { IncomeSourceType } from '../../../models/income-source/income-source-ty
5
5
  import { SalaryForecast } from '../../../models/income-source/salary-forecast';
6
6
  import { IncomeSourceTypeEnum } from '../../../db/Enums/income-source-type.enum';
7
7
  import { IncomeSource } from '../../../models/income-source/income-source';
8
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * Service to work with income sources
11
12
  */
12
- export declare class IncomeSourceService extends RestService<IncomeSourceBase, IncomeSource> {
13
+ export declare class IncomeSourceService extends RestService<IncomeSourceBase, IncomeSource> implements IEventListener {
13
14
  url: string;
14
15
  modelClass: typeof IncomeSource;
15
16
  incomeSourceTypes: IncomeSourceType[];
16
17
  incomeSourceTypeSubject: ReplaySubject<IncomeSourceType[]>;
18
+ listenEvents(): void;
17
19
  /**
18
20
  * Get income sources tax calculation
19
21
  * @param salaryForecast for which tax should be calculated
@@ -37,6 +39,10 @@ export declare class IncomeSourceService extends RestService<IncomeSourceBase, I
37
39
  * Get other incomes types
38
40
  */
39
41
  getIncomeSourceTypes(): Observable<IncomeSourceType[]>;
42
+ /**
43
+ * Sole businesses create together with income source
44
+ */
45
+ private listenSoleBusinessCreated;
40
46
  static ɵfac: i0.ɵɵFactoryDeclaration<IncomeSourceService, never>;
41
47
  static ɵprov: i0.ɵɵInjectableDeclaration<IncomeSourceService>;
42
48
  }
@@ -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';
@@ -1,11 +1,13 @@
1
1
  import { RestService } from '../../rest/rest.service';
2
2
  import { SoleBusiness as SoleBusinessBase } from '../../../../db/Models/sole/sole-business';
3
3
  import { SoleBusiness } from '../../../../models';
4
+ import { Observable } from 'rxjs';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class SoleBusinessService extends RestService<SoleBusinessBase, SoleBusiness> {
6
7
  modelClass: typeof SoleBusiness;
7
8
  url: string;
8
9
  isHydra: boolean;
10
+ add(soleBusiness: SoleBusiness): Observable<SoleBusiness>;
9
11
  static ɵfac: i0.ɵɵFactoryDeclaration<SoleBusinessService, never>;
10
12
  static ɵprov: i0.ɵɵInjectableDeclaration<SoleBusinessService>;
11
13
  }
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.27.5",
3
+ "version": "0.28.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
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';