<?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of FacturaScripts
 * Copyright (C) 2019-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Carlos García Gómez <carlos@facturascripts.com>
-->
<view>
    <columns>
        <column name="id" display="none" order="100">
            <widget type="text" fieldname="idrecibo"/>
        </column>
        <column name="date" display="none" order="110">
            <widget type="date" fieldname="fecha"/>
        </column>
        <column name="invoice" order="120">
            <widget type="autocomplete" fieldname="idfactura" onclick="EditFacturaCliente" readonly="dinamic">
                <values source="facturascli" fieldcode="idfactura" fieldtitle="codigo"/>
            </widget>
        </column>
        <column name="number" order="130">
            <widget type="number" fieldname="numero" decimal="0"/>
        </column>
        <column name="customer" order="140">
            <widget type="autocomplete" fieldname="codcliente">
                <values source="clientes" fieldcode="codcliente" fieldtitle="nombre"/>
            </widget>
        </column>
        <column name="observations" order="150">
            <widget type="textarea" fieldname="observaciones"/>
        </column>
        <column name="amount" display="right" order="160">
            <widget type="money" fieldname="importe">
                <option color="danger">lt:0</option>
            </widget>
        </column>
        <column name="expenses" display="right" order="170">
            <widget type="money" fieldname="gastos">
                <option color="danger">gt:0</option>
            </widget>
        </column>
        <column name="paid" display="center" order="180">
            <widget type="checkbox" fieldname="pagado"/>
        </column>
        <column name="method-payment" display="right" order="185">
            <widget type="autocomplete" fieldname="codpago">
                <values source="formaspago" fieldcode="codpago" fieldtitle="descripcion"/>
            </widget>
        </column>
        <column name="payment-date" order="190">
            <widget type="date" fieldname="fechapago"/>
        </column>
        <column name="expiration" display="right" order="200">
            <widget type="date" fieldname="vencimiento"/>
        </column>
    </columns>
    <rows>
        <row type="status">
            <option color="success" fieldname="pagado" title="paid">1</option>
            <option color="danger" fieldname="vencido" title="expired-receipt">1</option>
        </row>
    </rows>
    <modals>
        <group name="generate-receipts" title="new">
            <column name="receipts" numcolumns="12">
                <widget type="number" fieldname="number" min="1" max="100" required="true" icon="fa-solid fa-copy"/>
            </column>
            <column name="amount-1" title="amount" description="optional" numcolumns="12">
                <widget type="money" fieldname="amount_1"/>
            </column>
            <column name="amount-2" title="amount" description="optional" numcolumns="12">
                <widget type="money" fieldname="amount_2"/>
            </column>
            <column name="amount-3" title="amount" description="optional" numcolumns="12">
                <widget type="money" fieldname="amount_3"/>
            </column>
        </group>
    </modals>
</view>