taxtank-core 0.32.42 → 0.32.45

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.
@@ -3151,6 +3151,32 @@ var ChartAccountsValues = [
3151
3151
  unitOfMeasure: "hours",
3152
3152
  createdAt: "2024-01-30 15:15:00",
3153
3153
  updatedAt: "2024-01-30 15:15:00"
3154
+ },
3155
+ {
3156
+ id: 54,
3157
+ chartAccounts: {
3158
+ id: 888
3159
+ },
3160
+ financialYear: 2023,
3161
+ startDate: null,
3162
+ endDate: null,
3163
+ value: 0.67,
3164
+ unitOfMeasure: "hours",
3165
+ createdAt: "2024-01-30 15:15:00",
3166
+ updatedAt: "2024-01-30 15:15:00"
3167
+ },
3168
+ {
3169
+ id: 55,
3170
+ chartAccounts: {
3171
+ id: 888
3172
+ },
3173
+ financialYear: 2024,
3174
+ startDate: null,
3175
+ endDate: null,
3176
+ value: 0.67,
3177
+ unitOfMeasure: "hours",
3178
+ createdAt: "2024-01-30 15:15:00",
3179
+ updatedAt: "2024-01-30 15:15:00"
3154
3180
  }
3155
3181
  ];
3156
3182
 
@@ -5516,6 +5542,24 @@ __decorate([
5516
5542
  Type(() => AppFile)
5517
5543
  ], PropertyDocument.prototype, "file", void 0);
5518
5544
 
