taxtank-core 0.21.5 → 0.21.8

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 (51) hide show
  1. package/bundles/taxtank-core.umd.js +200 -95
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/chart-accounts.collection.js +12 -0
  4. package/esm2015/lib/collections/depreciation.collection.js +3 -3
  5. package/esm2015/lib/db/Models/bank/bank-account.js +1 -1
  6. package/esm2015/lib/db/Models/depreciation/depreciation.js +1 -1
  7. package/esm2015/lib/db/Models/sole/sole-business-allocation.js +4 -0
  8. package/esm2015/lib/db/Models/sole/sole-business-loss.js +4 -0
  9. package/esm2015/lib/db/Models/sole/sole-business.js +4 -0
  10. package/esm2015/lib/db/Models/sole/sole-contact.js +4 -0
  11. package/esm2015/lib/db/Models/sole/sole-forecast.js +1 -1
  12. package/esm2015/lib/db/Models/sole/sole-invoice-item.js +4 -0
  13. package/esm2015/lib/db/Models/sole/sole-invoice-template.js +4 -0
  14. package/esm2015/lib/db/Models/sole/sole-invoice.js +4 -0
  15. package/esm2015/lib/db/Models/transaction/transaction.js +1 -1
  16. package/esm2015/lib/db/Models/vehicle/vehicle-claim.js +1 -1
  17. package/esm2015/lib/db/Models/vehicle/vehicle.js +1 -1
  18. package/esm2015/lib/forms/abstract.form.js +2 -2
  19. package/esm2015/lib/forms/report/my-tax/my-tax-deductions.form.js +3 -2
  20. package/esm2015/lib/models/bank/bank-account.js +14 -4
  21. package/esm2015/lib/models/logbook/vehicle-claim.js +6 -3
  22. package/esm2015/lib/models/report/my-tax/index.js +21 -0
  23. package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +13 -3
  24. package/esm2015/lib/models/report/my-tax/my-tax-estimate/my-tax-estimate.js +40 -0
  25. package/esm2015/lib/models/tax-summary/report-item.js +8 -1
  26. package/esm2015/lib/services/event/sse.service.js +2 -1
  27. package/esm2015/public-api.js +4 -17
  28. package/fesm2015/taxtank-core.js +171 -90
  29. package/fesm2015/taxtank-core.js.map +1 -1
  30. package/lib/collections/chart-accounts.collection.d.ts +8 -0
  31. package/lib/db/Models/bank/bank-account.d.ts +2 -2
  32. package/lib/db/Models/depreciation/depreciation.d.ts +2 -0
  33. package/lib/db/Models/sole/sole-business-allocation.d.ts +9 -0
  34. package/lib/db/Models/sole/sole-business-loss.d.ts +9 -0
  35. package/lib/db/Models/sole/sole-business.d.ts +26 -0
  36. package/lib/db/Models/sole/sole-contact.d.ts +17 -0
  37. package/lib/db/Models/sole/sole-invoice-item.d.ts +12 -0
  38. package/lib/db/Models/sole/sole-invoice-template.d.ts +10 -0
  39. package/lib/db/Models/sole/sole-invoice.d.ts +18 -0
  40. package/lib/db/Models/transaction/transaction.d.ts +2 -0
  41. package/lib/db/Models/vehicle/vehicle-claim.d.ts +2 -2
  42. package/lib/db/Models/vehicle/vehicle.d.ts +0 -2
  43. package/lib/models/bank/bank-account.d.ts +2 -0
  44. package/lib/models/logbook/vehicle-claim.d.ts +1 -0
  45. package/lib/models/report/my-tax/index.d.ts +20 -0
  46. package/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.d.ts +1 -0
  47. package/lib/models/report/my-tax/my-tax-estimate/my-tax-estimate.d.ts +20 -0
  48. package/lib/models/tax-summary/report-item.d.ts +8 -1
  49. package/lib/services/event/sse.service.d.ts +1 -0
  50. package/package.json +1 -1
  51. package/public-api.d.ts +3 -16
