taxtank-core 0.21.6 → 0.21.9

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 (38) hide show
  1. package/bundles/taxtank-core.umd.js +247 -97
  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/collection.js +7 -1
  5. package/esm2015/lib/db/Enums/income-source-forecast-trust-type.enum.js +15 -0
  6. package/esm2015/lib/db/Enums/income-source-type-list-other.enum.js +3 -2
  7. package/esm2015/lib/db/Models/incomeSource/income-source-forecast.js +1 -1
  8. package/esm2015/lib/forms/abstract.form.js +2 -2
  9. package/esm2015/lib/forms/report/my-tax/my-tax-deductions.form.js +3 -2
  10. package/esm2015/lib/forms/report/my-tax/my-tax-partnerships-and-trusts.form.js +5 -2
  11. package/esm2015/lib/interfaces/income-source-forecast.interface.js +1 -1
  12. package/esm2015/lib/models/income-source/income-source-type.js +3 -3
  13. package/esm2015/lib/models/report/my-tax/index.js +21 -0
  14. package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +13 -3
  15. package/esm2015/lib/models/report/my-tax/my-tax-estimate/my-tax-estimate.js +40 -0
  16. package/esm2015/lib/models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts.js +20 -2
  17. package/esm2015/lib/models/tax-summary/report-item.js +8 -1
  18. package/esm2015/lib/validators/conditional.validator.js +26 -0
  19. package/esm2015/lib/validators/index.js +2 -1
  20. package/esm2015/public-api.js +5 -17
  21. package/fesm2015/taxtank-core.js +226 -93
  22. package/fesm2015/taxtank-core.js.map +1 -1
  23. package/lib/collections/chart-accounts.collection.d.ts +8 -0
  24. package/lib/collections/collection.d.ts +2 -0
  25. package/lib/db/Enums/income-source-forecast-trust-type.enum.d.ts +13 -0
  26. package/lib/db/Enums/income-source-type-list-other.enum.d.ts +3 -2
  27. package/lib/db/Models/incomeSource/income-source-forecast.d.ts +3 -1
  28. package/lib/forms/report/my-tax/my-tax-partnerships-and-trusts.form.d.ts +1 -1
  29. package/lib/interfaces/income-source-forecast.interface.d.ts +2 -0
  30. package/lib/models/report/my-tax/index.d.ts +20 -0
  31. package/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.d.ts +1 -0
  32. package/lib/models/report/my-tax/my-tax-estimate/my-tax-estimate.d.ts +20 -0
  33. package/lib/models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts.d.ts +9 -1
  34. package/lib/models/tax-summary/report-item.d.ts +8 -1
  35. package/lib/validators/conditional.validator.d.ts +2 -0
  36. package/lib/validators/index.d.ts +1 -0
  37. package/package.json +1 -1
  38. package/public-api.d.ts +4 -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
+ }
@@ -34,4 +34,6 @@ export declare class Collection<Model extends AbstractModel> implements Iterable
34
34
  replaceBy(path: string, value: any, item: Model): this;
35
35
  remove(items: Model[]): this;
36
36
  removeBy(path: string, values: any): this;
37
+ minBy(path: string): Model;
38
+ maxBy(path: string): Model;
37
39
  }
@@ -0,0 +1,13 @@
1
+ export declare enum IncomeSourceForecastTrustTypeEnum {
2
+ SPECIAL_DISABILITY_TRUST = 1,
3
+ DECEASED_ESTATE = 2,
4
+ FIXED_TRUST = 3,
5
+ HYBRID_TRUST = 4,
6
+ DISCRETIONARY_SERVICE_TRUST = 5,
7
+ DISCRETIONARY_TRADING_TRUST = 6,
8
+ DISCRETIONARY_INVESTMENT_TRUST = 7,
9
+ CASH_MANAGEMENT_UNIT_TRUST = 8,
10
+ PUBLIC_UNIT_TRUST_LISTED = 9,
11
+ PUBLIC_UNIT_TRUST_UNLISTED = 10,
12
+ TESTAMENTARY_TRUST = 11
13
+ }
@@ -1,6 +1,7 @@
1
1
  export declare enum IncomeSourceTypeListOtherEnum {
2
2
  PSI = 6,
3
3
  SOLE_TRADER = 7,
4
- PARTNERSHIPS_AND_TRUSTS = 9,
5
- OTHER_INCOME = 10
4
+ TRUSTS = 9,
5
+ OTHER_INCOME = 10,
6
+ PARTNERSHIPS = 12
6
7
  }
@@ -1,13 +1,15 @@
1
+ import { IncomeSourceForecastTrustTypeEnum } from '../../Enums/income-source-forecast-trust-type.enum';
1
2
  import { IncomeSource } from './income-source';
2
3
  import { IncomeSourceType } from './income-source-type';
3
4
  import { AbstractModel } from '../abstract-model';
4
5
  export declare class IncomeSourceForecast extends AbstractModel {
5
- id?: number;
6
6
  financialYear?: number;
7
7
  amount?: number;
8
8
  tax?: number;
9
9
  taxInstalments?: number;
10
10
  frankingCredits?: number;
11
+ trustType?: IncomeSourceForecastTrustTypeEnum;
12
+ id?: number;
11
13
  incomeSource?: IncomeSource;
12
14
  incomeSourceType?: IncomeSourceType;
13
15
  }
