taxtank-core 2.1.26 → 2.1.28

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.
@@ -9234,7 +9234,7 @@ class SoleInvoiceCollection extends Collection {
9234
9234
  return this.getOpen().filter(invoice => round(amountPerInvoice.get(invoice.id), 2) < invoice.grossPrice.toFixed(2));
9235
9235
  }
9236
9236
  getOpen() {
9237
- return this.filter((invoice) => invoice.isOpen());
9237
+ return this.filterBy('status', SoleInvoiceStatusesEnum.OPEN);
9238
9238
  }
9239
9239
  getInvoiceItemsIds() {
9240
9240
  return flatten(this.map(invoice => invoice.items.map(item => item.id)));
@@ -9258,7 +9258,11 @@ class SoleInvoiceCollection extends Collection {
9258
9258
  return this.sumBy('grossPrice');
9259
9259
  }
9260
9260
  toTransactions() {
9261
- return this.map(invoice => invoice.items.map(item => item.toTransaction({ claimAmount: item.totalPrice, date: invoice.dateFrom })).flat()).flat();
9261
+ return this.map(invoice => invoice.items.map(item => item.toTransaction({
9262
+ business: invoice.business,
9263
+ claimAmount: item.totalPrice,
9264
+ date: invoice.dateFrom,
9265
+ })).flat()).flat();
9262
9266
  }
9263
9267
  }
9264
9268
 
@@ -16706,6 +16710,12 @@ class SoleInvoiceService extends RestService$1 {
16706
16710
  }
16707
16711
  return list.first.number + 1;
16708
16712
  }
16713
+ getQuotes() {
16714
+ return this.get().pipe(map((invoices) => invoices.filterBy('type', SoleInvoiceTypeEnum.QUOTE)));
16715
+ }
16716
+ getInvoices() {
16717
+ return this.get().pipe(map((invoices) => invoices.filterBy('type', SoleInvoiceTypeEnum.INVOICE)));
16718
+ }
16709
16719
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SoleInvoiceService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
16710
16720
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SoleInvoiceService, providedIn: 'root' }); }
16711
16721
  }