taxtank-core 0.28.38 → 0.28.41

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.
Files changed (26) hide show
  1. package/bundles/taxtank-core.umd.js +33 -17
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/tax-summary/report-item.collection.js +2 -2
  4. package/esm2015/lib/collections/tax-summary/tax-return-categories.const.js +5 -4
  5. package/esm2015/lib/db/Enums/tax-return-category-list.enum.js +4 -1
  6. package/esm2015/lib/db/Models/depreciation/depreciation.js +1 -1
  7. package/esm2015/lib/db/Models/transaction/transaction-base.js +8 -1
  8. package/esm2015/lib/db/Models/transaction/transaction.js +1 -1
  9. package/esm2015/lib/interfaces/asset-type.enum.js +8 -4
  10. package/esm2015/lib/models/chart-accounts/chart-accounts.js +7 -1
  11. package/esm2015/lib/models/depreciation/depreciation-receipt.js +2 -2
  12. package/esm2015/lib/models/document/document.js +2 -2
  13. package/esm2015/lib/models/property/property-document.js +2 -2
  14. package/esm2015/lib/models/sole/sole-invoice-item.js +1 -5
  15. package/esm2015/lib/models/sole/sole-invoice.js +4 -3
  16. package/esm2015/lib/models/transaction/transaction-receipt.js +2 -2
  17. package/fesm2015/taxtank-core.js +33 -17
  18. package/fesm2015/taxtank-core.js.map +1 -1
  19. package/lib/db/Enums/tax-return-category-list.enum.d.ts +3 -0
  20. package/lib/db/Models/depreciation/depreciation.d.ts +1 -0
  21. package/lib/db/Models/transaction/transaction-base.d.ts +8 -2
  22. package/lib/db/Models/transaction/transaction.d.ts +1 -0
  23. package/lib/interfaces/asset-type.enum.d.ts +8 -3
  24. package/lib/models/chart-accounts/chart-accounts.d.ts +6 -0
  25. package/lib/models/sole/sole-invoice-item.d.ts +0 -4
  26. package/package.json +1 -1
@@ -2764,6 +2764,12 @@ class ChartAccounts extends ChartAccounts$1 {
2764
2764
  return (this.isWorkExpense() || this.isSoleExpense()) && (!this.isVehicleExpense() && !this.isPersonalExpense());
2765
2765
  }
2766
2766
  }
2767
+ /**
2768
+ * Australian GST percent value (VAT)
2769
+ */
2770
+ ChartAccounts.GSTRatio = 0.1;
2771
+ ChartAccounts.GSTCoefficient = 1.1;
2772
+ ChartAccounts.GSTPercent = 10;
2767
2773
  __decorate([
2768
2774
  Type(() => ChartAccountsHeading)
2769
2775
  ], ChartAccounts.prototype, "heading", void 0);
@@ -2816,6 +2822,12 @@ class TransactionBase extends AbstractModel {
2816
2822
  }
2817
2823
  return !!this.business;
2818
2824
  }
2825
+ getAmountWithGst() {
2826
+ return this.isGST ? +(this.amount * ChartAccounts.GSTCoefficient).toFixed(2) : this.amount;
2827
+ }
2828
+ getGstAmount() {
2829
+ return +(this.getAmountWithGst() - this.amount).toFixed(2);
2830
+ }
2819
2831
  }
