// Fusion Accounting - Multicurrency Revaluation Filters
// Copyright (C) 2026 Nexa Systems Inc.

import { AccountReport } from "@fusion_accounting/components/account_report/account_report";
import { AccountReportFilters } from "@fusion_accounting/components/account_report/filters/filters";

/**
 * MulticurrencyRevaluationReportFilters - Filter panel extension for the
 * multicurrency revaluation report with exchange rate display options.
 */
export class MulticurrencyRevaluationReportFilters extends AccountReportFilters {
    static template = "fusion_accounting.MulticurrencyRevaluationReportFilters";

    //------------------------------------------------------------------------------------------------------------------
    // Custom filters
    //------------------------------------------------------------------------------------------------------------------
    async filterExchangeRate(ev, currencyId) {
        this.controller.options.currency_rates[currencyId].rate = ev.currentTarget.value;
    }
}

AccountReport.registerCustomComponent(MulticurrencyRevaluationReportFilters);