@@ -0,0 +1,8 @@
1
+ import { Collection } from './collection';
2
+ import { ChartAccounts } from '../models/chart-accounts/chart-accounts';
3
+ export declare class ChartAccountsCollection extends Collection<ChartAccounts> {
4
+ /**
5
+ * Get 'Klms travelled for work' related chart account value
6
+ */
7
+ getVehicleKlmsRate(year?: number): number;
8
+ }
@@ -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
  }
@@ -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
  */
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 'My Tax' report related data (classes, enums, const, e.t.c)
3
+ */
4
+ export * from './my-tax-business-or-losses/my-tax-business-or-losses';
5
+ export * from './my-tax-deductions/my-tax-deductions';
6
+ export * from './my-tax-deductions/deduction-fields.const';
7
+ export * from './my-tax-deductions/deduction-self-education-type.enum';
8
+ export * from './my-tax-deductions/deduction-clothing-type.enum';
9
+ export * from './my-tax-dividends/my-tax-dividends';
10
+ export * from './my-tax-employee-share-schemes/my-tax-employee-share-schemes';
11
+ export * from './my-tax-estimate/my-tax-estimate';
12
+ export * from './my-tax-income-statements/my-tax-income-statements';
13
+ export * from './my-tax-income-tests/my-tax-income-tests';
14
+ export * from './my-tax-interest/my-tax-interest';
15
+ export * from './my-tax-losses/my-tax-losses';
16
+ export * from './my-tax-offsets/my-tax-offsets';
17
+ export * from './my-tax-other-income/my-tax-other-income';
18
+ export * from './my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts';
19
+ export * from './my-tax-rent/my-tax-rent';
20
+ export * from './ato-links';
@@ -31,6 +31,7 @@ export declare class MyTaxDeductions {
31
31
  forestryManagedInvestmentSchemesDeductionsTotalAmount: number;
32
32
  otherDeductionsTotalAmount: number;
33
33
  constructor(transactions: TransactionCollection, depreciations: DepreciationCollection, vehicleClaim: VehicleClaim, vehicleClaimRate: number);
34
+ private getVehicleExpensesTotalAmount;
34
35
  private setVehicleClaimData;
35
36
  /**
36
37
  * Total amount from Other work related expenses and Tools & equipment depreciations
@@ -0,0 +1,20 @@
1
+ import { ReportItem } from '../../../tax-summary/report-item';
2
+ import { TaxSummary } from '../../../tax-summary/tax-summary';
3
+ /**
4
+ * @Todo add link to documentation about related fields, add comments to methods
5
+ */
6
+ export declare class MyTaxEstimate {
7
+ taxableIncome: number;
8
+ taxPayable: number;
9
+ grossTaxPayable: number;
10
+ medicareLevy: number;
11
+ medicareLevySurcharge: number;
12
+ taxCredits: number;
13
+ lowMiddleIncomeTaxOffsets: number;
14
+ percentageOfTaxPaid: number;
15
+ taxOffsets: number;
16
+ netRefund: number;
17
+ static fromTaxSummary(taxSummary: TaxSummary): MyTaxEstimate;
18
+ static getLowMiddleIncomeTaxOffsets(taxOffsetsReportItem: ReportItem): number;
19
+ static getTaxOffsets(taxOffsetsReportItemAmount: number, lowMiddleIncomeTaxOffsets: number): number;
20
+ }
@@ -2,16 +2,23 @@ import { TaxReturnCategory } from '../../db/Models/tax-return/tax-return-categor
2
2
  import { ReportItemDetails } from './report-item-details';
3
3
  import { ReportItemCollection } from '../../collections/tax-summary/report-item.collection';
4
4
  import { AbstractModel } from '../../db/Models/abstract-model';
5
+ import { Collection } from '../../collections/collection';
5
6
  /**
7
+ * @Todo no base model - should be generated on backend side
6
8
  * Used in tax summary reports to show amounts relating to a tax return category entity and details of what this
7
9
  * amount is comprised of. Example here shows an amount of $951.96 and also details of what this amount is comprised of:
8
10
  */
9
11
  export declare class ReportItem extends AbstractModel {
10
12
  amount: number;
11
- details: ReportItemDetails[];
12
13
  taxReturnCategory: TaxReturnCategory;
13
14
  title: string;
14
15
  items: ReportItemCollection;
16
+ /**
17
+ * @Todo Alex: We need to apply this everywhere - transform an array into a collection,
18
+ * but at the moment we can't do this due to inheritance from the base model.
19
+ * Potential solution: Inherit Collection from Array
20
+ */
21
+ details: Collection<ReportItemDetails>;
15
22
  /**
16
23
  * Get amount for one income source
17
24
  * @param name Name of income source for filter
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.21.5",
3
+ "version": "0.21.8",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './lib/collections/collection';
9
9
  export * from './lib/collections/account-setup-item.collection';
10
10
  export * from './lib/collections/bank-account.collection';
11
11
  export * from './lib/collections/bank-transaction.collection';
12
+ export * from './lib/collections/chart-accounts.collection';
12
13
  export * from './lib/collections/client.collection';
13
14
  export * from './lib/collections/client-movement.collection';
14
15
  export * from './lib/collections/client-portfolio-report.collection';
@@ -248,22 +249,7 @@ export * from './lib/models/registration-invite/registration-invite';
248
249
  export * from './lib/models/report/depreciation/depreciation-lvp-report-item';
249
250
  export * from './lib/models/report/depreciation/depreciation-report-item';
250
251
  export * from './lib/models/report/depreciation/depreciation-lvp-asset-type.enum';
251
- export * from './lib/models/report/my-tax/ato-links';
252
- export * from './lib/models/report/my-tax/my-tax-business-or-losses/my-tax-business-or-losses';
253
- export * from './lib/models/report/my-tax/my-tax-deductions/my-tax-deductions';
254
- export * from './lib/models/report/my-tax/my-tax-deductions/deduction-clothing-type.enum';
255
- export * from './lib/models/report/my-tax/my-tax-deductions/deduction-fields.const';
256
- export * from './lib/models/report/my-tax/my-tax-deductions/deduction-self-education-type.enum';
257
- export * from './lib/models/report/my-tax/my-tax-dividends/my-tax-dividends';
258
- export * from './lib/models/report/my-tax/my-tax-employee-share-schemes/my-tax-employee-share-schemes';
259
- export * from './lib/models/report/my-tax/my-tax-income-statements/my-tax-income-statements';
260
- export * from './lib/models/report/my-tax/my-tax-income-tests/my-tax-income-tests';
261
- export * from './lib/models/report/my-tax/my-tax-interest/my-tax-interest';
262
- export * from './lib/models/report/my-tax/my-tax-losses/my-tax-losses';
263
- export * from './lib/models/report/my-tax/my-tax-offsets/my-tax-offsets';
264
- export * from './lib/models/report/my-tax/my-tax-other-income/my-tax-other-income';
265
- export * from './lib/models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts';
266
- export * from './lib/models/report/my-tax/my-tax-rent/my-tax-rent';
252
+ export * from './lib/models/report/my-tax';
267
253
  export * from './lib/models/report/property/property-report-item';
268
254
  export * from './lib/models/report/property/property-report-item-transaction';
269
255
  export * from './lib/models/report/vehicle-expense/vehicle-expense';
@@ -327,6 +313,7 @@ export * from './lib/services/http/chat/message-document/message-document.servic
327
313
  export * from './lib/services/http/firm/client-invite/client-invite.service';
328
314
  export * from './lib/services/http/firm/client-movement/client-movement.service';
329
315
  export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
316
+ export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
330
317
  export * from './lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service';
331
318
  export * from './lib/services/http/depreciation/depreciation.service';
332
319
  export * from './lib/services/http/document/document-folder/document-folder.service';