taxtank-core 1.0.53 → 1.0.56

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.
@@ -255,7 +255,8 @@ let ChartAccountsValue$1 = class ChartAccountsValue extends AbstractModel {
255
255
  let ChartAccounts$1 = class ChartAccounts extends AbstractModel {
256
256
  };
257
257
 
258
- let DepreciationCapitalProject$1 = class DepreciationCapitalProject extends AbstractModel {
258
+ let DepreciationCapitalProject$1 = class DepreciationCapitalProject extends ObservableModel {
259
+ static { this.className = 'DepreciationCapitalProject'; }
259
260
  };
260
261
 
261
262
  let DepreciationForecast$1 = class DepreciationForecast extends AbstractModel {
@@ -1325,11 +1326,11 @@ var TaxReturnCategoryListEnum;
1325
1326
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_DONATION"] = 73] = "WORK_DONATION";
1326
1327
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_TAX_AFFAIRS"] = 74] = "WORK_TAX_AFFAIRS";
1327
1328
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_OTHER_DEDUCTIONS"] = 76] = "WORK_OTHER_DEDUCTIONS";
1329
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_SUPER_CONTRIBUTION"] = 81] = "WORK_SUPER_CONTRIBUTION";
1328
1330
  // holding expenses
1329
1331
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_INTEREST_DEDUCTIONS"] = 71] = "HOLDING_INTEREST_DEDUCTIONS";
1330
1332
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_DIVIDEND_DEDUCTION"] = 72] = "HOLDING_DIVIDEND_DEDUCTION";
1331
1333
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_UPP"] = 75] = "HOLDING_UPP";
1332
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_SUPER_CONTRIBUTION"] = 81] = "HOLDING_SUPER_CONTRIBUTION";
1333
1334
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_INVESTMENT_SCHEME"] = 82] = "HOLDING_INVESTMENT_SCHEME";
1334
1335
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_INVESTMENT_SCHEME_DEDUCTION"] = 83] = "HOLDING_INVESTMENT_SCHEME_DEDUCTION";
1335
1336
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_OTHER_DEDUCTION"] = 84] = "HOLDING_OTHER_DEDUCTION";
@@ -1342,20 +1343,15 @@ var TaxReturnCategoryListEnum;
1342
1343
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_PARTNERSHIPS"] = 79] = "HOLDING_PARTNERSHIPS";
1343
1344
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDING_TRUSTS"] = 80] = "HOLDING_TRUSTS";
1344
1345
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["GROSS_RENT"] = 8] = "GROSS_RENT";
1345
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["PSI_SBE_INCOME"] = 14] = "PSI_SBE_INCOME";
1346
1346
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["CAPITAL_GAINS"] = 15] = "CAPITAL_GAINS";
1347
+ // sole income
1348
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["PSI_SBE_INCOME"] = 14] = "PSI_SBE_INCOME";
1347
1349
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["GROSS_PAYMENTS_NO_ABN_GIVEN"] = 42] = "GROSS_PAYMENTS_NO_ABN_GIVEN";
1348
1350
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["GROSS_PAYMENTS_VOLUNTARY_AGREEMENT"] = 43] = "GROSS_PAYMENTS_VOLUNTARY_AGREEMENT";
1349
1351
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["GROSS_PAYMENTS_LABOUR_HIRE_OR_OTHER"] = 44] = "GROSS_PAYMENTS_LABOUR_HIRE_OR_OTHER";
1350
1352
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["ASSESSABLE_GOVERNMENT_PAYMENTS"] = 45] = "ASSESSABLE_GOVERNMENT_PAYMENTS";
1351
1353
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["OTHER_BUSINESS_INCOME"] = 46] = "OTHER_BUSINESS_INCOME";
1352
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_EXPENSES"] = 7] = "WORK_EXPENSES";
1353
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["INTEREST_DEDUCTIONS"] = 9] = "INTEREST_DEDUCTIONS";
1354
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["CAPITAL_WORKS"] = 10] = "CAPITAL_WORKS";
1355
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["PLANT_AND_EQUIPMENT"] = 11] = "PLANT_AND_EQUIPMENT";
1356
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["BORROWING_EXPENSES"] = 29] = "BORROWING_EXPENSES";
1357
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["OTHER_RENTAL_DEDUCTIONS"] = 12] = "OTHER_RENTAL_DEDUCTIONS";
1358
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["OTHER_DEDUCTIONS"] = 18] = "OTHER_DEDUCTIONS";
1354
+ // sole expenses
1359
1355
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["PURCHASES_AND_OTHER_COSTS"] = 48] = "PURCHASES_AND_OTHER_COSTS";
1360
1356
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["CONTRACTORS_SUBCONTRACTORS_COMMISSION_EXPENSES"] = 49] = "CONTRACTORS_SUBCONTRACTORS_COMMISSION_EXPENSES";
1361
1357
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["SUPERANNUATION_EXPENSES"] = 50] = "SUPERANNUATION_EXPENSES";
@@ -1364,9 +1360,16 @@ var TaxReturnCategoryListEnum;
1364
1360
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["RENT_EXPENSES"] = 53] = "RENT_EXPENSES";
1365
1361
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["INTEREST_EXPENSES_WITHIN_AUSTRALIA"] = 54] = "INTEREST_EXPENSES_WITHIN_AUSTRALIA";
1366
1362
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["INTEREST_EXPENSES_OVERSEAS"] = 55] = "INTEREST_EXPENSES_OVERSEAS";
1367
- TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["DEPRECIATION_EXPENSES"] = 56] = "DEPRECIATION_EXPENSES";
1368
1363
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["MOTOR_VEHICLE_EXPENSES"] = 57] = "MOTOR_VEHICLE_EXPENSES";
1369
1364
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["ALL_OTHER_EXPENSES"] = 58] = "ALL_OTHER_EXPENSES";
1365
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_EXPENSES"] = 7] = "WORK_EXPENSES";
1366
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["INTEREST_DEDUCTIONS"] = 9] = "INTEREST_DEDUCTIONS";
1367
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["CAPITAL_WORKS"] = 10] = "CAPITAL_WORKS";
1368
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["PLANT_AND_EQUIPMENT"] = 11] = "PLANT_AND_EQUIPMENT";
1369
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["BORROWING_EXPENSES"] = 29] = "BORROWING_EXPENSES";
1370
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["OTHER_RENTAL_DEDUCTIONS"] = 12] = "OTHER_RENTAL_DEDUCTIONS";
1371
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["OTHER_DEDUCTIONS"] = 18] = "OTHER_DEDUCTIONS";
1372
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["DEPRECIATION_EXPENSES"] = 56] = "DEPRECIATION_EXPENSES";
1370
1373
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_RELATED_DEPRECIATION"] = 69] = "WORK_RELATED_DEPRECIATION";
1371
1374
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["GROSS_TAX_PAYABLE"] = 19] = "GROSS_TAX_PAYABLE";
1372
1375
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_ON_TAXABLE_INCOME"] = 20] = "TAX_ON_TAXABLE_INCOME";
@@ -1375,6 +1378,9 @@ var TaxReturnCategoryListEnum;
1375
1378
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_CREDITS"] = 23] = "TAX_CREDITS";
1376
1379
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_WITHHELD"] = 24] = "TAX_WITHHELD";
1377
1380
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_INSTALMENTS"] = 25] = "TAX_INSTALMENTS";
1381
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["WORK_TAX_INSTALMENTS"] = 85] = "WORK_TAX_INSTALMENTS";
1382
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["HOLDINGS_TAX_INSTALMENTS"] = 86] = "HOLDINGS_TAX_INSTALMENTS";
1383
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["SOLE_TAX_INSTALMENTS"] = 87] = "SOLE_TAX_INSTALMENTS";
1378
1384
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["FRANKING_CREDITS"] = 26] = "FRANKING_CREDITS";
1379
1385
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS"] = 27] = "TAX_OFFSETS";
1380
1386
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_LOW"] = 61] = "TAX_OFFSETS_LOW";
@@ -6877,6 +6883,7 @@ class Depreciation extends Depreciation$1 {
6877
6883
  amount: -this.currentYearForecast?.amount || 0,
6878
6884
  claimAmount: -this.currentYearForecast?.claimAmount || 0,
6879
6885
  claimPercent: claimPercent,
6886
+ date: this.currentYearForecast?.fromDate ?? this.date,
6880
6887
  sharedClaimPercent: claimPercent,
6881
6888
  }));
