taxtank-core 3.0.1 → 3.0.3

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.
@@ -609,6 +609,7 @@ var ChartAccountsListEnum;
609
609
  ChartAccountsListEnum[ChartAccountsListEnum["FOREIGN_PENSION_EXPENSES"] = 1054] = "FOREIGN_PENSION_EXPENSES";
610
610
  ChartAccountsListEnum[ChartAccountsListEnum["ANNUITY_PURCHASE_PRICE"] = 1055] = "ANNUITY_PURCHASE_PRICE";
611
611
  ChartAccountsListEnum[ChartAccountsListEnum["FOREIGN_TAX_WITHHELD_PENSION"] = 1056] = "FOREIGN_TAX_WITHHELD_PENSION";
612
+ ChartAccountsListEnum[ChartAccountsListEnum["EV_HOME_CHARGING"] = 1057] = "EV_HOME_CHARGING";
612
613
  })(ChartAccountsListEnum || (ChartAccountsListEnum = {}));
613
614
 
614
615
  var BusinessChartAccountsEnum;
@@ -688,6 +689,7 @@ var BusinessChartAccountsEnum;
688
689
  BusinessChartAccountsEnum[BusinessChartAccountsEnum["CHILDCARE_FEES"] = 1010] = "CHILDCARE_FEES";
689
690
  BusinessChartAccountsEnum[BusinessChartAccountsEnum["GOVERNMENT_CHILDCARE_SUBSIDIES"] = 1011] = "GOVERNMENT_CHILDCARE_SUBSIDIES";
690
691
  BusinessChartAccountsEnum[BusinessChartAccountsEnum["ADDITIONAL_CHILDCARE_SERVICES"] = 1017] = "ADDITIONAL_CHILDCARE_SERVICES";
692
+ BusinessChartAccountsEnum[BusinessChartAccountsEnum["EV_HOME_CHARGING"] = 909] = "EV_HOME_CHARGING";
691
693
  })(BusinessChartAccountsEnum || (BusinessChartAccountsEnum = {}));
692
694
 
693
695
  var ChartAccountsMetaFieldListEnum;
@@ -707,6 +709,7 @@ var ChartAccountsMetaFieldListEnum;
707
709
  ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["UNFRANKED"] = 27] = "UNFRANKED";
708
710
  ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["TAX_OFFSETS_N_R_A_S"] = 29] = "TAX_OFFSETS_N_R_A_S";
709
711
  ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["DISCOUNT_FROM_DEFERRED_SCHEMES"] = 32] = "DISCOUNT_FROM_DEFERRED_SCHEMES";
712
+ ChartAccountsMetaFieldListEnum[ChartAccountsMetaFieldListEnum["KWH"] = 33] = "KWH";
710
713
  })(ChartAccountsMetaFieldListEnum || (ChartAccountsMetaFieldListEnum = {}));
711
714
 
712
715
  var ChartAccountsMetaFieldTypeEnum;
