<?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of FacturaScripts
 * Copyright (C) 2017-2024 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>
 * @author Artex Trading sa     <jcuello@artextrading.com>
-->
<view>
    <columns>
        <column name="id" display="none" order="90">
            <widget type="text" fieldname="idfactura"/>
        </column>
        <column name="company" display="none" order="100">
            <widget type="select" fieldname="idempresa">
                <values source="empresas" fieldcode="idempresa" fieldtitle="nombrecorto"/>
            </widget>
        </column>
        <column name="warehouse" display="none" order="110">
            <widget type="select" fieldname="codalmacen">
                <values source="almacenes" fieldcode="codalmacen" fieldtitle="nombre"/>
            </widget>
        </column>
        <column name="serie" display="none" order="120">
            <widget type="select" fieldname="codserie">
                <values source="series" fieldcode="codserie" fieldtitle="codserie"/>
            </widget>
        </column>
        <column name="exercise" display="none" order="130">
            <widget type="select" fieldname="codejercicio">
                <values source="ejercicios" fieldcode="codejercicio" fieldtitle="codejercicio"/>
            </widget>
        </column>
        <column name="number" display="none" order="140">
            <widget type="text" fieldname="numero"/>
        </column>
        <column name="code" order="150">
            <widget type="text" fieldname="codigo"/>
        </column>
        <column name="original" display="none" order="155">
            <widget type="text" fieldname="codigorect"/>
        </column>
        <column name="numsupplier" order="160">
            <widget type="text" fieldname="numproveedor"/>
        </column>
        <column name="supplier-code" display="none" order="170">
            <widget type="text" fieldname="codproveedor"/>
        </column>
        <column name="supplier" order="180">
            <widget type="text" fieldname="nombre"/>
        </column>
        <column name="fiscal-number" display="none" order="190">
            <widget type="text" fieldname="cifnif"/>
        </column>
        <column name="observations" order="200">
            <widget type="textarea" fieldname="observaciones"/>
        </column>
        <column name="status" display="none" order="210">
            <widget type="autocomplete" fieldname="idestado">
                <values source="estados_documentos" fieldcode="idestado" fieldtitle="nombre"/>
            </widget>
        </column>
        <column name="number-attachments" display="none" order="215">
            <widget type="number" fieldname="numdocs" decimal="0"/>
        </column>
        <column name="email-sent" display="none" order="220">
            <widget type="checkbox" fieldname="femail"/>
        </column>
        <column name="paid" display="center" order="230">
            <widget type="checkbox" fieldname="pagada"/>
        </column>
        <column name="payment-method" display="none" order="240">
            <widget type="select" fieldname="codpago">
                <values source="formaspago" fieldcode="codpago" fieldtitle="descripcion"/>
            </widget>
        </column>
        <column name="subtotal" display="none" order="250">
            <widget type="money" fieldname="netosindto"/>
        </column>
        <column name="global-dto" display="none" order="260">
            <widget type="percentage" fieldname="dtopor1"/>
        </column>
        <column name="global-dto-2" display="none" order="270">
            <widget type="percentage" fieldname="dtopor2"/>
        </column>
        <column name="net" display="none" order="280">
            <widget type="money" fieldname="neto"/>
        </column>
        <column name="taxes" display="none" order="290">
            <widget type="money" fieldname="totaliva"/>
        </column>
        <column name="surcharge" display="none" order="300">
            <widget type="money" fieldname="totalrecargo"/>
        </column>
        <column name="retention" display="none" order="310">
            <widget type="percentage" fieldname="irpf"/>
        </column>
        <column name="retentions" display="none" order="320">
            <widget type="money" fieldname="totalirpf"/>
        </column>
        <column name="supplied-amount" display="none" order="330">
            <widget type="money" fieldname="totalsuplidos"/>
        </column>
        <column name="total" display="right" order="340">
            <widget type="money" fieldname="total">
                <option color="danger">lt:0</option>
            </widget>
        </column>
        <column name="currency" display="none" order="350">
            <widget type="select" fieldname="coddivisa">
                <values source="divisas" fieldcode="coddivisa" fieldtitle="coddivisa"/>
            </widget>
        </column>
        <column name="conversion-rate" display="none" order="360">
            <widget type="number" fieldname="tasaconv"/>
        </column>
        <column name="totaleuros" display="none" order="370">
            <widget type="money" fieldname="totaleuros"/>
        </column>
        <column name="date" display="right" order="380">
            <widget type="date" fieldname="fecha"/>
        </column>
    </columns>
    <modals>
        <group name="renumber-invoices" title="renumber" icon="fa-solid fa-sort-numeric-down">
            <column name="exercise" description="renumber-invoices-p">
                <widget type="select" fieldname="exercise" required="true">
                    <values source="ejercicios" fieldcode="codejercicio"/>
                </widget>
            </column>
        </group>
    </modals>
    <rows>
        <row type="status">
            <option color="dark" title="rectified-invoice" fieldname="idfacturarect">notnull:</option>
            <option color="success" title="paid" fieldname="pagada">1</option>
            <option color="danger" fieldname="vencida" title="expired-receipt">1</option>
            <option color="warning" title="non-editable-document" fieldname="editable">0</option>
            <option color="info" title="email-sent" fieldname="femail">notnull:</option>
            <option color="secondary" title="invoice-without-acc-entry" fieldname="idasiento">null:</option>
        </row>
    </rows>
</view>
