<?xml version="1.0" encoding="UTF-8" ?>
<templates>
    <t t-name="stock_account.StockValuationReport">
        <div class="o_action account_report">
            <ControlPanel>
                <!-- Buttons bar -->
                <t t-set-slot="control-panel-create-button">
                    <StockValuationReportButtonsBar/>
                </t>
                <!-- <t t-set-slot="control-panel-additional-actions">
                    <AccountReportCogMenu/>
                </t> -->

                <!-- Filters -->
                <t t-set-slot="layout-actions">
                   <div class="d-flex gap-1 flex-wrap">
                       <StockValuationReportFilters/>
                   </div>
                </t>
            </ControlPanel>
             <div class="o_content">
                <div id="warnings" class="warnings d-print-none"/>
                <div class="fit-content w-print-100">
                    <table class="table table-borderless table-hover w-print-100 mx-auto">
                        <tbody>
                            <t t-call="stock_account.StockValuationReport.InitialBalance"/>
                            <t t-if="data.inventory_loss" t-call="stock_account.StockValuationReport.InventoryLoss"/>
                            <t t-call="stock_account.StockValuationReport.StockVariation"/>
                            <t t-call="stock_account.StockValuationReport.EndingStock"/>
                            <!-- <t t-call="stock_account.StockValuationReport.Accrual"/> -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </t>

    <t t-name="stock_account.StockValuationReport.EmptyLine">
        <tr class="empty"><td colspan="3"/></tr>
    </t>

    <t t-name="stock_account.StockValuationReport.InitialBalance">
        <StockValuationReportLine
            label.translate="Initial Balance"
            level="0"
            onClickMethod="data.initial_balance.lines.length ? openAccountMoves.bind(this) : undefined"
            sublines="data.initial_balance.lines"
            value="data.initial_balance.value"
        />
        <t t-call="stock_account.StockValuationReport.EmptyLine"/>
    </t>

    <t t-name="stock_account.StockValuationReport.StockVariation">
        <StockValuationReportLine
            label.translate="Stock Variation"
            level="0"
            sublines="data.stock_variation.lines"
            displayDebitCredit="true"
            value="data.stock_variation.value"/>
        <t t-call="stock_account.StockValuationReport.EmptyLine"/>
    </t>

    <t t-name="stock_account.StockValuationReport.EndingStock">
        <StockValuationReportLine
            label.translate="Ending Stock"
            level="0"
            onClickMethod="data.ending_stock.lines.length ? openStockReport.bind(this) : undefined"
            sublines="data.ending_stock.lines"
            value="data.ending_stock.value"/>
        <t t-call="stock_account.StockValuationReport.EmptyLine"/>
    </t>

    <t t-name="stock_account.StockValuationReport.InventoryLoss">
        <StockValuationReportLine
            label.translate="Inventory Loss"
            level="0"
            displayDebitCredit="true"
            onClickMethod.bind="openInventoryLoss"
            sublines="data.inventory_loss.lines"
            value="data.inventory_loss.value"/>
        <t t-call="stock_account.StockValuationReport.EmptyLine"/>
    </t>

    <t t-name="stock_account.StockValuationReport.Accrual">
        <t t-if="accrual.lines.length">
            <StockValuationReportToggleLine
                label.translate="Accrual"
                sublines="accrual.lines"
                level="0"/>
        </t>
    </t>
</templates>