@@ -3851,6 +3854,136 @@ var ChartAccountsValues = [
3851
3854
  unitOfMeasure: "hours",
3852
3855
  createdAt: "2026-06-27 00:00:00",
3853
3856
  updatedAt: "2026-06-27 00:00:00"
3857
+ },
3858
+ {
3859
+ id: 71,
3860
+ chartAccounts: {
3861
+ id: 909
3862
+ },
3863
+ financialYear: 2023,
3864
+ startDate: null,
3865
+ endDate: null,
3866
+ value: 4.2,
3867
+ unitOfMeasure: "kWh",
3868
+ createdAt: "2026-06-27 00:00:00",
3869
+ updatedAt: "2026-06-27 00:00:00"
3870
+ },
3871
+ {
3872
+ id: 72,
3873
+ chartAccounts: {
3874
+ id: 909
3875
+ },
3876
+ financialYear: 2024,
3877
+ startDate: null,
3878
+ endDate: null,
3879
+ value: 4.2,
3880
+ unitOfMeasure: "kWh",
3881
+ createdAt: "2026-06-27 00:00:00",
3882
+ updatedAt: "2026-06-27 00:00:00"
3883
+ },
3884
+ {
3885
+ id: 73,
3886
+ chartAccounts: {
3887
+ id: 909
3888
+ },
3889
+ financialYear: 2025,
3890
+ startDate: null,
3891
+ endDate: null,
3892
+ value: 4.2,
3893
+ unitOfMeasure: "kWh",
3894
+ createdAt: "2026-06-27 00:00:00",
3895
+ updatedAt: "2026-06-27 00:00:00"
3896
+ },
3897
+ {
3898
+ id: 74,
3899
+ chartAccounts: {
3900
+ id: 909
3901
+ },
3902
+ financialYear: 2026,
3903
+ startDate: null,
3904
+ endDate: null,
3905
+ value: 8.78,
3906
+ unitOfMeasure: "kWh",
3907
+ createdAt: "2026-06-27 00:00:00",
3908
+ updatedAt: "2026-06-27 00:00:00"
3909
+ },
3910
+ {
3911
+ id: 75,
3912
+ chartAccounts: {
3913
+ id: 909
3914
+ },
3915
+ financialYear: 2027,
3916
+ startDate: null,
3917
+ endDate: null,
3918
+ value: 8.78,
3919
+ unitOfMeasure: "kWh",
3920
+ createdAt: "2026-06-27 00:00:00",
3921
+ updatedAt: "2026-06-27 00:00:00"
3922
+ },
3923
+ {
3924
+ id: 76,
3925
+ chartAccounts: {
3926
+ id: 1057
3927
+ },
3928
+ financialYear: 2023,
3929
+ startDate: null,
3930
+ endDate: null,
3931
+ value: 4.2,
3932
+ unitOfMeasure: "kWh",
3933
+ createdAt: "2026-06-27 00:00:00",
3934
+ updatedAt: "2026-06-27 00:00:00"
3935
+ },
3936
+ {
3937
+ id: 77,
3938
+ chartAccounts: {
3939
+ id: 1057
3940
+ },
3941
+ financialYear: 2024,
3942
+ startDate: null,
3943
+ endDate: null,
3944
+ value: 4.2,
3945
+ unitOfMeasure: "kWh",
3946
+ createdAt: "2026-06-27 00:00:00",
3947
+ updatedAt: "2026-06-27 00:00:00"
3948
+ },
3949
+ {
3950
+ id: 78,
3951
+ chartAccounts: {
3952
+ id: 1057
3953
+ },
3954
+ financialYear: 2025,
3955
+ startDate: null,
3956
+ endDate: null,
3957
+ value: 4.2,
3958
+ unitOfMeasure: "kWh",
3959
+ createdAt: "2026-06-27 00:00:00",
3960
+ updatedAt: "2026-06-27 00:00:00"
3961
+ },
3962
+ {
3963
+ id: 79,
3964
+ chartAccounts: {
3965
+ id: 1057
3966
+ },
3967
+ financialYear: 2026,
3968
+ startDate: null,
3969
+ endDate: null,
3970
+ value: 8.78,
3971
+ unitOfMeasure: "kWh",
3972
+ createdAt: "2026-06-27 00:00:00",
3973
+ updatedAt: "2026-06-27 00:00:00"
3974
+ },
3975
+ {
3976
+ id: 80,
3977
+ chartAccounts: {
3978
+ id: 1057
3979
+ },
3980
+ financialYear: 2027,
3981
+ startDate: null,
3982
+ endDate: null,
3983
+ value: 8.78,
3984
+ unitOfMeasure: "kWh",
3985
+ createdAt: "2026-06-27 00:00:00",
3986
+ updatedAt: "2026-06-27 00:00:00"
3854
3987
  }
3855
3988
  ];
3856
3989
 
