taxtank-core 0.28.54 → 0.28.56

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.
@@ -597,24 +597,25 @@
597
597
  AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 46] = "SOLE_DEPRECIATION_METHOD_UPDATED";
598
598
  AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 47] = "SOLE_DETAILS_CREATED";
599
599
  AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 48] = "SOLE_DETAILS_UPDATED";
600
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 49] = "TAX_REVIEW_UPDATED";
601
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 50] = "TRANSACTION_CREATED";
602
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 51] = "TRANSACTION_DELETED";
603
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 52] = "TRANSACTION_UPDATED";
604
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 53] = "TRANSACTION_UPDATED_WITH_RECEIPT";
605
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 54] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
606
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 55] = "TRANSACTION_RECEIPT_CREATED";
607
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 56] = "TRANSACTION_RECEIPT_DELETED";
608
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 57] = "TRANSACTIONS_CREATED";
609
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 58] = "USER_UPDATED";
610
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 59] = "VEHICLE_CLAIM_UPDATED";
611
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 60] = "VEHICLE_CLAIM_CREATED";
612
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 61] = "VEHICLE_CLAIM_DETAILS_UPDATED";
613
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 62] = "VEHICLE_CLAIM_DETAILS_CREATED";
614
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 63] = "VEHICLE_LOGBOOK_CREATED";
615
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 64] = "VEHICLE_LOGBOOK_UPDATED";
616
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 65] = "VEHICLE_LOGBOOK_DELETED";
617
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 66] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
600
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_INVOICE_PUBLISHED"] = 49] = "SOLE_INVOICE_PUBLISHED";
601
+ AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 50] = "TAX_REVIEW_UPDATED";
602
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 51] = "TRANSACTION_CREATED";
603
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 52] = "TRANSACTION_DELETED";
604
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 53] = "TRANSACTION_UPDATED";
605
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 54] = "TRANSACTION_UPDATED_WITH_RECEIPT";
606
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 55] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
607
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 56] = "TRANSACTION_RECEIPT_CREATED";
608
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 57] = "TRANSACTION_RECEIPT_DELETED";
609
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 58] = "TRANSACTIONS_CREATED";
610
+ AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 59] = "USER_UPDATED";
611
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 60] = "VEHICLE_CLAIM_UPDATED";
612
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 61] = "VEHICLE_CLAIM_CREATED";
613
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 62] = "VEHICLE_CLAIM_DETAILS_UPDATED";
614
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 63] = "VEHICLE_CLAIM_DETAILS_CREATED";
615
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 64] = "VEHICLE_LOGBOOK_CREATED";
616
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 65] = "VEHICLE_LOGBOOK_UPDATED";
617
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 66] = "VEHICLE_LOGBOOK_DELETED";
618
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 67] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
618
619
  })(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
619
620
 
620
621
  var EventDispatcherService = /** @class */ (function () {
@@ -8813,7 +8814,7 @@
8813
8814
  __extends(PropertyReportItemTransaction, _super);
8814
8815
  function PropertyReportItemTransaction(transactions, property, chartAccounts) {
8815
8816
  var _this = _super.call(this, property, chartAccounts) || this;
8816
- _this.amount = Math.abs(transactions.amount);
8817
+ _this.amount = Math.abs(transactions.grossAmount);
8817
8818
  _this.description = chartAccounts.name;
8818
8819
  return _this;
8819
8820
  }
@@ -12707,8 +12708,14 @@
12707
12708
  return this.update(updatedInvoice);
12708
12709
  };
12709
12710
  SoleInvoiceService.prototype.publish = function (invoice, document) {
12711
+ var _this = this;
12710
12712
  // use id only to avoid unexpected changes
12711
- return this.update(merge__default["default"]({}, invoice, { document: document, status: exports.SoleInvoiceStatusesEnum.PENDING }));
12713
+ return this.update(merge__default["default"]({}, invoice, { document: document, status: exports.SoleInvoiceStatusesEnum.PENDING }))
12714
+ .pipe(operators.map(function (publishedInvoice) {
12715
+ debugger;
12716
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.SOLE_INVOICE_PUBLISHED, publishedInvoice));
12717
+ return publishedInvoice;
12718
+ }));
12712
12719
  };
12713
12720
  SoleInvoiceService.prototype.sendEmail = function (invoice) {
12714
12721
  return this.http.post(this.environment.apiV2 + "/" + this.url + "/" + invoice.id + "/send", {});
@@ -14002,6 +14009,7 @@
14002
14009
  this.listenReceiptDeleted();
14003
14010
  this.listenVehicleClaimChanges();
14004
14011
  this.listenPropertyForecastUpdate();
14012
+ this.listenInvoicesPublish();
14005
14013
  };
14006
14014
  /**
14007
14015
  * get list of all user's TaxTank transactions
@@ -14317,6 +14325,12 @@
14317
14325
  replace(this.cache, transactionToReplace);
14318
14326
  this.updateCache();
14319
14327
  };
14328
+ TransactionService.prototype.listenInvoicesPublish = function () {
14329
+ var _this = this;
14330
+ this.eventDispatcherService.on(exports.AppEventTypeEnum.SOLE_INVOICE_PUBLISHED).subscribe(function () {
14331
+ _this.resetCache();
14332
+ });
14333
+ };
14320
14334
  return TransactionService;
14321
14335
  }(RestService));
14322
14336
  TransactionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TransactionService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }, { token: ToastService }, { token: TransactionReceiptService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });