taxtank-core 0.28.79 → 0.28.80

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