taxtank-core 2.1.69 → 2.1.71

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.
@@ -25679,23 +25679,26 @@ class BankAccountForm extends BankAccountAllocationForm {
25679
25679
  }
25680
25680
 
25681
25681
  class BankAccountsFilterForm extends AbstractForm {
25682
- constructor(availableCurrencies) {
25682
+ constructor(bankAccounts) {
25683
25683
  super({
25684
- tankType: new FormControl(null),
25684
+ tankType: new FormControl(),
25685
25685
  property: new FormControl(),
25686
25686
  isActive: new FormControl(true),
25687
25687
  searchQuery: new FormControl(''),
25688
- currencyType: new FormControl(CurrencyTypeEnum.ALL),
25688
+ currencyType: new FormControl({
25689
+ value: CurrencyTypeEnum.ALL,
25690
+ disabled: !bankAccounts.items.some(bankAccount => bankAccount.isForeign),
25691
+ }),
25689
25692
  currencies: new FormControl({ value: [], disabled: true }),
25690
25693
  });
25691
- this.availableCurrencies = availableCurrencies;
25694
+ this.bankAccounts = bankAccounts;
25692
25695
  this.listenFormControlsChanges();
25693
25696
  }
25694
25697
  listenFormControlsChanges() {
25695
25698
  this.get('currencyType').valueChanges.subscribe((value) => {
25696
25699
  if (value === CurrencyTypeEnum.FOREIGN) {
25697
25700
  this.get('currencies').enable();
25698
- this.get('currencies').setValue(this.availableCurrencies);
25701
+ this.get('currencies').setValue(this.bankAccounts.uniqMapBy('currency'));
25699
25702
  }
25700
25703
  else {
25701
25704
  this.get('currencies').disable();