taxtank-core 0.28.42 → 0.28.44

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.
@@ -1 +1,2 @@
1
+ export * from './sole-business-losses.collection';
1
2
  export * from './sole-invoice.collection';
@@ -0,0 +1,9 @@
1
+ import { Collection } from '../collection';
2
+ import { SoleBusinessLoss } from '../../models';
3
+ import { TransactionBaseCollection } from '../transaction';
4
+ export declare class SoleBusinessLossesCollection extends Collection<SoleBusinessLoss> {
5
+ /**
6
+ * Calculate business losses applied to the current year
7
+ */
8
+ calculateBusinessLossApplied(transactions: TransactionBaseCollection): number;
9
+ }
@@ -13,12 +13,17 @@ export declare class ReportItemCollection extends Collection<ReportItem> {
13
13
  * Search items which has details
14
14
  */
15
15
  getBySection(section: TaxSummarySectionEnum): ReportItemCollection;
16
+ getByCategory(categoryId: TaxReturnCategoryListEnum): ReportItem[];
16
17
  /**
17
18
  * Recursively find report item by Tax Return Category ID
18
19
  */
19
20
  findByCategory(categoryId: TaxReturnCategoryListEnum): ReportItem;
20
21
  /**
21
- * Get Collection of report items by Tax Return Categories IDs
22
+ * get Collection of report items by Tax Return Categories IDs (one item per category)
23
+ */
24
+ findByCategories(categories: TaxReturnCategoryListEnum[]): ReportItemCollection;
25
+ /**
26
+ * Get Collection of report items by Tax Return Categories IDs (all items per category)
22
27
  */
23
28
  getByCategories(categories: TaxReturnCategoryListEnum[]): ReportItemCollection;
24
29
  /**
@@ -26,6 +31,12 @@ export declare class ReportItemCollection extends Collection<ReportItem> {
26
31
  * Get total amount of report items by Tax Return categories and Tax Summary Section.
27
32
  */
28
33
  sumByCategoriesAndSection(categories: TaxReturnCategoryListEnum[], section: TaxSummarySectionEnum): number;
34
+ /**
35
+ * @TODO vik refactor once Nicole approved
36
+ * unlike sumByCategoriesAndSection, which find just one reportItem per category,
37
+ * this method will search for recursively for all matches
38
+ */
39
+ sumByCategories(categories: TaxReturnCategoryListEnum[]): number;
29
40
  /**
30
41
  * Get collection of all report item details related to passed income source
31
42
  * @TODO Alex: consider to create and move to ReportItemDetailsCollection
@@ -1,6 +1,9 @@
1
1
  import { TransactionBase } from '../../db/Models/transaction/transaction-base';
2
2
  import { Collection } from '../collection';
3
- import { SoleBusiness } from '../../models';
4
3
  export declare class TransactionBaseCollection extends Collection<TransactionBase> {
5
- getClaimAmountByBusiness(business: SoleBusiness): number;
4
+ getClaimAmountByBusinessId(businessId: number): number;
5
+ /**
6
+ * Get business related transactions
7
+ */
8
+ getWithBusiness(): this;
6
9
  }
@@ -57,5 +57,8 @@ export declare enum TaxReturnCategoryListEnum {
57
57
  TAX_OFFSETS_LOW = 61,
58
58
  TAX_OFFSETS_MIDDLE = 62,
59
59
  TAX_OFFSETS_SOLE = 63,
60
- TAX_PAYABLE = 28
60
+ TAX_PAYABLE = 28,
61
+ BUSINESS_INCOME_OR_LOSS = 59,
62
+ DEFERRED_BUSINESS_LOSSES_FROM_PRIOR_YEAR = 64,
63
+ DEFERRED_BUSINESS_LOSSES = 60
61
64
  }
@@ -1,8 +1,5 @@
1
1
  import { AbstractForm } from '../../abstract.form';
2
2
  import { MyTaxLosses } from '../../../models/report/my-tax/my-tax-losses/my-tax-losses';
3
- /**
4
- * @Todo waiting for Sole tank implementation
5
- */
6
3
  export declare class MyTaxLossesForm extends AbstractForm<MyTaxLosses> {
7
4
  constructor(losses: MyTaxLosses);
8
5
  }
@@ -1,8 +1,18 @@
1
- import { TransactionCollection } from '../../../../collections/transaction/transaction.collection';
1
+ import { TransactionBaseCollection, SoleBusinessLossesCollection } from '../../../../collections';
2
2
  /**
3
- * @Todo waiting for Sole tank implementation
3
+ * Sole business losses report
4
+ * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/4644110466/Tax+Return+MyTax+-+Online+Form ("Losses" section)
4
5
  */
5
6
  export declare class MyTaxLosses {
6
- transactions: TransactionCollection;
7
- constructor(transactions: TransactionCollection);
7
+ private transactions;
8
+ private businessLosses;
9
+ /**
10
+ * Losses carried forward from earlier income years
11
+ */
12
+ businessLossDeferred: number;
13
+ /**
14
+ * Losses applied to the current year (until profit gets to $0)
15
+ */
16
+ businessLossApplied: number;
17
+ constructor(transactions: TransactionBaseCollection, businessLosses: SoleBusinessLossesCollection);
8
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.28.42",
3
+ "version": "0.28.44",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",