<?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of FacturaScripts
 * Facturascripts       Copyright (C) 2015-2022 Carlos Garcia Gomez            <carlos@facturascripts.com>
 * AsientosPredefinidos Copyright (C) 2021-2022 Jeronimo Pedro Sánchez Manzano <socger@gmail.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/>.
 * 
 * Este fichero es parte del plugin PreAsientos de FacturaScripts 2020
 * @author Rafael del Pozo <pozo@us.es>
 * Basado en el table asientos.xml.
 * Estructura de la tabla prevariables. Hija de la tabla preasientos.
-->
<table>
        
    <column>
        <name>codcontrapartida</name>
        <type>character varying(15)</type>
    </column>
    <column>
        <name>codsubcuenta</name>
        <type>character varying(15)</type>
        <null>NO</null>
    </column>
    <column>
        <name>concepto</name>
        <type>character varying(255)</type>
    </column>

    <column>
        <name>debe</name>
        <type>character varying(50)</type>
        <null>NO</null>
        <default>0</default>
    </column>
    <column>
        <name>haber</name>
        <type>character varying(50)</type>
        <null>NO</null>
        <default>0</default>
    </column>
    <column>
        <name>id</name>
        <type>serial</type>
    </column>
    <column>
        <name>idasientopre</name>
        <type>integer</type>
        <null>NO</null>
    </column>
    <column>
        <name>orden</name>
        <type>integer</type>
        <null>NO</null>
        <default>0</default>
    </column>
    
    
    <constraint>
        <name>asientospre_lineas_pkey</name>
        <type>PRIMARY KEY (id)</type>
    </constraint>
    
    
    <constraint>
        <name>ca_asientospre_lineas_asientospre</name>
        <type>FOREIGN KEY (idasientopre) REFERENCES asientospre (id) ON DELETE CASCADE ON UPDATE CASCADE</type>
    </constraint>
</table>