5545
+ class PropertyCategoryMovement extends PropertyCategoryMovement$1 {
5546
+ }
5547
+ __decorate([
5548
+ Type(() => PropertyValuation)
5549
+ ], PropertyCategoryMovement.prototype, "valuation", void 0);
5550
+ __decorate([
5551
+ Type(() => PropertyCategory)
5552
+ ], PropertyCategoryMovement.prototype, "propertyCategory", void 0);
5553
+ __decorate([
5554
+ Type(() => Property)
5555
+ ], PropertyCategoryMovement.prototype, "property", void 0);
5556
+ __decorate([
5557
+ Type(() => Date)
5558
+ ], PropertyCategoryMovement.prototype, "fromDate", void 0);
5559
+ __decorate([
5560
+ Type(() => Date)
5561
+ ], PropertyCategoryMovement.prototype, "toDate", void 0);
5562
+
5519
5563
  class PropertyValuation extends PropertyValuation$1 {
5520
5564
  get financialYear() {
5521
5565
  return new FinancialYear(this.date).year;
@@ -5530,6 +5574,9 @@ __decorate([
5530
5574
  __decorate([
5531
5575
  Type(() => PropertyDocument)
5532
5576
  ], PropertyValuation.prototype, "document", void 0);
5577
+ __decorate([
5578
+ Type(() => PropertyCategoryMovement)
5579
+ ], PropertyValuation.prototype, "categoryMovement", void 0);
5533
5580
 
5534
5581
  class PropertyForecast extends PropertyForecast$1 {
5535
5582
  constructor() {
@@ -5583,24 +5630,6 @@ __decorate([
5583
5630
  Transform(({ value }) => +value)
5584
5631
  ], PropertyForecast.prototype, "marketValue", void 0);
5585
5632
 
5586
- class PropertyCategoryMovement extends PropertyCategoryMovement$1 {
5587
- }
5588
- __decorate([
5589
- Type(() => PropertyValuation)
5590
- ], PropertyCategoryMovement.prototype, "valuation", void 0);
5591
- __decorate([
5592
- Type(() => PropertyCategory)
5593
- ], PropertyCategoryMovement.prototype, "propertyCategory", void 0);
5594
- __decorate([
5595
- Type(() => Property)
5596
- ], PropertyCategoryMovement.prototype, "property", void 0);
5597
- __decorate([
5598
- Type(() => Date)
5599
- ], PropertyCategoryMovement.prototype, "fromDate", void 0);
5600
- __decorate([
5601
- Type(() => Date)
5602
- ], PropertyCategoryMovement.prototype, "toDate", void 0);
5603
-
5604
5633
  /**
5605
5634
  * propertySale docs - https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/4209508353/Property+Sold+button
5606
5635
  */
@@ -8681,10 +8710,11 @@ class BankAccountCollection extends Collection {
8681
8710
  return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.bankAccountProperties.find((bankAccountProperty) => ids.includes(bankAccountProperty.property.id))));
8682
8711
  }
8683
8712
  /**
8713
+ * @TODO feature functionality allow to work with shared accounts
8684
8714
  * get collection of active bank accounts
8685
8715
  */
8686
- getActiveBankAccounts() {
8687
- return new BankAccountCollection(this.items.filter((bankAccount) => bankAccount.isActive()));
8716
+ getActive() {
8717
+ return this.getOwn().filter((bankAccount) => bankAccount.isActive());
8688
8718
  }
8689
8719
  /**
8690
8720
  * get reduction of loan (reduction of principle) percentage
@@ -8780,17 +8810,12 @@ class BankAccountCollection extends Collection {
8780
8810
  }
8781
8811
  /**
8782
8812
  * @TODO Alex/Vik: maybe we should get it from jwtToken or think about some localStorageService?
8783
- * get own bankAccounts active for current financial year
8784
8813
  */
8785
8814
  getOwn() {
8786
- return this.filter((bankAccount) => {
8787
- const commencementDate = bankAccount.loan?.commencementDate;
8788
- const endDate = new FinancialYear().endDate;
8789
- return bankAccount.isOwner(+localStorage.getItem('userId')) && (!commencementDate || commencementDate <= endDate);
8790
- });
8815
+ return this.filter((bankAccount) => bankAccount.isOwner(+localStorage.getItem('userId')));
8791
8816
  }
8792
8817
  getActiveLoanAccountsByProperties(ids) {
8793
- return this.getActiveBankAccounts().getLoanAccounts().getByPropertiesIds(ids);
8818
+ return this.getActive().getLoanAccounts().getByPropertiesIds(ids);
8794
8819
  }
8795
8820
  }
8796
8821
 
@@ -9597,10 +9622,12 @@ class BankAccount extends BankAccount$1 {
9597
9622
  return this.loan ? this.loan.monthlyRepaymentAmount * this.getPropertyPercentage(propertyId) : 0;
9598
9623
  }
9599
9624
  /**
9600
- * Check if bank account is active (has 'active' status or hasn't been paid out/refinanced)
9625
+ * Check if bank account is active for current financial year (has 'active' status or hasn't been paid out/refinanced)
9601
9626
  */
9602
9627
  isActive() {
9603
- return this.status === BankAccountStatusEnum.ACTIVE;
9628
+ const commencementDate = this.loan?.commencementDate;
9629
+ const endDate = new FinancialYear().endDate;
9630
+ return this.status === BankAccountStatusEnum.ACTIVE && (!commencementDate || commencementDate <= endDate);
9604
9631
  }
9605
9632
  /**
9606
9633
  * first import (transactions) of basiq accounts
@@ -11086,6 +11113,9 @@ class BankAccountService extends RestService$1 {
11086
11113
  this.disabledMethods = ['post', 'putBatch', 'delete', 'deleteBatch'];
11087
11114
  this.listenEvents();
11088
11115
  }
11116
+ getActive() {
11117
+ return this.getBy('status', BankAccountStatusEnum.ACTIVE);
11118
+ }
11089
11119
  /**
11090
11120
  * Listen system notifications and update cache when got basiq notification received
11091
11121
  */
@@ -11698,6 +11728,10 @@ class ChatService extends RestService$1 {
11698
11728
  const message = messages[0];
11699
11729
  const cache = this.cache.toArray();
11700
11730
  const updatedChat = cache.find((chat) => chat?.id === message.chat?.id);
11731
+ // @TODO vik
11732
+ if (!updatedChat) {
11733
+ return;
11734
+ }
11701
11735
  updatedChat.updatedAt = message?.createdAt;
11702
11736
  this.handleResponse([updatedChat], 'put');
11703
11737
  }, ['post']);
@@ -15697,17 +15731,6 @@ var HoldingImportMessagesEnum;
15697
15731
  })(HoldingImportMessagesEnum || (HoldingImportMessagesEnum = {}));
15698
15732
 
15699
15733
  var HoldingTypeExchanges = [
15700
- {
15701
- id: 1,
15702
- code: "US",
15703
- name: "NYSE",
15704
- currency: "USD",
15705
- close_time: "16:00",
15706
- timezone: "America/New_York",
15707
- exchange_updated_at: "2023-04-21 11:54:56",
15708
- min_market_cap: 100000000,
15709
- min_avg_volume50d: 1000000
15710
- },
15711
15734
  {
15712
15735
  id: 2,
15713
15736
  code: "AU",
@@ -15719,6 +15742,17 @@ var HoldingTypeExchanges = [
15719
15742
  min_market_cap: 10000000,
15720
15743
  min_avg_volume50d: 10000
15721
15744
  },
15745
+ {
15746
+ id: 1,
15747
+ code: "US",
15748
+ name: "NYSE",
15749
+ currency: "USD",
15750
+ close_time: "16:00",
15751
+ timezone: "America/New_York",
15752
+ exchange_updated_at: "2023-04-21 11:54:56",
15753
+ min_market_cap: 100000000,
15754
+ min_avg_volume50d: 1000000
15755
+ },
15722
15756
  {
15723
15757
  id: 3,
15724
15758
  code: "LSE",
@@ -23358,6 +23392,7 @@ class WorkExpenseForm extends WorkTransactionForm {
23358
23392
  // amount set automatically for chartAccounts with hours meta field
23359
23393
  if (transaction.getMetaFieldValue(ChartAccountsMetaFieldListEnum.HOURS)) {
23360
23394
  this.get('amount').disable();
23395
+ this.get('amountWithGST').disable();
23361
23396
  }
23362
23397
  }
23363
23398
  listenEvents() {
@@ -23370,9 +23405,13 @@ class WorkExpenseForm extends WorkTransactionForm {
23370
23405
  return;
23371
23406
  }
23372
23407
  // for home office hours expense amount is a fixed rate per hour
23408
+ const amount = this.get('chartAccounts').value.getCurrentYearValue().value * +hoursMetaField.value;
23373
23409
  this.get('amount').reset();
23374
23410
  this.get('amount').disable();
23375
- this.get('amount').setValue(this.get('chartAccounts').value.getCurrentYearValue().value * +hoursMetaField.value);
23411
+ this.get('amount').setValue(amount);
23412
+ this.get('amountWithGST').reset();
23413
+ this.get('amountWithGST').disable();
23414
+ this.get('amountWithGST').setValue(amount);
23376
23415
  });
23377
23416
  }
23378
23417
  }