@@ -1,5 +1,5 @@
1
1
  import { AbstractForm } from '../../abstract.form';
2
- import { MyTaxPartnershipsAndTrusts } from '../../../models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts';
2
+ import { MyTaxPartnershipsAndTrusts } from '../../../models/report/my-tax';
3
3
  export declare class MyTaxPartnershipsAndTrustsForm extends AbstractForm<MyTaxPartnershipsAndTrusts> {
4
4
  constructor(partnershipsAndTrusts: MyTaxPartnershipsAndTrusts);
5
5
  }
@@ -1,4 +1,5 @@
1
1
  import { IncomeSource } from "../models/income-source/income-source";
2
+ import { IncomeSourceForecastTrustTypeEnum } from '../db/Enums/income-source-forecast-trust-type.enum';
2
3
  /**
3
4
  * Interface for income source forecasts
4
5
  */
@@ -7,4 +8,5 @@ export interface IIncomeSourceForecast {
7
8
  financialYear?: number;
8
9
  incomeSource?: IncomeSource;
9
10
  netPay?: number;
11
+ trustType?: IncomeSourceForecastTrustTypeEnum;
10
12
  }
@@ -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
+ }
@@ -1,10 +1,14 @@
1
1
  import { TransactionCollection } from '../../../../collections/transaction/transaction.collection';
2
+ import { IncomeSourceForecastTrustTypeEnum } from '../../../../db/Enums/income-source-forecast-trust-type.enum';
3
+ import { IncomeSourceCollection } from '../../../../collections/income-source.collection';
2
4
  export declare class MyTaxPartnershipsAndTrusts {
3
5
  transactions: TransactionCollection;
6
+ incomeSources: IncomeSourceCollection;
4
7
  partnershipIncomes: TransactionCollection;
5
8
  partnershipExpenses: TransactionCollection;
6
9
  trustsIncomes: TransactionCollection;
7
10
  trustsExpenses: TransactionCollection;
11
+ trustType: IncomeSourceForecastTrustTypeEnum;
8
12
  netNonPrimaryProductionAmount: number;
9
13
  partnershipsNetIncome: number;
10
14
  trustsNetIncome: number;
@@ -13,5 +17,9 @@ export declare class MyTaxPartnershipsAndTrusts {
13
17
  taxPaidTotal: number;
14
18
  frankingCreditsTotal: number;
15
19
  taxOffsetNRASTotalAmount: number;
16
- constructor(transactions: TransactionCollection);
20
+ constructor(transactions: TransactionCollection, incomeSources: IncomeSourceCollection);
21
+ /**
22
+ * Get Income source forecast trust type, related to trust income with max amount
23
+ */
24
+ private getTrustType;
17
25
  }
@@ -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
@@ -0,0 +1,2 @@
1
+ import { AbstractControl, ValidatorFn } from '@angular/forms';
2
+ export declare function conditionalValidator(condition: (control: AbstractControl) => boolean, validator: (control: AbstractControl) => object | null): ValidatorFn;
@@ -1,4 +1,5 @@
1
1
  export * from './at-least-one.validator';
2
2
  export * from './autocomplete.validator';
3
+ export * from './conditional.validator';
3
4
  export * from './password.validator';
4
5
  export * from './password-match.validator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.21.6",
3
+ "version": "0.21.9",
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';
@@ -73,6 +74,7 @@ export * from './lib/db/Enums/depreciation-calculation-percent.enum';
73
74
  export * from './lib/db/Enums/depreciation-type.enum';
74
75
  export * from './lib/db/Enums/depreciation-write-off-amount.enum';
75
76
  export * from './lib/db/Enums/firm-type.enum';
77
+ export * from './lib/db/Enums/income-source-forecast-trust-type.enum';
76
78
  export * from './lib/db/Enums/income-source-type.enum';
77
79
  export * from './lib/db/Enums/income-source-type-list-other.enum';
78
80
  export * from './lib/db/Enums/income-source-type-list-sole.enum';
@@ -248,22 +250,7 @@ export * from './lib/models/registration-invite/registration-invite';
248
250
  export * from './lib/models/report/depreciation/depreciation-lvp-report-item';
249
251
  export * from './lib/models/report/depreciation/depreciation-report-item';
250
252
  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';
253
+ export * from './lib/models/report/my-tax';
267
254
  export * from './lib/models/report/property/property-report-item';
268
255
  export * from './lib/models/report/property/property-report-item-transaction';
269
256
  export * from './lib/models/report/vehicle-expense/vehicle-expense';
@@ -327,6 +314,7 @@ export * from './lib/services/http/chat/message-document/message-document.servic
327
314
  export * from './lib/services/http/firm/client-invite/client-invite.service';
328
315
  export * from './lib/services/http/firm/client-movement/client-movement.service';
329
316
  export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
317
+ export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
330
318
  export * from './lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service';
331
319
  export * from './lib/services/http/depreciation/depreciation.service';
332
320
  export * from './lib/services/http/document/document-folder/document-folder.service';