taxtank-core 0.29.30 → 0.29.32

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.
@@ -0,0 +1,5 @@
1
+ import { Collection } from './collection';
2
+ import { AllocationGroup } from '../models';
3
+ export declare class AllocationGroupCollection extends Collection<AllocationGroup> {
4
+ constructor(items: AllocationGroup[]);
5
+ }
@@ -9,6 +9,7 @@ export * from './subscription';
9
9
  export * from './tax-summary';
10
10
  export * from './transaction';
11
11
  export * from './vehicle';
12
+ export * from './allocation-group.collection';
12
13
  export * from './account-setup-item.collection';
13
14
  export * from './bank-account.collection';
14
15
  export * from './bank-transaction.collection';
@@ -12,6 +12,7 @@ import { TransactionBase } from './transaction-base';
12
12
  import { Property } from '../property/property';
13
13
  import { Depreciation } from '../depreciation/depreciation';
14
14
  import { SoleBusiness } from '../sole/sole-business';
15
+ import { SoleInvoiceItem } from '../sole/sole-invoice-item';
15
16
  export declare class Transaction extends TransactionBase {
16
17
  id?: number;
17
18
  type?: TransactionTypeEnum;
@@ -43,4 +44,5 @@ export declare class Transaction extends TransactionBase {
43
44
  updatedBy?: User;
44
45
  business?: SoleBusiness;
45
46
  isGST?: boolean;
47
+ soleInvoiceItem?: SoleInvoiceItem;
46
48
  }
@@ -0,0 +1,34 @@
1
+ import { SoleInvoice } from '../sole';
2
+ import { Transaction } from '../transaction';
3
+ import { AbstractModel } from '../../db/Models';
4
+ import { TransactionOperationEnum } from '../../db/Enums/transaction-operation.enum';
5
+ import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
6
+ import { BankTransactionCollection, TransactionAllocationCollection, TransactionCollection } from '../../collections';
7
+ /**
8
+ * User knows nothing about invoiceItem transaction/allocation, it's encapsulated. That's why we need an extra model to hide technical complication from user
9
+ * @TODO Alex: we use category and invoice number in the same place: think about common name and unite 2 fields in 1
10
+ * @TODO Alex: think: move check operation methods to some common class (with transaction)
11
+ * @TODO Alex: isTransactionChangeable method's name is breaking abstraction
12
+ */
13
+ export declare class AllocationGroup extends AbstractModel {
14
+ operation: TransactionOperationEnum;
15
+ date: Date;
16
+ amount: number;
17
+ description: string;
18
+ category?: string;
19
+ tankType: TankTypeEnum;
20
+ childTransactions?: TransactionCollection;
21
+ invoiceNumber?: number;
22
+ allocations: TransactionAllocationCollection;
23
+ bankTransactions: BankTransactionCollection;
24
+ static fromInvoice(invoice: SoleInvoice, bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): AllocationGroup;
25
+ static fromTransaction(transaction: Transaction, bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): AllocationGroup;
26
+ isFindMatch(): boolean;
27
+ isMatchInvoice(): boolean;
28
+ isTransfer(): boolean;
29
+ isAllocate(): boolean;
30
+ /**
31
+ * user can edit/delete (via redo all) transaction only for allocate and find and match operations
32
+ */
33
+ isTransactionChangeable(): boolean;
34
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './basiq';
2
+ export * from './allocation-group';
2
3
  export * from './bank';
3
4
  export * from './bank-account';
4
5
  export * from './bank-account-chart-data';
@@ -109,4 +109,5 @@ export declare class ChartAccounts extends ChartAccountsBase {
109
109
  * chart accounts included in salary, like tips or allowance
110
110
  */
111
111
  isSalaryIncluded(): boolean;
112
+ isPropertyCapitalWorks(): boolean;
112
113
  }
@@ -12,6 +12,7 @@ import { IReceipt } from '../../interfaces/receipt.interface';
12
12
  import { TransactionAllocationCollection } from '../../collections';
13
13
  import { Depreciation } from '../depreciation/depreciation';
14
14
  import { Expense } from '../../interfaces/expense.interface';
15
+ import { SoleInvoiceItem } from '../sole';
15
16
  export declare class Transaction extends TransactionBase implements Expense, IReceipt {
16
17
  transactions: Transaction[];
17
18
  property: Property;
@@ -23,6 +24,7 @@ export declare class Transaction extends TransactionBase implements Expense, IRe
23
24
  loan: Loan;
24
25
  date: Date;
25
26
  allocations: TransactionAllocation[];
27
+ soleInvoiceItem: SoleInvoiceItem;
26
28
  tax: number;
27
29
  operation: TransactionOperationEnum;
28
30
  allocatedAmount: number;
@@ -30,6 +32,7 @@ export declare class Transaction extends TransactionBase implements Expense, IRe
30
32
  isSelected: boolean;
31
33
  claimPercent: number;
32
34
  amount: number;
35
+ get invoiceId(): number;
33
36
  isDebit(): boolean;
34
37
  isCredit(): boolean;
35
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.29.30",
3
+ "version": "0.29.32",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",