taxtank-core 0.28.80 → 0.28.82

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.
@@ -7962,7 +7962,7 @@
7962
7962
  * Cash position is equal to Total Amount because income is positive and expense is negative,
7963
7963
  */
7964
7964
  get: function () {
7965
- return this.claimAmount;
7965
+ return this.grossAmount;
7966
7966
  },
7967
7967
  enumerable: false,
7968
7968
  configurable: true
@@ -7983,6 +7983,13 @@
7983
7983
  enumerable: false,
7984
7984
  configurable: true
7985
7985
  });
7986
+ Object.defineProperty(TransactionCollection.prototype, "grossAmount", {
7987
+ get: function () {
7988
+ return this.items.reduce(function (sum, transaction) { return sum + transaction.grossAmount; }, 0);
7989
+ },
7990
+ enumerable: false,
7991
+ configurable: true
7992
+ });
7986
7993
  TransactionCollection.prototype.getByChartAccountsCategories = function (categories) {
7987
7994
  return new TransactionCollection(this.items.filter(function (transaction) { return categories.includes(transaction.chartAccounts.category); }));
7988
7995
  };
@@ -19120,7 +19127,10 @@
19120
19127
  // we need invoice template only for new invoices
19121
19128
  if (!invoice.id) {
19122
19129
  (_this.commonData).addControl('template', new forms.FormControl(_this.defaultTemplate));
19123
- _this.updateTemplateRelatedFields(_this.defaultTemplate);
19130
+ // user can have no template, but he can add it from this form
19131
+ if (_this.defaultTemplate) {
19132
+ _this.updateTemplateRelatedFields(_this.defaultTemplate);
19133
+ }
19124
19134
  }
19125
19135
  // invoice.taxType is always NONE ('No Tax') when soleDetails.isGST === false
19126
19136
  if (!_this.soleDetailsGST) {