2820
2832
  __decorate([
2821
2833
  Exclude({ toPlainOnly: true }),
@@ -2868,15 +2880,19 @@ var DepreciationCalculationEnum;
2868
2880
  class TransactionReceipt$1 extends AbstractModel {
2869
2881
  }
2870
2882
 
2871
- // @TODO this enum should come from backend
2872
2883
  /**
2873
2884
  * Enum with asset types
2874
2885
  */
2875
2886
  var AssetTypeEnum;
2876
2887
  (function (AssetTypeEnum) {
2877
- AssetTypeEnum["RECEIPTS"] = "receipts";
2878
- AssetTypeEnum["DOCUMENTS"] = "documents";
2888
+ AssetTypeEnum["TRANSACTION_RECEIPT"] = "transactionReceipt";
2889
+ AssetTypeEnum["PROPERTY"] = "property";
2890
+ AssetTypeEnum["DOCUMENT"] = "document";
2879
2891
  AssetTypeEnum["MESSAGE"] = "message";
2892
+ AssetTypeEnum["USER_PHOTO"] = "userPhoto";
2893
+ AssetTypeEnum["PROPERTY_PHOTO"] = "propertyPhoto";
2894
+ AssetTypeEnum["DEPRECIATION_RECEIPT"] = "depreciationReceipt";
2895
+ AssetTypeEnum["FIRM_PHOTO"] = "firmPhoto";
2880
2896
  })(AssetTypeEnum || (AssetTypeEnum = {}));
2881
2897
 
2882
2898
  /**
@@ -2894,7 +2910,7 @@ var AssetEntityTypeEnum;
2894
2910
  class TransactionReceipt extends TransactionReceipt$1 {
2895
2911
  constructor() {
2896
2912
  super(...arguments);
2897
- this.type = AssetTypeEnum.RECEIPTS;
2913
+ this.type = AssetTypeEnum.TRANSACTION_RECEIPT;
2898
2914
  this.entityType = AssetEntityTypeEnum.TRANSACTIONS;
2899
2915
  }
2900
2916
  }
@@ -3603,10 +3619,6 @@ class SoleInvoiceItem extends SoleInvoiceItem$1 {
3603
3619
  return this.price * this.quantity;
3604
3620
  }
3605
3621
  }
3606
- /**
3607
- * GST percent value
3608
- */
3609
- SoleInvoiceItem.GSTRatio = 0.1;
3610
3622
  __decorate([
3611
3623
  Type(() => SoleInvoice)
3612
3624
  ], SoleInvoiceItem.prototype, "invoice", void 0);
@@ -3756,13 +3768,13 @@ class SoleInvoice extends SoleInvoice$1 {
3756
3768
  */
3757
3769
  get inclusiveGSTAmount() {
3758
3770
  const gstPrice = this.itemsCollection.gstPrice;
3759
- return +(gstPrice - (gstPrice / (1 + SoleInvoiceItem.GSTRatio))).toFixed(2);
3771
+ return +(gstPrice - (gstPrice / (1 + ChartAccounts.GSTRatio))).toFixed(2);
3760
3772
  }
3761
3773
  /**
3762
3774
  * When tax exclusive, GST amount should be added additionally to total price
3763
3775
  */
3764
3776
  get exclusiveGSTAmount() {
3765
- return +(this.itemsCollection.gstPrice * SoleInvoiceItem.GSTRatio).toFixed(2);
3777
+ return +(this.itemsCollection.gstPrice * ChartAccounts.GSTRatio).toFixed(2);
3766
3778
  }
3767
3779
  isDraft() {
3768
3780
  return this.status === SoleInvoiceStatusesEnum.DRAFT;
@@ -4241,7 +4253,7 @@ class PropertyDocument$1 extends AbstractModel {
4241
4253
  class PropertyDocument extends PropertyDocument$1 {
4242
4254
  constructor() {
4243
4255
  super(...arguments);
4244
- this.type = AssetTypeEnum.DOCUMENTS;
4256
+ this.type = AssetTypeEnum.DOCUMENT;
4245
4257
  this.entityType = AssetEntityTypeEnum.PROPERTIES;
4246
4258
  }
4247
4259
  getApiUrlPrefix() {
@@ -5027,7 +5039,7 @@ var DocumentApiUrlPrefixEnum;
5027
5039
  class Document extends Document$1 {
5028
5040
  constructor() {
5029
5041
  super(...arguments);
5030
- this.type = AssetTypeEnum.DOCUMENTS;
5042
+ this.type = AssetTypeEnum.DOCUMENT;
5031
5043
  this.entityType = AssetEntityTypeEnum.FOLDERS;
5032
5044
  }
5033
5045
  /**
@@ -6974,7 +6986,7 @@ class ReportItemCollection extends Collection {
6974
6986
  getBySection(section) {
6975
6987
  let result = [];
6976
6988
  for (let reportItem of this.items) {
6977
- if (reportItem.details.length && reportItem.taxReturnCategory.section === section) {
6989
+ if ((reportItem.details.length || reportItem.amount) && reportItem.taxReturnCategory.section === section) {
6978
6990
  result.push(reportItem);
6979
6991
  }
6980
6992
  else {
@@ -7089,6 +7101,9 @@ var TaxReturnCategoryListEnum;
7089
7101
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_INSTALMENTS"] = 25] = "TAX_INSTALMENTS";
7090
7102
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["FRANKING_CREDITS"] = 26] = "FRANKING_CREDITS";
7091
7103
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS"] = 27] = "TAX_OFFSETS";
7104
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_LOW"] = 61] = "TAX_OFFSETS_LOW";
7105
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_MIDDLE"] = 62] = "TAX_OFFSETS_MIDDLE";
7106
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_SOLE"] = 63] = "TAX_OFFSETS_SOLE";
7092
7107
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_PAYABLE"] = 28] = "TAX_PAYABLE";
7093
7108
  })(TaxReturnCategoryListEnum || (TaxReturnCategoryListEnum = {}));
7094
7109
 
@@ -7153,7 +7168,9 @@ const TAX_RETURN_CATEGORIES = {
7153
7168
  TaxReturnCategoryListEnum.TAX_CREDITS
7154
7169
  ],
7155
7170
  taxOffsets: [
7156
- TaxReturnCategoryListEnum.TAX_OFFSETS
7171
+ TaxReturnCategoryListEnum.TAX_OFFSETS,
7172
+ TaxReturnCategoryListEnum.TAX_OFFSETS_LOW,
7173
+ TaxReturnCategoryListEnum.TAX_OFFSETS_MIDDLE,
7157
7174
  ]
7158
7175
  },
7159
7176
  sole: {
@@ -7177,9 +7194,8 @@ const TAX_RETURN_CATEGORIES = {
7177
7194
  TaxReturnCategoryListEnum.MOTOR_VEHICLE_EXPENSES,
7178
7195
  TaxReturnCategoryListEnum.ALL_OTHER_EXPENSES
7179
7196
  ],
7180
- // @TODO TT-2386 Nikita to move sole tax offsets in separated category
7181
7197
  taxOffsets: [
7182
- TaxReturnCategoryListEnum.TAX_OFFSETS
7198
+ TaxReturnCategoryListEnum.TAX_OFFSETS_SOLE
7183
7199
  ],
7184
7200
  },
7185
7201
  };
@@ -8213,7 +8229,7 @@ class DepreciationReceipt$1 extends AbstractModel {
8213
8229
  class DepreciationReceipt extends DepreciationReceipt$1 {
8214
8230
  constructor() {
8215
8231
  super(...arguments);
8216
- this.type = AssetTypeEnum.RECEIPTS;
8232
+ this.type = AssetTypeEnum.DEPRECIATION_RECEIPT;
8217
8233
  this.entityType = AssetEntityTypeEnum.DEPRECIATIONS;
8218
8234
  }
8219
8235
  }