@@ -4110,6 +4243,9 @@ class ChartAccounts extends ChartAccounts$1 {
4110
4243
  isHomeOfficeExpense() {
4111
4244
  return ChartAccounts.homeOfficeList.includes(this.id);
4112
4245
  }
4246
+ isEvHomeCharging() {
4247
+ return [ChartAccountsListEnum.EV_HOME_CHARGING, BusinessChartAccountsEnum.EV_HOME_CHARGING].includes(this.id);
4248
+ }
4113
4249
  isHomeOfficeWorkHours() {
4114
4250
  return this.id === ChartAccountsListEnum.HOME_OFFICE_HOURS;
4115
4251
  }
@@ -8953,9 +9089,6 @@ class PropertyReportItem extends AbstractModel {
8953
9089
  this.subCode = chartAccounts.taxReturnItem?.subCode;
8954
9090
  this.description = chartAccounts.name;
8955
9091
  }
8956
- get claimAmount() {
8957
- return round(this.amount * (this.claimPercent / 100), 2);
8958
- }
8959
9092
  get shareClaimAmount() {
8960
9093
  return this.claimAmount * (this.sharePercent / 100);
8961
9094
  }
@@ -8996,9 +9129,13 @@ class PropertyReportItemDepreciation extends PropertyReportItem {
8996
9129
  class PropertyReportItemTransaction extends PropertyReportItem {
8997
9130
  constructor(transactions, property, chartAccounts) {
8998
9131
  super(property, chartAccounts);
9132
+ this.transactions = transactions;
8999
9133
  this.amount = Math.abs(transactions.sumBy('grossAmount'));
9000
9134
  this.description = chartAccounts.name;
9001
9135
  }
9136
+ get claimAmount() {
9137
+ return this.transactions.claimAmount / this.sharePercent * 100;
9138
+ }
9002
9139
  }
9003
9140
 
9004
9141
  /**
@@ -11034,6 +11171,10 @@ class ChartAccountsValueCollection extends Collection {
11034
11171
  const chartAccountsId = isSole ? BusinessChartAccountsEnum.HOME_OFFICE_HOURS : ChartAccountsListEnum.HOME_OFFICE_HOURS;
11035
11172
  return this.find((ca) => ca.chartAccounts.id === chartAccountsId && new FinancialYear().year === ca.financialYear).value;
11036
11173
  }
11174
+ getKwhRate(isSole) {
11175
+ const chartAccountsId = isSole ? BusinessChartAccountsEnum.EV_HOME_CHARGING : ChartAccountsListEnum.EV_HOME_CHARGING;
11176
+ return this.find((ca) => ca.chartAccounts.id === chartAccountsId && new FinancialYear().year === ca.financialYear).value;
11177
+ }
11037
11178
  }
11038
11179
 
11039
11180
  class HomeOfficeClaimCollection extends Collection {
@@ -29781,18 +29922,22 @@ class WorkExpenseForm extends WorkTransactionForm {
29781
29922
  }
29782
29923
  watchChartAccountsMetaFields() {
29783
29924
  this.get('metaFields').valueChanges.subscribe((metaFields) => {
29784
- const hoursMetaField = new Collection(metaFields).findBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.HOURS);
29785
- if (!hoursMetaField) {
29786
- return;
29925
+ // fixed rate (ie amount per hour/kwh)
29926
+ const rateMetaFields = [ChartAccountsMetaFieldListEnum.KWH, ChartAccountsMetaFieldListEnum.HOURS];
29927
+ const rate = new Collection(metaFields).filterBy('chartAccountsMetaField.id', rateMetaFields).first?.value;
29928
+ if (rate) {
29929
+ const amount = +rate * this.get('chartAccounts').value.getCurrentYearValue().value;
29930
+ this.get('amount').reset();
29931
+ this.get('amount').disable();
29932
+ this.get('amount').setValue(amount);
29933
+ this.get('amountWithGST').reset();
29934
+ this.get('amountWithGST').disable();
29935
+ this.get('amountWithGST').setValue(amount);
29936
+ }
29937
+ else {
29938
+ this.get('amount').enable();
29939
+ this.get('amountWithGST').enable();
29787
29940
  }
29788
- // for home office hours expense amount is a fixed rate per hour
29789
- const amount = this.get('chartAccounts').value.getCurrentYearValue().value * +hoursMetaField.value;
29790
- this.get('amount').reset();
29791
- this.get('amount').disable();
29792
- this.get('amount').setValue(amount);
29793
- this.get('amountWithGST').reset();
29794
- this.get('amountWithGST').disable();
29795
- this.get('amountWithGST').setValue(amount);
29796
29941
  });
29797
29942
  }
29798
29943
  watchChartAccounts() {
@@ -29826,7 +29971,7 @@ class HoldingIncomeForm extends WorkTransactionForm {
29826
29971
  this.get('amount').setValidators([Validators.required, conditionalValidator(() => this.get('chartAccounts').value && this.get('chartAccounts').value.isDividends(), matchSumValidator(this.getAmountComponents, 'The Franked and Unfranked amounts entered do not equal the total Amount received. Please check and try again.'))]);
29827
29972
  // forbid to edit some fields for allocated transaction
29828
29973
  if (allocations.length) {
29829
- this.get('chartAccounts').disable();
29974
+ this.get('chartAccounts').disable({ emitEvent: false });
29830
29975
  }
29831
29976
  this.get('transactions').disable();
29832
29977
  // amount changes are not available for transactions with allocations or during allocate process