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
@@ -3570,6 +3570,12 @@
3570
3570
  };
3571
3571
  return ChartAccounts;
3572
3572
  }(ChartAccounts$1));
3573
+ /**
3574
+ * Australian GST percent value (VAT)
3575
+ */
3576
+ ChartAccounts.GSTRatio = 0.1;
3577
+ ChartAccounts.GSTCoefficient = 1.1;
3578
+ ChartAccounts.GSTPercent = 10;
3573
3579
  __decorate([
3574
3580
  classTransformer.Type(function () { return ChartAccountsHeading; })
3575
3581
  ], ChartAccounts.prototype, "heading", void 0);
@@ -3630,6 +3636,12 @@
3630
3636
  }
3631
3637
  return !!this.business;
3632
3638
  };
3639
+ TransactionBase.prototype.getAmountWithGst = function () {
3640
+ return this.isGST ? +(this.amount * ChartAccounts.GSTCoefficient).toFixed(2) : this.amount;
3641
+ };
3642
+ TransactionBase.prototype.getGstAmount = function () {
3643
+ return +(this.getAmountWithGst() - this.amount).toFixed(2);
3644
+ };
3633
3645
  return TransactionBase;
3634
3646
  }(AbstractModel));
3635
3647
  __decorate([
@@ -3694,15 +3706,19 @@
3694
3706
  return TransactionReceipt;
3695
3707
  }(AbstractModel));
3696
3708
 
3697
- // @TODO this enum should come from backend
3698
3709
  /**
3699
3710
  * Enum with asset types
3700
3711
  */
3701
3712
  exports.AssetTypeEnum = void 0;
3702
3713
  (function (AssetTypeEnum) {
3703
- AssetTypeEnum["RECEIPTS"] = "receipts";
3704
- AssetTypeEnum["DOCUMENTS"] = "documents";
3714
+ AssetTypeEnum["TRANSACTION_RECEIPT"] = "transactionReceipt";
3715
+ AssetTypeEnum["PROPERTY"] = "property";
3716
+ AssetTypeEnum["DOCUMENT"] = "document";
3705
3717
  AssetTypeEnum["MESSAGE"] = "message";
3718
+ AssetTypeEnum["USER_PHOTO"] = "userPhoto";
3719
+ AssetTypeEnum["PROPERTY_PHOTO"] = "propertyPhoto";
3720
+ AssetTypeEnum["DEPRECIATION_RECEIPT"] = "depreciationReceipt";
3721
+ AssetTypeEnum["FIRM_PHOTO"] = "firmPhoto";
3706
3722
  })(exports.AssetTypeEnum || (exports.AssetTypeEnum = {}));
3707
3723
 
3708
3724
  /**
@@ -3721,7 +3737,7 @@
3721
3737
  __extends(TransactionReceipt, _super);
3722
3738
  function TransactionReceipt() {
3723
3739
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
3724
- _this.type = exports.AssetTypeEnum.RECEIPTS;
3740
+ _this.type = exports.AssetTypeEnum.TRANSACTION_RECEIPT;
3725
3741
  _this.entityType = exports.AssetEntityTypeEnum.TRANSACTIONS;
3726
3742
  return _this;
3727
3743
  }
@@ -4651,10 +4667,6 @@
4651
4667
  });
4652
4668
  return SoleInvoiceItem;
4653
4669
  }(SoleInvoiceItem$1));
4654
- /**
4655
- * GST percent value
4656
- */
4657
- SoleInvoiceItem.GSTRatio = 0.1;
4658
4670
  __decorate([
4659
4671
  classTransformer.Type(function () { return SoleInvoice; })
4660
4672
  ], SoleInvoiceItem.prototype, "invoice", void 0);
@@ -4862,7 +4874,7 @@
4862
4874
  */
4863
4875
  get: function () {
4864
4876
  var gstPrice = this.itemsCollection.gstPrice;
4865
- return +(gstPrice - (gstPrice / (1 + SoleInvoiceItem.GSTRatio))).toFixed(2);
4877
+ return +(gstPrice - (gstPrice / (1 + ChartAccounts.GSTRatio))).toFixed(2);
4866
4878
  },
4867
4879
  enumerable: false,
4868
4880
  configurable: true
@@ -4872,7 +4884,7 @@
4872
4884
  * When tax exclusive, GST amount should be added additionally to total price
4873
4885
  */