6882
6889
  }
@@ -7197,24 +7204,6 @@ class TransactionCollection extends TransactionBaseCollection {
7197
7204
  getTaxable() {
7198
7205
  return this.filter(transaction => transaction.claimPercent > 0);
7199
7206
  }
7200
- getWorkTaxCredits() {
7201
- const transactions = this.filter(transaction => transaction.isWorkTank() && !transaction.depreciation && transaction.claimAmount !== 0 && transaction.chartAccounts.id !== 571);
7202
- const metaFields = new Collection(transactions
7203
- .map(transaction => transaction.metaFields)
7204
- .flat()
7205
- .filter(metaField => [4].includes(metaField.chartAccountsMetaField.id)));
7206
- const instalments = this.filterBy('chartAccounts.id', 911).amount;
7207
- return -transactions.sumBy('claimableTax') - metaFields.sumBy('value') + instalments;
7208
- }
7209
- getHoldingTaxCredits() {
7210
- const transactions = this.filter(transaction => transaction.isHoldingTank() && !transaction.depreciation && transaction.claimAmount !== 0 && transaction.chartAccounts.id !== 571);
7211
- const metaFields = new Collection(transactions
7212
- .map(transaction => transaction.metaFields)
7213
- .flat()
7214
- .filter(metaField => [4, 5].includes(metaField.chartAccountsMetaField.id)));
7215
- const instalments = this.filterBy('chartAccounts.id', 662).amount;
7216
- return -metaFields.sumBy('value') + instalments;
7217
- }
7218
7207
  }
