taxtank-core 0.28.86 → 0.28.87

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.
@@ -600,23 +600,25 @@
600
600
  AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 49] = "SOLE_DETAILS_UPDATED";
601
601
  AppEventTypeEnum[AppEventTypeEnum["SOLE_INVOICE_PUBLISHED"] = 50] = "SOLE_INVOICE_PUBLISHED";
602
602
  AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 51] = "TAX_REVIEW_UPDATED";
603
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 52] = "TRANSACTION_CREATED";
604
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 53] = "TRANSACTION_DELETED";
605
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 54] = "TRANSACTION_UPDATED";
606
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 55] = "TRANSACTION_UPDATED_WITH_RECEIPT";
607
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 56] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
608
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 57] = "TRANSACTION_RECEIPT_CREATED";
609
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 58] = "TRANSACTION_RECEIPT_DELETED";
610
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 59] = "TRANSACTIONS_CREATED";
611
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 60] = "USER_UPDATED";
612
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 61] = "VEHICLE_CLAIM_UPDATED";
613
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 62] = "VEHICLE_CLAIM_CREATED";
614
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 63] = "VEHICLE_CLAIM_DETAILS_UPDATED";
615
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 64] = "VEHICLE_CLAIM_DETAILS_CREATED";
616
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 65] = "VEHICLE_LOGBOOK_CREATED";
617
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 66] = "VEHICLE_LOGBOOK_UPDATED";
618
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 67] = "VEHICLE_LOGBOOK_DELETED";
619
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 68] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
603
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_ALLOCATION_CREATED"] = 52] = "TRANSACTION_ALLOCATION_CREATED";
604
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_ALLOCATION_DELETED"] = 53] = "TRANSACTION_ALLOCATION_DELETED";
605
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 54] = "TRANSACTION_CREATED";
606
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 55] = "TRANSACTION_DELETED";
607
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 56] = "TRANSACTION_UPDATED";
608
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 57] = "TRANSACTION_UPDATED_WITH_RECEIPT";
609
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 58] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
610
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 59] = "TRANSACTION_RECEIPT_CREATED";
611
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 60] = "TRANSACTION_RECEIPT_DELETED";
612
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 61] = "TRANSACTIONS_CREATED";
613
+ AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 62] = "USER_UPDATED";
614
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 63] = "VEHICLE_CLAIM_UPDATED";
615
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 64] = "VEHICLE_CLAIM_CREATED";
616
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 65] = "VEHICLE_CLAIM_DETAILS_UPDATED";
617
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 66] = "VEHICLE_CLAIM_DETAILS_CREATED";
618
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 67] = "VEHICLE_LOGBOOK_CREATED";
619
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 68] = "VEHICLE_LOGBOOK_UPDATED";
620
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 69] = "VEHICLE_LOGBOOK_DELETED";
621
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 70] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
620
622
  })(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
621
623
 
622
624
  var EventDispatcherService = /** @class */ (function () {
@@ -7888,7 +7890,7 @@
7888
7890
  PropertyCategoryMovementCollection.prototype.getByForecast = function (property, forecast) {
7889
7891
  var financialYear = new FinancialYear(forecast.financialYear);
7890
7892
  return this.filterBy('property.id', property.id).filter(function (movement) {
7891
- return movement.fromDate <= financialYear.endDate && movement.toDate >= financialYear.startDate;
7893
+ return movement.fromDate <= financialYear.endDate && !movement.toDate || movement.toDate >= financialYear.startDate;
7892
7894
  });
7893
7895
  };
7894
7896
  PropertyCategoryMovementCollection.prototype.hasCategory = function (categoryId) {
@@ -12982,6 +12984,9 @@
12982
12984
  _this.isHydra = true;
12983
12985
  return _this;
12984
12986
  }
12987
+ SoleInvoiceService.prototype.listenEvents = function () {
12988
+ this.listenAllocations();
12989
+ };
12985
12990
  SoleInvoiceService.prototype.add = function (invoice) {
12986
12991
  var _this = this;
12987
12992
  return _super.prototype.add.call(this, invoice).pipe(operators.map(function (newInvoice) {
@@ -13030,6 +13035,15 @@
13030
13035
  var number = (_b = (_a = last__default["default"](this.cache)) === null || _a === void 0 ? void 0 : _a.number) !== null && _b !== void 0 ? _b : 0;
13031
13036
  return number + 1;
13032
13037
  };
13038
+ SoleInvoiceService.prototype.listenAllocations = function () {
13039
+ var _this = this;
13040
+ this.eventDispatcherService.on([
13041
+ exports.AppEventTypeEnum.TRANSACTION_ALLOCATION_CREATED,
13042
+ exports.AppEventTypeEnum.TRANSACTION_ALLOCATION_DELETED
13043
+ ]).subscribe(function () {
13044
+ _this.resetCache();
13045
+ });
13046
+ };
13033
13047
  return SoleInvoiceService;
13034
13048
  }(RestService));
13035
13049
  SoleInvoiceService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SoleInvoiceService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
@@ -14125,6 +14139,28 @@
14125
14139
  TransactionAllocationService.prototype.add = function (allocation) {
14126
14140
  return this.addBatch([allocation]).pipe(operators.map(function (newAllocations) { return newAllocations[0]; }));
14127
14141
  };
14142
+ TransactionAllocationService.prototype.addBatch = function (models, queryParams) {
14143
+ var _this = this;
14144
+ return _super.prototype.addBatch.call(this, models, queryParams)
14145
+ .pipe(operators.map(function (allocations) {
14146
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.TRANSACTION_ALLOCATION_CREATED, allocations));
14147
+ return allocations;
14148
+ }));
14149
+ };
14150
+ TransactionAllocationService.prototype.delete = function (model) {
14151
+ var _this = this;
14152
+ return _super.prototype.delete.call(this, model)
14153
+ .pipe(operators.map(function () {
14154
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.TRANSACTION_ALLOCATION_DELETED, null));
14155
+ }));
14156
+ };
14157
+ TransactionAllocationService.prototype.deleteBatch = function (models) {
14158
+ var _this = this;
14159
+ return _super.prototype.deleteBatch.call(this, models)
14160
+ .pipe(operators.map(function () {
14161
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.TRANSACTION_ALLOCATION_DELETED, null));
14162
+ }));
14163
+ };
14128
14164
  /**
14129
14165
  * get list of transactions allocations related with passed bank transactions list
14130
14166
  */
@@ -17610,7 +17646,6 @@
17610
17646
  var _this = this;
17611
17647
  if (force === void 0) { force = false; }
17612
17648
  if (this._serviceSubscription === undefined || force) {
17613
- console.log('getSubscription');
17614
17649
  this._serviceSubscription = null;
17615
17650
  this.http.get(this.environment.apiV2 + "/subscriptions/last")
17616
17651
  .pipe(operators.map(function (response) {