4874
4886
  get: function () {
4875
- return +(this.itemsCollection.gstPrice * SoleInvoiceItem.GSTRatio).toFixed(2);
4887
+ return +(this.itemsCollection.gstPrice * ChartAccounts.GSTRatio).toFixed(2);
4876
4888
  },
4877
4889
  enumerable: false,
4878
4890
  configurable: true
@@ -5492,7 +5504,7 @@
5492
5504
  __extends(PropertyDocument, _super);
5493
5505
  function PropertyDocument() {
5494
5506
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
5495
- _this.type = exports.AssetTypeEnum.DOCUMENTS;
5507
+ _this.type = exports.AssetTypeEnum.DOCUMENT;
5496
5508
  _this.entityType = exports.AssetEntityTypeEnum.PROPERTIES;
5497
5509
  return _this;
5498
5510
  }
@@ -6491,7 +6503,7 @@
6491
6503
  __extends(Document, _super);
6492
6504
  function Document() {
6493
6505
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
6494
- _this.type = exports.AssetTypeEnum.DOCUMENTS;
6506
+ _this.type = exports.AssetTypeEnum.DOCUMENT;
6495
6507
  _this.entityType = exports.AssetEntityTypeEnum.FOLDERS;
6496
6508
  return _this;
6497
6509
  }
@@ -8864,7 +8876,7 @@
8864
8876
  try {
8865
8877
  for (var _b = __values(this.items), _c = _b.next(); !_c.done; _c = _b.next()) {
8866
8878
  var reportItem = _c.value;
8867
- if (reportItem.details.length && reportItem.taxReturnCategory.section === section) {
8879
+ if ((reportItem.details.length || reportItem.amount) && reportItem.taxReturnCategory.section === section) {
8868
8880
  result.push(reportItem);
8869
8881
  }
8870
8882
  else {
@@ -9011,6 +9023,9 @@
9011
9023
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_INSTALMENTS"] = 25] = "TAX_INSTALMENTS";
9012
9024
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["FRANKING_CREDITS"] = 26] = "FRANKING_CREDITS";
9013
9025
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS"] = 27] = "TAX_OFFSETS";
9026
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_LOW"] = 61] = "TAX_OFFSETS_LOW";
9027
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_MIDDLE"] = 62] = "TAX_OFFSETS_MIDDLE";
9028
+ TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_OFFSETS_SOLE"] = 63] = "TAX_OFFSETS_SOLE";
9014
9029
  TaxReturnCategoryListEnum[TaxReturnCategoryListEnum["TAX_PAYABLE"] = 28] = "TAX_PAYABLE";
9015
9030
  })(exports.TaxReturnCategoryListEnum || (exports.TaxReturnCategoryListEnum = {}));
9016
9031
 
@@ -9075,7 +9090,9 @@
9075
9090
  exports.TaxReturnCategoryListEnum.TAX_CREDITS
9076
9091
  ],
9077
9092
  taxOffsets: [
9078
- exports.TaxReturnCategoryListEnum.TAX_OFFSETS
9093
+ exports.TaxReturnCategoryListEnum.TAX_OFFSETS,
9094
+ exports.TaxReturnCategoryListEnum.TAX_OFFSETS_LOW,
9095
+ exports.TaxReturnCategoryListEnum.TAX_OFFSETS_MIDDLE,
9079
9096
  ]
9080
9097
  },
9081
9098
  sole: {
@@ -9099,9 +9116,8 @@
9099
9116
  exports.TaxReturnCategoryListEnum.MOTOR_VEHICLE_EXPENSES,
9100
9117
  exports.TaxReturnCategoryListEnum.ALL_OTHER_EXPENSES
9101
9118
  ],
9102
- // @TODO TT-2386 Nikita to move sole tax offsets in separated category
9103
9119
  taxOffsets: [
9104
- exports.TaxReturnCategoryListEnum.TAX_OFFSETS
9120
+ exports.TaxReturnCategoryListEnum.TAX_OFFSETS_SOLE
9105
9121
  ],
9106
9122
  },
9107
9123
  };
@@ -10296,7 +10312,7 @@
10296
10312
  __extends(DepreciationReceipt, _super);
10297
10313
  function DepreciationReceipt() {
10298
10314
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
10299
- _this.type = exports.AssetTypeEnum.RECEIPTS;
10315
+ _this.type = exports.AssetTypeEnum.DEPRECIATION_RECEIPT;
10300
10316
  _this.entityType = exports.AssetEntityTypeEnum.DEPRECIATIONS;
10301
10317
  return _this;
10302
10318
  }