7219
7208
 
7220
7209
  class TransactionAllocationCollection extends Collection {
@@ -8805,6 +8794,7 @@ const TAX_RETURN_CATEGORIES = {
8805
8794
  TaxReturnCategoryListEnum.WORK_DONATION,
8806
8795
  TaxReturnCategoryListEnum.WORK_TAX_AFFAIRS,
8807
8796
  TaxReturnCategoryListEnum.WORK_OTHER_DEDUCTIONS,
8797
+ TaxReturnCategoryListEnum.WORK_SUPER_CONTRIBUTION,
8808
8798
  ],
8809
8799
  depreciation: [
8810
8800
  TaxReturnCategoryListEnum.WORK_RELATED_DEPRECIATION
@@ -8812,7 +8802,7 @@ const TAX_RETURN_CATEGORIES = {
8812
8802
  interest: [],
8813
8803
  taxWithheld: [
8814
8804
  TaxReturnCategoryListEnum.TAX_WITHHELD
8815
- ]
8805
+ ],
8816
8806
  },
8817
8807
  property: {
8818
8808
  income: [
@@ -8844,7 +8834,6 @@ const TAX_RETURN_CATEGORIES = {
8844
8834
  TaxReturnCategoryListEnum.HOLDING_INTEREST_DEDUCTIONS,
8845
8835
  TaxReturnCategoryListEnum.HOLDING_DIVIDEND_DEDUCTION,
8846
8836
  TaxReturnCategoryListEnum.HOLDING_UPP,
8847
- TaxReturnCategoryListEnum.HOLDING_SUPER_CONTRIBUTION,
8848
8837
  TaxReturnCategoryListEnum.HOLDING_INVESTMENT_SCHEME,
8849
8838
  TaxReturnCategoryListEnum.HOLDING_INVESTMENT_SCHEME_DEDUCTION,
8850
8839
  TaxReturnCategoryListEnum.HOLDING_OTHER_DEDUCTION,
@@ -8860,11 +8849,12 @@ const TAX_RETURN_CATEGORIES = {
8860
8849
  },
8861
8850
  sole: {
8862
8851
  income: [
8852
+ TaxReturnCategoryListEnum.PSI_SBE_INCOME,
8863
8853
  TaxReturnCategoryListEnum.GROSS_PAYMENTS_NO_ABN_GIVEN,
8864
8854
  TaxReturnCategoryListEnum.GROSS_PAYMENTS_VOLUNTARY_AGREEMENT,
8865
8855
  TaxReturnCategoryListEnum.GROSS_PAYMENTS_LABOUR_HIRE_OR_OTHER,
8866
8856
  TaxReturnCategoryListEnum.ASSESSABLE_GOVERNMENT_PAYMENTS,
8867
- TaxReturnCategoryListEnum.OTHER_BUSINESS_INCOME
8857
+ TaxReturnCategoryListEnum.OTHER_BUSINESS_INCOME,
8868
8858
  ],
8869
8859
  expenses: [
8870
8860
  TaxReturnCategoryListEnum.PURCHASES_AND_OTHER_COSTS,
@@ -8876,7 +8866,7 @@ const TAX_RETURN_CATEGORIES = {
8876
8866
  TaxReturnCategoryListEnum.INTEREST_EXPENSES_WITHIN_AUSTRALIA,
8877
8867
  TaxReturnCategoryListEnum.INTEREST_EXPENSES_OVERSEAS,
8878
8868
  TaxReturnCategoryListEnum.MOTOR_VEHICLE_EXPENSES,
8879
- TaxReturnCategoryListEnum.ALL_OTHER_EXPENSES
8869
+ TaxReturnCategoryListEnum.ALL_OTHER_EXPENSES,
8880
8870
  ],
8881
8871
  depreciation: [
8882
8872
  TaxReturnCategoryListEnum.DEPRECIATION_EXPENSES,
@@ -8887,9 +8877,6 @@ const TAX_RETURN_CATEGORIES = {
8887
8877
  lossCurrent: [
8888
8878
  TaxReturnCategoryListEnum.DEFERRED_BUSINESS_LOSSES,
8889
8879
  ],
8890
- taxOffsets: [
8891
- TaxReturnCategoryListEnum.TAX_OFFSETS_SOLE
8892
- ],
8893
8880
  },
8894
8881
  summary: {
8895
8882
  income: [
@@ -12718,7 +12705,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImpor
12718
12705
  * Service for work with messages
12719
12706
  */
12720
12707
  class MessageService extends RestService$1 {
12721
- // mercureTopic = 'messages';
12722
12708
  constructor(environment) {
12723
12709
  super(environment);
12724
12710
  this.environment = environment;
@@ -12726,6 +12712,7 @@ class MessageService extends RestService$1 {
12726
12712
  this.collectionClass = MessageCollection;
12727
12713
  this.endpointUri = 'messages';
12728
12714
  this.disabledMethods = ['postBatch', 'putBatch'];
12715
+ this.mercureTopic = 'messages';
12729
12716
  this.listenEvents();
12730
12717
  }
12731
12718
  listenEvents() {
@@ -12841,6 +12828,7 @@ class DepreciationService extends RestService$1 {
12841
12828
  this.listenToUpdatedBankAccount();
12842
12829
  this.listenSoleDepreciationMethodChanges();
12843
12830
  this.listenPropertyDepreciationCalculationChanges();
12831
+ this.listenCSE(DepreciationCapitalProject, this.refreshCache, ['put']);
12844
12832
  }
12845
12833
  getOpenBalance(depreciation) {
12846
12834
  return this.http.post(`${this.apiUrl}/opening-balance?financialYear=${new FinancialYear().year}`, depreciation)
@@ -13287,7 +13275,6 @@ var ClientInviteMessages;
13287
13275
  })(ClientInviteMessages || (ClientInviteMessages = {}));
13288
13276
 
13289
13277
  class ClientMovementService extends RestService$1 {
13290
- // mercureTopic = 'clientMovements';
13291
13278
  constructor(environment) {
13292
13279
  super(environment);
13293
13280
  this.environment = environment;
@@ -13295,6 +13282,7 @@ class ClientMovementService extends RestService$1 {
13295
13282
  this.collectionClass = ClientMovementCollection;
13296
13283
  this.modelClass = ClientMovement;
13297
13284
  this.disabledMethods = ['postBatch', 'delete', 'deleteBatch'];
13285
+ this.mercureTopic = 'clientMovements';
13298
13286
  this.listenEvents();
13299
13287
  }
13300
13288
  listenEvents() {
@@ -15644,8 +15632,17 @@ class TaxSummary {
15644
15632
  * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/217677990/Dashboard+Main
15645
15633
  */
15646
15634
  get workNetCash() {
15635
+ return this.workNetTotal + this.workTaxCredits;
15636
+ }
15637
+ get workTaxCredits() {
15647
15638
  const taxWithheld = this.summary.items.sumByCategoriesAndSection(TAX_RETURN_CATEGORIES.work.taxWithheld, TaxSummarySectionEnum.WORK_TANK);
15648
- return this.workNetTotal - Math.abs(taxWithheld);
15639
+ const taxInstallments = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.WORK_TAX_INSTALMENTS], TaxSummarySectionEnum.SUMMARY);
15640
+ return taxWithheld + taxInstallments;
15641
+ }
15642
+ get soleTaxCredits() {
15643
+ const taxOffsets = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.TAX_OFFSETS_SOLE], TaxSummarySectionEnum.SOLE_TANK);
15644
+ const taxInstallments = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.SOLE_TAX_INSTALMENTS], TaxSummarySectionEnum.SUMMARY);
15645
+ return taxOffsets + taxInstallments;
15649
15646
  }
15650
15647
  get income() {
15651
15648
  return this.getReportItems([this.work, this.property, this.sole, this.holdings]).sumByCategories([
@@ -15720,9 +15717,10 @@ class TaxSummary {
15720
15717
  return this.holdingsNetTotal + this.holdingsTaxCredits;
15721
15718
  }
15722
15719
  get holdingsTaxCredits() {
15723
- const taxInstallments = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.TAX_INSTALMENTS], TaxSummarySectionEnum.HOLDINGS_TANK);
15724
15720
  const frankingCredits = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.FRANKING_CREDITS], TaxSummarySectionEnum.HOLDINGS_TANK);
15725
- return taxInstallments + frankingCredits;
15721
+ const taxWithheld = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.TAX_WITHHELD], TaxSummarySectionEnum.HOLDINGS_TANK);
15722
+ const taxInstallments = this.summary.items.sumByCategoriesAndSection([TaxReturnCategoryListEnum.HOLDINGS_TAX_INSTALMENTS], TaxSummarySectionEnum.SUMMARY);
15723
+ return taxInstallments + frankingCredits + taxWithheld;
15726
15724
  }
15727
15725
  /**
15728
15726
  * Sole Net Cash = gross income – expenses
@@ -16697,6 +16695,8 @@ class UserService extends RestService$1 {
16697
16695
  // @TODO vik use separated service to handle global user storage
16698
16696
  localStorage.setItem('userId', user.id.toString());
16699
16697
  localStorage.setItem('financialYear', user.financialYear.toString());
16698
+ // for firm area (client roles updated in subscriptionService)
16699
+ localStorage.setItem('roles', JSON.stringify(this.getCacheFirst().roles));
16700
16700
  return users;
16701
16701
  }));
16702
16702
  }