<?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of FacturaScripts
 * Copyright (C) 2017-2020 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 Artex Trading sa     <jcuello@artextrading.com>
 * @author Carlos García Gómez  <carlos@facturascripts.com>
-->
<view>
    <columns>
        <group name="master">
            <column name="exercise" numcolumns="2" order="100">
                <widget type="select" fieldname="codejercicio" readonly="true">
                    <values source="ejercicios" fieldcode="codejercicio" fieldtitle="nombre" />
                </widget>
            </column>
            <column name="date" numcolumns="2" order="100">
                <widget type="date" fieldname="fecha" readonly="true" />
            </column>
            <column name="concept" order="120">
                <widget type="text" fieldname="concepto" required="true" />
            </column>
            <column name="channel" numcolumns="1" order="130">
                <widget type="number" fieldname="canal" readonly="true" />
            </column>
            <column name="amount" numcolumns="2" display="right" order="200">
                <widget type="money" fieldname="importe" readonly="true" />
            </column>
        </group>
        <group name="detail">
            <column name="idasiento" order="100" display="none">
                <widget type="text" fieldname="idasiento" />
            </column>
            <column name="id" order="100" display="none">
                <widget type="text" fieldname="idpartida" />
            </column>
            <column name="subaccount" numcolumns="4" order="105">
                <widget type="autocomplete" fieldname="codsubcuenta" required="true">
                    <values source="subcuentas" fieldcode="codsubcuenta" fieldtitle="descripcion" />
                </widget>
            </column>
            <column name="counterpart" numcolumns="4" order="110">
                <widget type="autocomplete" fieldname="codcontrapartida" required="true">
                    <values source="subcuentas" fieldcode="codsubcuenta" fieldtitle="descripcion" />
                </widget>
            </column>
            <column name="description" order="115">
                <widget type="autocomplete" fieldname="concepto" required="true">
                    <values source="conceptos_partidas" fieldcode="descripcion" fieldtitle="codconcepto" strict="false" />
                </widget>
            </column>
            <column name="debit" numcolumns="3" display="right" order="120">
                <widget type="money" fieldname="debe">
                    <option color="danger">lt:0</option>
                </widget>
            </column>
            <column name="credit" numcolumns="3" display="right" order="130">
                <widget type="money" fieldname="haber">
                    <option color="danger">lt:0</option>
                </widget>
            </column>
        </group>
    </columns>
    <rows>
        <row type="actions">
            <button type="js" id="vat-register-btn" label="VAT-register" color="info" action="showVatRegister('vat-register')" hint="hint-vat-register" icon="fa-solid fa-book" />
            <button type="action" id="clone-btn" label="clone" color="info" action="clone" hint="clone-account-entry" icon="fa-solid fa-clone" />
            <button type="action" label="lock-unlock" color="warning" action="lock" hint="lock-unlock-account-entry" icon="fa-solid fa-lock" />
        </row>
    </rows>
    <modals>
        <group name="vat-register" class="modal-lg" title="VAT-register" icon="fa-solid fa-book">
            <column name="vat-document" numcolumns="6" description="desc-vat-document">
                <widget type="text" fieldname="documento" required="true" />
            </column>
            <column name="fiscal-number" numcolumns="6">
                <widget type="text" fieldname="cifnif" icon="fa-solid fa-id-card" required="true" />
            </column>
            <column name="tax-base" numcolumns="6">
                <widget type="money" decimal="2" fieldname="baseimponible" />
            </column>
            <column name="pct-vat" numcolumns="3">
                <widget type="number" decimal="2" fieldname="iva" />
            </column>
            <column name="surcharge" numcolumns="3">
                <widget type="number" decimal="2" fieldname="recargo" />
            </column>
        </group>
    </modals>
</view>
