taxtank-core 3.0.1 → 3.0.2

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
  }
@@ -11034,6 +11170,10 @@ class ChartAccountsValueCollection extends Collection {
11034
11170
  const chartAccountsId = isSole ? BusinessChartAccountsEnum.HOME_OFFICE_HOURS : ChartAccountsListEnum.HOME_OFFICE_HOURS;
11035
11171
  return this.find((ca) => ca.chartAccounts.id === chartAccountsId && new FinancialYear().year === ca.financialYear).value;
11036
11172
  }
11173
+ getKwhRate(isSole) {
11174
+ const chartAccountsId = isSole ? BusinessChartAccountsEnum.EV_HOME_CHARGING : ChartAccountsListEnum.EV_HOME_CHARGING;
11175
+ return this.find((ca) => ca.chartAccounts.id === chartAccountsId && new FinancialYear().year === ca.financialYear).value;
11176
+ }
11037
11177
  }
11038
11178
 
11039
11179
  class HomeOfficeClaimCollection extends Collection {
@@ -29766,14 +29906,7 @@ class WorkExpenseForm extends WorkTransactionForm {
29766
29906
  constructor(transaction, registeredForGst, allocations, homeOfficeClaim) {
29767
29907
  super(transaction, registeredForGst, allocations);
29768
29908
  this.homeOfficeClaim = homeOfficeClaim;
29769
- if (!transaction.chartAccounts?.hasWorkExpensePayer()) {
29770
- this.get('incomeSource').disable();
29771
- }
29772
- // amount set automatically for chartAccounts with hours meta field
29773
- if (transaction.getMetaFieldValue(ChartAccountsMetaFieldListEnum.HOURS)) {
29774
- this.get('amount').disable();
29775
- this.get('amountWithGST').disable();
29776
- }
29909
+ this.emitValues();
29777
29910
  }
29778
29911
  listenEvents() {
29779
29912
  this.watchChartAccountsMetaFields();
@@ -29781,18 +29914,22 @@ class WorkExpenseForm extends WorkTransactionForm {
29781
29914
  }
29782
29915
  watchChartAccountsMetaFields() {
29783
29916
  this.get('metaFields').valueChanges.subscribe((metaFields) => {
29784
- const hoursMetaField = new Collection(metaFields).findBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.HOURS);
29785
- if (!hoursMetaField) {
29786
- return;
29917
+ // fixed rate (ie amount per hour/kwh)
29918
+ const rateMetaFields = [ChartAccountsMetaFieldListEnum.KWH, ChartAccountsMetaFieldListEnum.HOURS];
29919
+ const rate = new Collection(metaFields).filterBy('chartAccountsMetaField.id', rateMetaFields).first?.value;
29920
+ if (rate) {
29921
+ const amount = +rate * this.get('chartAccounts').value.getCurrentYearValue().value;
29922
+ this.get('amount').reset();
29923
+ this.get('amount').disable();
29924
+ this.get('amount').setValue(amount);
29925
+ this.get('amountWithGST').reset();
29926
+ this.get('amountWithGST').disable();
29927
+ this.get('amountWithGST').setValue(amount);
29928
+ }
29929
+ else {
29930
+ this.get('amount').enable();
29931
+ this.get('amountWithGST').enable();
29787
29932
  }
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
29933
  });
29797
29934
  }
29798
29935
  watchChartAccounts() {