taxtank-core 0.28.79 → 0.28.81

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
  };
@@ -12993,12 +13000,21 @@
12993
13000
  return newInvoice;
12994
13001
  }));
12995
13002
  };
13003
+ SoleInvoiceService.prototype.update = function (invoice) {
13004
+ var _this = this;
13005
+ return _super.prototype.update.call(this, invoice).pipe(operators.map(function (updatedInvoice) {
13006
+ if (!updatedInvoice.isDraft()) {
13007
+ // @TODO vik use different event to reload transactions
13008
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.SOLE_INVOICE_PUBLISHED, updatedInvoice));
13009
+ }
13010
+ return updatedInvoice;
13011
+ }));
13012
+ };
12996
13013
  SoleInvoiceService.prototype.updateStatus = function (invoice, status) {
12997
13014
  var _this = this;
12998
13015
  // @TODO use id only to avoid unexpected changes
12999
13016
  return this.update(Object.assign({}, invoice, { status: status })).pipe(operators.map(function (updatedInvoice) {
13000
- // draft invoice status can be changed to pending only, which means publish
13001
- if (invoice.isDraft()) {
13017
+ if (updatedInvoice.isPending()) {
13002
13018
  _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.SOLE_INVOICE_PUBLISHED, updatedInvoice));
13003
13019
  }
13004
13020
  return updatedInvoice;