--- bulmages-0.9.1.orig/debian/guardaemp.1 +++ bulmages-0.9.1/debian/guardaemp.1 @@ -0,0 +1,16 @@ +.TH guardaemp 1 User Manuals +.SH NAME +guardaemp \- saves a enterprise for bulmacont accounting program +.SH SYNOPSIS +\fBguardaemp +\f1 +.SH DESCRIPTION +guardaemp is used to save one enterprise for bulmacont, a accounting program for small amd midle bussines. +.SH AUTHOR +guardaemp was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/copyright +++ bulmages-0.9.1/debian/copyright @@ -0,0 +1,48 @@ +This package was debianized by René Mérou on +Sun, 2 Apr 2006 09:29:45 +0200. + +It was downloaded from http://download.berlios.de/bulmages/bulmages-0.5.1.1.tar.gz + +Copyright Holder: (C) 2004-2006 IGLUES + +Upstream Authors: Tomeu Borrás , Josep Maria Estopa Rey +, Josep Burción , René Mérou +, David Gutiérez , Joan Miquel +Torres Rigó , Francisco Santiago Capel Torres + +License: + +This program is free software; you can redistribute it and/or modify it +under the terms of the "GNU General Public License". On Debian GNU/Linux +systems, the complete text of that license can be found in +`/usr/share/common-licenses/GPL'. + +* There are two files (fixed.h, i fixed.cpp that they was released as Public Domain and has been modified for bulmages) + Upstream: Philip Erdelsky's + Dowloaded from: http://efgh.com/software/fixed.htm + Public Domain (C) 1998 + +* This program includes files from tiny SPRL project, edited to change some behavoires. We changed the name of binaries to bgtrml2pdf to avoid conflicts. The bgtrml2pdf is distributed under the terms of LGPL licence: +It was downloaded from . + +Copyright Holder: Tiny SPRL , + Martin von Loewis , + Terje Rosten , + Nicolas Evrard + + Copyright (C) 2000-2006 Tiny SPRL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + --- bulmages-0.9.1.orig/debian/creabulmafact +++ bulmages-0.9.1/debian/creabulmafact @@ -0,0 +1,3 @@ +#!/bin/sh +cd /usr/share/bulmages/dbmodels/ +. ./creabulmafact --- bulmages-0.9.1.orig/debian/bulmacont.menu +++ bulmages-0.9.1/debian/bulmacont.menu @@ -0,0 +1,2 @@ +?package(bulmacont):needs="X11" section="Apps/Tools" longtitle="BulmaCont: accounting aplication" title="BulmaCont" command="/usr/bin/bulmacont" icon="/usr/share/bulmages/icons/iconbulmacont.xpm" + --- bulmages-0.9.1.orig/debian/dirs +++ bulmages-0.9.1/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/sbin +usr/lib \ No newline at end of file --- bulmages-0.9.1.orig/debian/nuevaemp.1 +++ bulmages-0.9.1/debian/nuevaemp.1 @@ -0,0 +1,16 @@ +.TH nuevaemp 1 User Manuals +.SH NAME +nuevaemp \- creates a enterprise for bulmacont accounting program +.SH SYNOPSIS +\fBnuevaemp +\f1 +.SH DESCRIPTION +nuevaemp is used to create one enterprise for bulmacont, a accounting program for small amd midle bussines. +.SH AUTHOR +nuevaemp was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/README.es.Debian +++ bulmages-0.9.1/debian/README.es.Debian @@ -0,0 +1,14 @@ +vbulmages para Debian +------------------- +Para ejecutar bulmacont o bulmafact por primera vez, es necesario que se instalen las bases de datos. +Para instalar la base de datos de bulmacont el root debe ejecutar execute /usr/sbin/bulmacont-server-install +Para instalar la base de datos de bulmafact el root debe ejecutar /usr/sbin/bulmafact-server-install + + +Usamos los ficheros /etc/bulmacont-server.conf y /etc/bulmafact-server.conf como indicadores de que hay una versión instalada previa de la base de datos. Esos ficheros no serán borrados con apt-get. Si se desea reinstalar bulmacont-server y bulmafact-server, borrense los ficheros /etc/bulma* y las bases de datos bulmacont bulmafact y bgplangcont. Mi gratitud también para Tomeu Borras que me ayudó resolviendo errores en el paquete debian. +---- + +Quiero expresar mi agradeciento a Baby y Xerakko del canal #debian-mentors-es del IRC freenode. Su ayuda fue muy importante para hacer este paquete. +También quiero agradecer a Javier Linares su ayuda al guiarme para hacer mi primer paquete debian como ejercicio y a Juan Antonio Marqués Sanchis por su ayuda resolviendo un bug. + + -- René Mérou , sat, 23 Sep 2006 22:59:41 +0200 --- bulmages-0.9.1.orig/debian/bulmacont-server-install +++ bulmages-0.9.1/debian/bulmacont-server-install @@ -0,0 +1,79 @@ +#!/bin/bash +############################################################################### +# BulmaCont-server instalation script +# (C) Tomeu Borrás, y René Mérou Septiempbre 2004-2006 +# distributed under GPL licence +#------------------------------------------------------------------------------ +############################################################################### + +version="v0.5.9 - server" +direj="/usr/share/bulmages" +ptexto="--texto" + +#creating database users. +echo -e "\033[33m""Enter a database user for the program (or press enter to stop ussers addition):" "\033[0m" +read user +while [ "$user" != "" ] + do + su - postgres -c "createuser --adduser --createdb $user" + echo -e "\033[33m""Enter a database user for the program: (or press enter to stop ussers addition) " "\033[0m" + read user + done + + +function tiempo { + sleep 2 +} + + +# root? +if [ ! $(whoami) = "root" ]; then + echo "This script must be executed like root. \n" + exit 1 +fi + + + +# installing databases + +echo "Creating databases. \n" +tiempo + + + +if [ -e /etc/bulmacont-server.conf ]; then + echo "/etc/bulmacont-server.conf exists, this means the bulmacont database was installed before. " + LIST_DATABASES=`su - postgres -c "psql -l -t"` + for database in $LIST_DATABASES + do + # info "Procesing databases $database" + # using patchs for BulmaCont + for j in `ls /usr/share/bulmages/dbmodels/actualizar | grep rev- | sort 2> /dev/null` + do + # info "checking the existence of the file /usr/share/bulmages/$j" + if [ ! -e /usr/share/bulmages/dbmodels/actualizar/$j ]; then + # info "checking the tipe of the database $database" + + TIPO=`su - postgres -c "psql -t $database -c \"SELECT valor FROM configuracion WHERE nombre='Tipo'\"" 2> /dev/null` + if [ "$TIPO" = " bulmacont" ]; then + #info "error: there exist one BulmaCont database" + tiempo + + echo "upgrading database with patch $direj/$j a $database" + su - postgres -c "pg_dump $database > /tmp/backup/$database.pgdump" + su - postgres -c "psql $database < $direj/dbmodels/actualizar/$j > /dev/null" + #exit 0 + fi + + fi + done + done +else + # Creating databases for bulmacont. + su - postgres -c "/usr/share/bulmages/dbmodels/creabulmacont $ptexto bulmacont 2 BulmaCont 2006" + su - postgres -c "/usr/share/bulmages/dbmodels/creabulmacont $ptexto bgplangcont 1 \"Plan Contable Vacio\" 2006" + echo "instalation of the new version of configuration file. \n" + touch /etc/bulmacont-server.conf + echo "BulmaCont-server installed" "\033[32m" "\033[0m" + +fi --- bulmages-0.9.1.orig/debian/compat +++ bulmages-0.9.1/debian/compat @@ -0,0 +1 @@ +4 --- bulmages-0.9.1.orig/debian/creabulmacont.1 +++ bulmages-0.9.1/debian/creabulmacont.1 @@ -0,0 +1,15 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. +.TH "CREABULMACONT" "1" "May 2007" "H" "User Commands" +.SH "NAME" +creabulmacont \- create new bulmacont database for a company +.SH "DESCRIPTION" +creabulmacont [\-\-texto | \-\-dialog] nombre [0 | 1 | 2] nomempresa ejercicio + +.IP +option 0: Void database +.IP +option 1: Database with a standard contable plan (try this if you have doubts) +.IP +option 2: Test sample for bulmacont. Sample database. +.SH "SEE ALSO" +.B creabulmafact (1) --- bulmages-0.9.1.orig/debian/rules +++ bulmages-0.9.1/debian/rules @@ -0,0 +1,177 @@ +#!/usr/bin/make -f + +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. + + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# shared library versions, option 1 +version=1.0.9.1 +major=1 + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + $(MAKE) -f /usr/share/quilt/quilt.make patch + + # Add here commands to configure the package. + ( cd bulmages; qmake-qt4 -recursive) + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + cd bulmages; $(MAKE) + #dh_install bulmages/installbulmages/libbulmalib.so.$(version) \ + # debian/tmp/usr/lib ; + # (cd debian/tmp/usr/lib ; ln -sf libbulmalib.so.$(version) \ + # libbulmalib.so.0.5 ; ln -sf libbulmalib.so.$(version) \ + # libbulmalib.so.0; ln -sf libbulmalib.so.$(version) libbulmalib.so ) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + rm -f bulmages/installbulmages/plugins/libregistroiva.so + rm -f bulmages/installbulmages/plugins/libmypluginbf.so + rm -f bulmages/installbulmages/plugins/libefacturabf.so.1.0. + rm -f bulmages/installbulmages/plugins/libtarifasbf.so + rm -f bulmages/installbulmages/plugins/libcomercialbf.so + rm -f bulmages/installbulmages/plugins/libefacturabf.so.1.0.0 + rm -f bulmages/installbulmages/libbulmalib.so.* + -cd bulmages; pwd $(MAKE) clean; $(MAKE) distclean + -cd bulmages/bulmalib; $(MAKE) clean; $(MAKE) distclean + $(MAKE) -f /usr/share/quilt/quilt.make unpatch + dh_clean + +install: build + + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + dh_installdirs -pbulmages-common usr/share/bulmages + dh_installdirs -pbulmages-common usr/share/bulmages/dbmodels + #dh_installdirs -pbulmages-server usr/share/dbconfig-common/data/bulmacont-server/install + #dh_installdirs -pbulmages-server usr/share/dbconfig-common/data/bulmafact-server/install + + dh_installdirs -pbulmages-docs usr/share/bulmages/docs + dh_install -pbulmages-docs bulmages/doc/* usr/share/bulmages/docs + + dh_install -plibbulmalib1-dev bulmages/installbulmages/libbulmalib*.so usr/lib/ + dh_install -plibbulmalib1-dev bulmages/bulmalib/*.h usr/include/ + dh_install -plibbulmalib1 bulmages/installbulmages/libbulmalib*.so.1.* usr/lib/ + + dh_install -pbulmages-common bulmages/installbulmages/*.jpg usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/*.png usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/rev-* usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/dbmodels usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/ayuda usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/css usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/icons/*.png usr/share/bulmages + + dh_install -pbulmafact bulmages/installbulmages/icons/iconbulmafact.xpm\ + usr/share/bulmages/icons/ + dh_install -pbulmacont bulmages/installbulmages/icons/iconbulmacont.xpm\ + usr/share/bulmages/icons/ + dh_install -pbulmages-common bulmages/installbulmages/traducciones usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/formularios usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/ainteligentes usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/balances usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/openreports usr/share/bulmages + dh_install -pbulmages-common bulmages/installbulmages/bulmages.conf etc/bulmages + dh_install -pbulmages-common bulmages/installbulmages/bulmafact.conf etc/bulmages + dh_install -pbulmages-common bulmages/installbulmages/bulmacont.conf etc/bulmages + + # instala el bgtrml2pdf + dh_installdirs -pbulmages-common usr/share/bulmages/bgtrml2pdf + dh_install -pbulmages-common bulmages/installbulmages/bgtrml2pdf/bgtrml2pdf usr/bin + dh_install -pbulmages-common bulmages/installbulmages/bgtrml2pdf/bgcolor.py usr/share/bulmages/bgtrml2pdf + dh_install -pbulmages-common bulmages/installbulmages/bgtrml2pdf/bg__init__.py usr/share/bulmages/bgtrml2pdf + dh_install -pbulmages-common bulmages/installbulmages/bgtrml2pdf/bgutils.py usr/share/bulmages/bgtrml2pdf + dh_installman -pbulmages-common debian/bgtrml2pdf.1 + dh_installman -pbulmages-servers debian/creabulmafact.1 + dh_installman -pbulmages-servers debian/creabulmacont.1 + + + + #dh_install -pbulmages-server debian/database/bulmacont/pgsql usr/share/dbconfig-common/data/bulmacont-server/install + #dh_install -pbulmages-server debian/database/bulmacont/install-dbadmin/pgsql usr/share/dbconfig-common/data/bulmacont-server/install-dbadmin + dh_install -pbulmages-servers debian/bulmacont-server-install usr/sbin + dh_install -pbulmages-servers debian/creabulmacont usr/bin + dh_install -pbulmages-servers debian/creabulmafact usr/bin + + dh_installman -pbulmages-servers debian/bulmacont-server-install.1 + + dh_install -pbulmacont bulmages/installbulmages/bulmacont usr/bin + dh_installman -pbulmacont debian/bulmacont.1 + dh_installdirs -pbulmacont usr/lib/bulmages/plugins + dh_install -pbulmacont bulmages/installbulmages/plugins/*.so usr/lib/bulmages/plugins + + #dh_install -pbulmages-server debian/database/bulmafact/pgsql usr/share/dbconfig-common/data/bulmafact-server/install + #dh_install -pbulmages-server debian/database/bulmafact/install-dbadmin/pgsql usr/share/dbconfig-common/data/bulmafact-server/install-dbadmin + + dh_install -pbulmages-servers debian/bulmafact-server-install usr/sbin + dh_installman -pbulmages-servers debian/bulmafact-server-install.1 + dh_installman -pbulmafact debian/bulmafact.1 + dh_install -pbulmafact bulmages/installbulmages/bulmafact usr/bin + + dh_compress + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs debian/README.*Debian + dh_installexamples + + dh_pysupport + dh_install + + #dh_installdebconf + + dh_installmenu + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + + dh_installdeb + dh_makeshlibs + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- bulmages-0.9.1.orig/debian/bulmafact-server-install +++ bulmages-0.9.1/debian/bulmafact-server-install @@ -0,0 +1,72 @@ +#!/bin/bash + +############################################################################### +# BulmaFact-server instalation script +# (C) Tomeu Borrás, y René Mérou Septiempbre 2004-2006 +# distributed under GPL licence +#------------------------------------------------------------------------------ +############################################################################### + + +version="v0.5.9 - server" +direj="/usr/share/bulmages" +ptexto="--texto" + + + +#creating database users. +echo -e "\033[33m""Enter a database user for the program (or press enter to stop ussers addition):" "\033[0m" +read user +while [ "$user" != "" ] + do + su - postgres -c "createuser --adduser --createdb $user" + echo -e "\033[33m""Enter a database user for the program: (or press enter to stop ussers addition) " "\033[0m" + read user + done + + + +function tiempo { + sleep 2 +} + +# root? +if [ ! $(whoami) = "root" ]; then + echo "This script must be executed like root. \n" + exit 1 +fi + +if [ -e /etc/bulmafact-server.conf ]; then + echo "/etc/bulmafact-server.conf exists, this means the bulmafact database was installed before. " + LIST_DATABASES=`su - postgres -c "psql -l -t"` + for database in $LIST_DATABASES + do + # info "Procesing databases $database" + # using patchs for BulmaCont + for j in `ls /usr/share/bulmages/dbmodels/actualizar | grep rev- | sort 2> /dev/null` + do + # info "checking the existence of the file /usr/share/bulmages/$j" + if [ ! -e /usr/share/bulmages/dbmodels/actualizar/$j ]; then + # info "checking the tipe of the database $database" + TIPO=`su - postgres -c "psql -t $database -c \"SELECT valor FROM configuracion WHERE nombre='Tipo'\"" 2> /dev/null` + if [ "$TIPO" = " bulmafact" ]; then + echo "upgrading database with patch $direj/$j a $database" + su - postgres -c "pg_dump $database > /tmp/backup/$database.pgdump" + su - postgres -c "psql $database < $direj/dbmodels/actualizar/$j > /dev/null" + tiempo + fi + fi + done + done +else + + echo "Creating databases. \n" + tiempo + # Creating databases for BulmaFact. + su - postgres -c "/usr/share/bulmages/dbmodels/creabulmafact $ptexto bulmafact 2 \"Facturacion Vacia\" 2006 metabd" + echo "instalation of the new version of configuration file. \n" + touch /etc/bulmafact-server.conf + + echo "BulmaFact-server installed" "\033[32m" "\033[0m" + +fi \ No newline at end of file --- bulmages-0.9.1.orig/debian/README.Debian +++ bulmages-0.9.1/debian/README.Debian @@ -0,0 +1,19 @@ +bulmages for Debian +------------------- + +This package includes a mixed upstream svn snapshot with changes done at 20061210 and later ones to get it stable/releseable. + +In order to execute bulmacont or bulmafact at the first time you will need to install de databases. +To install bulmacont database the root must execute /usr/sbin/bulmacont-server-install +To install bulmafact database the root must execute /usr/sbin/bulmafact-server-install + + +We use the files /etc/bulmacont-server.conf and /etc/bulmafact-server.conf like flags in order to detect previous instalations of the databases. That files will not be deleted by apt-get. If you want to reinstall bulmacont and bulmafact, please remove /etc/bulma* and drop bulmacont bulmafact and bgplangcont databases. +-- + +I want to expres my gratitude to Baby and Xerakko from debian-mentors-es channel in the freenode IRC. Their help was very important to make this package. +And thank you too to Javier Linares how helpedme to make my first debian package like one exercice, and to Juan Antonio Marques Sanchis because of his help to solve one bug. My gratitude goes to Tomeu Borras too because he helped us to solve problems in the debian package. + +Thank you Xesca, you are my Moonlight Shadow. + + -- René Mérou , sat, 23 Sep 2006 22:59:41 +0200 --- bulmages-0.9.1.orig/debian/changelog +++ bulmages-0.9.1/debian/changelog @@ -0,0 +1,83 @@ +bulmages (0.9.1-2) unstable; urgency=low + [ Miguel Gea Milvaques] + * Add only the libbulmalib.so.1 library (Closes: #423845). + + -- René Mérou Sun, 13 May 2007 19:33:44 +0200 + +bulmages (0.9.1-1) unstable; urgency=low + [ Miguel Gea Milvaques ] + * New Upsream release. + * Modified control file to avoid virtual package problems Closes: #406932 + + [ René Mérou ] + * Deleted unused scripts creaemp nuevaemp and cargaemp Closes: #409292 + * Improved descriptions of packages Closes: #406924 + * Header library files added Closes: #406931 + * Bulmages description improved Closes: #407520 + + -- René Mérou Sat, 3 Mar 2007 10:54:35 +0100 + +bulmages (0.5.9+svn20061021+20061210-1) unstable; urgency=low + + [ Miguel Gea Milvaques] + * added btrml2pdf.py manual + * removed debconf templates + * added python dependence + * renamed bgtrml2pdf.py to bgtrml2pdf + * bulmafact-server and bulmacont-server are now joined in bulmages-servers. + * added quilt support + + -- René Mérou Sat, 23 Dec 2006 00:00:17 +0100 + +bulmages (0.5.9+svn20061021-2) unstable; urgency=low + + * Added python2.4-imaging dependence. + * Added licences to copyright. + * Installed plugins (modified rules file). + * Installed bgtrml2pdf files. + + -- René Mérou Sat, 18 Nov 2006 21:18:36 +0100 + +bulmages (0.5.9+svn20061021-1) unstable; urgency=low + + * first 0.5.9 release. + + -- René Mérou Sun, 24 Sep 2006 20:42:45 +0200 + +bulmages (0.5.3+svn20060108-1) unstable; urgency=low + + * Last qt3 release. + + -- René Mérou Sun, 2 Apr 2006 09:29:45 +0200 + +bulmages (0.5.1.1-1+4) unstable; urgency=low + + * Bug 'bug -bugreports- word in bulmages man' fixed. + + -- René Mérou Fri, 09 Dec 2005 20:48:11 +0100 + +bulmages (0.5.1.1-1+3) unstable; urgency=low + + * Bug 'bug port 5432-5433' fixed. + + -- René Mérou Wed, 26 Oct 2005 14:38:31 +0200 + +bulmages (0.5.1.1-1+2) unstable; urgency=low + + * Bug 'Depends: postgresql-8.0 for servers' fixed. + + -- René Mérou Thu, 20 Oct 2005 23:18:02 +0200 + +bulmages (0.5.1.1-1+1) unstable; urgency=low + + * Bug 'locate plpgsql.so' fixed. + + -- René Mérou Wed, 19 Oct 2005 02:21:08 +0200 + +bulmages (0.5.1.1-1) unstable; urgency=low + + [ René Mérou ] + * Initial release Closes: #311876 + + -- René Mérou Mon, 5 Sep 2005 02:13:52 +0200 + --- bulmages-0.9.1.orig/debian/creabulmacont +++ bulmages-0.9.1/debian/creabulmacont @@ -0,0 +1,3 @@ +#!/bin/sh +cd /usr/share/bulmages/dbmodels/ +. ./creabulmacont --- bulmages-0.9.1.orig/debian/libbulmalib1.postinst +++ bulmages-0.9.1/debian/libbulmalib1.postinst @@ -0,0 +1,5 @@ +#!/bin/sh +if [ "$1" = "configure" ]; then + /sbin/ldconfig +fi +#DEBHELPER# --- bulmages-0.9.1.orig/debian/database/bulmacont/install-dbadmin/pgsql +++ bulmages-0.9.1/debian/database/bulmacont/install-dbadmin/pgsql @@ -0,0 +1,14 @@ +SET client_encoding = 'SQL_ASCII'; +SET check_function_bodies = false; + +SET SESSION AUTHORIZATION 'postgres'; +SET search_path = public, pg_catalog; + +SET DATESTYLE TO European; + +CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler + AS '$libdir/plpgsql', 'plpgsql_call_handler' + LANGUAGE c; + +CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; + --- bulmages-0.9.1.orig/debian/database/bulmacont/pgsql +++ bulmages-0.9.1/debian/database/bulmacont/pgsql @@ -0,0 +1,3124 @@ +-- Todos los queries necesarios para crear las bases de datos iniciales de bulmages y bulmafact +-- por separado en un solo script, cada uno con nombre y senyal en --######### + + +-- el createdb -E SQL_ASCII $2 2>> /tmp/errores1.txt > /dev/null supongo que se hace antes. +--lista de scripts: bulmages_schema.sql , t_configuracion_data.sql , t_grupo_data.sql , t_cuenta_data.sql , t_fpago_data.sql , t_tipoiva_data.sql , t_ejercicios_data.sql , t_cuenta_data1.sql , t_canal_data.sql , t_c_coste_data.sql , t_diario_data.sql , t_asiento_data.sql , t_apunte_data.sql ( vacio!) , t_borrador_data.sql , t_registroiva_data.sql , t_ainteligente_data.sql ( vacio!), t_binteligente_data.sql ( vacio!), t_compmasap_data.sql ( vacio!), t_compbalance_data.sql ( vacio!), t_balance_data.sql ( vacio!), t_amortizacion_data.sql , t_linamortizacion_data.sql + +--Todo esto corresponde con bulmacont: ********************************************************** + + +-- Creamos la estructura *************************************************** +-- bulmages_schema.sql ################################################### + + +-- +-- PostgreSQL database definition of Bulmages +-- Creamos el lenguaje plpgsql y lo preparamos para ser usado con toda la base +-- de datos. + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- TOC entry 84 (OID 1345917) +-- Name: plpgsql_call_handler(); Type: FUNC PROCEDURAL LANGUAGE; Schema: public; Owner: postgres +-- + +--CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler +-- AS '$libdir/plpgsql', 'plpgsql_call_handler' +-- LANGUAGE c; + + +-- +-- TOC entry 83 (OID 1345918) +-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: public; Owner: +-- + +--CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; + + +-- +-- TOC entry 4 (OID 2200) +-- Name: public; Type: ACL; Schema: -; Owner: postgres +-- + +--REVOKE ALL ON SCHEMA public FROM PUBLIC; +--GRANT ALL ON SCHEMA public TO PUBLIC; + + + +-- La tabla de configuraci�. +-- En esta tabla se guardan parametros que el programa va a utilizar. +-- Como por ejemplo el numero de d�itos por defecto de las cuentas o el asiento inteligente que se enlaza con +-- facturacion. +-- Tiene tres campos +-- idconfiguracion: el identificador (No tiene ningn uso especial). +-- nombre: El nombre del parametro de configuracion. +-- valor: El valor que toma dicho parametro. +CREATE TABLE configuracion ( + idconfiguracion integer NOT NULL, + nombre character varying(25), + valor character varying(350) +); + + + +CREATE TABLE grupo ( + idgrupo serial PRIMARY KEY, + descripcion character varying(50) +); + + + +-- La tabla cuenta es la que presenta el plan contable. +-- Principalmente define el arbol de cuentas, tiene varios campos de SOLO LECTURA que sirven para acumulados. +-- Los campos son: +-- idcuenta El identificador de la cuenta. Tipo Serial +-- codigo El codigo de la cuenta. +-- descripcion Descripcion de la cuenta +-- imputacion booleano que indica si la cuenta es de imputacion o no (aun no he descubierto para que sirve). +-- padre Este campo indica el idcuenta padre de la cuenta que tratamos. Es un apuntador al indice de la tabla lo que la convierte en arbol +-- bloqueada Este boleano indica si la cuenta esta bloqueada o no +-- idgrupo es el apuntador a la tabla de grupos. +-- msg ????? +-- debe Este campo es de solo lectura e indica el acumulado en debe de la cuenta. +-- haber Este campo es de solo lectura e indica el acumulado en haber de la cuenta. +-- nodebe Este booleano indica si la cuenta puede tener inserciones en el debe o no. +-- nohaber Este booleano indica si la cuenta puede tener inserciones en el haber o no. +-- regularizacion Este booleano indica si la cuenta es de regularizacion o no. +-- activo: Este campo indica si la cuenta es de activo o de pasivo. +-- nombreent_cuenta: Si hay una entidad ligada a la cuenta aqui ponemos su nombre. +-- cifent_cuenta: Si hay una entidad ligada a la cuenta aqui ponemos su CIF +-- dirent_cuenta: Direccion de una entidad ligada con la cuenta +-- cpent_cuenta: C�igo Postal de una entidad ligada con la cuenta +-- telent_cuenta: Telefono de una entidad ligada con la cuetna. +-- coment_cuenta: Comentarios de una entidad ligada con la cuenta. +-- bancoent_cuenta: Cuenta bancaria de una entidad ligada con la cuenta. +-- emailent_cuenta: Direccion de correo ligada con la entidad +-- webent_cuenta: Pagina web ligada con la entidad +-- tipocuenta: Campo de tipo integer que en realidad es un ENUM (para los valores que ahora no recuerdo y falta rellenar) ?????? + +CREATE TABLE cuenta ( + idcuenta serial PRIMARY KEY, + codigo character varying(12) NOT NULL, + descripcion character varying(100) NOT NULL, + imputacion boolean NOT NULL DEFAULT TRUE, + padre integer, + bloqueada boolean NOT NULL DEFAULT FALSE, + idgrupo integer NOT NULL REFERENCES grupo(idgrupo), + msg character varying(500), + debe numeric(12,2) NOT NULL DEFAULT 0, + haber numeric(12,2) NOT NULL DEFAULT 0, + nodebe boolean NOT NULL DEFAULT FALSE, + nohaber boolean NOT NULL DEFAULT FALSE, + regularizacion boolean, + activo boolean, + nombreent_cuenta character varying(100), + cifent_cuenta character varying(12), + cpent_cuenta character varying(5), + dirent_cuenta character varying(80), + telent_cuenta character varying(20), + coment_cuenta character varying(500), + bancoent_cuenta character varying(30), + emailent_cuenta character varying(50), + webent_cuenta character varying(70), + tipocuenta integer DEFAULT 1 +); + + + + + +-- La tabla canal refleja los canales a los que puede pertenecer un apunte determinado. +CREATE TABLE canal ( + idcanal serial PRIMARY KEY, + descripcion character varying(100), + nombre character varying(50) +); + + + +CREATE TABLE c_coste ( + idc_coste serial PRIMARY KEY, + descripcion character varying(100), + nombre character varying(50) NOT NULL, + codigo character(3), + padre integer, + imputacion boolean, + debe numeric(12,2) DEFAULT 0, + haber numeric(12,2) DEFAULT 0 +); + + +CREATE TABLE acumulado_c_coste ( + idacumulado_c_coste serial PRIMARY KEY, + idcuenta integer NOT NULL REFERENCES cuenta(idcuenta), + idc_coste integer NOT NULL REFERENCES c_coste(idc_coste), + debe numeric(12,2) DEFAULT 0, + haber numeric(12,2) DEFAULT 0 +); + + +CREATE TABLE acumulado_canal ( + idacumulado_canal serial PRIMARY KEY, + idcuenta integer NOT NULL REFERENCES cuenta(idcuenta), + idcanal integer NOT NULL REFERENCES canal(idcanal), + debe numeric(12,2) DEFAULT 0, + haber numeric(12,2) DEFAULT 0 +); + + +-- +-- TOC entry 36 (OID 1345982) +-- Name: diario; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE diario ( + iddiario serial PRIMARY KEY, + descripcion character varying(100) +); + +\echo "La tabla diario est�en desuso, aunque de momento se crea." + + +-- El campo ordenasiento se puede dejar en nulo s�o porque luego el trigger lo reasigna. Con un default ser� m� adecuado pero +-- no se como se implementa un default tan complicado. +CREATE TABLE asiento ( + idasiento serial PRIMARY KEY, + descripcion character varying(100), + fecha date, + comentariosasiento character varying(2000), + ordenasiento integer, + clase smallint DEFAULT 0 +); + + + +CREATE TABLE adocumental ( + idadocumental serial PRIMARY KEY, + idasiento integer REFERENCES asiento(idasiento), + descripcionadocumental character varying(200), + fechaintadocumental timestamp with time zone, + fechaasadocumental timestamp with time zone, + archivoadocumental character varying(300) +); + + + +CREATE TABLE apunte ( + idapunte serial PRIMARY KEY, + codigoborrador integer, + idasiento integer NOT NULL REFERENCES asiento(idasiento), + iddiario integer REFERENCES diario(iddiario), + fecha timestamp with time zone, + conceptocontable character varying(50), + idcuenta integer NOT NULL REFERENCES cuenta(idcuenta), + descripcion character varying(100), + debe numeric(12,2) NOT NULL DEFAULT 0, + haber numeric(12,2) NOT NULL DEFAULT 0, + contrapartida integer REFERENCES cuenta(idcuenta), + comentario character varying(100), + idcanal integer REFERENCES canal(idcanal), + marcaconciliacion character(12), + idc_coste integer REFERENCES c_coste(idc_coste), + idtipoiva integer, + orden integer, + punteo boolean DEFAULT false +); + + + +CREATE TABLE borrador ( + idborrador serial PRIMARY KEY, + codigoborrador integer, + idasiento integer NOT NULL REFERENCES asiento(idasiento), + iddiario integer REFERENCES diario(iddiario), + fecha timestamp with time zone, + conceptocontable character varying(50), + idcuenta integer NOT NULL REFERENCES cuenta(idcuenta), + descripcion character varying(100), + debe numeric(12,2) NOT NULL DEFAULT 0, + haber numeric(12,2) NOT NULL DEFAULT 0, + contrapartida integer REFERENCES cuenta(idcuenta), + comentario character varying(100), + idcanal integer REFERENCES canal(idcanal), + marcaconciliacion character(12), + idc_coste integer REFERENCES c_coste(idc_coste), + -- El campo idapunte no se utiliza, existe la combinacion idasiento, orden que lo sustituye. + idapunte integer, + idtipoiva integer, + orden integer NOT NULL +); + + + + + +-- La tabla fpago lleva las formas de pago existentes +-- idfpago Identificador de la forma de pago +-- nomfpago Nombre de la forma de pago +-- nplazosfpago Numero de plazos de la forma de pago +-- plazoprimerpagofpago El plazo hasta el primer cobro/pago. +-- tipoplazoprimerpagofpago Tipo del plazo de la forma de pago +-- 0 - dias +-- 1 - semanas +-- 2 - meses +-- 3 - a�s +-- plazoentrerecibofpago numero de plazos en los siguientes recibos +-- tipoplazoentrerecibofpago (Igual que tipoplazoprimerpagofpago) + +CREATE TABLE fpago ( + idfpago serial PRIMARY KEY, + nomfpago character varying(50), + nplazosfpago integer, + plazoprimerpagofpago integer, + tipoplazoprimerpagofpago integer, + plazoentrerecibofpago integer, + tipoplazoentrerecibofpago integer +); + + + + +-- La tabla de tipos de iva indica los tipos de iva que se soportan +-- Sirve para saber si un iva determinado es correcto o no. +-- Esta en forma de tabla y no en otra forma debido a que los porcentajes de IVA podrian cambiar. +-- Los campos son: +-- idtipoiva: Identificador de la tabla. +-- nombretipoiva: da un nombre al tipo de iva. +-- Porcentajetipoiva: El porcentaje que corresponde con este tipo. +CREATE TABLE tipoiva ( + idtipoiva serial PRIMARY KEY, + nombretipoiva character varying(25) UNIQUE, + porcentajetipoiva numeric(12,2), + idcuenta integer NOT NULL REFERENCES cuenta(idcuenta) +); + + +-- +-- TOC entry 40 (OID 1346006) +-- Name: registroiva; Type: TABLE; Schema: public; Owner: postgres +-- +-- ffactura fecha de la factura. +-- El campo iva es un campo de s�o lectura que se actualiza con los valores del IVA. +-- El campo factemitida indica si es una factura emitida o recibida. + +CREATE TABLE registroiva ( + idregistroiva serial PRIMARY KEY, + contrapartida integer REFERENCES cuenta(idcuenta), + baseimp numeric(12,2), + iva numeric(12,2), -- De solo lectura + ffactura date, + factura character varying(70), + idborrador integer, + incregistro boolean, + regularizacion boolean, + plan349 boolean, + numorden character varying(50), + cif character varying(25), + idfpago integer REFERENCES fpago(idfpago), + factemitida boolean NOT NULL, + rectificaaregistroiva integer REFERENCES registroiva(idregistroiva) +); + +-- La tabla prevcobro es prevision de cobros / pagos para facturas. +-- Esta tabla proporciona las formas de pago de cada factura que se pasa a un cliente o que recibimos de un proveedor. + +-- tipoprevcobro indica si es un cobro (true) o un pago (false). +-- fpagoprevcobro es un identificador a la otra tabla de Formas de Pago. +-- idcuenta La cuenta sobre la que se har�el cobro / pago. +-- idasiento Asiento de cobro (Si est�hecho). +-- cantidadprevistaprevcobro Cantidad Prevista del cobro. +-- cantidadprevcobro Cantidad Cobrada. +-- fprevistaprevcobro Fecha en que se prevee el cobro / pago. +-- fcobroprevcobro Fecha en que se ha realizado el cobro / pago. +-- idregistroiva Registro de IVA con el que se corresponde, o factura con la que se corresponde. +-- tipoprevcobro Indica si es un cobro o un pago. TRUE --> COBRO FALSE -->PAGO + + +CREATE TABLE prevcobro ( + idprevcobro serial PRIMARY KEY, + fprevistaprevcobro date, + fcobroprevcobro date, + idctacliente integer REFERENCES cuenta(idcuenta), + idfpago integer REFERENCES fpago(idfpago), + idcuenta integer REFERENCES cuenta(idcuenta), + idasiento integer REFERENCES asiento(idasiento), + cantidadprevistaprevcobro numeric(12,2) DEFAULT 0, + cantidadprevcobro numeric(12,2) DEFAULT 0, + idregistroiva integer REFERENCES registroiva(idregistroiva), + tipoprevcobro boolean NOT NULL DEFAULT FALSE, + docprevcobro character varying(50) +); + +\echo "Se ha creado la tabla prevcobro" + +-- Esta tabla especifica para cada factura los IVAS correspondientes. +CREATE TABLE iva ( + idiva serial PRIMARY KEY, + idtipoiva integer NOT NULL REFERENCES tipoiva (idtipoiva), + idregistroiva integer NOT NULL REFERENCES registroiva(idregistroiva), + baseiva numeric(12,2) DEFAULT 0, + ivaiva numeric(12,2) DEFAULT 0 +); + +\echo "Se ha creado la tabla iva" + + +CREATE TABLE ainteligente ( + idainteligente serial PRIMARY KEY, + descripcion character varying(100), + comentariosasiento character varying(2000) +); + + +CREATE TABLE binteligente ( + idbinteligente serial PRIMARY KEY, + idainteligente integer, + iddiario character varying(100), + fecha character varying(100), + conceptocontable character varying(100), + codcuenta character varying(100), + descripcion character varying(100), + debe character varying(100), + haber character varying(100), + contrapartida character varying(100), + comentario character varying(100), + canal character varying(100), + marcaconciliacion character varying(100), + idc_coste character varying(100) +); + + + +-- +-- TOC entry 47 (OID 1346044) +-- Name: balance; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE balance ( + idbalance serial PRIMARY KEY, + nombrebalance character varying(150) +); + +\echo "Se ha creado balance" + +-- +-- TOC entry 45 (OID 1346034) +-- Name: mpatrimonial; Type: TABLE; Schema: public; Owner: postgres +-- + +-- La casilla tipomasapatrimonial : +-- 0.- normal, presentar siempre +-- 1.- Sólo presentar si el saldo es >0, +-- 2.- Sólo presentar si el saldo es <0 +-- 3.- Presentar en valor absoluto. + +CREATE TABLE mpatrimonial ( + idmpatrimonial serial PRIMARY KEY, + idbalance integer REFERENCES balance(idbalance), + descmpatrimonial character varying(150), + orden integer, + tabulacion integer, + saldo numeric(12,2), + opdesc integer, + tipompatrimonial integer DEFAULT 0 +); + +\echo "Se ha creado la tabla mpatrimonial" + +-- +-- TOC entry 44 (OID 1346029) +-- Name: compmasap; Type: TABLE; Schema: public; Owner: postgres +-- La casilla tipocompmasap : 0.- normal, 1.- Sólo presentar si el saldo es >0, 2.- Sólo presentar si el saldo es <0 + +CREATE TABLE compmasap ( + idcompmasap serial PRIMARY KEY, + idcuenta integer REFERENCES cuenta(idcuenta), + idmpatrimonial integer, + masaperteneciente integer, + saldo numeric(12,2), + signo boolean, + tipocompmasap integer DEFAULT 0, + nombre character varying(150) +); + +\echo "Se ha creado la tabla compmasap" + +-- +-- TOC entry 46 (OID 1346039) +-- Name: compbalance; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE compbalance ( + idcompbalance serial PRIMARY KEY, + idbalance integer NOT NULL REFERENCES balance(idbalance), + idmpatrimonial integer, + concepto character varying(150), + orden integer, + tabulacion integer +); + +\echo "Se ha creado la tabla compbalance" + + +-- +-- TOC entry 56 (OID 1346100) +-- Name: amortizacion; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE amortizacion ( + idamortizacion serial NOT NULL, + idcuentaactivo integer, + idcuentaamortizacion integer, + descamortizacion character varying(2000), + nomamortizacion character varying(200), + fechacompra date, + fecha1cuota date, + valorcompra numeric(12,2), + periodicidad integer, + numcuotas integer, + metodo integer, + nifproveedor character varying(12), + nomproveedor character varying(150), + dirproveedor character varying(200), + telproveedor character varying(20), + agrupacion character varying(150) +); + +\echo "Se ha creado la tabla amortizacion" + +-- +-- TOC entry 57 (OID 1346108) +-- Name: linamortizacion; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE linamortizacion ( + idlinamortizacion serial NOT NULL, + idamortizacion integer, + idasiento integer REFERENCES asiento(idasiento), + ejercicio integer, + fechaprevista date, + cantidad numeric(12,2) +); +\echo "Se ha creado la tabla linamortizacion" + +-- +-- TOC entry 58 (OID 1346111) +-- Name: ejercicios; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE ejercicios ( + ejercicio integer, + periodo smallint, + bloqueado boolean +); + +\echo "Se ha creado la tabla ejercicios" + + +-- +-- TOC entry 85 (OID 1346047) +-- Name: abreasientos(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION abreasientos() RETURNS integer + AS ' +--DECLARE as RECORD; +--DECLARE res RECORD; +BEGIN +-- FOR as IN SELECT * FROM asiento ORDER BY idasiento DESC LOOP +-- SELECT INTO res cambiaasiento(as.idasiento, as.idasiento*3); +-- END LOOP; +-- Abrir los asientos es modificar el campo ordenasiento de los mismos para que se reorganicen + UPDATE asiento SET ordenasiento= ordenasiento * 3; + RETURN 0; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 86 (OID 1346048) +-- Name: cambiaasiento(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION cambiaasiento(integer, integer) RETURNS integer + AS ' +DECLARE + idinicial ALIAS FOR $1; + idfinal ALIAS FOR $2; + as RECORD; +BEGIN + -- Esta funcion cambia un asiento de sitio, el asiento inicial y lo pone en el asiento final + -- El problema es que si el asiento final debe estar vacio + SELECT INTO as * FROM asiento WHERE idasiento = idinicial; + IF FOUND THEN + INSERT INTO asiento (idasiento, fecha, descripcion, comentariosasiento) VALUES (idfinal, as.fecha, as.descripcion, as.comentariosasiento); + UPDATE borrador SET idasiento = idfinal WHERE idasiento = idinicial; + UPDATE apunte SET idasiento = idfinal WHERE idasiento = idinicial; + DELETE FROM asiento WHERE idasiento = idinicial; + END IF; + RETURN 0; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 87 (OID 1346049) +-- Name: ccontrapartida(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- +-- La contrapartida de un apunte donde todo son ceros es la misma que el apunte. +CREATE FUNCTION ccontrapartida(integer) RETURNS integer + AS ' +DECLARE + midapunte ALIAS FOR $1; + apt RECORD; + aptasien RECORD; + contra RECORD; +BEGIN + SELECT INTO apt * FROM apunte WHERE idapunte= midapunte; +-- Este metodo de buscar contrapartidas es poco eficaz por lo que de momento +-- Tenemos desabilitada la opci� de las contrapartidas asi como debe ser. +-- MUCHO OJO, PUEDE TENER GRAVES CONSECUENCIAS + IF apt.contrapartida ISNULL THEN +-- RETURN apt.idcuenta; + SELECT INTO contra idcuenta FROM apunte WHERE idapunte = bcontrapartida(midapunte); + IF FOUND THEN + RETURN contra.idcuenta; + ELSE + RETURN apt.idcuenta; + END IF; + ELSE + RETURN apt.contrapartida; + END IF; +END; +' + LANGUAGE plpgsql; + + + +-- Creo que haciendo una funci� que cierre todas las contrapartidas de un asiento dado tendr�muchos +-- mejores rendimientos que mediante las funciones particulares y al cerrar el asiento se pueden +-- Recalcular todos los cierres. + +-- Recorremos el asiento en una nica pasada y almacenamos contrapartidas de paso (maximas) al llegar a un punto de descuadre cero asignamos contrapartidas e inicializamos marcadores. +-- Esta funci� es invocada desde cierraasiento ya que al cerrar el asiento se calculan las contrapartidas de todos los apuntes. +-- Esta es de momento la forma m� eficiente de calcular contrapartidas. + +CREATE FUNCTION contraasiento(integer) RETURNS NUMERIC(12,2) + AS ' +DECLARE + midasiento ALIAS FOR $1; + midapunte ALIAS FOR $1; + apt RECORD; + aptasien RECORD; + cont RECORD; + descuadre NUMERIC(12,2); + apmaxdebe INTEGER; + apmaxhaber INTEGER; + maxdebe NUMERIC(12,2); + maxhaber NUMERIC(12,2); + ctadebe INTEGER; + ctahaber INTEGER; + salida BOOLEAN; + salidadebe BOOLEAN; + salidahaber BOOLEAN; +BEGIN + maxdebe := 0; + maxhaber := 0; + apmaxdebe:=0; + apmaxhaber := 0; + ctadebe := 0; + ctahaber := 0; + descuadre := 0; + FOR cont IN SELECT idcuenta,idapunte, debe, haber, orden FROM apunte WHERE idasiento = midasiento ORDER BY orden LOOP + -- Si es el debe maximo lo hacemos constar. + IF cont.debe >= maxdebe THEN + maxdebe := cont.debe; + apmaxdebe := cont.idapunte; + ctadebe := cont.idcuenta; + END IF; + -- Si es el haber mximo lo hacemos constar + IF cont.haber >= maxhaber THEN + maxhaber := cont.haber; + apmaxhaber := cont.idapunte; + ctahaber := cont.idcuenta; + END IF; + -- Calculamos el descuadre + descuadre := descuadre + cont.debe; + descuadre := descuadre - cont.haber; + -- Si es el descuadre inicializamos las variables. + IF descuadre = 0 AND ctadebe <> 0 AND ctahaber <> 0 THEN + UPDATE apunte SET contrapartida= ctahaber WHERE haber=0 AND idasiento = midasiento AND orden <= cont.orden AND contrapartida ISNULL; + UPDATE apunte SET contrapartida= ctadebe WHERE debe=0 AND idasiento = midasiento AND orden <= cont.orden AND contrapartida ISNULL; + maxdebe := 0; + maxhaber := 0; + apmaxdebe:=0; + apmaxhaber := 0; + ctadebe := 0; + ctahaber := 0; + END IF; + END LOOP; + RETURN 0; +END; + ' LANGUAGE plpgsql; + + +-- +-- TOC entry 88 (OID 1346050) +-- Name: bcontrapartida(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- +-- Dado un apunte nos retorna el apunte que ejerce de contrapartida. (no la cuenta si no el apunte). +-- Esta funcion puede variar con la funcion ccontrapartida ya que en ccontrapartida el calculo es distinto y puede ser erroneo. +-- Esta funcion esta mucho mas perfeccionada con lo que es menos probable un error. Por tanto se sugiere la migracion a esta nueva funcion +CREATE FUNCTION bcontrapartida(integer) RETURNS integer + AS ' +DECLARE + midapunte ALIAS FOR $1; + apt RECORD; + aptasien RECORD; + cont RECORD; + descuadre NUMERIC(12,2); + apmaxdebe INTEGER; + apmaxhaber INTEGER; + maxdebe NUMERIC(12,2); + maxhaber NUMERIC(12,2); + salida BOOLEAN; + salidadebe BOOLEAN; + salidahaber BOOLEAN; +BEGIN + +-- RAISE NOTICE ''Em pezamos''; + SELECT INTO apt contrapartida, idasiento FROM apunte WHERE idapunte=midapunte; + IF apt.contrapartida ISNULL THEN + -- Inicializamos las variables. + descuadre:=0; + maxdebe :=0; + maxhaber := 0; + apmaxdebe:=0; + apmaxhaber:=0; + salidadebe := FALSE; + salidahaber := FALSE; + FOR cont IN SELECT idapunte, debe, haber FROM apunte WHERE idasiento = apt.idasiento ORDER BY orden LOOP + -- Si es la cuenta que estamos buscando lo hacemos constar. + IF cont.idapunte = midapunte THEN + IF cont.debe > 0 THEN + salidahaber := TRUE; + ELSE + salidadebe := TRUE; + END IF; + END IF; + -- Si es el debe maximo lo hacemos constar. + IF cont.debe > maxdebe THEN + maxdebe := cont.debe; + apmaxdebe := cont.idapunte; + END IF; + -- Si es el haber mximo lo hacemos constar + IF cont.haber > maxhaber THEN + maxhaber := cont.haber; + apmaxhaber := cont.idapunte; + END IF; + -- Calculamos el descuadre + descuadre := descuadre + cont.debe; + descuadre := descuadre - cont.haber; + -- Si es el descuadre inicializamos las variables. + IF (descuadre = 0) THEN -- Asi nos aseguramos que valores positivos tambi� entran. + IF (salidadebe = TRUE) THEN + RETURN apmaxdebe; + END IF; + IF (salidahaber = TRUE) THEN + RETURN apmaxhaber; + END IF; + maxdebe := 0; + maxhaber := 0; + apmaxdebe:=0; + apmaxhaber := 0; + + END IF; + END LOOP; + return 0; + ELSE + SELECT INTO cont idapunte FROM apunte WHERE idasiento = apt.idasiento AND idcuenta = apt.contrapartida; + RETURN cont.idapunte; + END IF; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 89 (OID 1346051) +-- Name: bcontrapartidaborr(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- +-- Dado un apunte nos retorna el apunte que ejerce de contrapartida. (no la cuenta si no el apunte). +-- Esta funcion puede variar con la funcion ccontrapartida ya que en ccontrapartida el calculo es distinto y puede ser erroneo. +-- Esta funcion esta mucho mas perfeccionada con lo que es menos probable un error. Por tanto se sugiere la migracion a esta nueva funcion +CREATE FUNCTION bcontrapartidaborr(integer) RETURNS integer + AS ' +DECLARE + midapunte ALIAS FOR $1; + apt RECORD; + aptasien RECORD; + cont RECORD; + descuadre numeric(12,2); + apmaxdebe INTEGER; + apmaxhaber INTEGER; + maxdebe numeric(12,2); + maxhaber numeric(12,2); + salida BOOLEAN; + salidadebe BOOLEAN; + salidahaber BOOLEAN; +BEGIN + +-- RAISE NOTICE ''Em pezamos''; + SELECT INTO apt * FROM borrador WHERE idborrador=midapunte; + IF apt.contrapartida ISNULL THEN + -- Inicializamos las variables. + descuadre:=0; + maxdebe :=0; + maxhaber := 0; + apmaxdebe:=0; + apmaxhaber:=0; + salidadebe := FALSE; + salidahaber := FALSE; + + FOR cont IN SELECT * FROM borrador WHERE idasiento = apt.idasiento ORDER BY orden LOOP + -- Si es la cuenta que estamos buscando lo hacemos constar. + IF cont.idborrador = midapunte THEN + IF cont.debe > 0 THEN + salidahaber := TRUE; + ELSE + salidadebe := TRUE; + END IF; + END IF; + -- Si es el debe maximo lo hacemos constar. + IF cont.debe > maxdebe THEN + maxdebe := cont.debe; + apmaxdebe := cont.idborrador; + END IF; + -- Si es el haber mximo lo hacemos constar + IF cont.haber > maxhaber THEN + maxhaber := cont.haber; + apmaxhaber := cont.idborrador; + END IF; + -- Calculamos el descuadre + descuadre := descuadre + cont.debe; + descuadre := descuadre - cont.haber; + -- Si es el descuadre inicializamos las variables. + IF (descuadre*descuadre < 0.001) THEN -- Asi nos aseguramos que valores positivos tambi� entran. + IF (salidadebe = TRUE) THEN + RETURN apmaxdebe; + END IF; + IF (salidahaber = TRUE) THEN + RETURN apmaxhaber; + END IF; + maxdebe := 0; + maxhaber := 0; + apmaxdebe:=0; + apmaxhaber := 0; + + END IF; + END LOOP; + return 0; + ELSE + SELECT INTO cont * FROM borrador WHERE idasiento = apt.idasiento AND idcuenta = apt.contrapartida; + RETURN cont.idborrador; + END IF; +END;' + LANGUAGE plpgsql; + + +-- +-- TOC entry 90 (OID 1346052) +-- Name: id_cuenta(character varying); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION id_cuenta(character varying) RETURNS integer + AS ' +DECLARE + codcuenta ALIAS FOR $1; + cta RECORD; +BEGIN + SELECT INTO cta idcuenta FROM cuenta WHERE codigo = "codcuenta"; + IF FOUND THEN + RETURN cta.idcuenta; + ELSE + RETURN 0; + END IF; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 91 (OID 1346053) +-- Name: nivel(character varying); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION nivel(character varying) RETURNS integer + AS ' +DECLARE + codcuenta ALIAS FOR $1; +BEGIN + RETURN LENGTH(codcuenta); +END; +' + LANGUAGE plpgsql; + + + + + +CREATE OR REPLACE FUNCTION saldototalmpatrimonial(integer) RETURNS NUMERIC(12,2) + AS ' +DECLARE + identmpatrimonial ALIAS FOR $1; + saldo NUMERIC(12,2); + saldoi NUMERIC(12,2); + rsaldo RECORD; + rsaldo1 RECORD; + smpatrimonialsum RECORD; + smpatrimonialrest RECORD; + mp RECORD; +BEGIN + saldo := 0; + FOR rsaldo IN SELECT (debe-haber) AS total, tipocompmasap FROM cuenta LEFT JOIN compmasap ON cuenta.idcuenta = compmasap.idcuenta WHERE masaperteneciente = identmpatrimonial AND compmasap.idcuenta IS NOT NULL AND signo = TRUE LOOP + IF (rsaldo.total IS NOT NULL) THEN + IF (rsaldo.tipocompmasap = 0 OR (rsaldo.tipocompmasap = 1 AND rsaldo.total > 0) OR (rsaldo.tipocompmasap = 2 AND rsaldo.total < 0)) THEN + saldo := saldo + rsaldo.total; + END IF; + END IF; + END LOOP; + FOR rsaldo1 IN SELECT (debe-haber) AS total, tipocompmasap FROM cuenta LEFT JOIN compmasap ON cuenta.idcuenta = compmasap.idcuenta WHERE masaperteneciente = identmpatrimonial AND compmasap.idcuenta IS NOT NULL AND signo = FALSE LOOP + IF (rsaldo1.total IS NOT NULL) THEN + IF (rsaldo1.tipocompmasap = 0 OR (rsaldo1.tipocompmasap = 1 AND rsaldo1.total > 0) OR (rsaldo1.tipocompmasap = 2 AND rsaldo1.total < 0)) THEN + saldo := saldo - rsaldo1.total; + END IF; + END IF; + END LOOP; + FOR smpatrimonialsum IN SELECT idmpatrimonial, tipocompmasap FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = true LOOP + saldoi := saldototalmpatrimonial (smpatrimonialsum.idmpatrimonial); + IF (smpatrimonialsum.tipocompmasap = 0 OR (smpatrimonialsum.tipocompmasap = 1 AND saldoi > 0) OR (smpatrimonialsum.tipocompmasap = 2 AND saldoi < 0)) THEN + saldo := saldo + saldoi; + END IF; + + END LOOP; + FOR smpatrimonialrest IN SELECT idmpatrimonial, tipocompmasap FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = false LOOP + + saldoi := saldototalmpatrimonial (smpatrimonialrest.idmpatrimonial); + IF (smpatrimonialrest.tipocompmasap = 0 OR (smpatrimonialrest.tipocompmasap = 1 AND saldoi > 0) OR (smpatrimonialrest.tipocompmasap = 2 AND saldoi < 0)) THEN + saldo := saldo - saldoi; + END IF; + END LOOP; + + SELECT INTO mp tipompatrimonial FROM mpatrimonial WHERE idmpatrimonial = identmpatrimonial; + IF FOUND THEN + IF mp.tipompatrimonial = 1 THEN + IF saldo > 0 THEN + RETURN saldo; + ELSE + RETURN 0; + END IF; + END IF; + IF mp.tipompatrimonial = 2 THEN + IF saldo < 0 THEN + RETURN saldo; + ELSE + RETURN 0; + END IF; + END IF; + IF mp.tipompatrimonial = 3 THEN + IF saldo > 0 THEN + RETURN saldo; + ELSE + RETURN -saldo; + END IF; + END IF; + END IF; + RETURN saldo; +END; +' LANGUAGE plpgsql; + + +-- +-- TOC entry 93 (OID 1346055) +-- Name: saldompatrimonial(integer, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres +-- +CREATE OR REPLACE FUNCTION saldompatrimonial(integer, timestamp without time zone, timestamp without time zone) RETURNS numeric(12,2) + AS ' +DECLARE + identmpatrimonial ALIAS FOR $1; + fechain ALIAS FOR $2; + fechafin ALIAS FOR $3; + aptsum RECORD; + aptrest RECORD; + rsaldo RECORD; + rsaldo1 RECORD; + smpatrimonialsum RECORD; + smpatrimonialrest RECORD; + saldo NUMERIC(12,2); + saldoi NUMERIC(12,2); +BEGIN + saldo := 0; + FOR rsaldo IN SELECT * FROM cuenta LEFT JOIN compmasap ON cuenta.idcuenta = compmasap.idcuenta WHERE masaperteneciente = identmpatrimonial AND compmasap.idcuenta IS NOT NULL AND signo = TRUE LOOP + saldoi := saldototal(rsaldo.codigo, fechain, fechafin); + IF (rsaldo.tipocompmasap = 0 OR (rsaldo.tipocompmasap = 1 AND saldoi > 0) OR (rsaldo.tipocompmasap = 2 AND saldoi < 0)) THEN + saldo := saldo + saldoi; + END IF; + END LOOP; + FOR rsaldo1 IN SELECT * FROM cuenta LEFT JOIN compmasap ON cuenta.idcuenta = compmasap.idcuenta WHERE masaperteneciente = identmpatrimonial AND compmasap.idcuenta IS NOT NULL AND signo = FALSE LOOP + saldoi := saldototal(rsaldo1.codigo, fechain, fechafin); + IF (rsaldo1.tipocompmasap = 0 OR (rsaldo1.tipocompmasap = 1 AND saldoi > 0) OR (rsaldo1.tipocompmasap = 2 AND saldoi < 0)) THEN + saldo := saldo - saldoi; + END IF; + END LOOP; + FOR smpatrimonialsum IN SELECT idmpatrimonial, tipocompmasap FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = true LOOP + saldoi := saldompatrimonial (smpatrimonialsum.idmpatrimonial, fechain, fechafin); + IF (smpatrimonialsum.tipocompmasap = 0 OR (smpatrimonialsum.tipocompmasap = 1 AND saldoi > 0) OR (smpatrimonialsum.tipocompmasap = 2 AND saldoi < 0)) THEN + saldo := saldo + saldoi; + END IF; + + END LOOP; + FOR smpatrimonialrest IN SELECT idmpatrimonial, tipocompmasap FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = false LOOP + + saldoi := saldompatrimonial (smpatrimonialrest.idmpatrimonial, fechain, fechafin); + IF (smpatrimonialrest.tipocompmasap = 0 OR (smpatrimonialrest.tipocompmasap = 1 AND saldoi > 0) OR (smpatrimonialrest.tipocompmasap = 2 AND saldoi < 0)) THEN + saldo := saldo - saldoi; + END IF; + + END LOOP; + + SELECT INTO mp tipompatrimonial FROM mpatrimonial WHERE idmpatrimonial = identmpatrimonial; + IF FOUND THEN + IF mp.tipompatrimonial = 1 THEN + IF saldo > 0 THEN + RETURN saldo; + ELSE + RETURN 0; + END IF; + END IF; + IF mp.tipompatrimonial = 2 THEN + IF saldo < 0 THEN + RETURN saldo; + ELSE + RETURN 0; + END IF; + END IF; + IF mp.tipompatrimonial = 3 THEN + IF saldo > 0 THEN + RETURN saldo; + ELSE + RETURN -saldo; + END IF; + END IF; + END IF; + + + RETURN saldo; +END; +' LANGUAGE plpgsql; + + + +-- TOC entry 94 (OID 1346056) +-- Name: debempatrimonial(integer, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION debempatrimonial(integer, timestamp without time zone, timestamp without time zone) RETURNS numeric(12,2) + AS ' +DECLARE + identmpatrimonial ALIAS FOR $1; + fechain ALIAS FOR $2; + fechafin ALIAS FOR $3; + aptsum RECORD; + aptrest RECORD; + smpatrimonialsum RECORD; + smpatrimonialres RECORD; + debe NUMERIC(12,2); +BEGIN + -- Esta funcion calcula el debe de una masa patrimonial entre dos fechas. + debe := 0; + FOR aptsum IN SELECT * FROM cuenta WHERE idcuenta IN (SELECT idcuenta FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idcuenta IS NOT NULL AND signo = true) LOOP + debe := debe + debetotal(aptsum.idcuenta, fechain, fechafin); + END LOOP; + FOR aptrest IN SELECT * FROM cuenta WHERE idcuenta IN (SELECT idcuenta FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idcuenta IS NOT NULL AND signo = false) LOOP + debe := debe - debetotal(aptsum.idcuenta, fechain, fechafin); + END LOOP; + FOR smpatrimonialsum IN SELECT * FROM mpatrimonial WHERE idmpatrimonial IN (SELECT idmpatrimonial FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = true) LOOP + debe := debe + debempatrimonial (smpatrimonialsum.idmpatrimonial, fechain, fechafin); + END LOOP; + FOR smpatrimonialsum IN SELECT * FROM mpatrimonial WHERE idmpatrimonial IN (SELECT idmpatrimonial FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = false) LOOP + debe := debe - debepatrimonial (smpatrimonialsum.idmpatrimonial, fechain, fechafin); + END LOOP; + RETURN debe; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 95 (OID 1346057) +-- Name: habermpatrimonial(integer, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION habermpatrimonial(integer, timestamp without time zone, timestamp without time zone) RETURNS numeric(12,2) + AS ' +DECLARE + identmpatrimonial ALIAS FOR $1; + fechain ALIAS FOR $2; + fechafin ALIAS FOR $3; + aptsum RECORD; + aptrest RECORD; + smpatrimonialsum RECORD; + smpatrimonialres RECORD; + haber NUMERIC(12,2); +BEGIN + -- Esta funcion calcula el saldo de una masa patrimonial entre dos fechas. + haber := 0; + FOR aptsum IN SELECT * FROM cuenta WHERE idcuenta IN (SELECT idcuenta FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idcuenta IS NOT NULL AND signo = true) LOOP + haber := haber + habertotal(aptsum.idcuenta, fechain, fechafin); + END LOOP; + FOR aptrest IN SELECT * FROM cuenta WHERE idcuenta IN (SELECT idcuenta FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idcuenta IS NOT NULL AND signo = false) LOOP + haber := haber - habertotal(aptsum.idcuenta, fechain, fechafin); + END LOOP; + FOR smpatrimonialsum IN SELECT * FROM mpatrimonial WHERE idmpatrimonial IN (SELECT idmpatrimonial FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = true) LOOP + haber := haber + habermpatrimonial (smpatrimonialsum.idmpatrimonial, fechain, fechafin); + END LOOP; + FOR smpatrimonialsum IN SELECT * FROM mpatrimonial WHERE idmpatrimonial IN (SELECT idmpatrimonial FROM compmasap WHERE masaperteneciente = identmpatrimonial AND idmpatrimonial IS NOT NULL AND signo = false) LOOP + haber := haber - habermpatrimonial (smpatrimonialsum.idmpatrimonial, fechain, fechafin); + END LOOP; + RETURN haber; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 96 (OID 1346058) +-- Name: saldototal(character varying, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION saldototal(character varying, timestamp without time zone, timestamp without time zone) RETURNS numeric(12,2) + AS ' +DECLARE + codcuenta ALIAS FOR $1; + fechain ALIAS FOR $2; + fechafin ALIAS FOR $3; + apt RECORD; + apt1 RECORD; + --apt2 RECORD; + cta RECORD; + saldo NUMERIC(12,2); +BEGIN +-- SELECT INTO apt * FROM apunte WHERE id_cuenta(codcuenta) = apunte.idcuenta; + SELECT INTO cta id_cuenta(codcuenta) AS id; + SELECT INTO apt sum(debe) AS tdebe, sum(haber) AS thaber FROM apunte WHERE apunte.idcuenta = cta.id AND fecha <= "fechafin" AND fecha >= "fechain"; + IF (apt.tdebe ISNULL) THEN + saldo := 0; + ELSE + saldo := apt.tdebe - apt.thaber; + END IF; +-- RAISE NOTICE '' saldo total % valor adquirido %'', codcuenta, saldo; + FOR apt1 IN SELECT codigo FROM cuenta WHERE padre = cta.id LOOP + saldo := saldo + saldototal(apt1.codigo,fechain, fechafin); + END LOOP; + RETURN saldo; +END; +' LANGUAGE plpgsql; + + +-- +-- TOC entry 97 (OID 1346059) +-- Name: debetotal(integer, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION debetotal(integer, timestamp without time zone, timestamp without time zone) RETURNS numeric(12,2) + AS ' +DECLARE + mcuenta ALIAS FOR $1; + fechain ALIAS FOR $2; + fechafin ALIAS FOR $3; + apt RECORD; + apt1 RECORD; + apt2 RECORD; + cta RECORD; + debet NUMERIC(12,2); +BEGIN +-- SELECT INTO apt * FROM apunte WHERE cuenta = apunte.idcuenta; +-- RAISE NOTICE '' Calculando debetotal de % entre % y % '', cuenta, fechain, fechafin; + debet := 0; + SELECT INTO apt sum(debe) AS mdebe FROM apunte WHERE apunte.idcuenta = mcuenta AND fecha <= "fechafin" AND fecha >= "fechain"; + if (apt.mdebe ISNULL) THEN + debet:= 0; + ELSE + debet := apt.mdebe; + END IF; +-- RAISE NOTICE '' debe total % valor adquirido %'', cuenta, debet; + FOR apt1 IN SELECT idcuenta FROM cuenta WHERE padre = mcuenta LOOP + debet := debet + debetotal(apt1.idcuenta,fechain, fechafin); + END LOOP; + RETURN debet; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 98 (OID 1346060) +-- Name: debetotal1(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION debetotal1(integer) RETURNS numeric(12,2) + AS ' +DECLARE + mcuenta ALIAS FOR $1; + apt RECORD; + apt1 RECORD; + apt2 RECORD; + cta RECORD; + debet NUMERIC(12,2); +BEGIN +-- SELECT INTO apt * FROM apunte WHERE id_cuenta(codcuenta) = apunte.idcuenta; + debet := 0; + SELECT INTO apt sum(debe) AS mdebe FROM apunte WHERE apunte.idcuenta = mcuenta; + if (apt.mdebe ISNULL) THEN + debet:= 0; + ELSE + debet := apt.mdebe; + END IF; +-- RAISE NOTICE '' debe total1 % valor adquirido %'', codcuenta, debet; + FOR apt1 IN SELECT idcuenta FROM cuenta WHERE padre = mcuenta LOOP + debet := debet + debetotal1(apt1.idcuenta); + END LOOP; + RETURN debet; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 99 (OID 1346061) +-- Name: habertotal(integer, timestamp without time zone, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION habertotal(integer, timestamp without time zone, timestamp without time zone) RETURNS numeric(12,2) + AS ' +DECLARE + mcuenta ALIAS FOR $1; + fechain ALIAS FOR $2; + fechafin ALIAS FOR $3; + apt RECORD; + apt1 RECORD; + apt2 RECORD; + cta RECORD; + habert NUMERIC(12,2); +BEGIN +-- SELECT INTO apt * FROM apunte WHERE id_cuenta(codcuenta) = apunte.idcuenta; + habert := 0; + SELECT INTO apt sum(haber) AS thaber FROM apunte WHERE apunte.idcuenta = mcuenta AND fecha <= "fechafin" AND fecha >= "fechain"; + IF (apt.thaber ISNULL) THEN + habert := 0; + ELSE + habert := apt.thaber; + END IF; +-- RAISE NOTICE '' haber total % valor adquirido %'', codcuenta, habert; + FOR apt1 IN SELECT idcuenta FROM cuenta WHERE padre = mcuenta LOOP + habert := habert + habertotal(apt1.idcuenta,fechain, fechafin); + END LOOP; + RETURN habert; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 100 (OID 1346062) +-- Name: habertotal1(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION habertotal1(integer) RETURNS numeric(12,2) + AS ' +DECLARE + mcuenta ALIAS FOR $1; + apt RECORD; + apt1 RECORD; + apt2 RECORD; + cta RECORD; + habert NUMERIC(12,2); +BEGIN +-- SELECT INTO apt * FROM apunte WHERE id_cuenta(codcuenta) = apunte.idcuenta; + habert := 0; + SELECT INTO apt sum(haber) AS thaber FROM apunte WHERE apunte.idcuenta = mcuenta; + IF (apt.thaber ISNULL) THEN + habert := 0; + ELSE + habert := apt.thaber; + END IF; +-- RAISE NOTICE '' haber total % valor adquirido %'', codcuenta, habert; + FOR apt1 IN SELECT idcuenta FROM cuenta WHERE padre = mcuenta LOOP + habert := habert + habertotal1(apt1.idcuenta); + END LOOP; + RETURN habert; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 101 (OID 1346063) +-- Name: recalculasaldos(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION recalculasaldos() RETURNS numeric(12,2) + AS ' +DECLARE + cta RECORD; +BEGIN +-- El orden si es importante ya que aparecen problemas con el trigger. que se dispara en los updates. + + FOR cta IN SELECT * FROM cuenta WHERE padre IS NOT NULL ORDER BY padre LOOP + UPDATE cuenta SET debe = debetotal1(cta.idcuenta), haber=habertotal1(cta.idcuenta) WHERE idcuenta = cta.idcuenta; + END LOOP; + FOR cta IN SELECT * FROM cuenta WHERE padre IS NULL ORDER BY padre LOOP + UPDATE cuenta SET debe = debetotal1(cta.idcuenta), haber=habertotal1(cta.idcuenta) WHERE idcuenta = cta.idcuenta; + END LOOP; + RETURN 0; +END; +' + LANGUAGE plpgsql; + +CREATE FUNCTION recalculasaldos2() RETURNS integer + AS ' +DECLARE + niveles RECORD; + cta RECORD; +BEGIN + -- De momento, la haremos funcionar para un sistema de cuentas xxxxyyy + SELECT INTO niveles strpos(valor, ''y'')-1 AS numx FROM configuracion WHERE nombre=''CodCuenta''; + IF niveles.numx <> 4 THEN + RAISE NOTICE ''Lo siento, pero esta función sólo funciona de momento con 4 niveles de cuentas''; + RETURN -1; + END IF; + + -- Creamos la tabla con el �bol de cuentas y sus valores (se ha considerado hasta nivel 4) + CREATE TEMPORARY TABLE temp4 AS (SELECT n1.codigo AS cod1, n1.debe AS debe1, n1.haber AS haber1, n2.codigo AS cod2, n2.debe AS debe2, n2.haber AS haber2, n3.codigo AS cod3, n3.debe AS debe3, n3.haber AS haber3, n4.codigo AS cod4, n4.debe AS debe4, n4.haber AS haber4 FROM (SELECT idcuenta, codigo, debe, haber FROM cuenta WHERE padre IS NULL) AS n1 INNER JOIN (SELECT idcuenta, padre, codigo, debe, haber FROM cuenta) AS n2 ON n1.idcuenta=n2.padre INNER JOIN (SELECT idcuenta, padre, codigo, debe, haber FROM cuenta) AS n3 ON n2.idcuenta=n3.padre LEFT JOIN (SELECT padre, codigo, debe, haber FROM cuenta) AS n4 ON n3.idcuenta=n4.padre); + + -- Ahora iremos actualizando las ramas desde las hojas hasta las ra�es + -- Primero, tendremos en cuenta aquellas cuentas que est� en un nivel 4, calculamos la suma de su nivel y subimos el dato al nivel 3 + CREATE TEMPORARY TABLE temp3 AS (SELECT cod1,cod2,cod3,sum(debe4) AS debe3,sum(haber4) AS haber3 FROM temp4 WHERE debe4 IS NOT NULL group by cod1,cod2,cod3 order by cod3); + -- Seguidamente, a�dimos las hojas del nivel 3 que descartamos en la acci� anterior porque no ten�n cuentas hijas en el nivel 4 + INSERT INTO temp3 SELECT cod1,cod2,cod3,debe3,haber3 FROM temp4 WHERE debe4 IS NULL; + -- Se calculan las sumas del nivel 3 y les pasamos el dato a las cuentas padre del nivel 2 + CREATE TEMPORARY TABLE temp2 AS (SELECT cod1,cod2,sum(debe3) AS debe2,sum(haber3) AS haber2 FROM temp3 group by cod1,cod2 order by cod2); + -- Y finalmente, hacemos lo mismo con el nivel 2 y subimos las sumas al nivel 1 + CREATE TEMPORARY TABLE temp1 AS (SELECT cod1,sum(debe2) AS debe1,sum(haber2) AS haber1 FROM temp2 group by cod1 order by cod1); + + -- Ahora vamos a eliminar de las tablas aquellas cuentas que no ser�necesario actualizar por ya estar con los valores correctos + CREATE TEMPORARY TABLE nivel1 AS (SELECT t1.cod1,t1.debe1,t1.haber1 FROM (SELECT * FROM temp1) AS t1 INNER JOIN (SELECT codigo,debe,haber FROM cuenta) AS t2 ON t1.cod1=t2.codigo WHERE t1.debe1<>t2.debe OR t1.haber1<>t2.haber); + CREATE TEMPORARY TABLE nivel2 AS (SELECT t1.cod2,t1.debe2,t1.haber2 FROM (SELECT * FROM temp2) AS t1 INNER JOIN (SELECT codigo,debe,haber FROM cuenta) AS t2 ON t1.cod2=t2.codigo WHERE t1.debe2<>t2.debe OR t1.haber2<>t2.haber); + CREATE TEMPORARY TABLE nivel3 AS (SELECT t1.cod3,t1.debe3,t1.haber3 FROM (SELECT * FROM temp3) AS t1 INNER JOIN (SELECT codigo,debe,haber FROM cuenta) AS t2 ON t1.cod3=t2.codigo WHERE t1.debe3<>t2.debe OR t1.haber3<>t2.haber); + + -- Como colof�, hay que introducir los valores actualizados en las cuentas padre. + FOR cta IN SELECT * FROM nivel1 ORDER BY cod1 LOOP + RAISE NOTICE ''Cuenta % -> debe: % haber: %'',cta.cod1,cta.debe1,cta.haber1; + UPDATE cuenta SET debe=cta.debe1, haber=cta.haber1 WHERE idcuenta IN (SELECT idcuenta FROM cuenta WHERE codigo=cta.cod1); + RAISE NOTICE ''Cuenta % actualizada'',cta.cod1; + END LOOP; + FOR cta IN SELECT * FROM nivel2 ORDER BY cod2 LOOP + RAISE NOTICE ''Cuenta % -> debe: % haber: %'',cta.cod2,cta.debe2,cta.haber2; + UPDATE cuenta SET debe=cta.debe2, haber=cta.haber2 WHERE idcuenta IN (SELECT idcuenta FROM cuenta WHERE codigo=cta.cod2); + RAISE NOTICE ''Cuenta % actualizada'',cta.cod2; + END LOOP; + FOR cta IN SELECT * FROM nivel3 WHERE length(cod3)=niveles.numx ORDER BY cod3 LOOP + RAISE NOTICE ''Cuenta % -> debe: % haber: %'',cta.cod3,cta.debe3,cta.haber3; + UPDATE cuenta SET debe=cta.debe3, haber=cta.haber3 WHERE idcuenta IN (SELECT idcuenta FROM cuenta WHERE codigo=cta.cod3); + RAISE NOTICE ''Cuenta % actualizada'',cta.cod3; + END LOOP; + + RETURN 0; +END; +' LANGUAGE plpgsql; + + +-- +-- TOC entry 102 (OID 1346064) +-- Name: aumenta_valor(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION aumenta_valor() RETURNS "trigger" + AS ' +DECLARE + cta int4; + ccost int4; + ctar RECORD; + ccostr RECORD; +BEGIN + UPDATE cuenta SET debe = debe + NEW.debe, haber = haber + NEW.haber WHERE idcuenta = NEW.idcuenta; + UPDATE c_coste SET debe = debe + NEW.debe, haber = haber + NEW.haber WHERE idc_coste = NEW.idc_coste; + IF NEW.idcuenta IS NOT NULL THEN + UPDATE acumulado_canal SET debe= debe + NEW.debe, haber = haber + NEW.haber WHERE idcuenta = NEW.idcuenta AND +idcanal = NEW.idcanal; + END IF; + cta := NEW.idcuenta; + ccost := NEW.idc_coste; +-- RAISE NOTICE '' Se ha lanzado la funcion aumenta_valor()''; + SELECT INTO ccostr * FROM c_coste WHERE idc_coste = ccost; + WHILE FOUND LOOP + SELECT INTO ctar * FROM cuenta WHERE idcuenta = cta; + WHILE FOUND LOOP +-- RAISE NOTICE '' Cuenta % Centro Coste %'', ctar.idcuenta, ccostr.idc_coste; + UPDATE acumulado_c_coste SET debe = debe + NEW.debe, haber = haber + NEW.haber WHERE idc_coste = +ccostr.idc_coste AND idcuenta = ctar.idcuenta; + SELECT INTO ctar * FROM cuenta WHERE idcuenta = ctar.padre; + END LOOP; + SELECT INTO ccostr * FROM c_coste WHERE idc_coste = ccostr.padre; + END LOOP; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER nuevo_apunte + AFTER INSERT OR UPDATE ON apunte + FOR EACH ROW + EXECUTE PROCEDURE aumenta_valor(); +-- +-- TOC entry 103 (OID 1346065) +-- Name: disminuye_valor(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION disminuye_valor() RETURNS "trigger" + AS ' +DECLARE + cta int4; + ccost int4; + ctar RECORD; + ccostr RECORD; +BEGIN +-- RAISE NOTICE ''disminuye_valor: debe antiguo %, debe nuevo %'', OLD.debe, NEW.debe; + + UPDATE cuenta SET debe = debe - OLD.debe, haber = haber - OLD.haber WHERE idcuenta = OLD.idcuenta; + UPDATE c_coste SET debe = debe - OLD.debe, haber = haber - OLD.haber WHERE idc_coste = OLD.idc_coste; + IF OLD.idcuenta IS NOT NULL THEN + UPDATE acumulado_canal SET debe= debe - OLD.debe, haber =haber - OLD.haber WHERE idcuenta = OLD.idcuenta AND +idcanal = OLD.idcanal; + END IF; + cta := OLD.idcuenta; + ccost := OLD.idc_coste; +-- RAISE NOTICE '' Se ha lanzado la funcion disminuye_valor()''; + SELECT INTO ccostr * FROM c_coste WHERE idc_coste = ccost; + WHILE FOUND LOOP + SELECT INTO ctar * FROM cuenta WHERE idcuenta = cta; + WHILE FOUND LOOP +-- RAISE NOTICE '' Cuenta % Centro Coste %'', ctar.idcuenta, ccostr.idc_coste; + UPDATE acumulado_c_coste SET debe = debe - OLD.debe, haber = haber -OLD.haber WHERE idc_coste = ccostr.idc_coste +AND idcuenta = ctar.idcuenta; + SELECT INTO ctar * FROM cuenta WHERE idcuenta = ctar.padre; + END LOOP; + SELECT INTO ccostr * FROM c_coste WHERE idc_coste = ccostr.padre; + END LOOP; +-- RAISE NOTICE '' disminuye_valor: Finaliza el algoritmo. ''; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER nuevo_apunte1 + AFTER UPDATE ON apunte + FOR EACH ROW + EXECUTE PROCEDURE disminuye_valor(); + +-- +-- TOC entry 104 (OID 1346066) +-- Name: disminuye_valor1(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION disminuye_valor1() RETURNS "trigger" + AS ' +DECLARE + cta int4; + ccost int4; + ctar RECORD; + ccostr RECORD; +BEGIN + + UPDATE cuenta SET debe = debe - OLD.debe, haber = haber - OLD.haber WHERE idcuenta = OLD.idcuenta; + UPDATE c_coste SET debe = debe - OLD.debe, haber = haber - OLD.haber WHERE idc_coste = OLD.idc_coste; + IF OLD.idcuenta IS NOT NULL THEN + UPDATE acumulado_canal SET debe= debe - OLD.debe, haber =haber - OLD.haber WHERE idcuenta = OLD.idcuenta AND +idcanal = OLD.idcanal; + END IF; + cta := OLD.idcuenta; + ccost := OLD.idc_coste; +-- RAISE NOTICE '' Se ha lanzado la funcion disminuye_valor()''; + SELECT INTO ccostr * FROM c_coste WHERE idc_coste = ccost; + WHILE FOUND LOOP + SELECT INTO ctar * FROM cuenta WHERE idcuenta = cta; + WHILE FOUND LOOP +-- RAISE NOTICE '' Cuenta % Centro Coste %'', ctar.idcuenta, ccostr.idc_coste; + UPDATE acumulado_c_coste SET debe = debe - OLD.debe, haber = haber -OLD.haber WHERE idc_coste = ccostr.idc_coste +AND idcuenta = ctar.idcuenta; + SELECT INTO ctar * FROM cuenta WHERE idcuenta = ctar.padre; + END LOOP; + SELECT INTO ccostr * FROM c_coste WHERE idc_coste = ccostr.padre; + END LOOP; +-- RAISE NOTICE '' disminuye_valor: Finaliza el algoritmo. ''; + RETURN OLD; +END; +' + LANGUAGE plpgsql; + + +CREATE TRIGGER nuevo_apunte2 + AFTER DELETE ON apunte + FOR EACH ROW + EXECUTE PROCEDURE disminuye_valor1(); + +-- +-- TOC entry 105 (OID 1346067) +-- Name: creacuenta(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION creacuenta() RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT * FROM canal LOOP + INSERT INTO acumulado_canal (idcuenta, idcanal,debe,haber) VALUES(NEW.idcuenta, mrecord.idcanal,0,0); + END LOOP; + FOR mrecord IN SELECT * FROM c_coste LOOP + INSERT INTO acumulado_c_coste (idcuenta, idc_coste,debe,haber) VALUES(NEW.idcuenta, mrecord.idc_coste,0,0); + END LOOP; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER nueva_cuenta + AFTER INSERT ON cuenta + FOR EACH ROW + EXECUTE PROCEDURE creacuenta(); + + +-- +-- TOC entry 106 (OID 1346068) +-- Name: borracuenta(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION borracuenta() RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT * FROM canal LOOP + DELETE FROM acumulado_canal WHERE idcuenta = OLD.idcuenta; + END LOOP; + FOR mrecord IN SELECT * FROM c_coste LOOP + DELETE FROM acumulado_c_coste WHERE idcuenta=OLD.idcuenta; + END LOOP; + RETURN OLD; +END; +' + LANGUAGE plpgsql; + + +CREATE TRIGGER borra_cuenta + BEFORE DELETE ON cuenta + FOR EACH ROW + EXECUTE PROCEDURE borracuenta(); + +-- +-- TOC entry 107 (OID 1346069) +-- Name: creacanal(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION creacanal() RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT * FROM cuenta LOOP + INSERT INTO acumulado_canal (idcuenta, idcanal,debe,haber) VALUES(mrecord.idcuenta, NEW.idcanal,0,0); + END LOOP; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER nuevo_canal + AFTER INSERT ON canal + FOR EACH ROW + EXECUTE PROCEDURE creacanal(); + + +-- +-- TOC entry 108 (OID 1346070) +-- Name: borracanal(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION borracanal() RETURNS "trigger" + AS ' +BEGIN + DELETE FROM acumulado_canal WHERE idcanal = OLD.idcanal; + RETURN OLD; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER borra_canal + BEFORE DELETE ON canal + FOR EACH ROW + EXECUTE PROCEDURE borracanal(); + +-- +-- TOC entry 109 (OID 1346071) +-- Name: creaccoste(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION creaccoste() RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT * FROM cuenta LOOP + INSERT INTO acumulado_c_coste (idcuenta, idc_coste,debe,haber) VALUES(mrecord.idcuenta, NEW.idc_coste,0,0); + END LOOP; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER nuevo_ccoste + AFTER INSERT ON c_coste + FOR EACH ROW + EXECUTE PROCEDURE creaccoste(); + +-- +-- TOC entry 110 (OID 1346072) +-- Name: borraccoste(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION borraccoste() RETURNS "trigger" + AS ' +BEGIN + DELETE FROM acumulado_c_coste WHERE idc_coste = OLD.idc_coste; + RETURN OLD; +END; +' + LANGUAGE plpgsql; + + +CREATE TRIGGER borra_ccoste + BEFORE DELETE ON c_coste + FOR EACH ROW + EXECUTE PROCEDURE borraccoste(); + +-- +-- TOC entry 111 (OID 1346073) +-- Name: propagaacumuladocuenta(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION propagaacumuladocuenta() RETURNS "trigger" + AS ' +DECLARE + incdebe numeric(12,2); + inchaber numeric(12,2); +BEGIN + incdebe = NEW.debe - OLD.debe; + inchaber = NEW.haber - OLD.haber; +-- RAISE NOTICE ''propagaacumuladocuenta %'', NEW.codigo; + IF incdebe <> 0 OR inchaber <> 0 THEN + UPDATE cuenta SET debe = debe + incdebe, haber = haber + inchaber WHERE idcuenta = NEW.padre; + END IF; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER propaga_acumulado_cuenta + AFTER UPDATE ON cuenta + FOR EACH ROW + EXECUTE PROCEDURE propagaacumuladocuenta(); + +-- +-- TOC entry 112 (OID 1346074) +-- Name: propagaacumuladoccoste(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION propagaacumuladoccoste() RETURNS "trigger" + AS ' +DECLARE + incdebe numeric(12,2); + inchaber numeric(12,2); +BEGIN + incdebe = NEW.debe - OLD.debe; + inchaber = NEW.haber - OLD.haber; + IF incdebe <> 0 OR inchaber <> 0 THEN + UPDATE c_coste SET debe = debe + incdebe, haber = haber + inchaber WHERE idc_coste = OLD.padre; + END IF; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + +CREATE TRIGGER propaga_acumulado_ccoste + AFTER UPDATE ON c_coste + FOR EACH ROW + EXECUTE PROCEDURE propagaacumuladoccoste(); + +-- +-- TOC entry 113 (OID 1346075) +-- Name: acumulados_canal(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION acumulados_canal() RETURNS "trigger" + AS ' +DECLARE + incdebe numeric(12,2); + inchaber numeric(12,2); + cuentar RECORD; +BEGIN +-- RAISE NOTICE '' Ha entrado el trigger acumulados_canal() ''; +-- RAISE NOTICE '' idcuenta % idcanal %'', NEW.idcuenta, NEW.idcanal; + incdebe = NEW.debe - OLD.debe; + inchaber = NEW.haber - OLD.haber; + SELECT INTO cuentar * FROM cuenta WHERE idcuenta = NEW.idcuenta; + SELECT INTO cuentar * FROM cuenta WHERE idcuenta = cuentar.padre; + IF FOUND THEN + UPDATE acumulado_canal SET debe = debe + incdebe, haber = haber + inchaber WHERE idcuenta = cuentar.idcuenta AND idcanal += NEW.idcanal; + END IF; + RETURN NEW; +END; +' + LANGUAGE plpgsql; + + +CREATE TRIGGER acumulados_canal_fk + AFTER UPDATE ON acumulado_canal + FOR EACH ROW + EXECUTE PROCEDURE acumulados_canal(); + + + +-- TOC entry 114 (OID 1346096) +-- Name: abreasiento(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION abreasiento(integer) RETURNS integer + AS 'DECLARE + id_asiento ALIAS FOR $1; +BEGIN + DELETE FROM apunte WHERE idasiento=id_asiento; + RETURN 1; +END; +' + LANGUAGE plpgsql; + + +-- +-- TOC entry 115 (OID 1346097) +-- Name: cierraasiento(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION cierraasiento(integer) RETURNS integer + AS 'DECLARE + id_asiento ALIAS FOR $1; + mrecord RECORD; +BEGIN + DELETE FROM apunte WHERE idasiento=id_asiento; + -- // Linia Afegida per Josep B. + + FOR mrecord IN SELECT * from borrador WHERE idasiento=id_asiento LOOP + INSERT INTO apunte (codigoborrador, idasiento, iddiario, fecha, conceptocontable, idcuenta, descripcion, debe, +haber, contrapartida, comentario, idcanal, marcaconciliacion, idc_coste, idtipoiva, orden) VALUES (mrecord.codigoborrador, +mrecord.idasiento, mrecord.iddiario, mrecord.fecha, mrecord.conceptocontable, mrecord.idcuenta, mrecord.descripcion, +mrecord.debe, mrecord.haber, mrecord.contrapartida, mrecord.comentario, mrecord.idcanal, mrecord.marcaconciliacion, +mrecord.idc_coste, mrecord.idtipoiva, mrecord.orden); + END LOOP; + +-- Cuando cerramos el asiento, tambien recalculamos todas las contrapartidas. + PERFORM contraasiento(id_asiento); + RETURN 1; +END; + +' + LANGUAGE plpgsql; + + + + +-- +-- TOC entry 116 (OID 1346113) +-- Name: reordenaasientos(integer); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE FUNCTION reordenaasientos(integer) RETURNS integer + AS ' +DECLARE + ejercicio ALIAS FOR $1; + as RECORD; + cont integer; +BEGIN + cont := 1; + FOR as IN SELECT * from asiento WHERE EXTRACT(YEAR FROM fecha)=ejercicio ORDER BY fecha,ordenasiento LOOP + IF (cont <> as.ordenasiento) THEN + UPDATE asiento SET ordenasiento = cont WHERE idasiento = as.idasiento; + END IF; + cont := cont + 1; + END LOOP; + RETURN 0; +END; +' LANGUAGE plpgsql; + + +-- +-- TOC entry 116 (OID 1346113) +-- Name: reordenaasientosall(); Type: FUNCTION; Schema: public; Owner: postgres +-- + +CREATE OR REPLACE FUNCTION reordenaasientosall() RETURNS integer + AS ' +DECLARE + bs RECORD; + ejercicio integer; +BEGIN + FOR bs IN SELECT DISTINCT EXTRACT (YEAR FROM FECHA) AS ano FROM asiento ORDER BY ano LOOP + ejercicio = bs.ano; + PERFORM reordenaasientos(ejercicio); + END LOOP; + RETURN 0; +END; +' LANGUAGE plpgsql; + + + + +-- ********************************************************************** +-- APARTADO DE COMPROBACIONES DE INTEGRIDAD EXTRA Y DETECCI� DE ERRORES. +-- ********************************************************************** +-- ********************************************************************** + +-- Las comprobaciones saltan como disparadores y abortan la ejecuci� si no se cumplen las restricciones. +--DROP TRIGGER restriccionescuentatrigger ON cuenta CASCADE; +--DROP FUNCTION restriccionescuenta(); + + +CREATE FUNCTION restriccionescuenta () RETURNS "trigger" +AS ' +DECLARE + cta RECORD; +BEGIN + IF NEW.padre <> 0 THEN + SELECT INTO cta * FROM cuenta WHERE idcuenta= NEW.padre; + IF NOT FOUND THEN + RAISE EXCEPTION '' La cuenta padre no existe. ''; + END IF; + END IF; + IF NEW.codigo = '''' THEN + RAISE EXCEPTION '' No se puede dejar el código de cuenta vacio ''; + END IF; + IF NEW.descripcion = '''' THEN + RAISE EXCEPTION '' Nombre de cuenta vacio ''; + END IF; + IF NEW.nombreent_cuenta = '''' THEN + NEW.nombreent_cuenta = NEW.descripcion; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER restriccionescuentatrigger + BEFORE INSERT OR UPDATE ON cuenta + FOR EACH ROW + EXECUTE PROCEDURE restriccionescuenta(); + + + +CREATE OR REPLACE FUNCTION restriccionesborradocuenta () RETURNS "trigger" +AS ' +DECLARE + cta RECORD; +BEGIN + SELECT INTO cta * FROM cuenta WHERE padre = OLD.idcuenta; + IF FOUND THEN + RAISE EXCEPTION '' La cuenta tiene hijos. ''; + END IF; + RETURN OLD; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER restriccionesborradocuentatrigger + BEFORE DELETE ON cuenta + FOR EACH ROW + EXECUTE PROCEDURE restriccionesborradocuenta(); + + +CREATE FUNCTION restriccionesborrador () RETURNS "trigger" +AS ' +DECLARE + cta RECORD; + ej RECORD; + ord RECORD; +BEGIN + SELECT INTO cta * FROM cuenta WHERE idcuenta = NEW.idcuenta; + IF FOUND THEN + IF cta.bloqueada THEN + RAISE EXCEPTION '' Cuenta bloqueada, no se puede utilizar esta cuenta ''; + END IF; + + IF cta.nodebe THEN + IF NEW.debe <> 0 THEN + RAISE EXCEPTION '' Cuenta bloqueada por debe, solo permite haber ''; + END IF; + END IF; + IF cta.nohaber THEN + IF NEW.haber <> 0 THEN + RAISE EXCEPTION '' Cuenta bloqueada por haber, solo permite debe ''; + END IF; + END IF; + ELSE + RAISE EXCEPTION '' Cuenta inexistente ''; + END IF; + + SELECT INTO ord * FROM borrador WHERE idasiento = NEW.idasiento AND orden=NEW.orden AND idborrador <> NEW.idborrador; + IF FOUND THEN + RAISE EXCEPTION '' El campo orden está duplicado ''; + END IF; + + SELECT INTO ej * FROM ejercicios WHERE ejercicio = EXTRACT (YEAR FROM NEW.fecha) AND periodo =0; + IF FOUND THEN + IF ej.bloqueado = TRUE THEN + RAISE EXCEPTION '' Periodo bloqueado ''; + END IF; + ELSE + RAISE EXCEPTION '' Ejercicio Inexistente''; + END IF; + SELECT INTO ej * FROM ejercicios WHERE ejercicio = EXTRACT (YEAR FROM NEW.fecha) AND periodo = EXTRACT (MONTH FROM NEW.fecha); + IF ej.bloqueado = TRUE THEN + RAISE EXCEPTION '' Periodo bloqueado ''; + END IF; + + + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionesborradortrigger + BEFORE INSERT OR UPDATE ON borrador + FOR EACH ROW + EXECUTE PROCEDURE restriccionesborrador(); + + + +CREATE FUNCTION restriccionesasiento () RETURNS "trigger" +AS ' +DECLARE + ej RECORD; +BEGIN + SELECT INTO ej * FROM ejercicios WHERE ejercicio = EXTRACT (YEAR FROM NEW.fecha) AND periodo =0; + IF FOUND THEN + IF ej.bloqueado = TRUE THEN + RAISE EXCEPTION '' Periodo bloqueado ''; + END IF; + ELSE + RAISE EXCEPTION '' Ejercicio Inexistente''; + END IF; + SELECT INTO ej * FROM ejercicios WHERE ejercicio = EXTRACT (YEAR FROM NEW.fecha) AND periodo = EXTRACT (MONTH FROM NEW.fecha); + IF ej.bloqueado = TRUE THEN + RAISE EXCEPTION '' Periodo bloqueado ''; + END IF; + IF NEW.ordenasiento ISNULL OR NEW.ordenasiento = 0 THEN + SELECT INTO ej max(ordenasiento)+1 AS max, count(idasiento) as cuenta FROM asiento; + IF ej.cuenta > 0 THEN + NEW.ordenasiento = ej.max; + ELSE + NEW.ordenasiento = 1; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER restriccionesasientotrigger + BEFORE INSERT OR UPDATE ON asiento + FOR EACH ROW + EXECUTE PROCEDURE restriccionesasiento(); + + +CREATE FUNCTION tr_borradoasiento() RETURNS "trigger" +AS ' +BEGIN + UPDATE prevcobro SET idasiento = NULL WHERE idasiento=OLD.idasiento; + RETURN OLD; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER restriccionesborradoasientotrigger + BEFORE DELETE ON asiento + FOR EACH ROW + EXECUTE PROCEDURE tr_borradoasiento(); + + + +-- Propaga los acumulados de IVA +CREATE FUNCTION inserttipoiva () RETURNS "trigger" +AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT * FROM registroiva LOOP + INSERT INTO iva (idregistroiva, idtipoiva,baseiva) VALUES(mrecord.idregistroiva, NEW.idtipoiva,0); + END LOOP; + RETURN NEW; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER nuevotipoiva + AFTER INSERT ON tipoiva + FOR EACH ROW + EXECUTE PROCEDURE inserttipoiva(); + +CREATE FUNCTION deletetipoiva () RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + DELETE FROM iva WHERE idtipoiva=OLD.idtipoiva; + RETURN OLD; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER borratipoiva + BEFORE DELETE ON tipoiva + FOR EACH ROW + EXECUTE PROCEDURE deletetipoiva(); + + + +CREATE OR REPLACE FUNCTION cambiadoiva () RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT SUM(baseiva) AS suma, SUM(ivaiva) AS sumaiva FROM iva WHERE iva.idregistroiva=NEW.idregistroiva LOOP + UPDATE registroiva SET baseimp=mrecord.suma, iva=mrecord.sumaiva WHERE idregistroiva=NEW.idregistroiva; + END LOOP; + RETURN NEW; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER civa + AFTER INSERT OR UPDATE ON iva + FOR EACH ROW + EXECUTE PROCEDURE cambiadoiva(); + + +CREATE OR REPLACE FUNCTION cambiadoivad () RETURNS "trigger" + AS ' +DECLARE + mrecord RECORD; +BEGIN + FOR mrecord IN SELECT SUM(baseiva) AS suma, SUM(ivaiva) AS sumaiva FROM iva WHERE iva.idregistroiva=OLD.idregistroiva LOOP + UPDATE registroiva SET baseimp=mrecord.suma, iva=mrecord.sumaiva WHERE idregistroiva=OLD.idregistroiva; + END LOOP; + RETURN OLD; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER civad + AFTER DELETE ON iva + FOR EACH ROW + EXECUTE PROCEDURE cambiadoivad(); +-- ****************************************************** +-- FIN DEL APARTADO DE COMPROBACIONES. +-- ****************************************************** +-- ****************************************************** + +COMMENT ON SCHEMA public IS 'Standard public schema'; + + + + +-- Empiezo a meter datos ********************************************** + +-- t_configuracion_data.sql ##################################################### + + +-- +-- PostgreSQL database dump +-- + +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (1, 'CodCuenta', 'xxxxyyy'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (2, 'Amortizacion', 'Amortizacion'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (3, 'Cobro', 'Cobro'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (4, 'CIF', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (5, 'TipoIva', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (6, 'NombreVia', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (7, 'NumeroVia', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (8, 'Escalera', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (9, 'Piso', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (10, 'Puerta', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (11, 'CodPostal', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (12, 'Municipio', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (13, 'Provincia', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (14, 'Pais', '--'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (15, 'Tipo', 'BulmaCont'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (16, 'Ejercicio', '2004'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (17, 'NombreEmpresa', 'Sin Definir'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (18, 'RegistroEmitida', '472'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (19, 'RegistroSoportada', '477'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (20, 'DatabaseRevision', '0.5.1'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (21, 'CuentaRegularizacion', '129'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (22, 'CuentasIngresos', '60;62'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (23, 'CuentasGastos', '70'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (24, 'CuentasDerechos', '43;3'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (25, 'CuentasObligaciones', '40;41'); +INSERT INTO configuracion (idconfiguracion, nombre, valor) VALUES (26, 'Pago', 'Pago'); + +-- t_grupo_data.sql ################################################### + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 2 (OID 1345950) +-- Name: grupo; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY grupo (idgrupo, descripcion) FROM stdin; +2 2.- INMOVILIZADO +3 3.- EXISTENCIAS +4 4.- AC y DE POR OPERACIONES DE TRAFICO +5 5.- CUENTAS FINANCIERAS +1 1.- FINANCIACION BASICA +6 6.- COMPRAS Y GASTOS +7 7.- VENTAS E INGRESOS +\. + +-- t_cuenta_data.sql ################################################### + + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3697054) +-- Name: cuenta; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (613, '70', 'VENTAS DE MERCADERIAS DE PRODUCCION PROPIA, DE SERVICIOS, ETC.' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (462, '57', 'TESORERIA' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (323, '43', 'CLIENTES' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (583, '68', 'DOTACIONES A LAS PROVISIONES' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (357, '47', 'ADMINISTRACIONES PUBLICAS' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (299, '40', 'PROVEEDORES' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (314, '41', 'ACREEDORES VARIOS' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES ( 88, '10', 'CAPITAL' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (126, '15', 'EMPRESITOS Y OTRAS EMISIONES ANALOGAS' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (192, '23', 'INMOVILIZACIONES MATERIALES EN CURSO' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (507, '63', 'TRIBUTOS' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (199, '24', 'INVERSIONES FINANCIERAS EN EMPRESAS DEL GRUPO Y ASOCIADAS' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (223, '26', 'FIANZAS Y DEPOSITOS CONSTITUIDOS A LARGO PLAZO' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (226, '27', 'GASTOS A DISTRIBUIR EN VARIOS EJERCICIOS' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (264, '31', 'MATERIAS PRIMAS' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (275, '33', 'PRODUCTOS EN CURSO' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (284, '36', 'PRODUCTOS, RESIDUOS Y MATERIALES RECUPERADOS' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (343, '44', 'DEUDORES VARIOS' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (418, '53', 'INVERSIONES FINANCIERAS A CORTO PLAZO EN EMPRESAS DEL GRUPO Y ASOCIADAS' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (445, '55', 'OTRAS CUENTAS NO BANCARIAS' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (457, '56', 'FIANZAS Y DEPOSITOS RECIBIDOS Y CONSTITUIDOS A CORTO PLAZO' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (469, '58', 'AJUSTES POR PERIODIFICACION' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (531, '66', 'GASTOS FINANCIEROS' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (575, '67', 'PERDIDAS PROCEDENTES DEL INMOVILIZADO Y GASTOS EXCEPCIONALES' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (643, '74', 'SUBVENCIONES A LA EXPLOTACION' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (646, '75', 'OTROS INGRESOS DE GESTION' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (281, '35', 'PRODUCTOS TERMINADOS' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (278, '34', 'PRODUCTOS SEMITERMINADOS' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (632, '71', 'VARIACION DE EXISTENCIAS' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (637, '73', 'TRABAJOS REALIZADOS PARA LA EMPRESA' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (267, '32', 'OTROS APROVISIONAMIENTOS' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (166, '20', 'GASTOS DE ESTABLECIMIENTO' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (120, '14', 'PROVISIONES PARA RIESGOS Y GASTOS' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (136, '16', 'DEUDAS A LARGO PLAZO CON EMPRESAS DEL GRUPO Y ASOCIADAS' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (145, '17', 'DEUDAS A LARGO PLAZO POR PRESTAMOS RECIBIDOS Y OTROS CONCEPTOS' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (153, '18', 'FIANZAS Y DEPOSITOS RECIBIDOS A LARGO PLAZO' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (384, '50', 'EMPRESITOS Y OTRAS EMISIONES ANALOGAS A CORTO PLAZO' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (393, '51', 'DEUDAS A CORTO PLAZO CON EMPRESAS DEL GRUPO Y ASOCIADAS' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (407, '52', 'DEUDAS A CORTO PLAZO POR PRESTAMOS RECIBIDOS Y OTROS CONCEPTOS' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (113, '13', 'INGRESOS A DISTRIBUIR EN VARIOS EJERCICIOS' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (156, '19', 'SITUACIONES TRANSITORIAS DE FINANCIACION' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (210, '25', 'OTRAS INVERSIONES FINANCIERAS' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (249, '29', 'PROVISIONES DE INMOVILIZADO' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (170, '21', 'INMOVILIZACIONES INMATERIALES' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (95, '11', 'RESERVAS' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (379, '49', 'PROVISIONES POR OPERACIONES DE TRAFICO' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (376, '48', 'AJUSTES POR PERIODIFICACION' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (181, '22', 'INMOVILIZACIONES MATERIALES' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (431, '54', 'OTRAS INVERSIONES FINANCIERAS TEMPORALES' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (261, '30', 'COMERCIALES' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (230, '28', 'AMORTIZACION ACUMULADA DEL INMOVILIZADO' , TRUE, NULL, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (472, '59', 'PROVISIONES FINANCIERAS' , TRUE, NULL, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (291, '39', 'PROVISIONES POR DEPRECIACION DE EXISTENCIAS' , TRUE, NULL, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (685, '77', 'BENEFICIOS PROCEDENTES DEL INMOVILIZADO E INGRESOS EXCEPCIONALES' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (519, '64', 'GASTOS DE PERSONAL' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (106, '12', 'RESULTADOS PENDIENTES DE APLICACION' , TRUE, NULL, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (525, '65', 'OTROS GASTOS DE GESTION' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (587, '69', 'DOTACIONES A LAS PROVISIONES' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (479, '60', 'COMPRAS' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (655, '76', 'INGRESOS FINANCIEROS' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (492, '61', 'VARIACION DE EXISTENCIAS' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (496, '62', 'SERVICIOS EXTERIORES' , TRUE, NULL, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (694, '79', 'EXCESOS Y APLICACIONES DE PROVISIONES' , TRUE, NULL, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (354, '46', 'PERSONAL' , TRUE, NULL, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 0); + + +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (363, '472', 'Hacienda Publica, IVA soportado' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (699, '794', 'Provision para insolvencias de trafico aplicada' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (368, '475', 'Hacienda Publica, acreedor por conceptos fiscales' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (505, '628', 'Suministros' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (93, '101', 'Fondo social' , TRUE, 88, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (94, '102', 'Capital' , TRUE, 88, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 3); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (96, '110', 'Prima de emision de acciones' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (97, '111', 'Reservas de revalorizacion' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (103, '116', 'Reservas Estatutarias' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (104, '117', 'Reservas voluntarias' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (105, '118', 'Reservas por capital amortizado' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (100, '114', 'Reservas para acciones de la sociedad dominante' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (102, '115', 'Reservas para acciones propias' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (99, '113', 'Reservas especiales' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (109, '122', 'Aportaciones de socios para compensacion de perdidas' , TRUE, 106, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (108, '121', 'Resultados negativos de ejercicios anteriores' , TRUE, 106, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (117, '131', 'Subvenciones de capital' , TRUE, 113, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (118, '135', 'Ingresos por interes diferidos' , TRUE, 113, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (119, '136', 'Diferencias positivas en moneda extranjera' , TRUE, 113, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (114, '130', 'Subvenciones oficiales de capital' , TRUE, 113, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (121, '140', 'Provisiones para pensiones y obligaciones similares' , TRUE, 120, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (122, '141', 'Provision para impuestos' , TRUE, 120, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (123, '142', 'Provision para responsabilidades' , TRUE, 120, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (124, '143', 'Provision para grandes reparaciones' , TRUE, 120, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (125, '144', 'Fondo de reversion' , TRUE, 120, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (127, '150', 'Obligaciones y bonos' , TRUE, 126, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (134, '151', 'Obligaciones y bonos convertibles' , TRUE, 126, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (135, '155', 'Deudas representadas en otro valores negociables' , TRUE, 126, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (137, '160', 'Deudas a largo plazo con empresas del grupo' , TRUE, 136, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (140, '161', 'Deudas a largo plazo con empresas asociadas' , TRUE, 136, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (141, '162', 'Deudas a largo plazo con entidades de credito del grupo' , TRUE, 136, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (142, '163', 'Deudas a largo plazo con entidades de credito asociadas' , TRUE, 136, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (143, '164', 'Proveedores de inmovilizado a largo plazo, empresas del grupo' , TRUE, 136, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (144, '165', 'proveedores de inmovilizado a largo plazo, empresas asociadas' , TRUE, 136, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (146, '170', 'Deudas a largo plazo con entidades de credito' , TRUE, 145, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (149, '171', 'Deudas a largo plazo' , TRUE, 145, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (150, '172', 'Deudas a largo plazo transformables en subvenciones' , TRUE, 145, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (151, '173', 'Proveedores de inmovilizado a largo plazo' , TRUE, 145, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (152, '174', 'Efectos a pagar a largo plazo' , TRUE, 145, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (154, '180', 'Fianzas recibidas a largo plazo' , TRUE, 153, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (155, '185', 'Depositos recibidos a largo plazo' , TRUE, 153, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (158, '191', 'Accionistas por desembolsos no exigidos, empresas del grupo' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (160, '193', 'Accionistas por aportaciones no dinerarias pendientes' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (161, '194', 'Accionistas por aportaciones no dinerarias pendientes, empresas del grupo' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (162, '195', 'Accionistas por aportaciones no dinerarias pendientes, empresas asociadas' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (163, '196', 'Socios, parte no desembolsada' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (164, '198', 'Acciones propias en situaciones especiales' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (165, '199', 'Acciones propias para reduccion del capital' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (159, '192', 'Accionistas por desembolsos no exigidos, empresas asociadas' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (157, '190', 'Accionistas por desembolsos no exigidos' , TRUE, 156, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (167, '200', 'Gastos de constitucion' , TRUE, 166, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (168, '201', 'Gastos de primer establecimiento' , TRUE, 166, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (169, '202', 'Gastos de ampliacion de capital' , TRUE, 166, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (174, '211', 'Concesiones administrativas' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (179, '217', 'Derechos sobre bienes en regimen de arrendamientos financieros' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (180, '219', 'Anticipos para inmovilizaciones inmateriales' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (177, '214', 'Derechos de traspase' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (176, '213', 'Fondo de comercio' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (171, '210', 'Gastos de investigacion y desarrollo' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (178, '215', 'Aplicaciones informaticas' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (184, '222', 'Instalaciones tecnicas' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (190, '228', 'Elementos de transporte' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (189, '227', 'Equipos para proceso de informacion' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (188, '226', 'Mobiliario' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (186, '224', 'Utillaje' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (191, '229', 'Otro inmovilizado material' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (187, '225', 'Otras instalaciones' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (193, '230', 'Adaptacion de terrenos y de bienes naturales' , TRUE, 192, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (194, '231', 'Construcciones en curso' , TRUE, 192, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (195, '232', 'Instalaciones tecnicas en montaje' , TRUE, 192, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (196, '233', 'Maquinaria en montaje' , TRUE, 192, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (197, '237', 'Equipos para procesos de informacion en montaje' , TRUE, 192, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (198, '239', 'Anticipos para inmovilizaciones materiales' , TRUE, 192, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (200, '240', 'Participaciones en empresas del grupo' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (201, '241', 'Participaciones en empresas asociadas' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (202, '242', 'Valores de renta fija de empresas del grupo' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (203, '243', 'Valores de renta fija de empresas asociadas' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (204, '244', 'Creditos a largo plazo a empresas del grupo' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (205, '245', 'Creditos a largo plazo a empresas asociadas' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (206, '246', 'Intereses a largo plazo de inversiones financieras en empresas del grupo' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (207, '247', 'Intereses a largo plazo de inversiones financieras en empresas asociadas' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (208, '248', 'Desembolsos pendientes sobre acciones de empresas del grupo' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (209, '249', 'Desembolsos pendientes sobre acciones de empresas asociadas' , TRUE, 199, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (211, '250', 'Inversiones financieras permanentes en capital' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (215, '251', 'Valores de renta fija' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (216, '252', 'Creditos a largo plazo' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (217, '253', 'Creditos a largo plazo por enajenacion de inmovilizado' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (218, '254', 'Creditos a largo plazo al personal' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (219, '256', 'Intereses a largo plazo de valores de renta fija' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (221, '258', 'Imposiciones a largo plazo' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (222, '259', 'Desembolsos pendientes sobre acciones' , TRUE, 210, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (220, '257', 'Intereses a largo plazo de creditos' , TRUE, 219, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (224, '260', 'Fianzas constituidas a largo plazo' , TRUE, 223, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (225, '261', 'Depositos constituidos a largo plazo' , TRUE, 223, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (227, '270', 'Gastos de formalizacion de deudas' , TRUE, 226, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (228, '271', 'Gastos por intereses diferidos en valores negociables' , TRUE, 226, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (229, '272', 'Gastos por intereses diferidos' , TRUE, 226, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (250, '291', 'Provision por depreciacion del inmovilizado inmaterial' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (252, '293', 'Provision por depreciacion de valores de renta fija a largo plazo de empresas del grupo' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (254, '294', 'Provision por depreciacion de valores de renta fija a largo plazo de empresas asociadas' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (258, '297', 'Provision para insolvencias de valores negociables a largo plazo' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (259, '296', 'Provision para insolvencias de creditos a largo plazo a empresas asociadas' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (257, '295', 'Provision para insolvencias de creditos a largo plazo a empresas del grupo' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (260, '298', 'Provision para insolvencias de creditos a largo plazo' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (263, '301', 'Mercaderias B' , TRUE, 261, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (265, '310', 'Materias primas A' , TRUE, 264, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (266, '311', 'Materias primas B' , TRUE, 264, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (268, '320', 'Elementos y conjuntos incorporables' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (269, '321', 'Combustibles' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (270, '322', 'Repuestos' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (271, '325', 'Materiales diversos' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (273, '327', 'Envases' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (274, '328', 'Material de oficina' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (272, '326', 'Embalajes' , TRUE, 267, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (276, '330', 'Productos en curso A' , TRUE, 275, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (277, '331', 'Productos en curso B' , TRUE, 275, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (279, '340', 'Productos semiterminados A' , TRUE, 278, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (280, '341', 'Productos semiterminados B' , TRUE, 278, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (282, '350', 'Productos terminados A' , TRUE, 281, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (283, '351', 'Productos terminados B' , TRUE, 281, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (285, '360', 'Subproductos A' , TRUE, 284, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (286, '361', 'Subproductos B' , TRUE, 284, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (287, '365', 'Residuos A' , TRUE, 284, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (288, '366', 'Residuos B' , TRUE, 284, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (289, '368', 'Materiales recuperados A' , TRUE, 284, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (290, '369', 'Materiales recuperados B' , TRUE, 284, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (293, '391', 'Provision por depreciacion de materias primas' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (294, '392', 'Provision por depreciacion de otros aprovisionamientos' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (295, '393', 'Provision por depreciacion de productos en curso' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (296, '394', 'Provision por depreciacion de productos semiterminados' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (297, '395', 'Provision por depreciacion de productos terminados' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (298, '396', 'Provision por depreciacion de subproductos, residuos y materiales recuperados' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (313, '407', 'Anticipos a proveedores' , TRUE, 299, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (304, '402', 'Proveedores, empresas del grupo' , TRUE, 299, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (311, '403', 'Proveedores, empresas asociadas' , TRUE, 299, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (312, '406', 'Embases y embalajes a devolver a proveedores' , TRUE, 299, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (321, '411', 'Acreedores, efectos comerciales a pagar' , TRUE, 314, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (322, '419', 'Acreedores por operaciones en comun' , TRUE, 314, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (333, '432', 'Clientes, empresas del grupo' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (339, '433', 'Clientes, empresas asociadas' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (341, '436', 'Envases y embalajes a devolver por clientes' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (342, '437', 'Anticipos de clientes' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (344, '440', 'Deudores' , TRUE, 343, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (348, '441', 'Deudores, efectos comerciales a cobrar' , TRUE, 343, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (352, '445', 'Deudores de dudoso cobro' , TRUE, 343, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (353, '449', 'Deudores por operaciones en comun' , TRUE, 343, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (355, '460', 'Anticipos de remuneraciones' , TRUE, 354, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (356, '465', 'Remuneraciones pendientes de pago' , TRUE, 354, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (358, '470', 'Hacienda Publica, deudor por diversos conceptos' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (362, '471', 'Organismos de la Seguridad Social, deudores' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (364, '473', 'Hacienda Publica, retenciones y pagos a cuenta' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (365, '474', 'Impuesto sobre beneficios anticipado y compensacion de perdidas' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (375, '479', 'Impuesto sobre beneficios diferido' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (378, '485', 'Ingresos anticipados' , TRUE, 376, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (381, '491', 'Provision para insolvencias de trafico de empresas del grupo' , TRUE, 379, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (382, '494', 'Provision para insolvencias de trafico de empresas asociadas' , TRUE, 379, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (383, '499', 'Provision para otras insolvencias de trafico' , TRUE, 379, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (385, '500', 'Obligaciones y bonos a corto plazo' , TRUE, 384, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (386, '501', 'Obligaciones y bonos convertibles a corto plazo' , TRUE, 384, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (387, '505', 'Deudas representadas en otros valores negociables a corto plazo' , TRUE, 384, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (389, '509', 'Valores negociables amortizados' , TRUE, 384, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (388, '506', 'Intereses de empresitos y otras emisiones analogas' , TRUE, 384, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (394, '510', 'Deudas a corto plazo con empresas del grupo' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (397, '511', 'Deudas a corto plazo con empresas asociadas' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (402, '513', 'Deudas a corto plazo con entidades de credito asociadas' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (403, '514', 'Proveedores de inmovilizado a corto plazo, empresas del grupo' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (404, '515', 'Proveedores de inmovilizado a corto plazo, empresas asociadas' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (405, '516', 'Intereses a corto plazo de deudas con empresas del grupo' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (406, '517', 'Intereses a corto plazo de deudas con empresas asociadas' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (398, '512', 'Deudas a corto plazo con entidades de credito del grupo' , TRUE, 393, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (417, '527', 'Intereses a corto plazo de deudas' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (416, '526', 'Intereses a corto plazo de deudas con entidades de credito' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (415, '525', 'Dividendo activo a pagar' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (408, '520', 'Deudas a corto plazo con entidades de credito' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (412, '521', 'Deudas a corto plazo' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (413, '523', 'Proveedores de inmovilizado a corto plazo' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (414, '524', 'Efectos a pagar a corto plazo' , TRUE, 407, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (419, '530', 'Participaciones a corto plazo en empresas del grupo' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (420, '531', 'Participaciones a corto plazo en empresas asociadas' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (421, '532', 'Valores de renta fija a corto plazo de empresas del grupo' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (422, '533', 'Valores de renta fija a corto plazo de empresas asociadas' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (423, '534', 'Creditos a corto plazo a empresas del grupo' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (424, '535', 'Creditos a corto plazo a empresas asociadas' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (425, '536', 'Intereses a corto plazo de inversiones financieras en empresas del grupo' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (428, '537', 'Intereses a corto plazo de inversiones financieras en empresas asociadas' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (429, '538', 'Desembolsos pendientes sobre acciones a corto plazo de empresas del grupo' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (430, '539', 'Desembolsos sobre acciones a corto plazo de empresas asociadas' , TRUE, 418, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (436, '541', 'Valores de renta fija a corto plazo' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (437, '542', 'Creditos a corto plazo' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (438, '543', 'Creditos a corto plazo por enajenacion del mobiliario' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (439, '544', 'Creditos a corto plazo al personal' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (440, '545', 'Dividendo a cobrar' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (441, '546', 'Intereses a corto plazo de valores de renta fija' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (442, '547', 'Intereses a corto plazo de creditos' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (443, '548', 'Imposiciones a corto plazo' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (444, '549', 'Desembolsos pendientes sobre acciones a corto plazo' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (455, '557', 'Dividendo activo a pagar' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (456, '558', 'Accionista por desembolsos exigidos' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (447, '551', 'Cuenta corriente con empresas del grupo' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (448, '552', 'Cuenta corriente con empresas asociadas' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (449, '553', 'Cuenta corriente con socios y administradores' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (450, '555', 'Partidas pendientes de aplicacion' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (451, '556', 'Desembolsos exigidos sobre acciones' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (446, '550', 'Titular de explotacion' , TRUE, 445, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 3); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (460, '565', 'Fianzas constituidas a corto plazo' , TRUE, 457, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (458, '560', 'Fianzas recibidas a corto plazo' , TRUE, 457, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (459, '561', 'Depositos recibidos a corto plazo' , TRUE, 457, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (461, '566', 'Depostios constituidos a corto plazo' , TRUE, 460, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (468, '575', 'Bancos e instituciones de credito, cuentas de ahorro, moneda extranjera' , TRUE, 462, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (467, '574', 'Bancos e instituciones de credito cuentas de ahorro' , TRUE, 462, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (470, '580', 'Intereses pagados por anticipado' , TRUE, 469, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (471, '585', 'Intereses cobrados por anticipado' , TRUE, 469, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (473, '593', 'Provision por depreciacion de valores negociables a corto plazo de empresas del grupo' , TRUE, 472, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (474, '594', 'Provision por depreciacion de valores negociables a corto plazo de empresas asociadas' , TRUE, 472, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (475, '595', 'Provision para insolvencias de creditos a corto plazo a empresas del grupo' , TRUE, 472, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (476, '596', 'Provision para insolvencias de creditos a corto plazo a empresas asociadas' , TRUE, 472, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (478, '598', 'Provision para insolvencias de creditos a corto plazo' , TRUE, 472, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (482, '602', 'Compras de otros aprovisionamientos' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (484, '608', 'Devoluciones de compras y operaciones similares' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (483, '607', 'Trabajos realizados por otras empresas' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (481, '601', 'Compras de materias primas' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (494, '611', 'Variacion de existencias de materias primas' , TRUE, 492, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (495, '612', 'Variacion de existencias de otros aprovisionamientos' , TRUE, 492, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (497, '620', 'Gastos en investigacion y desarrollo del ejercicio' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (500, '623', 'Servicios de profesionales independientes' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (502, '625', 'Primas de seguros' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (506, '629', 'Otros servicios' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (508, '630', 'Impuestos sobre beneficios' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (509, '631', 'Otros tributos' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (510, '633', 'Ajustes negativos en la imposicion sobre beneficios' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (511, '634', 'Ajustes negativos en la imposicion indirecta' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (514, '636', 'Devolucion de impuestos' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (515, '638', 'Ajustes positivos en la imposicion sobre beneficios' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (516, '639', 'Ajustes positivos en la imposicion indirecta' , TRUE, 507, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (521, '641', 'Indemnizaciones' , TRUE, 519, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (523, '643', 'Aportaciones a sistemas complementarios de pensiones' , TRUE, 519, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (524, '649', 'Otros gastos sociales' , TRUE, 519, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (527, '651', 'Resultados de operaciones en comun' , TRUE, 525, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (530, '659', 'Otras perdidas en gestion corriente' , TRUE, 525, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (532, '661', 'Intereses de obligaciones y bonos' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (541, '662', 'Intereses de deudas a largo plazo' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (546, '663', 'Intereses de deudas a corto plazo' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (551, '664', 'Intereses por descuento de efectos' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (555, '665', 'Descuento sobre ventas por pronto pago' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (559, '666', 'Perdidas procedentes de valores negociables' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (566, '667', 'Perdidas de creditos' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (573, '668', 'Diferencias negativas de cambio' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (574, '669', 'Otros gastos financieros' , TRUE, 531, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (581, '678', 'Gastos extraordinarios' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (576, '670', 'Perdidas procedentes del inmovilizado inmaterial' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (577, '671', 'Perdidas procedentes del inmovilizado material' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (578, '672', 'Perdidas procedentes de participaciones en capital a largo plazo en empresas del grupo' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (579, '673', 'Perdidas procedentes de participaciones en capital a largo plazo en empresas asociadas' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (580, '674', 'Perdidas por operaciones con acciones y obligaciones propias' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (582, '679', 'Gastos y perdidas de ejercicios anteriores' , TRUE, 575, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (584, '680', 'Amortizacion de gastos de establecimiento' , TRUE, 583, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (588, '690', 'Dotacion al fondo de reversion' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (589, '691', 'Dotacion a la provision del inmovilizado inmaterial' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (591, '692', 'Dotacion a la provision del inmovilizado material' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (593, '695', 'Dotacion a la provision para otras operaciones de trafico' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (594, '696', 'Dotacion a la provision para valores negociables a largo plazo' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (601, '697', 'Dotacion a la provision para insolvencias de creditos a largo plazo' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (609, '699', 'Dotacion a la provision para insolvencias de creditos a corto plazo' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (626, '709', 'Rappels sobre ventas' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (615, '701', 'Ventas de productos terminados' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (616, '702', 'Ventas de productos semiterminados' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (617, '703', 'Ventas de subproductos y residuos' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (618, '704', 'Ventas de embases y embalajes' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (633, '710', 'Variacion de existencias de productos en curso' , TRUE, 632, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (634, '711', 'Variacion de existencias de productos semiterminados' , TRUE, 632, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (635, '712', 'Variacion de existencias de productos terminados' , TRUE, 632, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (636, '713', 'Variacion de existencias de subproductos, residuos y materiales recuperados' , TRUE, 632, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (638, '730', 'Incorporacion al activo de gastos de establecimiento' , TRUE, 637, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (640, '732', 'Trabajos realizados para el inmovilizado material' , TRUE, 637, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (641, '733', 'Trabajos realizados para el inmovilizado material en curso' , TRUE, 637, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (642, '737', 'Incorporacion al activo de gastos de formalizacion de deudas' , TRUE, 637, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (639, '731', 'Trabajos realizados para el inmovilizado inmaterial' , TRUE, 637, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (644, '740', 'Subvenciones oficiales a la explotacion' , TRUE, 643, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (645, '741', 'Otras subvenciones a la explotacion' , TRUE, 643, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (647, '751', 'Resultados de operaciones en comun' , TRUE, 646, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (650, '752', 'Ingresos por arrendamientos' , TRUE, 646, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (651, '753', 'Ingresos de propiedad industrial cedida en explotacion' , TRUE, 646, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (652, '754', 'Ingresos por comisiones' , TRUE, 646, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (653, '755', 'Ingresos por servicios al personal' , TRUE, 646, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (654, '759', 'Ingresos por servicios diversos' , TRUE, 646, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (656, '760', 'Ingresos de participaciones en capital' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (660, '761', 'Ingresos de valores de renta fija' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (668, '763', 'Ingresos de creditos a corto plazo' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (664, '762', 'Ingresos de creditos a largo plazo' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (672, '765', 'Descuentos sobre compras por pronto pago' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (684, '769', 'Otros ingresos financieros' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (683, '768', 'Diferencias positivas de cambio' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (686, '770', 'Beneficios procedentes de inmovilizado inmaterial' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (689, '773', 'Beneficios procedentes de participaciones en capital a largo plazo en empresas asociadas' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (690, '774', 'Beneficios por operaciones con acciones y obligaciones propias' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (691, '775', 'Subvenciones de capital traspasadas al resultado del ejercicio ' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (692, '778', 'Ingresos extraordinarios' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (693, '779', 'Ingresos y beneficios de ejercicios anteriores' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (688, '772', 'Beneficios procedentes de participaciones en capital a largo plazo en empresas del grupo' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (696, '791', 'Exceso de provisi� del inmovilizado inmaterial' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (697, '792', 'Exceso de provisi� del inmovilizado material' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (695, '790', 'Exceso de provision para riesgos y gastos' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (701, '795', 'Provision para otras operaciones de trafico aplicada' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (702, '796', 'Exceso de provision para valores negociables a largo plazo' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (708, '797', 'Exceso de provision para insolvencias de creditos a largo plazo' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (712, '798', 'Exceso de provision para valores negociables a corto plazo ' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (716, '799', 'Exceso de provision para insolvencias de creditos a corto plazo' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (328, '431', 'Clientes, efectos comerciales a pagar' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (251, '292', 'Provision por depreciacion del inmovilizado material' , TRUE, 249, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (175, '212', 'Propiedad industrial' , TRUE, 170, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (182, '220', 'Terrenos y bienes naturales' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (183, '221', 'Construcciones' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (98, '112', 'Reserva legal' , TRUE, 95, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (340, '435', 'Clientes de dudoso cobro' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (380, '490', 'Provision para insolvencias de trafico' , TRUE, 379, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (373, '476', 'Organismos de la Seguridad Social, acreedores' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (377, '480', 'Gastos anticipados' , TRUE, 376, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (463, '570', 'Caja' , TRUE, 462, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (185, '223', 'Maquinaria' , TRUE, 181, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (432, '540', 'Inversiones financieras temporales en capital' , TRUE, 431, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (303, '401', 'Proveedores, efectos comerciales a pagar' , TRUE, 299, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (262, '300', 'Mercaderias A' , TRUE, 261, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (239, '282', 'Amortizacion acumulada del inmovilizado material' , TRUE, 230, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (231, '281', 'Amortizacion acumulada del inmovilizado inmaterial' , TRUE, 230, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (477, '597', 'Provision por depreciacion de valores negociables a corto plazo' , TRUE, 472, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (292, '390', 'Provision por depreciacion de mercaderias' , TRUE, 291, TRUE, 3, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (374, '477', 'Hacienda Publica, IVA repercutido' , TRUE, 357, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (687, '771', 'Beneficios procedentes de inmovilizado material' , TRUE, 685, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (498, '621', 'Arrendamiento y canones' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (620, '708', 'Devoluciones de ventas y operaciones similares' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (522, '642', 'Seguridad Social a cargo de la empresa' , TRUE, 519, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (590, '693', 'Dotacion a la provision de existencias' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (499, '622', 'Reparaciones y conservaciones' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (520, '640', 'Sueldos' , TRUE, 519, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (586, '682', 'Amortizacion del inmovilizado material' , TRUE, 583, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (111, '129', 'Perdidas y ganancias' , TRUE, 106, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (592, '694', 'Dotacion a la provision para insolvencias de trafico' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (698, '793', 'Provision de existencias aplicada' , TRUE, 694, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (501, '624', 'Transportes' , TRUE, 496, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (526, '650', 'Perdidas de creditos comerciales incobrables' , TRUE, 525, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (585, '681', 'Amortizacion del inmovilizado inmaterial' , TRUE, 583, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (605, '698', 'Dotacion a la provision para valores negociables a corto plazo' , TRUE, 587, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (488, '609', 'Rappels por compras' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (676, '766', 'Beneficios en valores negociables' , TRUE, 655, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (493, '610', 'Variacion de existencias de mercaderias' , TRUE, 492, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (324, '430', 'Clientes' , TRUE, 323, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (466, '573', 'Bancos e instituciones de credito c/c vista, moneda extranjera' , TRUE, 462, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (300, '400', 'Proveedores' , TRUE, 299, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (315, '410', 'Acreedores por prestaciones de servicios' , TRUE, 314, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (619, '705', 'Prestaciones de servicios' , TRUE, 613, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (724, '100', 'Capital Social' , TRUE, 88, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 3); + + + + + + +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (128, '1500', 'Obligaciones y bonos simples' , TRUE, 127, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (129, '1501', 'Obligaciones y bonos garantizados' , TRUE, 127, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (130, '1502', 'Obligaciones y bonos subordinados' , TRUE, 127, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (131, '1503', 'Obligaciones y bonos cupon cero' , TRUE, 127, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (132, '1504', 'Obligaciones y bonos con opcion de adquisicion de acciones' , TRUE, 127, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (133, '1505', 'Obligaciones y bonos con participacion de beneficios' , TRUE, 127, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (302, '4004', 'Proveedores (moneda extranjera)' , TRUE, 300, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (318, '4100', 'Acreedores por prestaciones de servicios' , TRUE, 315, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (766, '4300', 'Clientes' , TRUE, 324, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (212, '2500', 'Inversiones financieras permanentes en acciones con cotizacion en un mercado secundario ' , TRUE, 211, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (213, '2501', 'Inversiones financieras permanentes en acciones sin cotizacion en un mercado secundario ' , TRUE, 211, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (214, '2502', 'Otras inversiones financieras en capital' , TRUE, 211, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (301, '4000', 'Proveedores' , TRUE, 300, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (115, '1300', 'Subvenciones del Estado' , TRUE, 114, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (116, '1301', 'Subvenciones de Otras Administraciones Publicas' , TRUE, 114, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (370, '4751', 'Hacienda Publica, acreedor por retenciones practicadas' , TRUE, 368, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (703, '7960', 'Exceso de provision para participaciones en capital a largo plazo en empresas del grupo' , TRUE, 702, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (704, '7961', 'Exceso de provision para participaciones en capital a largo plazo en empresas asociadas' , TRUE, 702, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (705, '7963', 'Exceso de provision para valores negociables a largo plazo en otras empresas' , TRUE, 702, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (706, '7965', 'Exceso de provision para valores de renta fija a largo plazo de empresas del grupo' , TRUE, 702, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (707, '7966', 'Exceso de provision para valores de renta fija a largo plazo de empresas asociadas' , TRUE, 702, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (709, '7970', 'Exceso de provision para insolvencias de creditos a largo plazo de empresas del grupo ' , TRUE, 708, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (710, '7971', 'Exceso de provision para insolvencias de creditos a largo plazo de empresas asociadas' , TRUE, 708, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (711, '7973', 'Exceso de provision para insolvencias de creditos a largo plazo de otras empresas' , TRUE, 708, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (713, '7980', 'Exceso de provision para valores negociables a corto plazo de empresas del grupo ' , TRUE, 712, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (714, '7981', 'Exceso de provision para valores negociables a corto plazo de empresas asociadas' , TRUE, 712, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (715, '7983', 'Exceso de provision para valores negociables a corto plazo de otras empresas' , TRUE, 712, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (717, '7990', 'Exceso de provision para insolvencias de creditos a corto plazo de empresas del grupo' , TRUE, 716, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (718, '7991', 'Exceso de provision para insolvencias de creditos a corto plazo de empresas asociadas' , TRUE, 716, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (719, '7993', 'Exceso de provision para insolvencias de creditos a corto plazo de otras empresas' , TRUE, 716, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (138, '1600', 'Prestamos a largo plazo de empresas del grupo' , TRUE, 137, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (139, '1609', 'Otras deudas a largo plazo con empresas del grupo' , TRUE, 137, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (658, '7601', 'Ingresos de participaciones en capital de empresas asociadas' , TRUE, 656, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (657, '7600', 'Ingresos de participaciones en capital de empresas del grupo' , TRUE, 656, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (659, '7603', 'Ingresos de participaciones en capital de otras empresas' , TRUE, 656, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (661, '7610', 'Ingresos de creditos de renta fija de empresas del grupo' , TRUE, 660, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (662, '7611', 'Ingresos de creditos de renta fija de empresas asociadas' , TRUE, 660, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (663, '7613', 'Ingresos de creditos de renta fija de otras empresas' , TRUE, 660, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (665, '7621', 'Ingresos de creditos a largo plazo a empresas asociadas' , TRUE, 664, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (666, '7620', 'Ingresos de creditos a largo plazo a empresas del grupo' , TRUE, 664, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (667, '7623', 'Ingresos de creditos a largo plazo a otras empresas' , TRUE, 664, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (669, '7631', 'Ingresos de creditos a corto plazo a empresas asociadas' , TRUE, 668, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (670, '7630', 'Ingresos de creditos a corto plazo a empresas del grupo' , TRUE, 668, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (671, '7633', 'Ingresos de creditos a corto plazo a otras empresas' , TRUE, 668, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (673, '7650', 'Descuentos sobre compras por pronto pago de empresas del grupo' , TRUE, 672, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (674, '7651', 'Descuentos sobre compras por pronto pago de empresas asociadas' , TRUE, 672, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (675, '7653', 'Descuentos sobre compras por pronto pago de otras empresas' , TRUE, 672, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (677, '7660', 'Beneficios en valores negociables a largo plazo de empresas del grupo' , TRUE, 676, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (678, '7661', 'Beneficios en valores negociables a largo plazo de empresas asociadas' , TRUE, 676, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (679, '7663', 'Beneficios en valores negociables a largo plazo de otras empresas' , TRUE, 676, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (680, '7665', 'Beneficios en valores negociables a corto plazo de empresas del grupo' , TRUE, 676, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (681, '7666', 'Beneficios en valores negociables a corto plazo de empresas asociadas' , TRUE, 676, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (682, '7668', 'Beneficios en valores negociables a corto plazo de otras empresas' , TRUE, 676, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (621, '7080', 'Devoluciones de ventas de mercaderias' , TRUE, 620, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (622, '7081', 'Devoluciones de ventas de productos terminados' , TRUE, 620, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (623, '7082', 'Devoluciones de ventas de productos semiterminados' , TRUE, 620, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (624, '7083', 'Devoluciones de ventas de subproductos y residuos' , TRUE, 620, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (625, '7084', 'Devoluciones de ventas de envases y embalajes' , TRUE, 620, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (627, '7090', 'Rappels sobre ventas de mercaderia' , TRUE, 626, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (628, '7091', 'Rappels sobre ventas de productos terminados' , TRUE, 626, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (629, '7092', 'Rappels sobre ventas de productos semiterminados' , TRUE, 626, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (630, '7093', 'Rappels sobre ventas de subproductos y residuos' , TRUE, 626, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (631, '7094', 'Rappels sobre ventas de envases y embalajes' , TRUE, 626, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (648, '7510', 'Perdida transferida (gestor)' , TRUE, 647, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (649, '7511', 'Beneficio atribuido (participe o asociado no gestor)' , TRUE, 647, TRUE, 7, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (534, '6610', 'Intereses de obligaciones y bonos a largo plazo en empresas del grupo' , TRUE, 532, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (535, '6611', 'Intereses de obligaciones y bonos a largo plazo en empresas asociadas' , TRUE, 532, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (536, '6613', 'Intereses de obligaciones y bonos a largo plazo en otras empresas' , TRUE, 532, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (537, '6615', 'Intereses de obligaciones y bonos a corto plazo en empresas del grupo' , TRUE, 532, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (539, '6616', 'Intereses de obligaciones y bonos a corto plazo en empresas asociadas' , TRUE, 532, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (540, '6618', 'Intereses de obligaciones y bonos a corto plazo en otras empresas' , TRUE, 532, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (542, '6620', 'Intereses de deudas a largo plazo con empresas del grupo' , TRUE, 541, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (543, '6621', 'Intereses de deudas a largo plazo con empresas asociadas' , TRUE, 541, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (544, '6622', 'Intereses de deudas a largo plazo con entidades de credito' , TRUE, 541, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (545, '6623', 'Intereses de deudas a largo plazo con otras empresas' , TRUE, 541, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (547, '6630', 'Intereses de deudas a corto plazo con empresas del grupo' , TRUE, 546, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (548, '6631', 'Intereses de deudas a corto plazo con empresas asociadas' , TRUE, 546, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (549, '6632', 'Intereses de deudas a corto plazo con entidades de credito' , TRUE, 546, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (550, '6633', 'Intereses de deudas a corto plazo con otras empresas' , TRUE, 546, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (552, '6640', 'Intereses por descuento de efectos en entidades de credito del grupo' , TRUE, 551, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (553, '6641', 'Intereses por descuento de efectos en entidades de credito asociadas' , TRUE, 551, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (554, '6643', 'Intereses por descuento de efectos en otras entidades de credito' , TRUE, 551, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (556, '6650', 'Descuento sobre ventas por pronto pago a empresas del grupo' , TRUE, 555, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (557, '6651', 'Descuento sobre ventas por pronto pago a empresas asociadas' , TRUE, 555, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (558, '6653', 'Descuento sobre ventas por pronto pago a otras empresas' , TRUE, 555, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (560, '6660', 'Perdidas en valores negociables a largo plazo de empresas del grupo' , TRUE, 559, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (561, '6661', 'Perdidas en valores negociables a largo plazo de empresas asociadas' , TRUE, 559, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (562, '6663', 'Perdidas en valores negociables a largo plazo de otras empresas' , TRUE, 559, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (563, '6665', 'Perdidas en valores negociables a corto plazo de empresas del grupo' , TRUE, 559, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (564, '6666', 'Perdidas en valores negociables a corto plazo de empresas asociadas' , TRUE, 559, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (565, '6668', 'Perdidas en valores negociables a corto plazo de otras empresas' , TRUE, 559, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (567, '6670', 'Perdidas de creditos a largo plazo a empresas del grupo' , TRUE, 566, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (568, '6671', 'Perdidas de creditos a largo plazo a empresas asociadas' , TRUE, 566, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (569, '6673', 'Perdidas de creditos a largo plazo a otras empresas' , TRUE, 566, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (570, '6675', 'Perdidas de creditos a corto plazo a empresas del grupo' , TRUE, 566, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (571, '6676', 'Perdidas de creditos a corto plazo a empresas asociadas' , TRUE, 566, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (572, '6678', 'Perdidas de creditos a corto plazo a otras empresas' , TRUE, 566, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (147, '1700', 'Prestamos a largo plazo de entidades de credito' , TRUE, 146, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (148, '1709', 'Otras deudas a largo plazo con entidades de credito' , TRUE, 146, TRUE, 1, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (232, '2810', 'Amortizacion acumulada de gastos de investigacion y desarrollo' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (233, '2811', 'Amortizacion acumulada de concesiones administrativas' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (234, '2812', 'Amortizacion acumulada de propiedad industrial' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (235, '2813', 'Amortizacion acumulada de fondo de comercio' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (236, '2814', 'Amortizacion acumulada de derechos de traspaso' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (237, '2815', 'Amortizacion acumulada de aplicaciones informaticas' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (238, '2817', 'Amortizacion acumulada de derechos sobre bienes en regimen de arrendamiento financiero' , TRUE, 231, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (240, '2821', 'Amortizacion acumulada de construcciones' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (241, '2822', 'Amortizacion acumulada de instalaciones tecnicas' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (242, '2823', 'Amortizacion acumulada de maquinaria' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (243, '2824', 'Amortizacion acumulada de utillaje' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (244, '2825', 'Amortizacion acumulada de otras instalaciones' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (245, '2826', 'Amortizacion acumulada de mobiliario' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (246, '2827', 'Amortizacion acumulada de equipos para proceso de informacion' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (247, '2828', 'Amortizacion acumulada de elementos de transporte' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (248, '2829', 'Amortizacion acumulada de otro inmovilizado material' , TRUE, 239, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (595, '6960', 'Dotacion a la provision para participaciones en capital a largo plazo en empresas del grupo' , TRUE, 594, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (596, '6961', 'Dotacion a la provision para participaciones en capital a largo plazo en empresas asociadas' , TRUE, 594, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (598, '6963', 'Dotacion a la provision para valores negociables a largo plazo en otras empresas' , TRUE, 594, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (599, '6965', 'Dotacion a la provision para valores de renta fija a largo plazo en empresas del grupo' , TRUE, 594, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (600, '6966', 'Dotacion a la provision para valores de renta fija a largo plazo en empresas asociadas' , TRUE, 594, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (602, '6970', 'Dotacion a la provision para insolvencias de creditos a largo plazo a empresas del grupo' , TRUE, 601, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (603, '6971', 'Dotacion a la provision para insolvencias de creditos a largo plazo a empresas asociadas' , TRUE, 601, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (604, '6973', 'Dotacion a la provision para insolvencias de creditos a largo plazo a otras empresas' , TRUE, 601, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (606, '6980', 'Dotacion a la provision para valores negociables a corto plazo de empresas del grupo' , TRUE, 605, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (607, '6981', 'Dotacion a la provision para valores negociables a corto plazo de empresas asociadas' , TRUE, 605, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (608, '6983', 'Dotacion a la provision para valores negociables a corto plazo de otras empresas' , TRUE, 605, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (610, '6990', 'Dotacion a la provision para insolvencias de creditos a corto plazo a empresas del grupo' , TRUE, 609, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (611, '6991', 'Dotacion a la provision para insolvencias de creditos a corto plazo a empresas asociadas' , TRUE, 609, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (612, '6993', 'Dotacion a la provision para insolvencias de creditos a corto plazo a otras empresas' , TRUE, 609, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (528, '6510', 'Beneficio transferido (Gestor)' , TRUE, 527, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (529, '6511', 'Perdida soportada (participe o asociado no gestor)' , TRUE, 527, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (172, '2100', 'Gastos de investigacion y desarrollo en proyectos no terminados' , TRUE, 171, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (173, '2101', 'Gastos de investigacion y desarrollo en proyectos terminados' , TRUE, 171, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (487, '6082', 'Devoluciones de compras de otros aprovisionamientos' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (489, '6090', 'Rappels por compras de mercaderias' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (490, '6091', 'Rappels por compras de materias primas' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (491, '6092', 'Rappels por compras de otros aprovisionamientos' , TRUE, 479, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (410, '5201', 'Deudas a corto plazo por credito dispuesto' , TRUE, 408, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (409, '5201', 'Prestamos a corto plazo de entidades de credito' , TRUE, 408, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (411, '5208', 'Deudas por efectos descontados' , TRUE, 408, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (253, '2935', 'Provision por depreciacion de valores negociables a largo plazo en empresas del grupo' , TRUE, 252, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (255, '2941', 'Provision por depreciacion de participaciones en capital a largo plazo en empresas asociadas' , TRUE, 254, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (256, '2946', 'Provision por depreciacion de valores negociables a largo plazo en empresas asociadas' , TRUE, 254, TRUE, 2, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (512, '6341', 'Ajustes negativos en IVA de circulante' , TRUE, 511, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (513, '6342', 'Ajustes negativos en IVA de inversiones' , TRUE, 511, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (517, '6391', 'Ajustes positivos en IVA de circulante' , TRUE, 516, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (518, '6392', 'Ajustes positivos en IVA de inversiones' , TRUE, 516, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (485, '6080', 'Devoluciones de compras de mercaderias' , TRUE, 484, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (486, '6081', 'Devoluciones de compras de materias primas' , TRUE, 484, TRUE, 6, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (452, '5560', 'Desembolsos exigidos sobre acciones de empresas del grupo' , TRUE, 451, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (453, '5561', 'Desembolsos exigidos sobre acciones de empresas asociadas' , TRUE, 451, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (454, '5562', 'Desembolsos exigidos sobre acciones de otras empresas' , TRUE, 451, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (426, '5360', 'Intereses a corto plazo de valores de renta fija de empresas del grupo' , TRUE, 425, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (427, '5361', 'Intereses a corto plazo de creditos a empresas del grupo' , TRUE, 425, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (305, '4009', 'Proveedores, facturas pendientes de recibir o de formalizar' , TRUE, 300, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (306, '4020', 'Proveedores, empresas del grupo' , TRUE, 304, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (307, '4021', 'Efectos comerciales a pagar, empresas del grupo' , TRUE, 304, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (308, '4024', 'Proveedores, empresas del grupo (moneda extranjera)' , TRUE, 304, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (309, '4026', 'Envases y embalajes a devolver a proveedores, empresas del grupo' , TRUE, 304, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (310, '4029', 'Proveedores, empresas del grupo, facturas pendientes de recibir o de formalizar' , TRUE, 304, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (345, '4400', 'Deudores' , TRUE, 344, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (346, '4404', 'Deudores (moneda extranjera)' , TRUE, 344, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (347, '4409', 'Deudores, facturas pendientes de formalizar' , TRUE, 344, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (349, '4410', 'Deudores, efectos comerciales en cartera' , TRUE, 348, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (350, '4412', 'Deudores, efectos comerciales en gestion de cobro' , TRUE, 348, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (351, '4415', 'Deudores, efectos comerciales impagados' , TRUE, 348, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (433, '5400', 'Inversiones financieras temporales en acciones con cotizacion en un mercado secundario' , TRUE, 432, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (434, '5401', 'Inversiones financieras temporales en acciones sin cotizacion en un mercado secundario' , TRUE, 432, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (435, '5409', 'Otras inversiones financieras temporales en capital' , TRUE, 432, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (395, '5100', 'Prestamos a corto plazo de empresas del grupo' , TRUE, 394, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (396, '5109', 'Otras deudas a corto plazo con empresas del grupo' , TRUE, 394, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (400, '5128', 'Deudas por efectos descontados en entidades de credito del grupo' , TRUE, 398, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (401, '5129', 'Otras deudas a corto plazo con entidades de credito del grupo' , TRUE, 398, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (399, '5120', 'Prestamos a corto plazo de entidades de credito del grupo' , TRUE, 398, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (390, '5090', 'Obligaciones y bonos amortizados' , TRUE, 389, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (391, '5091', 'Obligaciones y bonos convertibles amortizados' , TRUE, 389, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (392, '5095', 'Otros valores negociables amortizados' , TRUE, 389, TRUE, 5, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (319, '4104', 'Acreedores por prestaciones de servicios (moneda extranjera)' , TRUE, 315, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (320, '4109', 'Acreedores por prestaciones de servicios, facturas pendientes de recibir o de formalizar' , TRUE, 315, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (359, '4700', 'Hacienda Publica, deudor por IVA' , TRUE, 358, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (360, '4708', 'Hacienda Publica, deudor por subvenciones conseguidas' , TRUE, 358, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (361, '4709', 'Hacienda Publica, deudor por devolucion de impuestos' , TRUE, 358, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (366, '4740', 'Impuesto sobre beneficios anticipado' , TRUE, 365, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (367, '4746', 'Credito por perdidas a compensar del ejercicio' , TRUE, 365, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (371, '4752', 'Hacienda Publica, acreedor por impuestos sobre sociedades' , TRUE, 368, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (372, '4758', 'Hacienda Publica, acreedor por subvenciones a reintegrar' , TRUE, 368, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (326, '4304', 'Clientes (Moneda extranjera)' , TRUE, 324, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (327, '4309', 'Clientes, facturas pendientes de formalizar' , TRUE, 324, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (329, '4310', 'Efectos comerciales en cartera' , TRUE, 328, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (330, '4311', 'Efectos comerciales descontados' , TRUE, 328, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (331, '4312', 'Efectos comerciales en gestion de cobro' , TRUE, 328, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (332, '4315', 'Efectos comerciales impagados' , TRUE, 328, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (334, '4320', 'Clientes, empresas del grupo' , TRUE, 333, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (335, '4321', 'Efectos comerciales a cobrar, empresas del grupo' , TRUE, 333, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (336, '4324', 'Clientes, empresas del grupo (moneda extranjera)' , TRUE, 333, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (337, '4326', 'Envases y embalajes a devolver a clientes, empresas del grupo' , TRUE, 333, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (338, '4329', 'Clientes, empresas del grupo, facturas' , TRUE, 333, TRUE, 4, '', 0, 0, TRUE, TRUE, TRUE, NULL, '', '', '', '', '', '', '', '', 1); + + + + +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (743, '4720004', 'IVA SOPORTADO 4% COMPRAS' , FALSE, 363, FALSE, 4, '', 0, 0, FALSE, FALSE, FALSE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (748, '4770016', 'IVA 16% VENTAS' , FALSE, 374, FALSE, 4, '', 0, 0, FALSE, FALSE, FALSE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (740, '4720016', 'IVA SOPORTADO 16% COMPRAS' , FALSE, 363, FALSE, 4, '', 0, 0, FALSE, FALSE, FALSE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (774, '4720007', 'IVA SOPORTADO 7% COMPRAS' , FALSE, 363, FALSE, 4, '', 0, 0, FALSE, FALSE, FALSE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (800, '4770007', 'IVA 7% VENTAS' , FALSE, 374, FALSE, 4, '', 0, 0, FALSE, FALSE, FALSE, NULL, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (801, '4770004', 'IVA 4% VENTAS' , FALSE, 374, FALSE, 4, '', 0, 0, FALSE, FALSE, FALSE, NULL, '', '', '', '', '', '', '', '', 1); + + + +-- Como hay un trigger recursivo y hay cuentas de nivel 4 que se actualizan despues que las de nivel 1 hay que hacer el update +-- tantas veces como niveles de cuentas tenemos. +-- El scripting de base de datos funciona muy bien. +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; +-- UPDATE CUENTA SET debe=0, haber=0; + +-- +-- TOC entry 2 (OID 3697052) +-- Name: cuenta_idcuenta_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('cuenta_idcuenta_seq', 10000, false); + + +-- t_fpago_data.sql ################################################################ + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3347651) +-- Name: fpago; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO fpago (idfpago, nomfpago, nplazosfpago, plazoprimerpagofpago, tipoplazoprimerpagofpago, plazoentrerecibofpago, tipoplazoentrerecibofpago) VALUES (1, '1 pago - 30 dias', 1, 30, NULL, 0, NULL); +INSERT INTO fpago (idfpago, nomfpago, nplazosfpago, plazoprimerpagofpago, tipoplazoprimerpagofpago, plazoentrerecibofpago, tipoplazoentrerecibofpago) VALUES (2, '2 pagos - 30 y 60 dias', 2, 30, NULL, 20, NULL); +INSERT INTO fpago (idfpago, nomfpago, nplazosfpago, plazoprimerpagofpago, tipoplazoprimerpagofpago, plazoentrerecibofpago, tipoplazoentrerecibofpago) VALUES (3, '3 pagos - 30 , 60 y 90 dias', 3, 30, NULL, 30, NULL); + + +-- +-- TOC entry 2 (OID 3347649) +-- Name: fpago_idfpago_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('fpago_idfpago_seq', 3, true); + + +-- t_tipoiva_data.sql ############################################################################ + + +INSERT INTO tipoiva (nombretipoiva, porcentajetipoiva, idcuenta) VALUES ('Soportado 16%', 16, id_cuenta('4720016')); +INSERT INTO tipoiva (nombretipoiva, porcentajetipoiva, idcuenta) VALUES ('Soportado 7%', 7, id_cuenta('4720007')); +INSERT INTO tipoiva (nombretipoiva, porcentajetipoiva, idcuenta) VALUES ('Soportado 4%', 4, id_cuenta('4720004')); +INSERT INTO tipoiva (nombretipoiva, porcentajetipoiva, idcuenta) VALUES ('Repercutido 16%', 16, id_cuenta('4770016')); +INSERT INTO tipoiva (nombretipoiva, porcentajetipoiva, idcuenta) VALUES ('Repercutido 7%', 7, id_cuenta('4770007')); +INSERT INTO tipoiva (nombretipoiva, porcentajetipoiva, idcuenta) VALUES ('Repercutido 4%', 4, id_cuenta('4770004')); + + +-- t_ejercicios_data.sql ######################################################################### + + +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 0, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 1, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 2, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 3, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 4, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 5, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 6, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 7, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 8, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 9, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 10, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 11, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2005, 12, FALSE); + +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 0, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 1, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 2, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 3, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 4, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 5, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 6, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 7, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 8, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 9, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 10, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 11, FALSE); +INSERT into ejercicios (ejercicio, periodo, bloqueado) VALUES (2004, 12, FALSE); + + + +-- t_cuenta_data1.sql #################################################################### + + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + + + + +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (762, '4000002', 'Maquinaria Industrial S.A.' , true, 301, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (614, '7000000', 'Ventas de mercaderias' , true, 613, FALSE, 7, NULL, 0, 0, FALSE, FALSE, FALSE, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (767, '4300001', 'Carniceria Sibuna' , true, 766, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (755, '1000034', 'una cuenta rara' , true, 88, FALSE, 1, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (770, '1000000', 'Capitan Socializado' , true, 724, FALSE, 1, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 3); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (775, '1000001', 'asdfasdf' , true, 724, FALSE, 1, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 3); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (776, '1000002', 'asdfasdfasd' , true, 724, FALSE, 1, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 3); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (107, '1200000', 'Remanente' , true, 106, FALSE, 1, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (771, '7940000', 'Provision para insolvencias de trafico aplicada.' , true, 699, FALSE, 7, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (772, '4000004', 'Adelaida' , true, 301, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (773, '4000005', 'Hotel restaurant els NOGUERS' , true, 301, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (768, '4300002', 'SYP - Consum' , true, 766, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '9225665f', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (764, '4000003', 'Imprenta Sa Taulera' , true, 301, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (756, '5730001', 'SA NOSTRA' , true, 466, FALSE, 5, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 4); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (747, '4100002', 'YACOM INTERNET FACTORY' , true, 318, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (503, '6260000', 'Servicios bancarios y similares' , true, 496, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (504, '6270000', 'Publicidad, propaganda y relaciones publicas' , true, 496, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (480, '6000000', 'Compras de mercaderias' , true, 479, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (369, '4750000', 'Hacienda Publica, acreedor por IVA' , true, 368, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (746, '6280004', 'SUMINISTRO ADSL' , true, 505, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (761, '4000001', 'Ganaderias Alfredo' , true, 301, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 2); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (769, '4300003', 'Restaurante Neirol' , true, 766, FALSE, 4, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (752, '6280005', 'Telefonica tef' , true, 505, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (726, '2250002', 'INMOVILIZADO CASA' , true, 187, FALSE, 2, NULL, 0, 0, FALSE, FALSE, FALSE, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (727, '2270001', 'INMOVILIZADO COMPONENTES ORDENADOR' , true, 189, FALSE, 2, NULL, 0, 0, FALSE, FALSE, FALSE, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (745, '6292001', 'SERVICIOS DE ASESORIA' , true, 506, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 5); +INSERT INTO cuenta (idcuenta, codigo, descripcion, imputacion, padre, bloqueada, idgrupo, msg, debe, haber, nodebe, nohaber, regularizacion, activo, nombreent_cuenta, cifent_cuenta, dirent_cuenta, telent_cuenta, coment_cuenta, bancoent_cuenta, emailent_cuenta, webent_cuenta, tipocuenta) VALUES (742, '6296000', 'MATERIAL DE OFICINA' , true, 506, FALSE, 6, NULL, 0, 0, FALSE, FALSE, FALSE, true, '', '', '', '', '', '', '', '', 5); + + +-- Como hay un trigger recursivo y hay cuentas de nivel 4 que se actualizan despues que las de nivel 1 hay que hacer el update +-- tantas veces como niveles de cuentas tenemos. +-- El scripting de base de datos funciona muy bien. +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; +UPDATE CUENTA SET debe=0, haber=0; + + +SELECT pg_catalog.setval('cuenta_idcuenta_seq', 10000, false); + + +-- t_canal_data.sql ####################################################################### + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3768319) +-- Name: canal; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO canal (idcanal, descripcion, nombre) VALUES (1, 'Tipo A', 'Canal A'); +INSERT INTO canal (idcanal, descripcion, nombre) VALUES (4, 'Tipo B', 'Canal B'); + + +-- +-- TOC entry 2 (OID 3768317) +-- Name: canal_idcanal_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('canal_idcanal_seq', 100, false); + + +-- t_c_coste_data.sql ##################################################################### + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3768326) +-- Name: c_coste; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO c_coste (idc_coste, descripcion, nombre, codigo, padre, imputacion, debe, haber) VALUES (10, 'Conetxia.', 'Son Oliva', NULL, NULL, NULL, NULL, NULL); + +-- +-- TOC entry 2 (OID 3768324) +-- Name: c_coste_idc_coste_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('c_coste_idc_coste_seq', 100, false); + + +-- t_diario_data.sql ################################################################### + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 2 (OID 1345982) +-- Name: diario; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY diario (iddiario, descripcion) FROM stdin; +\. + + +-- t_asiento_data.sql ################################################################ + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3839794) +-- Name: asiento; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO asiento (idasiento, descripcion, fecha, comentariosasiento, ordenasiento, clase) VALUES (1, '20/01/2005', '2005-01-20 00:00:00+01', NULL, 1, 1); + + +-- +-- TOC entry 2 (OID 3839792) +-- Name: asiento_idasiento_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('asiento_idasiento_seq', 100, false); + +-- t_borrador_data.sql ############################################################## + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3839850) +-- Name: borrador; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO borrador ( codigoborrador, idasiento, iddiario, fecha, conceptocontable, idcuenta, descripcion, debe, haber, contrapartida, comentario, idcanal, marcaconciliacion, idc_coste, idapunte, idtipoiva, orden) VALUES ( NULL, 1, NULL, '2005-01-20 00:00:00+01', 'un concepto', id_cuenta('4720016'), NULL, 16, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2); +INSERT INTO borrador ( codigoborrador, idasiento, iddiario, fecha, conceptocontable, idcuenta, descripcion, debe, haber, contrapartida, comentario, idcanal, marcaconciliacion, idc_coste, idapunte, idtipoiva, orden) VALUES ( NULL, 1, NULL, '2005-01-20 00:00:00+01', 'un concepto', id_cuenta('4300001'), NULL, 0, 116, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); +INSERT INTO borrador ( codigoborrador, idasiento, iddiario, fecha, conceptocontable, idcuenta, descripcion, debe, haber, contrapartida, comentario, idcanal, marcaconciliacion, idc_coste, idapunte, idtipoiva, orden) VALUES ( NULL, 1, NULL, '2005-01-20 00:00:00+01', 'un concepto', id_cuenta('7000000'), NULL, 100, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); + +SELECT cierraasiento(1); + +-- +-- TOC entry 2 (OID 3839848) +-- Name: borrador_idborrador_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('borrador_idborrador_seq', 3, true); + + +-- t_registroiva_data.sql ######################################################## + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 3347658) +-- Name: registroiva; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +-- +-- TOC entry 2 (OID 3347656) +-- Name: registroiva_idregistroiva_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('registroiva_idregistroiva_seq', 1, true); + + +-- t_amortizacion_data.sql ############################################################# + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 1346100) +-- Name: amortizacion; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY amortizacion (idamortizacion, idcuentaactivo, idcuentaamortizacion, descamortizacion, nomamortizacion, fechacompra, fecha1cuota, valorcompra, periodicidad, numcuotas, metodo, nifproveedor, nomproveedor, dirproveedor, telproveedor, agrupacion) FROM stdin; +4 770 770 \N coche 2004-01-01 2004-01-01 120000 \N 5 \N \N \N \N \N vehiculos +2 770 770 \N motocicleta 2004-01-01 2004-12-31 6700 \N 5 \N \N \N \N \N la amoto +5 483 586 \N Edificio Sa Riera 2005-09-10 2005-09-10 100 \N 10 \N \N \N \N \N \N +\. + + +-- +-- TOC entry 2 (OID 1346098) +-- Name: amortizacion_idamortizacion_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('amortizacion_idamortizacion_seq', 5, true); + + +-- t_linamortizacion_data.sql #################################################################### + + +-- +-- PostgreSQL database dump +-- + +SET client_encoding = 'UNICODE'; +SET check_function_bodies = false; + +SET search_path = public, pg_catalog; + +-- +-- Data for TOC entry 3 (OID 1346108) +-- Name: linamortizacion; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +-- +-- TOC entry 2 (OID 1346106) +-- Name: linamortizacion_idlinamortizacion_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('linamortizacion_idlinamortizacion_seq', 100, true); + + --- bulmages-0.9.1.orig/debian/database/bulmafact/install-dbadmin/pgsql +++ bulmages-0.9.1/debian/database/bulmafact/install-dbadmin/pgsql @@ -0,0 +1,14 @@ +SET client_encoding = 'SQL_ASCII'; +SET check_function_bodies = false; + +SET SESSION AUTHORIZATION 'postgres'; +SET search_path = public, pg_catalog; + +SET DATESTYLE TO European; + +CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler + AS '$libdir/plpgsql', 'plpgsql_call_handler' + LANGUAGE c; + +CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; + --- bulmages-0.9.1.orig/debian/database/bulmafact/pgsql +++ bulmages-0.9.1/debian/database/bulmafact/pgsql @@ -0,0 +1,2025 @@ +-- Todos los queries necesarios para crear las bases de datos iniciales de bulmafact +-- por separado en un solo script, cada uno con nombre y senyal en --######### + +SET DATESTYLE TO European; + +--Comentado en otra parte para ponerlo aqui arriba por si lo podemos quitar y dejarlo en el psql del admin + + +-- ahora lo de bulmafact ************************************************************************** + +-- bulmafact_schema.sql +-- ---------------------------------------------------------------------------------------- +-- (C) Joan Miquel Torrer Rigo & Tomeu Borras Riera & Mateu Borras Marco, Agosto 2004 +-- joanmi@bulma.net, tborras@conetxia.com mborras@conetxia.com +-- Este documento esta licenciado bajo licencia GPL, el cual no escribimos aqui por pereza. +-- ---------------------------------------------------------------------------------------- +-- psql xxxx < bulmafact-0_0_1.sql +-- --------------------------------------------------------------------------------------- + +SET SESSION AUTHORIZATION 'postgres'; +SET search_path = public, pg_catalog; + +SET DATESTYLE TO European; + +CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler + AS '$libdir/plpgsql', 'plpgsql_call_handler' + LANGUAGE c; + +--CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler +-- AS '/usr/lib/postgresql/8.0/lib/plpgsql.so', 'plpgsql_call_handler' +-- LANGUAGE c; + +CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; + + +-- NOTACION: +-- Considerar las siguientes opciones de codificaciï¿œ: +-- Los nombres de tabla estan escritos SIEMPRE en singular. +-- Todos los campos de una tabla terminan siempre con el nombre de la tabla (salvo las claves foraneas). +-- Las claves foraneas tienen el mismo nombre que el campo con que se corresponden en la tabla relacionada. +-- En caso de que haya diversas claves foraneas referentes al mismo campo, el criterio es que una de ellas tenga el nombre del campo con el que se corresponde y la otra tenga un nombre significativo. +-- Los campos de clave automatica empiezan por id +-- Los enums se simulan (normalmente) con campos numericos, el significado de los valores debe estar +-- explicado en este archivo. + + +-- La tabla de configuraciï¿œ. +-- En esta tabla se guardan parametros que el programa va a utilizar. +-- Como por ejemplo el numero de dï¿œitos por defecto de las cuentas o el asiento inteligente que se enlaza con +-- facturacion. +-- Tiene tres campos +-- idconfiguracion: el identificador (No tiene ningn uso especial). +-- nombre: El nombre del parametro de configuracion. +-- valor: El valor que toma dicho parametro. +CREATE TABLE configuracion ( + nombre character varying(25) PRIMARY KEY, + valor character varying(350) +); + + +-- Codi: Clau artificial. +-- Descripcio: Nom identificatiu o descripciï¿œbreu. +-- Dies_1T: Dies abans del primer termini computant els blocs de 30 com a mesos naturals. +-- Descompte: Descompte automï¿œic per l's d'aquesta forma de pagament. +CREATE TABLE forma_pago ( + idforma_pago serial PRIMARY KEY, + descforma_pago character varying(500), + dias1tforma_pago integer, + descuentoforma_pago numeric(12,2) +); + + +-- Codigo: Clave artificial. +-- Nombre: Nombre identificativo del almacï¿œ. +-- diralmacen: Direcciï¿œ del almacï¿œ. +-- poblalmacen: Poblaciï¿œ del almacï¿œ. +-- cpalmacenc: cï¿œigo postal almacï¿œ. +-- telfalmacen: Telï¿œono del almacï¿œ. +-- faxalmacen: Fax del almacï¿œ. +-- emailalmacen: correo electrï¿œico del almacï¿œ. +-- presupuestoautoalmacen el numero de presupuesto es automatico? N=No, +-- albaranautoalmacen el numero de albaran es automatico? N=No, +-- facturaautoalmacen el numero de es automatico? N=No, +CREATE TABLE almacen ( + idalmacen serial PRIMARY KEY, + codigoalmacen numeric(5, 0) NOT NULL, + nomalmacen character varying(50), + diralmacen character varying(150), + poblalmacen character varying(50), + cpalmacen character varying(20), + telalmacen character varying(20), + faxalmacen character varying(20), + emailalmacen character varying(100), + inactivoalmacen character(1), + UNIQUE(codigoalmacen) +); + + +-- +-- TOC entry 47 (OID 3090354) +-- Name: staff; Type: TABLE; Schema: public; Owner: fewa +-- + +CREATE TABLE trabajador ( + idtrabajador serial PRIMARY KEY, + nomtrabajador character varying NOT NULL, + apellidostrabajador character varying, + dirtrabajador character varying, + nsstrabajador character varying, + teltrabajador character varying, + moviltrabajador character varying, + emailtrabajador character varying, + fototrabajador character varying, + activotrabajador boolean DEFAULT TRUE NOT NULL +); + + +-- Tabla de paï¿œes +-- cod2: cï¿œigo de dos dï¿œitos +-- cod3: cï¿œigo de tres dï¿œitos +-- desc: descripciï¿œ del paï¿œ +CREATE TABLE pais ( + idpais serial PRIMARY KEY, + cod2pais character varying(2), + cod3pais character varying(3), + descpais character varying(50) +); + + +-- Tabla de monedas +-- cod2: cï¿œigo de dos dï¿œitos +-- cod3: cï¿œigo de tres dï¿œitos +-- desc: descripciï¿œ de la moneda +CREATE TABLE moneda ( + idmoneda serial PRIMARY KEY, + cod2moneda character varying(2), + cod3moneda character varying(3), + descmoneda character varying(50) +); + + +-- Esta tabla contiene las descripciones de los ivas que se pueden aplicar. +-- Descripcio: Text descriptiu del tipus d'IVA. +CREATE TABLE tipo_iva ( + idtipo_iva serial PRIMARY KEY, + desctipo_iva character varying(2000) +); + +-- Esta tabla contiene las tasas de cada tipo de iva a partir de una fecha dada. +-- porcentasa_iva contiene el porcentaje de la tasa de iva a aplicar. +-- fechatasa_iva es la fecha de entrada en vigor del % de IVA para el tipo descrito. +CREATE TABLE tasa_iva ( + idtasa_iva serial PRIMARY KEY, + idtipo_iva integer REFERENCES tipo_iva(idtipo_iva) NOT NULL, + porcentasa_iva NUMERIC(5, 2) NOT NULL, + fechatasa_iva date NOT NULL, + UNIQUE (idtipo_iva, fechatasa_iva) +); + + +-- Tabla con series de Iva, cï¿œigo i descripciï¿œ +-- Bï¿œicamente sirve para garantizar la integridad referencial en las series de facturaciï¿œ +-- Deberï¿œn existir en contabilidad tambien. +CREATE TABLE serie_factura ( +-- idserie_factura serial PRIMARY KEY, + codigoserie_factura character varying (6) PRIMARY KEY, + descserie_factura character varying(50) NOT NULL, + UNIQUE (codigoserie_factura) +); + + +-- codigofamilia cï¿œigo de la familia. +-- nombrefamilia nombre de la familia +-- descfamilia descripciï¿œ extendida de la familia. +-- codcompfamilia cï¿œigo compuesto de familia: Es la concatenaciï¿œ del cï¿œigo de familia con sus cï¿œigos padres. +-- codigocompletofamilia Este campo es de sï¿œo lectura, no se puede escribir sobre ï¿œ. + +CREATE TABLE familia ( + idfamilia serial PRIMARY KEY, + codigofamilia character varying(12) NOT NULL, + nombrefamilia character varying(50) NOT NULL, + descfamilia character varying(300), + padrefamilia integer REFERENCES familia(idfamilia), + codigocompletofamilia character varying(50) UNIQUE +); + +CREATE FUNCTION calculacodigocompletofamilia () RETURNS "trigger" +AS ' +DECLARE + as RECORD; + codigocompleto character varying(50); +BEGIN + codigocompleto := NEW.codigofamilia; + SELECT INTO as codigocompletofamilia FROM familia WHERE idfamilia = NEW.padrefamilia; + IF FOUND THEN + codigocompleto := as.codigocompletofamilia || codigocompleto; + END IF; + NEW.codigocompletofamilia := codigocompleto; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER calculacodigocompletofamiliatrigger + BEFORE INSERT OR UPDATE ON familia + FOR EACH ROW + EXECUTE PROCEDURE calculacodigocompletofamilia(); + + +CREATE FUNCTION propagacodigocompletofamilia () RETURNS "trigger" +AS ' +DECLARE +BEGIN + UPDATE familia SET codigocompletofamilia=codigocompletofamilia WHERE padrefamilia = NEW.idfamilia; + UPDATE articulo SET codigocompletoarticulo = codigocompletoarticulo WHERE articulo.idfamilia = NEW.idfamilia; + RETURN NEW; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER propagacodigocompletofamiliatrigger + AFTER UPDATE ON familia + FOR EACH ROW + EXECUTE PROCEDURE propagacodigocompletofamilia(); + +-- Esta funciï¿œ nos da el identificador de familia dado un cï¿œigo. +--CREATE OR REPLACE FUNCTION idfamilia (text) RETURNS "trigger" +-- AS ' +--DECLARE +-- codigo ALIAS FROR $1; +-- mrecord RECORD; +--BEGIN +-- FOR mrecord IN SELECT SUM(baseiva) AS suma, SUM(ivaiva) AS sumaiva FROM iva WHERE iva.idregistroiva=NEW.idregistroiva LOOP +-- UPDATE registroiva SET baseimp=mrecord.suma, iva=mrecord.sumaiva WHERE idregistroiva=NEW.idregistroiva; +-- END LOOP; +-- RETURN NEW; +--END; +--' LANGUAGE plpgsql; + + +-- El tipo de artï¿œulo es una tabla que permite crear una forma alternativa de agrupar los artï¿œulos. +-- codigo: identificador del tipo. +-- desc: +CREATE TABLE tipo_articulo ( + idtipo_articulo serial PRIMARY KEY, + codtipo_articulo character varying(10), + desctipo_articulo character varying(50) +); + + +-- Codigo: Clave artificial. +-- Nombre: Descripciï¿œ corta del artï¿œulo. +-- abrev: Nombre abreviado del articulo (para tpv o cartelitos estanterias...) +-- idtipo_articulo: identificador de tipo de artï¿œulo que se utilizarï¿œpara agrupar artï¿œulos como clasificaciï¿œ alternativa a el surtido (familias). +-- Observaciones: Campo de texto para a comentarios y observaciones. +-- El campo codigocompletoarticulo sï¿œo puede ser de lectura. +CREATE TABLE articulo ( + idarticulo serial PRIMARY KEY, + codarticulo character varying(12), + nomarticulo character varying(50), + abrevarticulo character varying(30), + obserarticulo character varying(2000), + presentablearticulo boolean NOT NULL DEFAULT TRUE, + controlstockarticulo boolean NOT NULL DEFAULT TRUE, + idtipo_articulo numeric(2, 0) REFERENCES tipo_articulo(idtipo_articulo), + idtipo_iva integer REFERENCES tipo_iva (idtipo_iva), + codigocompletoarticulo character varying(100) UNIQUE, + idfamilia integer REFERENCES familia(idfamilia) NOT NULL, + stockarticulo numeric(12,2) DEFAULT 0, + inactivoarticulo character(1), + -- ATENCION, este campo no da el pvp real del artï¿œulo, solo es una de las multiples formas de acceder al precio del articulo. + -- Para obtener el precio de un artï¿œulo se debe usar la funcion pvparticulo. + -- Para saber el iva correspondiente a un articulo se debe usar la funciï¿œ ivaarticulo. + pvparticulo numeric(12,2) NOT NULL DEFAULT 0 +); + + + +create or replace function is_number(varchar) returns boolean as +'select $1 ~ ''^[-+]?[0-9]+$''' strict immutable language sql; + +CREATE OR REPLACE FUNCTION to_number(character varying) RETURNS INT8 AS ' +DECLARE +BEGIN + RAISE NOTICE ''to_number %'', $1; + RETURN CAST(text($1) AS INT8); +END +' LANGUAGE 'plpgsql'; + +CREATE OR REPLACE FUNCTION calculacodigocompletoarticulo () RETURNS "trigger" +AS ' +DECLARE + as RECORD; + codigocompleto character varying(100); + codnumeric integer; +BEGIN + -- Lo primero comprobamos el el código del articulo no esté vacio y de ser así lo llenamos. + IF NEW.codarticulo = '''' THEN + SELECT INTO as max(codarticulo) AS m FROM articulo WHERE idfamilia = NEW.idfamilia; + IF FOUND THEN + IF is_number(as.m) THEN + codnumeric := to_number(as.m); + codnumeric := codnumeric +1; + NEW.codarticulo := CAST (codnumeric AS varchar); + WHILE length(NEW.codarticulo) < 4 LOOP + NEW.codarticulo := ''0'' || NEW.codarticulo; + END LOOP; + ELSE + NEW.codarticulo := ''0000''; + END IF; + ELSE + NEW.codarticulo = ''0000''; + END IF; + END IF; + + codigocompleto := NEW.codarticulo; + SELECT INTO as codigocompletofamilia FROM familia WHERE idfamilia = NEW.idfamilia; + IF FOUND THEN + codigocompleto := as.codigocompletofamilia || codigocompleto; + END IF; + NEW.codigocompletoarticulo := codigocompleto; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER calculacodigocompletoarticulotrigger + BEFORE INSERT OR UPDATE ON articulo + FOR EACH ROW + EXECUTE PROCEDURE calculacodigocompletoarticulo(); + + + + +CREATE OR REPLACE FUNCTION modificadostock () RETURNS "trigger" +AS ' +DECLARE + cant numeric; + as RECORD; +BEGIN + IF NEW.stockarticulo <> OLD.stockarticulo THEN + cant := NEW.stockarticulo - OLD.stockarticulo; + FOR as IN SELECT * FROM comparticulo WHERE idarticulo = NEW.idarticulo LOOP + UPDATE articulo SET stockarticulo = stockarticulo + cant * as.cantcomparticulo WHERE idarticulo = as.idcomponente; + END LOOP; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + +CREATE TRIGGER modificastocktrigger + AFTER UPDATE ON articulo + FOR EACH ROW + EXECUTE PROCEDURE modificadostock(); + + +-- Componentes de Artï¿œulo +CREATE TABLE comparticulo ( + idarticulo integer NOT NULL REFERENCES articulo(idarticulo), + cantcomparticulo integer NOT NULL DEFAULT 1, + idcomponente integer NOT NULL REFERENCES articulo(idarticulo), + PRIMARY KEY (idarticulo, idcomponente) +); + + +-- Los proveedores son los que nos suminstran articulos y/o servicios. +-- COMPROVACIONS D'INTEGRITAT>Genï¿œiques: +-- 1 Article tï¿œ1 sol proveï¿œor principal. +-- 1 Article tï¿œ1 sol proveï¿œor referent. +-- CAMPOS +-- ====== +-- Codi: Clau artificial. +-- Nom: Nom comercial o fiscal. +-- Nom_alternatiu: Nom comercial o fiscal. +-- CIF: Codi d'Identificaciï¿œFiscal. +-- CodiCli: Codi de client amb que ens facturen. ï¿œil per a identificar-nos. +-- C_Banc +-- Comentaris +-- Adreï¿œ: Adreï¿œ. +-- Poblaciï¿œ Poblaciï¿œ +-- CProv: Codi de provincia (dos primers dï¿œits del codi postal). +-- sCP: Tres darrers dï¿œits del codi postal. +-- Telf: Telï¿œon. +-- Fax: Fax. +-- Email: eMail. +-- Url: Url. +-- CompteWeb: Dades de login si disposen de tenda o tarifes en lï¿œia +CREATE TABLE proveedor ( + idproveedor serial PRIMARY KEY, + nomproveedor character varying(200), + nomaltproveedor character varying(200), + cifproveedor character varying(12) UNIQUE, + codicliproveedor character varying(30), + cbancproveedor character varying(20), + comentproveedor character varying(2000), + dirproveedor character varying(50), + poblproveedor character varying(50), + cpproveedor character varying(9) NOT NULL, + telproveedor character varying(12), + faxproveedor character varying(12), + emailproveedor character varying(100), + urlproveedor character varying(100), + clavewebproveedor character varying(100), + inactivoproveedor character(1) +); + + +--Numero: Nmero de divisiï¿œ(clau artificial). +--Descripcio: Nom o descripciï¿œde la divisiï¿œ +--Contactes: Nom de persona o persones de contacte. +--Comentaris +--Telf: Telï¿œon. +--Fax: Fax. +--Email +CREATE TABLE division ( + iddivision serial PRIMARY KEY, + descdivision character varying(1000), + contactosdivisioon character varying(500), + comentdivision character varying(2000), + teldivision character varying(20), + faxdivision character varying(20), + maildivision character varying(100), + idproveedor integer NOT NULL REFERENCES proveedor(idproveedor), + inactivodivision character(1) +); + + +-- El cliente siempre tiene la razï¿œ, bueno, o por lo menos eso cree. +--Codi: Clau artificial. +--Nom: Nom comercial o fiscal. +--Nom_alternatiu: Nom comercial o fiscal. +--CIF: Codi d'Identificaciï¿œFiscal. +--C_Banc: Compte Bancari. +--Adr: Adreï¿œ. +--Pobl: Poblaciï¿œ +--CProv: Codi de provincia (dos primers dï¿œits del codi postal). +--sCP: Tres darrers dï¿œits del codi postal. +--Telf: Telï¿œon. +--Fax: Fax. +--Email: eMail. +--Url: Url. +--Data_alta +--Data_Baixa +---Comentaris +CREATE TABLE cliente ( + idcliente serial PRIMARY KEY, + nomcliente character varying(100), + nomaltcliente character varying(300), + cifcliente character varying(200) UNIQUE, + bancocliente character varying(35), + dircliente character varying(100), + poblcliente character varying(40), + cpcliente character varying(10), + telcliente character varying(20), + faxcliente character varying(20), + mailcliente character varying(100), + urlcliente character varying(150), + faltacliente date DEFAULT NOW(), + fbajacliente date, + comentcliente character varying(2000), + inactivocliente character(1), + provcliente character varying +); + + +CREATE TABLE cobro ( + idcobro serial PRIMARY KEY, + idcliente integer NOT NULL REFERENCES cliente(idcliente), + fechacobro date DEFAULT NOW(), + cantcobro numeric(12,2) DEFAULT 0, + refcobro character varying(12) NOT NULL, + previsioncobro boolean DEFAULT FALSE, + comentcobro character varying(500), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + + +CREATE TABLE pago ( + idpago serial PRIMARY KEY, + idproveedor integer NOT NULL REFERENCES proveedor(idproveedor), + fechapago date DEFAULT NOW(), + cantpago numeric(12,2) DEFAULT 0, + refpago character varying(12) NOT NULL, + previsionpago boolean DEFAULT FALSE, + comentpago character varying(500), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + +-- Any: Any en que s'efectua la comanda. +-- Numero: Nmero de comanda (comenï¿œnt de 1 cada any). +-- Descripcio: Breu descripciï¿œo comentari opcional. +-- Data: Data d'emisiï¿œde la comanda. +CREATE TABLE pedido ( + idpedido serial PRIMARY KEY, + numpedido character varying(60), + fechapedido date, + descpedido character varying(500), + iddivision integer NOT NULL REFERENCES division(iddivision), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + + + +CREATE TABLE usuario ( + loginusuario character varying(15) PRIMARY KEY, + nombreusuario character varying(35), + apellido1usuario character varying(35), + apellido2usuario character varying(35), + claveusuario character varying(35), + permisosusuario text +); + + + +-- Any: Any de facturaciï¿œ +-- Numero: Nmero de factura. +-- Data Comentaris +-- Factura de proveï¿œor. +CREATE TABLE fra_pro ( + idfra_pro serial PRIMARY KEY, + numfra_pro character varying(60), + fcrefra_pro date, + comentfra_pro character varying(2000) +); + + + +-- Albaran de proveedor +-- Any: Any en que s'efectua la comanda. +-- NumCompra: Numero de Compra (Clau artificial per poder registrar recepcions que ens arribin sense l'albarï¿œpostposant la cumplimentaciï¿œdel nmero d'albarï¿œ. +-- NumAlbara: Nmero d'albarï¿œ +-- Data: Data de l'albarï¿œ-- Recepcio: Data de recepciï¿œ +-- Comentaris +CREATE TABLE alb_pro ( + idalb_pro serial PRIMARY KEY, + ncompraalb_pro integer, + nalbalb_pro character varying(60), + fcrealb_pro date, + frecepalb_pro date, + comentalb_pro character varying(2000), + + idfra_pro integer REFERENCES fra_pro(idfra_pro), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen) +); + + + +-- Linea de pedido +-- Numero: Nmero de lï¿œia. +-- Descripcio: Descripcio de l'article. +-- Quantitat +-- PVD +-- Previsiï¿œ Data prevista de recepciï¿œ + +CREATE TABLE lpedido ( + numlpedido serial PRIMARY KEY, + desclpedido character varying(150), + cantlpedido numeric(12,2), + pvdlpedido numeric(12,2), + prevlpedido date, + ivalpedido numeric(12,2), + descuentolpedido numeric(12,2), + idpedido integer NOT NULL REFERENCES pedido(idpedido), + idalb_pro integer REFERENCES alb_pro(idalb_pro), + idarticulo integer REFERENCES articulo(idarticulo) +-- PRIMARY KEY(idpedido, numlpedido) +); + + + + +-- Entendemos que un presupuesto es una relaciï¿œ de materiales y trabajos cuantificada que +-- hacemos a peticiï¿œ de un cliente determinado +-- Numero +-- Data: Data d'emisiï¿œdel presupost. +-- PersContacte: Nom de persona de contacte (si cal). +-- TelfContacte: Telï¿œon. +-- Venciment: Data mï¿œima de validesa del presupost. +-- Comentaris +-- Pressupost a clients. +CREATE TABLE presupuesto ( + idpresupuesto serial PRIMARY KEY, + numpresupuesto integer NOT NULL UNIQUE, + refpresupuesto character varying(12) NOT NULL, + fpresupuesto date, + descpresupuesto character varying(150), + contactpresupuesto character varying(90), + telpresupuesto character varying(20), + vencpresupuesto date, + comentpresupuesto character varying(3000), + idusuari integer, + procesadopresupuesto boolean DEFAULT FALSE, + idcliente integer REFERENCES cliente(idcliente), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idforma_pago integer NOT NULL REFERENCES forma_pago(idforma_pago), + idtrabajador integer REFERENCES trabajador(idtrabajador), + UNIQUE (idalmacen, numpresupuesto) +); + +CREATE FUNCTION restriccionespresupuesto () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.numpresupuesto IS NULL THEN + SELECT INTO asd max(numpresupuesto) AS m FROM presupuesto; + IF asd.m IS NOT NULL THEN + NEW.numpresupuesto := asd.m + 1; + ELSE + + NEW.numpresupuesto := 1; + END IF; + END IF; + IF NEW.refpresupuesto IS NULL OR NEW.refpresupuesto = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.refpresupuesto := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionespresupuestotrigger + BEFORE INSERT OR UPDATE ON presupuesto + FOR EACH ROW + EXECUTE PROCEDURE restriccionespresupuesto(); + + +-- Descuento de presupuesto. +-- Numero +--Concepte: Descripciï¿œdel motiu de descompte. +--Proporcio: Percentatge a descomptar. +-- Descompte de pressupost a clients. +CREATE TABLE dpresupuesto ( + iddpresupuesto serial PRIMARY KEY, + conceptdpresupuesto character varying(2000), + proporciondpresupuesto numeric(12,2), + idpresupuesto integer REFERENCES presupuesto(idpresupuesto) + -- Falta poner el lugar donde se aplica el descuento, antes de la factura o despuï¿œ de ï¿œta. +); + + + +-- Linea de presupuesto +-- Numero +-- Descripcio: Descripciï¿œde l'article en el moment de ser presupostat. +-- Quantitat +-- PVP: Preu de l'article en el moment de ser pressupostat +-- Descompte: Percentatge de descompte en lï¿œia. +-- Linia de pressupost a clients. +CREATE TABLE lpresupuesto ( + idlpresupuesto serial PRIMARY KEY, + desclpresupuesto character varying(150), + cantlpresupuesto numeric(12,2), + pvplpresupuesto numeric(12,2), + ivalpresupuesto numeric(12,2), + descuentolpresupuesto numeric(12,2), + idpresupuesto integer NOT NULL REFERENCES presupuesto(idpresupuesto), + idarticulo integer REFERENCES articulo(idarticulo) +); + +-- Falta poner por defecto el pvp y el iva + + +-- Any: Any en que s'efectua la comanda. +-- Numero: Nmero de comanda (comenï¿œnt de 1 cada any). +-- Descripcio: Breu descripciï¿œo comentari opcional. +-- Data: Data d'emisiï¿œde la comanda. +CREATE TABLE pedidocliente ( + idpedidocliente serial PRIMARY KEY, + numpedidocliente integer UNIQUE NOT NULL, + fechapedidocliente date, + refpedidocliente character varying(12) NOT NULL, + descpedidocliente character varying(500), + comentpedidocliente character varying(3000), + contactpedidocliente character varying(90), + telpedidocliente character varying(20), + idusuari integer, + idpresupuesto integer REFERENCES presupuesto(idpresupuesto), + procesadopedidocliente boolean DEFAULT FALSE, + idcliente integer NOT NULL REFERENCES cliente(idcliente), + idforma_pago integer REFERENCES forma_pago(idforma_pago), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + +CREATE FUNCTION restriccionespedidocliente () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.numpedidocliente IS NULL THEN + SELECT INTO asd max(numpedidocliente) AS m FROM pedidocliente; + IF asd.m IS NOT NULL THEN + NEW.numpedidocliente := asd.m + 1; + ELSE + NEW.numpedidocliente := 1; + END IF; + END IF; + IF NEW.refpedidocliente IS NULL OR NEW.refpedidocliente = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.refpedidocliente := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionespedidoclientetrigger + BEFORE INSERT OR UPDATE ON pedidocliente + FOR EACH ROW + EXECUTE PROCEDURE restriccionespedidocliente(); + + +-- Descuento de pedidocliente. +-- Numero +--Concepte: Descripciï¿œdel motiu de descompte. +--Proporcio: Percentatge a descomptar. +-- Descompte de pressupost a clients. +CREATE TABLE dpedidocliente ( + iddpedidocliente serial PRIMARY KEY, + conceptdpedidocliente character varying(2000), + proporciondpedidocliente numeric(12,2), + idpedidocliente integer NOT NULL REFERENCES pedidocliente(idpedidocliente) + -- Falta poner el lugar donde se aplica el descuento, antes de la factura o despuï¿œ de ï¿œta. +); + +-- Linea de pedido +-- Numero: Nmero de lï¿œia. +-- Descripcio: Descripcio de l'article. +-- Quantitat +-- PVD +-- Previsiï¿œ Data prevista de recepciï¿œ +CREATE TABLE lpedidocliente ( + numlpedidocliente serial PRIMARY KEY, + desclpedidocliente character varying(150), + cantlpedidocliente numeric(12,2), + pvplpedidocliente numeric(12,2), + prevlpedidocliente date, + ivalpedidocliente numeric(12,2), + descuentolpedidocliente numeric(12,2), + idpedidocliente integer NOT NULL REFERENCES pedidocliente(idpedidocliente), + puntlpedidocliente boolean DEFAULT FALSE, + idarticulo integer REFERENCES articulo(idarticulo) +); + + + + +-- FACTURACIO>Albarans: +-- Albarans pendents: S'entendran com albarans pendents tots aquells dels quals no existeixi ticket, factura ni nofactura. +-- Numero +-- Data +-- Factura a clients. +CREATE TABLE factura ( + idfactura serial PRIMARY KEY, + codigoserie_factura character varying (6) NOT NULL REFERENCES serie_factura(codigoserie_factura), + numfactura integer NOT NULL, + reffactura character varying(15) NOT NULL, + ffactura date, + descfactura character varying(500), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + contactfactura character varying(90), + telfactura character varying(20), + comentfactura character varying(3000), + procesadafactura boolean DEFAULT FALSE, + idusuari integer, + idcliente integer REFERENCES cliente(idcliente), + idforma_pago integer REFERENCES forma_pago(idforma_pago), + UNIQUE (idalmacen, codigoserie_factura, numfactura), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + +CREATE FUNCTION restriccionesfactura () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.numfactura IS NULL THEN + SELECT INTO asd max(numfactura) AS m FROM factura WHERE idserie_factura=NEW.idserie_factura AND idalmacen = NEW.idalmacen; + IF asd.m IS NOT NULL THEN + NEW.numfactura := asd.m + 1; + ELSE + NEW.numfactura := 1; + END IF; + END IF; + IF NEW.reffactura IS NULL OR NEW.reffactura = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.reffactura := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionesfacturatrigger + BEFORE INSERT OR UPDATE ON factura + FOR EACH ROW + EXECUTE PROCEDURE restriccionesfactura(); + + +-- Descuento de pedidocliente. +-- Numero +--Concepte: Descripciï¿œdel motiu de descompte. +--Proporcio: Percentatge a descomptar. +-- Descompte de pressupost a clients. +CREATE TABLE dfactura ( + iddfactura serial PRIMARY KEY, + conceptdfactura character varying(2000), + proporciondfactura numeric(12,2), + idfactura integer NOT NULL REFERENCES factura(idfactura) + -- Falta poner el lugar donde se aplica el descuento, antes de la factura o despuï¿œ de ï¿œta. +); + + +-- Linea de presupuesto +-- Numero +-- Descripcio: Descripciï¿œde l'article en el moment de ser presupostat. +-- Quantitat +-- PVP: Preu de l'article en el moment de ser pressupostat +-- Descompte: Percentatge de descompte en lï¿œia. +-- Linia de pressupost a clients. +CREATE TABLE lfactura ( + idlfactura serial PRIMARY KEY, + desclfactura character varying(150), + cantlfactura numeric(12,2), + pvplfactura numeric(12,2), + ivalfactura numeric(12,2), + descuentolfactura numeric(12,2), + idfactura integer NOT NULL REFERENCES factura(idfactura), + idarticulo integer REFERENCES articulo(idarticulo) +); + + +-- ------------------------------------------------------------------------------------------- +-- FACTURACIO>Albarans: +-- Albarans pendents: S'entendran com albarans pendents tots aquells dels quals no existeixi ticket, factura ni nofactura. +-- Numero +-- Data +-- Factura a clients. +CREATE TABLE facturap ( + idfacturap serial PRIMARY KEY, + numfacturap character varying (20) NOT NULL UNIQUE, + reffacturap character varying(15) NOT NULL, + ffacturap date, + descfacturap character varying(500), + contactfacturap character varying(90), + telfacturap character varying(20), + comentfacturap character varying(3000), + procesadafacturap boolean DEFAULT FALSE, + idusuari integer, + idproveedor integer REFERENCES proveedor(idproveedor), + idforma_pago integer REFERENCES forma_pago(idforma_pago), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + +CREATE FUNCTION restriccionesfacturap () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.reffacturap IS NULL OR NEW.reffacturap = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.reffacturap := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionesfacturaptrigger + BEFORE INSERT OR UPDATE ON facturap + FOR EACH ROW + EXECUTE PROCEDURE restriccionesfacturap(); + + +-- Linea de presupuesto +-- Numero +-- Descripcio: Descripciï¿œde l'article en el moment de ser presupostat. +-- Quantitat +-- PVP: Preu de l'article en el moment de ser pressupostat +-- Descompte: Percentatge de descompte en lï¿œia. +-- Linia de pressupost a clients. +CREATE TABLE lfacturap ( + idlfacturap serial PRIMARY KEY, + desclfacturap character varying(150), + cantlfacturap numeric(12,2), + pvplfacturap numeric(12,2), + ivalfacturap numeric(12,2), + descuentolfacturap numeric(12,2), + idfacturap integer NOT NULL REFERENCES facturap(idfacturap), + idarticulo integer REFERENCES articulo(idarticulo) +); + + + +-- Descuento de factura proveedor +-- Numero +--Concepte: Descripciï¿œdel motiu de descompte. +--Proporcio: Percentatge a descomptar. +-- Descompte de pressupost a clients. +CREATE TABLE dfacturap ( + iddfacturap serial PRIMARY KEY, + conceptdfacturap character varying(2000), + proporciondfacturap numeric(12,2), + idfacturap integer NOT NULL REFERENCES factura(idfactura) + -- Falta poner el lugar donde se aplica el descuento, antes de la factura o despuï¿œ de ï¿œta. +); + +-- ------------------------------------------------------------------------------------------- + +-- FACTURACIO>Albarans: +-- Albarans pendents: S'entendran com albarans pendents tots aquells dels quals no existeixi ticket, factura ni nofactura. +-- Numero: Numero de nofactura +-- Data +-- Concepte: Descripcio del concepte pel qual no es poden facturar els albarans aqui agrupats (garantia, -- contracte de manteniment, regals a clients, etc...). +-- Observacions +-- Agrupacio d'albarans no facturables en funciï¿œd'un determinat concepte. +CREATE TABLE nofactura ( + idnofactura serial PRIMARY KEY, + numnofactura integer NOT NULL, + fechanofactura date, + conceptnofactura character varying(150), + observnofactura character varying(150), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + UNIQUE (idalmacen, numnofactura) +); + + + +-- COMPROVACIONS D'INTEGRITAT>Genï¿œiques: +-- Tots els albarans d'una factura corresponen al mateix client. +-- FACTURACIO>Albarans: +-- Albarans pendents: S'entendran com albarans pendents tots aquells dels quals no existeixi ticket, factura ni nofactura. +-- Numero +-- Data +-- Albarï¿œa clients. +CREATE TABLE albaranp ( + idalbaranp serial PRIMARY KEY, + numalbaranp integer NOT NULL UNIQUE, + descalbaranp character varying(150), + refalbaranp character varying(12) NOT NULL, + fechaalbaranp date DEFAULT now(), +-- loginusuario character varying(15) REFERENCES usuario(loginusuario), + comentalbaranp character varying(3000), + procesadoalbaranp boolean DEFAULT FALSE, + idproveedor integer REFERENCES proveedor(idproveedor), + idforma_pago integer REFERENCES forma_pago(idforma_pago), + idusuari integer, +-- idfactura integer REFERENCES factura(idfactura), +-- idnofactura integer REFERENCES nofactura(idnofactura), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idtrabajador integer REFERENCES trabajador(idtrabajador), + UNIQUE (idalmacen, numalbaranp) +); + +CREATE FUNCTION restriccionesalbaranp () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.numalbaranp IS NULL THEN + SELECT INTO asd max(numalbaranp) AS m FROM albaranp; + IF asd.m IS NOT NULL THEN + NEW.numalbaranp := asd.m + 1; + ELSE + NEW.numalbaranp := 1; + END IF; + END IF; + IF NEW.refalbaranp IS NULL OR NEW.refalbaranp = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.refalbaranp := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionesalbaranptrigger + BEFORE INSERT OR UPDATE ON albaranp + FOR EACH ROW + EXECUTE PROCEDURE restriccionesalbaranp(); + + +-- Numero +-- Descripcio +-- Quantitat +-- PVP: Preu de l'article en el moment de la compra o de ser presupostat. +-- Descompte +-- Lï¿œia d'albarï¿œa clients. +CREATE TABLE lalbaranp ( + numlalbaranp serial PRIMARY KEY, + desclalbaranp character varying(100), + cantlalbaranp numeric(12,2), + ivalalbaranp numeric(12,2), + pvplalbaranp numeric(12,2), + descontlalbaranp numeric(12,2), + idalbaranp integer NOT NULL REFERENCES albaranp(idalbaranp), + idarticulo integer NOT NULL REFERENCES articulo(idarticulo) +); + +CREATE FUNCTION disminuyestockp () RETURNS "trigger" +AS ' +DECLARE +BEGIN + UPDATE articulo SET stockarticulo = stockarticulo - OLD.cantlalbaranp WHERE idarticulo= OLD.idarticulo; + RETURN OLD; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER disminuyestockpt + AFTER DELETE OR UPDATE ON lalbaranp + FOR EACH ROW + EXECUTE PROCEDURE disminuyestockp(); + + +CREATE FUNCTION aumentastockp () RETURNS "trigger" +AS ' +DECLARE +BEGIN + UPDATE articulo SET stockarticulo = stockarticulo + NEW.cantlalbaranp WHERE idarticulo = NEW.idarticulo; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER aumentastockpt + AFTER INSERT OR UPDATE ON lalbaranp + FOR EACH ROW + EXECUTE PROCEDURE aumentastockp(); + + +-- Descuento albaran proveedor +-- Numero +-- Concepte: Descripciï¿œdel motiu de descompte. +-- Proporcio: Percentatge a descomptar. +-- Descompte d'albarï¿œa clients. +CREATE TABLE dalbaranp ( + iddalbaranp serial PRIMARY KEY, + conceptdalbaranp character varying(500), + proporciondalbaranp numeric(12,2), + idalbaranp integer NOT NULL REFERENCES albaranp(idalbaranp) +); + + + + +-- COMPROVACIONS D'INTEGRITAT>Genï¿œiques: +-- Tots els albarans d'una factura corresponen al mateix client. +-- FACTURACIO>Albarans: +-- Albarans pendents: S'entendran com albarans pendents tots aquells dels quals no existeixi ticket, factura ni nofactura. +-- Numero +-- Data +-- Albarï¿œa clients. +CREATE TABLE albaran ( + idalbaran serial PRIMARY KEY, + numalbaran integer NOT NULL UNIQUE, + descalbaran character varying(150), + refalbaran character varying(12) NOT NULL, + fechaalbaran date, +-- loginusuario character varying(15) REFERENCES usuario(loginusuario), + comentalbaran character varying(3000), + comentprivalbaran character varying(3000), + procesadoalbaran boolean DEFAULT FALSE, + contactalbaran character varying, + telalbaran character varying, + idusuari integer, + idcliente integer REFERENCES cliente(idcliente), + idforma_pago integer REFERENCES forma_pago(idforma_pago), + idfactura integer REFERENCES factura(idfactura), + idnofactura integer REFERENCES nofactura(idnofactura), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idtrabajador integer REFERENCES trabajador(idtrabajador), + UNIQUE (idalmacen, numalbaran) +); + +-- ********************************************************************** +-- APARTADO DE COMPROBACIONES DE INTEGRIDAD EXTRA Y DETECCIï¿œ DE ERRORES. +-- ********************************************************************** +-- ********************************************************************** +CREATE FUNCTION restriccionesalbaran () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.numalbaran IS NULL THEN + SELECT INTO asd max(numalbaran) AS m FROM albaran; + IF asd.m IS NOT NULL THEN + NEW.numalbaran := asd.m + 1; + ELSE + NEW.numalbaran := 1; + END IF; + END IF; + IF NEW.refalbaran IS NULL OR NEW.refalbaran = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.refalbaran := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionesalbarantrigger + BEFORE INSERT OR UPDATE ON albaran + FOR EACH ROW + EXECUTE PROCEDURE restriccionesalbaran(); + + +CREATE FUNCTION random_string(int4) RETURNS "varchar" AS ' +DECLARE +iLoop int4; +result varchar; +BEGIN +result = ''''; +IF ($1>0) AND ($1 < 255) THEN + FOR iLoop in 1 .. $1 LOOP + result = result || chr(int4(random()*26)+65); + END LOOP; + RETURN result; +ELSE + RETURN ''f''; +END IF; +END; +' LANGUAGE 'plpgsql'; + + +CREATE FUNCTION crearef () RETURNS character varying (15) +AS ' +DECLARE +asd RECORD; +result character varying(15); +efound boolean; +BEGIN + efound := FALSE; + WHILE efound = FALSE LOOP + result := random_string(6); + efound := TRUE; + SELECT INTO asd idpresupuesto FROM presupuesto WHERE refpresupuesto=result; + IF FOUND THEN + efound := FALSE; + END IF; + SELECT INTO asd idpedidocliente FROM pedidocliente WHERE refpedidocliente=result; + IF FOUND THEN + efound := FALSE; + END IF; + SELECT INTO asd idalbaran FROM albaran WHERE refalbaran=result; + IF FOUND THEN + efound := FALSE; + END IF; + SELECT INTO asd idfactura FROM factura WHERE reffactura=result; + IF FOUND THEN + efound := FALSE; + END IF; + END LOOP; + RETURN result; +END; +' LANGUAGE plpgsql; + +-- Descuento albaran +-- Numero +-- Concepte: Descripciï¿œdel motiu de descompte. +-- Proporcio: Percentatge a descomptar. +-- Descompte d'albarï¿œa clients. +CREATE TABLE dalbaran ( + iddalbaran serial PRIMARY KEY, + conceptdalbaran character varying(500), + proporciondalbaran numeric(12,2), + idalbaran integer NOT NULL REFERENCES albaran(idalbaran) +); + + +-- Numero +-- Descripcio +-- Quantitat +-- PVP: Preu de l'article en el moment de la compra o de ser presupostat. +-- Descompte +-- Lï¿œia d'albarï¿œa clients. +CREATE TABLE lalbaran ( + numlalbaran serial PRIMARY KEY, + desclalbaran character varying(100), + cantlalbaran numeric(12,2), + pvplalbaran numeric(12,2), + descontlalbaran numeric(12,2), + ivalalbaran numeric(12,2), + idalbaran integer NOT NULL REFERENCES albaran(idalbaran), + idarticulo integer NOT NULL REFERENCES articulo(idarticulo) +); +CREATE FUNCTION disminuyestock () RETURNS "trigger" +AS ' +DECLARE +BEGIN + UPDATE articulo SET stockarticulo = stockarticulo + OLD.cantlalbaran WHERE idarticulo= OLD.idarticulo; + RETURN OLD; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER disminuyestockt + AFTER DELETE OR UPDATE ON lalbaran + FOR EACH ROW + EXECUTE PROCEDURE disminuyestock(); + + +CREATE FUNCTION aumentastock () RETURNS "trigger" +AS ' +DECLARE +BEGIN + UPDATE articulo SET stockarticulo = stockarticulo - NEW.cantlalbaran WHERE idarticulo = NEW.idarticulo; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER aumentastockt + AFTER INSERT OR UPDATE ON lalbaran + FOR EACH ROW + EXECUTE PROCEDURE aumentastock(); + + +-- FACTURACIO>Albarans: +-- Albarans pendents: S'entendran com albarans pendents tots aquells dels quals no existeixi ticket, factura ni nofactura. +CREATE TABLE ticket ( + numticket integer PRIMARY KEY, + fechaticket date +); + + +-- COMPROVACIONS D'INTEGRITAT>Genï¿œiques: +-- 1 Article tï¿œ1 sol proveï¿œor principal. +-- 1 Article tï¿œ1 sol proveï¿œor referent. +CREATE TABLE suministra ( + idsuministra serial PRIMARY KEY, + refpro character varying(100), + principalsuministra numeric(12,2), + idproveedor integer REFERENCES proveedor(idproveedor), + idarticulo integer REFERENCES articulo(idarticulo) +); + + + + + + +-- Los tipos de tarifa permiten tener diferentes precios para un mismo artï¿œulo en funciï¿œ de alguna variable que queramos definir (para un cliente, para una zona, si es para un minorista, tienda propia franquiciada ... +-- codigo: es un identificador pnemotï¿œnico de la tarifa. +-- desc: es un texto descriptivo del tipo de tarifa. + +CREATE TABLE tipo_tarifa ( + idtipo_tarifa serial PRIMARY KEY, + codtipo_tarifa character varying(10) NOT NULL UNIQUE, + desctipo_tarifa character varying(50) +); + + +-- La tabla tarifa contiene los precios de venta y oferta incluidas las ofertas MxN. +-- idalmacen: Almacï¿œ o tienda a la que corresponden los precios. +-- idarticulo: idetificador del articulo al que corresponde el precio. +-- finicio: fecha de inicio vigencia del precio +-- ffin: fecha de finalizaciï¿œ de vigencia del precio. +-- esoferta: indica si el precio es de oferta. +-- esmxn: indica si la oferta es mxn (p.e. 3x2). +-- cantidadm: cantidad de unidades para primer valor en oferta mxn (valor de unidades llevadas). +-- cantidadn: cantidad de unidades para segundo valor en oferta mxn (valor de unidades pagadas). +-- FALTA DEFINIR LAS REGLAS PARA EVITAR SOLAPAMIENTOS ENTRE OFERTAS. + +CREATE TABLE tarifa ( + idtarifa serial PRIMARY KEY, + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idarticulo integer NOT NULL REFERENCES articulo(idarticulo), + idtipo_tarifa integer NOT NULL REFERENCES tipo_tarifa(idtipo_tarifa), + finiciotarifa date, + ffintarifa date, + preciotarifa numeric(13, 4), + esofertatarifa character(1) NOT NULL CHECK(esofertatarifa='S' OR esofertatarifa='N'), + esmxntarifa character(1), + cantidadmtarifa numeric(5, 0), + cantidadntarifa numeric(5, 0) +); + + +-- Restricciones para la tabla tarifa: +-- Para un mismo almacï¿œ, artï¿œulo y tarifa, no puede haber mï¿œ de un precio a una misma fecha +-- Para un mismo almacï¿œ, artï¿œulo y tarifa, no puede haber mï¿œ de una oferta precio a una misma fecha +-- Sï¿œque se permite que haya solapamiento entre la tarifa normal y una oferta. Prevalece siempre la oferta. + +--DROP TRIGGER restriccionestarifatrigger ON cuenta CASCADE; +--DROP FUNCTION restriccionestarifa(); + +CREATE FUNCTION restriccionestarifa () RETURNS "trigger" +AS ' +DECLARE + cont INTEGER; +BEGIN + +RAISE NOTICE '' IDTARIFA = % '',NEW.idtarifa; + SELECT count(*) INTO cont FROM tarifa + WHERE tarifa.idtipo_tarifa = NEW.idtipo_tarifa AND tarifa.idarticulo = NEW.idarticulo AND tarifa.idalmacen = NEW.idalmacen AND tarifa.esofertatarifa = NEW.esofertatarifa AND + tarifa.idtarifa != NEW.idtarifa AND tarifa.finiciotarifa <= NEW.finiciotarifa AND tarifa.ffintarifa >= NEW.finiciotarifa; + if (NOT(cont ISNULL) AND cont > 0) THEN + RAISE EXCEPTION '' Solapamiento de fechas en fecha inicio ''; + END IF; + RAISE NOTICE '' CONTADOR = % '', cont; + + SELECT count(*) INTO cont FROM tarifa + WHERE tarifa.idtipo_tarifa = NEW.idtipo_tarifa AND tarifa.idarticulo = NEW.idarticulo AND tarifa.idalmacen = NEW.idalmacen AND tarifa.esofertatarifa = NEW.esofertatarifa AND + tarifa.idtarifa != NEW.idtarifa AND tarifa.finiciotarifa <= NEW.ffintarifa AND tarifa.ffintarifa >= NEW.ffintarifa; + if (NOT(cont ISNULL) AND cont > 0) THEN + RAISE EXCEPTION '' Solapamiento de fechas en fecha fin ''; + END IF; + RAISE NOTICE '' CONTADOR = % '', cont; + + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionestarifatrigger + BEFORE INSERT OR UPDATE ON tarifa + FOR EACH ROW + EXECUTE PROCEDURE restriccionestarifa(); + +CREATE TABLE precio_compra ( + idprecio_compra serial PRIMARY KEY, + idarticulo integer NOT NULL REFERENCES articulo(idarticulo), + iddivision integer REFERENCES division(iddivision), + idalmacen integer REFERENCES almacen(idalmacen), + fechapreciocompra date, + valorpreciocompra numeric(13, 4) NOT NULL +); + + +CREATE TABLE codigobarras ( + idcodigobarras serial PRIMARY KEY, + idarticulo integer NOT NULL REFERENCES articulo(idarticulo), + ean14codigobarras numeric(14, 0) NOT NULL UNIQUE, + unixcajacodigobarras numeric(4, 0), + cajxpaletcodigobarras numeric(4, 0), + unidadcodigobarras character(1) +); + +-- FUNCIONES VARIAS DE SOPORTE. + +CREATE OR REPLACE FUNCTION ivaarticulo(integer) RETURNS numeric(12,2) +AS' +DECLARE + idarticulo ALIAS FOR $1; + as RECORD; +BEGIN + SELECT INTO AS * FROM tipo_iva, tasa_iva, articulo WHERE tasa_iva.idtipo_iva = tipo_iva.idtipo_iva AND tipo_iva.idtipo_iva = articulo.idtipo_iva AND articulo.idarticulo = idarticulo ORDER BY fechatasa_iva; + IF FOUND THEN + RETURN as.porcentasa_iva; + END IF; + RETURN 0.0; +END; +' LANGUAGE plpgsql; + + +CREATE OR REPLACE FUNCTION pvparticulo(integer) RETURNS numeric(12,2) +AS' +DECLARE + idarticulo ALIAS FOR $1; + as RECORD; +BEGIN + SELECT INTO AS pvparticulo FROM articulo WHERE articulo.idarticulo = idarticulo; + IF FOUND THEN + RETURN as.pvparticulo; + END IF; + RETURN 0.0; +END; +' LANGUAGE plpgsql; + + +-- Any: Any en que s'efectua la comanda. +-- Numero: Nmero de comanda (comenï¿œnt de 1 cada any). +-- Descripcio: Breu descripciï¿œo comentari opcional. +-- Data: Data d'emisiï¿œde la comanda. +CREATE TABLE pedidoproveedor ( + idpedidoproveedor serial PRIMARY KEY, + numpedidoproveedor integer UNIQUE NOT NULL, + fechapedidoproveedor date, + refpedidoproveedor character varying(12) NOT NULL, + descpedidoproveedor character varying(500), + comentpedidoproveedor character varying(3000), + contactpedidoproveedor character varying(90), + telpedidoproveedor character varying(20), + procesadopedidoproveedor boolean DEFAULT FALSE, + idproveedor integer NOT NULL REFERENCES proveedor(idproveedor), + idforma_pago integer REFERENCES forma_pago(idforma_pago), + idalmacen integer NOT NULL REFERENCES almacen(idalmacen), + idtrabajador integer REFERENCES trabajador(idtrabajador) +); + +CREATE FUNCTION restriccionespedidoproveedor () RETURNS "trigger" +AS ' +DECLARE +asd RECORD; +BEGIN + IF NEW.numpedidoproveedor IS NULL THEN + SELECT INTO asd max(numpedidoproveedor) AS m FROM pedidoproveedor; + IF asd.m IS NOT NULL THEN + NEW.numpedidoproveedor := asd.m + 1; + ELSE + NEW.numpedidoproveedor := 1; + END IF; + END IF; + IF NEW.refpedidoproveedor IS NULL OR NEW.refpedidoproveedor = '''' THEN + SELECT INTO asd crearef() AS m; + IF FOUND THEN + NEW.refpedidoproveedor := asd.m; + END IF; + END IF; + RETURN NEW; +END; +' LANGUAGE plpgsql; + + +CREATE TRIGGER restriccionespedidoproveedortrigger + BEFORE INSERT OR UPDATE ON pedidoproveedor + FOR EACH ROW + EXECUTE PROCEDURE restriccionespedidoproveedor(); + + +-- Descuento de pedidocliente. +-- Numero +--Concepte: Descripciï¿œdel motiu de descompte. +--Proporcio: Percentatge a descomptar. +-- Descompte de pressupost a clients. +CREATE TABLE dpedidoproveedor ( + iddpedidoproveedor serial PRIMARY KEY, + conceptdpedidoproveedor character varying(2000), + proporciondpedidoproveedor numeric(12,2), + idpedidoproveedor integer NOT NULL REFERENCES pedidoproveedor(idpedidoproveedor) + -- Falta poner el lugar donde se aplica el descuento, antes de la factura o despuï¿œ de ï¿œta. +); + +-- Linea de pedido +-- Numero: Nmero de lï¿œia. +-- Descripcio: Descripcio de l'article. +-- Quantitat +-- PVD +-- Previsiï¿œ Data prevista de recepciï¿œ +CREATE TABLE lpedidoproveedor ( + numlpedidoproveedor serial PRIMARY KEY, + desclpedidoproveedor character varying(150), + cantlpedidoproveedor numeric(12,2), + pvplpedidoproveedor numeric(12,2), + prevlpedidoproveedor date, + ivalpedidoproveedor numeric(12,2), + descuentolpedidoproveedor numeric(12,2), + idpedidoproveedor integer NOT NULL REFERENCES pedidoproveedor(idpedidoproveedor), + puntlpedidoproveedor boolean DEFAULT FALSE, + idarticulo integer REFERENCES articulo(idarticulo) +); + + +-- Calculo de totales para presupuestos. +CREATE OR REPLACE FUNCTION calctotalpres(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpresupuesto * pvplpresupuesto * (1 - descuentolpresupuesto/100) *(1+ ivalpresupuesto/100) AS subtotal1 FROM lpresupuesto WHERE idpresupuesto = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpresupuesto FROM dpresupuesto WHERE idpresupuesto = idp LOOP + total := total * (1 - res.proporciondpresupuesto/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Calculo de totales para presupuestos. +CREATE OR REPLACE FUNCTION calcbimppres(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpresupuesto * pvplpresupuesto * (1 - descuentolpresupuesto/100) AS subtotal1 FROM lpresupuesto WHERE idpresupuesto = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpresupuesto FROM dpresupuesto WHERE idpresupuesto = idp LOOP + total := total * (1 - res.proporciondpresupuesto/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Calculo de totales para presupuestos. +CREATE OR REPLACE FUNCTION calcimpuestospres(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpresupuesto * pvplpresupuesto * (1 - descuentolpresupuesto/100) * (ivalpresupuesto/100) AS subtotal1 FROM lpresupuesto WHERE idpresupuesto = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpresupuesto FROM dpresupuesto WHERE idpresupuesto = idp LOOP + total := total * (1 - res.proporciondpresupuesto/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + + + +-- Cálculo de totales para pedido cliente. +CREATE OR REPLACE FUNCTION calctotalpedcli(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpedidocliente * pvplpedidocliente * (1 - descuentolpedidocliente/100) *(1+ ivalpedidocliente/100) AS subtotal1 FROM lpedidocliente WHERE idpedidocliente = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpedidocliente FROM dpedidocliente WHERE idpedidocliente = idp LOOP + total := total * (1 - res.proporciondpedidocliente/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + + +-- Cálculo de totales para pedido cliente. +CREATE OR REPLACE FUNCTION calcbimppedcli(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpedidocliente * pvplpedidocliente * (1 - descuentolpedidocliente/100) AS subtotal1 FROM lpedidocliente WHERE idpedidocliente = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpedidocliente FROM dpedidocliente WHERE idpedidocliente = idp LOOP + total := total * (1 - res.proporciondpedidocliente/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para pedido cliente. +CREATE OR REPLACE FUNCTION calcimpuestospedcli(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpedidocliente * pvplpedidocliente * (1 - descuentolpedidocliente/100) *( ivalpedidocliente/100) AS subtotal1 FROM lpedidocliente WHERE idpedidocliente = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpedidocliente FROM dpedidocliente WHERE idpedidocliente = idp LOOP + total := total * (1 - res.proporciondpedidocliente/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + + + +-- Cálculo de totales para albaranes. +CREATE OR REPLACE FUNCTION calctotalalbaran(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlalbaran * pvplalbaran * (1 - descontlalbaran/100) *(1+ ivalalbaran/100) AS subtotal1 FROM lalbaran WHERE idalbaran = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondalbaran FROM dalbaran WHERE idalbaran = idp LOOP + total := total * (1 - res.proporciondalbaran/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para albaranes. +CREATE OR REPLACE FUNCTION calcbimpalbaran(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlalbaran * pvplalbaran * (1 - descontlalbaran/100) AS subtotal1 FROM lalbaran WHERE idalbaran = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondalbaran FROM dalbaran WHERE idalbaran = idp LOOP + total := total * (1 - res.proporciondalbaran/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para albaranes. +CREATE OR REPLACE FUNCTION calcimpuestosalbaran(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlalbaran * pvplalbaran * (1 - descontlalbaran/100)*(ivalalbaran/100) AS subtotal1 FROM lalbaran WHERE idalbaran = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondalbaran FROM dalbaran WHERE idalbaran = idp LOOP + total := total * (1 - res.proporciondalbaran/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + + +-- Cálculo de totales para facturas +CREATE OR REPLACE FUNCTION calctotalfactura(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlfactura * pvplfactura * (1 - descuentolfactura/100) *(1+ ivalfactura/100) AS subtotal1 FROM lfactura WHERE idfactura = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondfactura FROM dfactura WHERE idfactura = idp LOOP + total := total * (1 - res.proporciondfactura/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para facturas +CREATE OR REPLACE FUNCTION calcbimpfactura(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlfactura * pvplfactura * (1 - descuentolfactura/100) AS subtotal1 FROM lfactura WHERE idfactura = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondfactura FROM dfactura WHERE idfactura = idp LOOP + total := total * (1 - res.proporciondfactura/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para facturas +CREATE OR REPLACE FUNCTION calcimpuestosfactura(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlfactura * pvplfactura * (1 - descuentolfactura/100) *(ivalfactura/100) AS subtotal1 FROM lfactura WHERE idfactura = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondfactura FROM dfactura WHERE idfactura = idp LOOP + total := total * (1 - res.proporciondfactura/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para pedido proveedor +CREATE OR REPLACE FUNCTION calctotalpedpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpedidoproveedor * pvplpedidoproveedor * (1 - descuentolpedidoproveedor/100) *(1+ ivalpedidoproveedor/100) AS subtotal1 FROM lpedidoproveedor WHERE idpedidoproveedor = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpedidoproveedor FROM dpedidoproveedor WHERE idpedidoproveedor = idp LOOP + total := total * (1 - res.proporciondpedidoproveedor/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +CREATE OR REPLACE FUNCTION calcbimppedpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpedidoproveedor * pvplpedidoproveedor * (1 - descuentolpedidoproveedor/100) AS subtotal1 FROM lpedidoproveedor WHERE idpedidoproveedor = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpedidoproveedor FROM dpedidoproveedor WHERE idpedidoproveedor = idp LOOP + total := total * (1 - res.proporciondpedidoproveedor/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + + +CREATE OR REPLACE FUNCTION calcimpuestospedpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlpedidoproveedor * pvplpedidoproveedor * (1 - descuentolpedidoproveedor/100) *( ivalpedidoproveedor/100) AS subtotal1 FROM lpedidoproveedor WHERE idpedidoproveedor = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondpedidoproveedor FROM dpedidoproveedor WHERE idpedidoproveedor = idp LOOP + total := total * (1 - res.proporciondpedidoproveedor/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para albaaran proveedor +CREATE OR REPLACE FUNCTION calctotalalbpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlalbaranp * pvplalbaranp * (1 - descontlalbaranp/100) *(1+ ivalalbaranp/100) AS subtotal1 FROM lalbaranp WHERE idalbaranp = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondalbaranp FROM dalbaranp WHERE idalbaranp = idp LOOP + total := total * (1 - res.proporciondalbaranp/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +CREATE OR REPLACE FUNCTION calcbimpalbpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlalbaranp * pvplalbaranp * (1 - descontlalbaranp/100) AS subtotal1 FROM lalbaranp WHERE idalbaranp = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondalbaranp FROM dalbaranp WHERE idalbaranp = idp LOOP + total := total * (1 - res.proporciondalbaranp/100); + END LOOP; + RETURN total; +END; +' language plpgsql; +\echo "Cálculo de totales para albaranes de proveedor" + +CREATE OR REPLACE FUNCTION calcimpuestosalbpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlalbaranp * pvplalbaranp * (1 - descontlalbaranp/100) *(ivalalbaranp/100) AS subtotal1 FROM lalbaranp WHERE idalbaranp = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondalbaranp FROM dalbaranp WHERE idalbaranp = idp LOOP + total := total * (1 - res.proporciondalbaranp/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para factura proveedor +CREATE OR REPLACE FUNCTION calctotalfacpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlfacturap * pvplfacturap * (1 - descuentolfacturap/100) *(1+ ivalfacturap/100) AS subtotal1 FROM lfacturap WHERE idfacturap = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondfacturap FROM dfacturap WHERE idfacturap = idp LOOP + total := total * (1 - res.proporciondfacturap/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + + +-- Cálculo de totales para factura proveedor +CREATE OR REPLACE FUNCTION calcbimpfacpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlfacturap * pvplfacturap * (1 - descuentolfacturap/100) AS subtotal1 FROM lfacturap WHERE idfacturap = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondfacturap FROM dfacturap WHERE idfacturap = idp LOOP + total := total * (1 - res.proporciondfacturap/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- Cálculo de totales para factura proveedor +CREATE OR REPLACE FUNCTION calcimpuestosfacpro(integer) RETURNS numeric(12,2) +AS ' +DECLARE +idp ALIAS FOR $1; +total numeric(12,2); +res RECORD; +BEGIN + total := 0; + FOR res IN SELECT cantlfacturap * pvplfacturap * (1 - descuentolfacturap/100) *(ivalfacturap/100) AS subtotal1 FROM lfacturap WHERE idfacturap = idp LOOP + total := total + res.subtotal1; + END LOOP; + FOR res IN SELECT proporciondfacturap FROM dfacturap WHERE idfacturap = idp LOOP + total := total * (1 - res.proporciondfacturap/100); + END LOOP; + RETURN total; +END; +' language plpgsql; + +-- bulmafact_data.sql ########################################### + +#SET DATESTYLE TO European; + +INSERT INTO configuracion (nombre, valor) VALUES ('CodCuenta', 'xxxxyyy'); +INSERT INTO configuracion (nombre, valor) VALUES ('CIF', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('TipoVia', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('NombreVia', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('NumeroVia', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Escalera', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Piso', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Puerta', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('CodPostal', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Municipio', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Provincia', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Pais', '--'); +INSERT INTO configuracion (nombre, valor) VALUES ('Tipo', 'BulmaFact'); +INSERT INTO configuracion (nombre, valor) VALUES ('ProgramaContabilidad', 'BulmaCont'); +INSERT INTO configuracion (nombre, valor) VALUES ('NombreEmpresa', 'Sin Definir'); +INSERT INTO configuracion (nombre, valor) VALUES ('AlmacenDefecto', '100'); + + +INSERT INTO forma_pago (descforma_pago, dias1tforma_pago, descuentoforma_pago) VALUES ('Contado', 1, 5); +INSERT INTO forma_pago (descforma_pago, dias1tforma_pago, descuentoforma_pago) VALUES ('Pagare 30 días', 30, 0); +INSERT INTO forma_pago (descforma_pago, dias1tforma_pago, descuentoforma_pago) VALUES ('Pagare 60 días', 60, 0); +INSERT INTO forma_pago (descforma_pago, dias1tforma_pago, descuentoforma_pago) VALUES ('Talón 15 dias', 15, 1); + + +INSERT INTO tipo_tarifa (codtipo_tarifa, desctipo_tarifa) VALUES('GENERAL', 'Tarifa General'); + +INSERT INTO almacen (codigoalmacen, nomalmacen, diralmacen, poblalmacen, cpalmacen, telalmacen, faxalmacen) VALUES (100, 'La Botica del Abuelo', 'Camí Vell de Bunyola', 'Palma de Mallorca', '07009', '971434343', '971434344'); +INSERT INTO almacen (codigoalmacen, nomalmacen, diralmacen, poblalmacen, cpalmacen, telalmacen, faxalmacen) VALUES (200, 'Colmado de Mateo', 'Joan Maura', 'Palma de Mallorca', '07005', '971467911', '971776776'); +INSERT INTO almacen (codigoalmacen, nomalmacen, diralmacen, poblalmacen, cpalmacen, telalmacen, faxalmacen) VALUES (300, 'Almacén Norte', 'Políono homogeneo', 'Alcudia', '07012', '971167911', '971111776'); + + +INSERT INTO proveedor (nomproveedor, cifproveedor, cpproveedor) VALUES ('Tomeu', '45678098D', '07008'); +INSERT INTO proveedor (nomproveedor, cifproveedor, cpproveedor) VALUES ('Cristina', '45679998D', '07008'); +INSERT INTO proveedor (nomproveedor, cifproveedor, cpproveedor) VALUES ('Marco Aurelio', '45668998D', '07008'); +INSERT INTO proveedor (nomproveedor, cifproveedor, cpproveedor) VALUES ('Torrijas', '45678995D', '07008'); + +INSERT INTO division (idproveedor, descdivision) VALUES (1, 'division 1 de mateu'); +INSERT INTO division (idproveedor, descdivision) VALUES (1, 'division 2 de mateu'); +INSERT INTO division (idproveedor, descdivision) VALUES (2, 'division 1 de cristina'); +INSERT INTO division (idproveedor, descdivision) VALUES (2, 'division 2 de cristina'); +INSERT INTO division (idproveedor, descdivision) VALUES (2, 'division 3 de cristina'); +INSERT INTO division (idproveedor, descdivision) VALUES (4, 'division 1 de Torrijas'); + + +INSERT INTO cliente (nomcliente, cifcliente, telcliente, poblcliente) VALUES('Jorge Gutiérrez', '39881444W', '971998877', 'Palma de Mallorca'); +INSERT INTO cliente (nomcliente, cifcliente, telcliente, poblcliente) VALUES('Carlos Santana', '43881555Z', '871998877', 'Campos'); +INSERT INTO cliente (nomcliente, cifcliente, telcliente, poblcliente) VALUES('Dolores Martínez', '66881444E', '666998877', 'Muro'); +INSERT INTO cliente (nomcliente, cifcliente, telcliente, poblcliente) VALUES('Pepe Infante', '55881444W', '9321998877', 'Barcelona'); + +INSERT INTO tipo_iva (desctipo_iva) VALUES('Exento'); +INSERT INTO tipo_iva (desctipo_iva) VALUES('Normal'); +INSERT INTO tasa_iva(idtipo_iva, porcentasa_iva, fechatasa_iva) VALUES(1, 0, '0001-01-01'); +INSERT INTO tasa_iva(idtipo_iva, porcentasa_iva, fechatasa_iva) VALUES(2, 16.00, '0001-01-01'); +INSERT INTO tasa_iva(idtipo_iva, porcentasa_iva, fechatasa_iva) VALUES(2, 17.00, '2005-01-01'); + +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('CO', 'Comestibles', NULL); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('DR', 'Drogueria', NULL); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('VE', 'Vehiculos', NULL); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('LA', 'Lacteos', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('CA', 'Carnicos', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('CH', 'Charcuteria', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('PE', 'Pescaderia', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('PA', 'Panaderia', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('FU', 'Fruteria', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('BE', 'Bebidas', 1); +INSERT INTO familia(codigofamilia, nombrefamilia, padrefamilia) VALUES ('IN', 'Infusiones', 1); +\echo "Hemos insertado las familias" + +INSERT INTO articulo (codarticulo, nomarticulo, obserarticulo, idtipo_iva, idfamilia) VALUES('1', 'Leche Entera', 'Brick leche entera 1 litro', 1, 4); +INSERT INTO articulo (codarticulo, nomarticulo, obserarticulo, idtipo_iva, idfamilia) VALUES('2', 'Natillas', 'Pack dos envases de natillas de vainilla', 2, 4); +INSERT INTO articulo (codarticulo, nomarticulo, obserarticulo, idtipo_iva, idfamilia) VALUES('3', 'Iogurt', 'Pack 4 unidades yogures sabores', 1, 5); +INSERT INTO articulo (codarticulo, nomarticulo, obserarticulo, idtipo_iva, idfamilia) VALUES('4', 'Nestcafé', 'Bote 400 gramos café soluble natural', 1, 5); +\echo "Hemos insertado los articulos" + +INSERT INTO pedido (numpedido, fechapedido, descpedido, iddivision, idalmacen) VALUES('P-1', '25/10/2004', 'Pedido semanal de carne y pescado', 1, 1); +INSERT INTO pedido (numpedido, fechapedido, descpedido, iddivision, idalmacen) VALUES('P-2', '30/10/2004', 'Pedido especial noche halloween', 2, 3); +INSERT INTO pedido (numpedido, fechapedido, descpedido, iddivision, idalmacen) VALUES('P-3', '02/11/2004', 'Frutos secos de temporada', 3, 2); +INSERT INTO pedido (numpedido, fechapedido, descpedido, iddivision, idalmacen) VALUES('P-4', '02/10/2004', 'Pedido semanal de lencería', 6, 1); +\echo "Hemos insertado los pedidos" + +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 10, 1.2, '30/10/2004', 1, 1); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 100, 2.23, '02/11/2004', 1, 2); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 15, 3.34, '30/10/2004', 1, 3); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 34, 11.20, '05/11/2004', 2, 1); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 45, 2.55, '05/11/2004', 2, 3); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 1, 4.28, '10/11/2004', 2, 4); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 34, 1.7, '31/12/2004', 3, 2); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 11, 1.3, '30/12/2004', 3, 3); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 28, 2.2, '30/12/2004', 3, 4); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 15, 3.2, '15/11/2004', 4, 1); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 10, 8.59, '10/11/2004', 4, 2); +INSERT INTO lpedido (desclpedido, cantlpedido, pvdlpedido, prevlpedido, idpedido, idarticulo) VALUES (' ', 6, 6.15, '25/11/2004', 4, 3); + + + +INSERT INTO pedidocliente (numpedidocliente, fechapedidocliente, descpedidocliente, idcliente, idalmacen) VALUES(1, '25/10/2004', 'Pedido carne y pescado', 1, 1); +INSERT INTO pedidocliente (numpedidocliente, fechapedidocliente, descpedidocliente, idcliente, idalmacen) VALUES(2, '30/10/2004', 'Pedido especial noche ', 2, 3); +INSERT INTO pedidocliente (numpedidocliente, fechapedidocliente, descpedidocliente, idcliente, idalmacen) VALUES(3, '02/11/2004', 'Frutos de temporada', 1, 2); +INSERT INTO pedidocliente (numpedidocliente, fechapedidocliente, descpedidocliente, idcliente, idalmacen) VALUES(4, '02/10/2004', 'Pedido de lencería', 2, 1); +\echo "Hemos insertado los pedidos de cliente" + + + +INSERT INTO presupuesto (numpresupuesto, fpresupuesto, contactpresupuesto, telpresupuesto, vencpresupuesto, comentpresupuesto, idusuari, idcliente, idalmacen, idforma_pago) VALUES (1, '30/11/2004', 'Primer Contacto', '971 32 32 78', '12/12/2004', 'Sin comentarios', 1, 1, 1,1); +INSERT INTO presupuesto (numpresupuesto, fpresupuesto, contactpresupuesto, telpresupuesto, vencpresupuesto, comentpresupuesto, idusuari, idcliente, idalmacen, idforma_pago) VALUES (2, '29/11/2004', 'Segundo Contacto', '91 454 45 30', '13/12/2004', 'Sin comentarios', 1, 1, 1,1); +INSERT INTO presupuesto (numpresupuesto, fpresupuesto, contactpresupuesto, telpresupuesto, vencpresupuesto, comentpresupuesto, idusuari, idcliente, idalmacen, idforma_pago) VALUES (3, '10/11/2004', 'Tercer Contacto', '971 29 06 29', '14/12/2004', 'Sin comentarios', 1, 2, 1,1); + + +INSERT INTO serie_factura (codigoserie_factura, descserie_factura) VALUES ('DD', 'Serie de ejemplo'); +INSERT INTO serie_factura (codigoserie_factura, descserie_factura) VALUES ('REC', 'Facturas Rectificativas'); + + +INSERT INTO factura (codigoserie_factura, numfactura, ffactura, contactfactura, telfactura, comentfactura, idusuari, idcliente, idalmacen) VALUES ('DD', 1, '30/11/2004', 'Primer Contacto', '971 32 32 78', 'Sin comentarios', 1, 1, 1); +INSERT INTO factura (codigoserie_factura,numfactura, ffactura, contactfactura, telfactura, comentfactura, idusuari, idcliente, idalmacen) VALUES ('DD', 2, '29/11/2004', 'Segundo Contacto', '91 454 45 30', 'Sin comentarios', 1, 1, 1); +INSERT INTO factura (codigoserie_factura,numfactura, ffactura, contactfactura, telfactura, comentfactura, idusuari, idcliente, idalmacen) VALUES ('REC', 3, '10/11/2004', 'Tercer Contacto', '971 29 06 29', 'Sin comentarios', 1, 2, 1); + + +INSERT INTO facturap (numfacturap, ffacturap, contactfacturap, telfacturap, comentfacturap, idusuari, idproveedor) VALUES ( 1, '30/11/2004', 'Primer Contacto', '971 32 32 78', 'Sin comentarios', 1, 1); +INSERT INTO facturap (numfacturap, ffacturap, contactfacturap, telfacturap, comentfacturap, idusuari, idproveedor) VALUES ( 2, '29/11/2004', 'Segundo Contacto', '91 454 45 30', 'Sin comentarios', 1, 1); +INSERT INTO facturap (numfacturap, ffacturap, contactfacturap, telfacturap, comentfacturap, idusuari, idproveedor) VALUES ( 3, '10/11/2004', 'Tercer Contacto', '971 29 06 29', 'Sin comentarios', 1, 2); + + + + +INSERT INTO suministra (idarticulo, idproveedor) VALUES (1, 1); +INSERT INTO suministra (idarticulo, idproveedor) VALUES (2, 1); +INSERT INTO suministra (idarticulo, idproveedor) VALUES (3, 2); +INSERT INTO suministra (idarticulo, idproveedor) VALUES (4, 2); +INSERT INTO suministra (idarticulo, idproveedor) VALUES (2, 3); +INSERT INTO suministra (idarticulo, idproveedor) VALUES (3, 3); +INSERT INTO suministra (idarticulo, idproveedor) VALUES (4, 1); + + + + +INSERT INTO albaran (numalbaran, fechaalbaran, idtrabajador, idcliente, idforma_pago, idalmacen, refalbaran) VALUES (1, '01/01/2005', NULL, 1, 1, 1,'R1'); +INSERT INTO albaran (numalbaran, fechaalbaran, idtrabajador, idcliente, idforma_pago, idalmacen, refalbaran) VALUES (2, '02/01/2005', NULL, 1, 2, 1,'R2'); +INSERT INTO albaran (numalbaran, fechaalbaran, idtrabajador, idcliente, idforma_pago, idalmacen, refalbaran) VALUES (3, '03/01/2005', NULL, 2, 3, 1,'R3'); +INSERT INTO albaran (numalbaran, fechaalbaran, idtrabajador, idcliente, idforma_pago, idalmacen, refalbaran) VALUES (4, '01/01/2005', NULL, 2, 4, 1,'R4'); +INSERT INTO albaran (numalbaran, fechaalbaran, idtrabajador, idcliente, idforma_pago, idalmacen, refalbaran) VALUES (5, '02/01/2005', NULL, 3, 2, 1,'R5'); +INSERT INTO albaran (numalbaran, fechaalbaran, idtrabajador, idcliente, idforma_pago, idalmacen, refalbaran) VALUES (6, '03/01/2005', NULL, 4, 1, 1,'R6'); + + +INSERT INTO albaranp (numalbaranp, fechaalbaranp, idtrabajador, idproveedor, idforma_pago, idalmacen, refalbaranp) VALUES (1, '01/01/2005', NULL, 1, 1, 1,'RP1'); +INSERT INTO albaranp (numalbaranp, fechaalbaranp, idtrabajador, idproveedor, idforma_pago, idalmacen, refalbaranp) VALUES (2, '02/01/2005', NULL, 1, 2, 1,'RP2'); +INSERT INTO albaranp (numalbaranp, fechaalbaranp, idtrabajador, idproveedor, idforma_pago, idalmacen, refalbaranp) VALUES (3, '03/01/2005', NULL, 2, 3, 1,'RP3'); +INSERT INTO albaranp (numalbaranp, fechaalbaranp, idtrabajador, idproveedor, idforma_pago, idalmacen, refalbaranp) VALUES (4, '01/01/2005', NULL, 2, 4, 1,'RP4'); +INSERT INTO albaranp (numalbaranp, fechaalbaranp, idtrabajador, idproveedor, idforma_pago, idalmacen, refalbaranp) VALUES (5, '02/01/2005', NULL, 3, 2, 1,'RP5'); +INSERT INTO albaranp (numalbaranp, fechaalbaranp, idtrabajador, idproveedor, idforma_pago, idalmacen, refalbaranp) VALUES (6, '03/01/2005', NULL, 4, 1, 1,'RP6'); --- bulmages-0.9.1.orig/debian/cargaemp.1 +++ bulmages-0.9.1/debian/cargaemp.1 @@ -0,0 +1,16 @@ +.TH cargaemp 1 User Manuals +.SH NAME +cargaemp \- loads a enterprise for bulmacont accounting program +.SH SYNOPSIS +\fBcargaemp +\f1 +.SH DESCRIPTION +cargaemp is used to load one enterprise for bulmacont, a accounting program for small amd midle bussines. +.SH AUTHOR +cargaemp was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/bulmafact-server-install.1 +++ bulmages-0.9.1/debian/bulmafact-server-install.1 @@ -0,0 +1,16 @@ +.TH bulmafact-server-install 1 User Manuals +.SH NAME +bulmafact-server-install \- creates a enterprise database and users for bulmafact-server +.SH SYNOPSIS +\fBbulmafact-server-install +\f1 +.SH DESCRIPTION +bulmafact-server-install is used to create one database for bulmafact-server, and adds users to access it. +.SH AUTHOR +bulmafact-server-install was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/bulmafact.1 +++ bulmages-0.9.1/debian/bulmafact.1 @@ -0,0 +1,25 @@ +.TH bulmafact 1 User Manuals +.SH NAME +bulmafact \- billing program +.SH SYNOPSIS +\fBbulmafact \fI[ database | user | password ]\fB +\f1 +.SH DESCRIPTION +bulmafact is billing program for small amd midle bussines. +.TP +\fBdatabase \f1 +the database to connect. We recoment to install the example database suplied with the scrip bulmafact-server-install in the debian package, it will also grant access to users. +.TP +\fBuser \f1 +the user for the access to the database. +.TP +\fBpassword \f1 +the user password for the access to the database. +.SH AUTHOR +bulmafact was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/bulmages.1 +++ bulmages-0.9.1/debian/bulmages.1 @@ -0,0 +1,25 @@ +.TH bulmages 1 User Manuals +.SH NAME +bulmages \- accounting and billing program +.SH SYNOPSIS +\fBbulmages \fI[ database | user | password ]\fB +\f1 +.SH DESCRIPTION +bulmages is a accounting and billing program for small amd midle bussines. +.TP +\fBdatabase \f1 +the database to connect. +.TP +\fBuser \f1 +the user for the access to the database. +.TP +\fBpassword \f1 +the user password for the access to the database. +.SH AUTHOR +bulmages was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/patches/series +++ bulmages-0.9.1/debian/patches/series @@ -0,0 +1 @@ +01_bgtrml2pdf.patch -p1 --- bulmages-0.9.1.orig/debian/patches/01_bgtrml2pdf.patch +++ bulmages-0.9.1/debian/patches/01_bgtrml2pdf.patch @@ -0,0 +1,44 @@ +diff -urN q/bulmages/installbulmages/bgtrml2pdf/bg__init__.py bulmages-0.9.1/bulmages/installbulmages/bgtrml2pdf/bg__init__.py +--- q/bulmages/installbulmages/bgtrml2pdf/bg__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ bulmages-0.9.1/bulmages/installbulmages/bgtrml2pdf/bg__init__.py 2007-03-03 17:20:03.000000000 +0100 +@@ -0,0 +1,18 @@ ++# trml2pdf - An RML to PDF converter ++# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA ++# ++# This library 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 2.1 of the License, or (at your option) any later version. ++# ++# This library 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 library; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++from bgtrml2pdf import parseString +diff -urN q/bulmages/installbulmages/bgtrml2pdf/__init__.py bulmages-0.9.1/bulmages/installbulmages/bgtrml2pdf/__init__.py +--- q/bulmages/installbulmages/bgtrml2pdf/__init__.py 2007-02-20 00:32:19.000000000 +0100 ++++ bulmages-0.9.1/bulmages/installbulmages/bgtrml2pdf/__init__.py 1970-01-01 01:00:00.000000000 +0100 +@@ -1,18 +0,0 @@ +-# trml2pdf - An RML to PDF converter +-# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA +-# +-# This library 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 2.1 of the License, or (at your option) any later version. +-# +-# This library 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 library; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- +-from trml2pdf import parseString --- bulmages-0.9.1.orig/debian/bulmacont.1 +++ bulmages-0.9.1/debian/bulmacont.1 @@ -0,0 +1,25 @@ +.TH bulmacont 1 User Manuals +.SH NAME +bulmacont \- accounting program +.SH SYNOPSIS +\fBbulmacont \fI[ database | user | password ]\fB +\f1 +.SH DESCRIPTION +bulmacont is accounting program for small amd midle bussines. +.TP +\fBdatabase \f1 +the database to connect. We recoment to install the example database suplied with the scrip bulmacont-server-install in the debian package, it will also grant access to users. +.TP +\fBuser \f1 +the user for the access to the database. +.TP +\fBpassword \f1 +the user password for the access to the database. +.SH AUTHOR +bulmacont was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/bulmacont-server-install.1 +++ bulmages-0.9.1/debian/bulmacont-server-install.1 @@ -0,0 +1,16 @@ +.TH bulmacont-server-install 1 User Manuals +.SH NAME +bulmacont-server-install \- creates a enterprise database and users for bulmacont-server +.SH SYNOPSIS +\fBbulmacont-server-install +\f1 +.SH DESCRIPTION +bulmacont-server-install is used to create one database for bulmafact-server, and adds users to access it. +.SH AUTHOR +bulmacont-server-install was written by the IGLUES team +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/debian/control +++ bulmages-0.9.1/debian/control @@ -0,0 +1,111 @@ +Source: bulmages +Section: kde +Priority: optional +Maintainer: René Mérou +Build-Depends: debhelper (>= 5.0.37.2), qt4-dev-tools(>= 4.1.4), libqt4-qt3support(>= 4.1.4), libqt4-dev, python, python-support (>= 0.3), libmysqlclient15-dev, libsqlite0-dev, quilt +Standards-Version: 3.7.2 + +Package: bulmages +Architecture: any +Depends: ${shlibs:Depends}, bulmages-common (>= 0.5.9), bulmages-admin (>=0.5.9), bulmacont (>= 0.5.9), bulmages-docs (>= 0.5.9), bulmafact (>= 0.5.9), bulmages-servers (>= 0.5.9) +Description: Accounting and invoicing programs for Spanish little businesses + This package provides the entire Bulmages financial suite for Spanish + businesses. Bulmages includes an accounting program (bulmacont), an invoicing + program (bulmafact), administration programs, and documentation. + . + This program is made in an open community, you are welcome to join us. + . + Homepage: http://www.iglues.org + +Package: bulmages-admin +Architecture: any +Depends: ${shlibs:Depends}, postgresql-client (>= 8.1.0), bulmages-common (>= 0.5.9) +Description: Small GUI to launch some management programs for little businesses + This package helps to start BulmaCont, and when available BulmaFact and + BulmaTPV. + . + This package gives a GUI to manage the creation of new databases for new + enterprises. + . + This program is made in an open community, you are welcome to join us. + . + Homepage: http://www.iglues.org + +Package: bulmages-common +Architecture: all +Depends: ${shlibs:Depends}, python2.4-imaging, kpdf, python +Description: Bulmages invoicing and accounting, config and common stuff + The config file bulmages.conf for all the bulmages programs. + +Package: bulmages-docs +Section: doc +Architecture: all +Depends: ${shlibs:Depends} +Description: Bulmages invoicing and accounting documentation files + Documentation files for bulmages invoicing and accounting programs. + . + This documentation is made in an open community, you are welcome to join us. + . + Homepage: http://www.iglues.org + +Package: bulmacont +Architecture: any +Depends: ${shlibs:Depends},python-reportlab, python, postgresql-client (>= 8.1.0), bulmages-admin (>= 0.5.9), bulmages-common (>= 0.5.9) +Recommends: bulmages-servers +Description: Spanish accounting program + This package helps with the accounting task for small or medium sized + businesses with statistics and the usual procedures. + . + This program is made in an open community, you are welcome to join us. + . + Homepage: http://www.iglues.org + +Package: bulmafact +Architecture: any +Depends: ${shlibs:Depends},python-reportlab, python, postgresql-client (>= 8.1.0), bulmages-admin (>= 0.5.9), bulmages-common (>= 0.5.9) +Recommends: bulmages-servers +Description: Spanish invoicing program + This package helps to manage the invoicing of small or medium sized businesses + in Spain. + . + This program is made in an open community, you are welcome to join us. + . + Homepage: http://www.iglues.org + +Package: bulmages-servers +Architecture: all +Depends: ${shlibs:Depends}, postgresql-client (>= 8.1.0), bulmages-common (>= 0.5.9), postgresql (>= 8.1.0) +Conflicts: bulmacont-server (<= 0.5.9+svn20061021-2), bulmafact-server (<= 0.5.9+svn20061021-2) +Description: Spanish accounting program server + This package helps with the accounting tasks for small or medium sized + businesses with statistics and the usual procedures. + . + This package includes the database server initialization scripts. + . + This program is made in an open community, you are welcome to join us. + . + Homepage: http://www.iglues.org + +Package: libbulmalib1-dev +Provides: libbulmalib-1-dev +Conflicts: libbulmalib-1-dev,libbulmalib +Section: libdevel +Architecture: any +Depends: libbulmalib1, ${shlibs:Depends} +Description: bulmages headers for development + Bulmages is invoicing and accounting for small businesses. + . + In this package you can find all files needed for a developer + environment (Headers, plus shared library). + +Package: libbulmalib1 +Provides: libbulmalib-1 +Conflicts: libbulmalib-1,libbulmalib +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: bulmages headers (runtime) + Bulmages is invoicing and accounting for small businesses. + . + In this package you can find the shared library, necessary for + execution environments. --- bulmages-0.9.1.orig/debian/creabulmafact.1 +++ bulmages-0.9.1/debian/creabulmafact.1 @@ -0,0 +1,12 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. +.TH "CREABULMAFACT" "1" "May 2007" "H" "User Commands" +.SH "NAME" +creabulmafact \- create new bulmafact database for a company +.SH "DESCRIPTION" +creabulmafact [\-\-texto | \-\-dialog] nombre [0 | 1 | 2] nomempresa +.IP +option 0: Void database, (Try this if you have doubt) +.IP +option 2: Test sample for bulmafact. Sample database. +.SH "SEE ALSO" +.B creabulmacont (1) --- bulmages-0.9.1.orig/debian/bulmafact.menu +++ bulmages-0.9.1/debian/bulmafact.menu @@ -0,0 +1,4 @@ +?package(bulmafact):needs="X11" section="Apps/Tools"\ + longtitle="BulmaFact: billing aplication"\ + title="BulmaFact" command="/usr/bin/bulmafact"\ + icon="/usr/share/bulmages/icons/iconbulmafact.xpm" --- bulmages-0.9.1.orig/debian/pycompat +++ bulmages-0.9.1/debian/pycompat @@ -0,0 +1 @@ +2 --- bulmages-0.9.1.orig/debian/bgtrml2pdf.1 +++ bulmages-0.9.1/debian/bgtrml2pdf.1 @@ -0,0 +1,16 @@ +.TH bgtrml2pdf 1 User Manuals +.SH NAME +bgtrml2pdf \- rml to pdf traslator +.SH SYNOPSIS +\fBbgtrml2pdf \fIfile.rml\fB +\f1 +.SH DESCRIPTION +bgtrml2pdf returns one pdf in echange of one rml file . +.SH AUTHOR +bgtrml2pdf was written by the IGLUES team using code from trml2pdf +.SH REPORTING BUGS +Report bugs to +.SH COPYRIGHT +Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO war- ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH COMMENTS +This man page was written using \fBxmltoman(1)\f1. --- bulmages-0.9.1.orig/bulmages/installbulmages/bgtrml2pdf/bgtrml2pdf +++ bulmages-0.9.1/bulmages/installbulmages/bgtrml2pdf/bgtrml2pdf @@ -24,6 +24,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + import sys import StringIO import xml.dom.minidom --- bulmages-0.9.1.orig/bulmages/installbulmages/deinstallbulmages +++ bulmages-0.9.1/bulmages/installbulmages/deinstallbulmages @@ -2,10 +2,12 @@ ############################################################################### # Script de desinstalacion de BulmaGes # (C) Tomeu Borras, y Rene Merou -# Este documento es GPL +# Este documento esta bajo licencia GPL #------------------------------------------------------------------------------ ############################################################################### -version="v0.9.1" +version="v"`cat version` +direj=$(pwd) + #Buscamos el parametro para saber si es texto o no @@ -21,9 +23,9 @@ if [ ! -e /usr/bin/dialog -a ! -e /usr/bin/xdialog -o $texto = 1 ]; then echo -e "$2" "$1" "$3" elif [ -e /usr/bin/xdialog ]; then - xdialog --title "Instalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --msgbox "$1" 10 60 + xdialog --title "Desinstalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --msgbox "$1" 10 60 else - dialog --title "Instalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --msgbox "$1" 10 60 + dialog --title "Desinstalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --msgbox "$1" 10 60 fi } @@ -31,9 +33,9 @@ if [ ! -e /usr/bin/dialog -a ! -e /usr/bin/xdialog -o $texto = 1 ]; then echo -e "$2" "$1" "$3" elif [ -e /usr/bin/xdialog ]; then - xdialog --title "Instalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --infobox "$1" 10 60 + xdialog --title "Desinstalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --infobox "$1" 10 60 else - dialog --title "Instalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --infobox "$1" 10 60 + dialog --title "Desinstalacion de BulmaGes $version" --backtitle "Asociacion Iglues" --infobox "$1" 10 60 fi } @@ -52,24 +54,22 @@ rm -f /etc/bulmages/bulmages-server.conf rm -rf /usr/share/bulmages rm -rf /usr/bin/bulmages -rm -rf /usr/bin/cargaemp -rm -rf /usr/bin/guardaemp -rm -rf /usr/bin/nuevaemp rm -rf /usr/bin/bulmafact rm -rf /usr/bin/bulmacont rm -rf /usr/bin/bulmatpv +rm -rf /usr/bin/bgtrml2pdf rm -rf /usr/lib/bulmages info "Eliminando bases de datos del programa" tiempo -LANG_PSQL=`su postgres -c "psql -l" | grep bulmages` +LANG_PSQL=`su postgres -c "psql -l" | grep bulmacont` if [ "$LANG_PSQL" != "" ]; then - info "Eliminando base de datos bulmages" - su postgres -c "dropdb bulmages" > /dev/null 2> /dev/null + info "Eliminando base de datos bulmacont" + su postgres -c "dropdb bulmacont" > /dev/null 2> /dev/null else - info "La base de datos bulmages no existe en el sistema" + info "La base de datos bulmacont no existe en el sistema" fi tiempo --- bulmages-0.9.1.orig/bulmages/installbulmages/installbulmages-client +++ bulmages-0.9.1/bulmages/installbulmages/installbulmages-client @@ -141,9 +141,6 @@ info "Instalando ejecutable del programa y scripts auxiliares. \n" tiempo cp bulmages /usr/bin -cp cargaemp /usr/bin -cp guardaemp /usr/bin -cp nuevaemp /usr/bin cp bulmafact /usr/bin cp bulmacont /usr/bin --- bulmages-0.9.1.orig/bulmages/installbulmages/canuales/perdigan.xml +++ bulmages-0.9.1/bulmages/installbulmages/canuales/perdigan.xml @@ -1,23 +1,32 @@ - Perdidas y Ganancias Abreviado + Perdidas y Ganancias Debe A - A) GASTOS
italica
+ A) GASTOS 1 - A1POSITIVO - A2NEGATIVO - A3MAYORCERO - A4MENORCERO - A5RESTAR + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10 + A11 + A12 + A13 + A14 + A15
- A1 - 1. Consumo de explotacion + 1. Consumo de explotación 2 60 @@ -25,7 +34,6 @@ 71 - A2 2. Gastos de personal @@ -35,7 +43,6 @@ A2b - A2a a) Sueldos, salarios y asimilados @@ -45,10 +52,9 @@ 641 - A2b - a) Cargas sociales + b) Cargas sociales 3 642 @@ -56,7 +62,6 @@ 649 - A3 3. Dotaciones para amortizaciones de inmovilizados @@ -65,11 +70,9 @@ 68 - A4 - 4. Variaciones de las provisiones de tráfico - y pérdidas de cŕeditos incobrables + 4. Variaciones de las provisiones de tráfico y pérdidas de créditos incobrables 2 650 @@ -81,7 +84,6 @@ 795 - A5 5. Otros gastos de explotacion @@ -97,12 +99,11 @@ 690 - AI I) BENEFICIOS DE EXPLOTACION (B1 - A1 - A2 - A3 -A4 -A5) 1 - + B1 A1RESTAR A2RESTAR @@ -110,8 +111,8 @@ A4RESTAR A5RESTAR + MAYORCERO - A6 6. Gastos financieros y gastos asimilados @@ -123,7 +124,6 @@ A6d - A6a a) Por deudas con empresas del grupo @@ -137,7 +137,6 @@ 6650 - A6b b) Por deudas con empresas asociadas @@ -151,7 +150,6 @@ 6651 - A6c c) Por otras deudas @@ -163,22 +161,20 @@ 6623 6632 6633 - 6643 + 664 6653 669 - A6d - d) Pérdidas de inversiones financieras + d) Pérdidas de inversiones financieras 3 666 667 - A7 7. Variaciones de las provisiones de inversiones financieras @@ -198,7 +194,6 @@ 799 - A8 8. Diferencias negativas de cambio @@ -207,20 +202,19 @@ 668 - AII II) RESULTADOS FINANCIEROS POSITIVOS (B2 + B3 - A6 - A7 -A8) 1 - + B2 B3 A6RESTAR A7RESTAR A8RESTAR + MAYORCERO - AIII III) BENEFICIOS DE LAS ACTIVIDADES ORDINARIAS (AI + AII - BI - BII) @@ -231,12 +225,11 @@ BIRESTAR BIIRESTAR + MAYORCERO - A9 - 9. Variación de las provisiones de inmovilizado, - material y cartera de control + 9. Variación de las provisiones de inmovilizado inmaterial, material y cartera de control 2 691 @@ -249,11 +242,9 @@ 7961 - A10 - 10. Pérdidas procedentes del inmovilizado, - inmaterial, material y cartera de control + 10. Pérdidas procedentes del inmovilizado inmaterial, material y cartera de control 2 670 @@ -262,16 +253,14 @@ 673 - A11 - 11. Pérdidas por operaciones con acciones y obligaciones propias + 11. Pérdidas por operaciones con acciones y obligaciones propias 2 674 - A12 12. Gastos extraordinarios @@ -280,16 +269,14 @@ 678 - A13 - 13. Gastos y pérdidas de otros ejercicios + 13. Gastos y pérdidas de otros ejercicios 2 679 - - + AIV IV) RESULTADOS EXTRAORDINARIOS POSITIVOS (B4 + B5 + B6 + B7 + B8 - A9 - A10 - A11 - A12 - A13) @@ -306,23 +293,23 @@ A12RESTAR A13RESTAR - - + MAYORCERO + AV V) BENEFICIOS ANTES DE IMPUESTOS (AIII + AIV - BIII - BIV) 1 - + AIII AIV BIIIRESTAR BIVRESTAR - - + MAYORCERO + A14 - 10. Impuestos sobre sociedades + 14. Impuestos sobre sociedades 2 630 @@ -330,16 +317,13 @@ 638 - A15 - 10. Otros impuestos + 15. Otros impuestos 2 - 679 - AVI VI) RESULTADOS DEL EJERCICIO (BENEFICIOS AV - A14 - A15) @@ -349,65 +333,70 @@ A14RESTAR A15RESTAR - - + MAYORCERO +
- + Haber B B) INGRESOS 1 - + + B1 + B2 + B3 + B4 + B5 + B6 + B7 + B8 - B1 - 1. Importe de explotacion + 1. Importe de explotación 2 B1a B1b - B1a a) Importe neto de la cifra de negocio 3 - 70 + 70POSITIVO - B1b b) Otros ingresos de explotacion 3 - 73 - 74 - 75 - 790 + 71POSITIVO + 73POSITIVO + 74POSITIVO + 75POSITIVO + 790POSITIVO - BI I) PERDIDAS DE EXPLOTACION (A1 + A2 + A3 + A4 + A5 - B1) 1 - - A1 - A2 - A3 - A4 - A5 - B1RESTAR + + A1 + A2 + A3 + A4 + A5 + B1RESTAR + MAYORCERO - B2 2. Ingresos financieros @@ -419,61 +408,59 @@ B2d - B2a a) En empresas del grupo 3 - 7600 7610 7620 7630 7650 + 7600POSITIVO + 7610POSITIVO + 7620POSITIVO + 7630POSITIVO + 7650POSITIVO - - + B2b b) En empresas asociadas 3 - 7601 - 7611 - 7621 - 7631 - 7651 + 7601POSITIVO + 7611POSITIVO + 7621POSITIVO + 7631POSITIVO + 7651POSITIVO - - + B2c c) Otros 3 - 7603 - 7613 - 7623 - 7633 - 7653 - 769 + 7603POSITIVO + 7613POSITIVO + 7623POSITIVO + 7633POSITIVO + 7653POSITIVO + 769POSITIVO - - + B2d d) Beneficios en inversiones financieras 3 - 766 + 766POSITIVO - - + B3 3. Diferencias positivas de cambio 2 - 768 + 768POSITIVO - - + BII II) RESULTADOS FINANCIEROS (NEGATIVOS) (A6 + A7 + A8 -B2 -B3) @@ -485,70 +472,63 @@ B2RESTAR B3RESTAR - - + MAYORCERO + BIII - III) PERDIDAS DE LAS ACTIVIDADES ORDINARIAS (BI + BII + AI - AII) + III) PERDIDAS DE LAS ACTIVIDADES ORDINARIAS (BI + BII - AI - AII) 1 BI BII - AI + AIRESTAR AIIRESTAR - - + MAYORCERO + B4 - 4. Beneficios en enajenación de inmovilizado - inmaterial, material y cartera de control + 4. Beneficios en enajenación de inmovilizado inmaterial y cartera de control 2 - 770 - 771 - 772 - 773 + 770POSITIVO + 771POSITIVO + 772POSITIVO + 773POSITIVO - - + B5 5. Beneficios por operaciones con acciones y obligaciones propias 2 - 774 + 774POSITIVO - - + B6 - 6. Subvenciones de capital transferidas al resultado - del ejercicio + 6. Subvenciones de capital transferidas al resultado del ejercicio 2 - 775 + 775POSITIVO - - + B7 7. Ingresos extraordinarios 2 - 778 + 778POSITIVO - B8 8. Ingresos y beneficios de otros ejercicios 2 - 779 + 779POSITIVO - BIV IV) RESULTADOS EXTRAORDINARIOS NEGATIVOS (A9 + A10 + A11 + A12 + A13 - B4 - B5 - B6 - B7 - B8) @@ -565,20 +545,20 @@ B7RESTAR B8RESTAR + MAYORCERO - BV - V) PERDIDAS ANTES DE IMPUESTOS (BIII + BIV + AIII - AIV) + V) PERDIDAS ANTES DE IMPUESTOS (BIII + BIV - AIII - AIV) 1 BIII BIV - AIII + AIIIRESTAR AIVRESTAR - - + MAYORCERO + BVI VI) RESULTADO DEL EJERCICIO (PERDIDAS) (BV + A14 + A15) @@ -588,6 +568,7 @@ A14 A15 + MAYORCERO
\ No newline at end of file --- bulmages-0.9.1.orig/bulmages/installbulmages/installbulmages-server +++ bulmages-0.9.1/bulmages/installbulmages/installbulmages-server @@ -180,7 +180,7 @@ # Tratamos el archivo de configuracion. info "Instalando la nueva version del archivo de configuracion. \n" touch /etc/bulmages/bulmages-server.conf - # Dejamos que la insercionœ del usuario la haga una funcionœ y asi encapsulamos un poco. + # Dejamos que la insercionœ del usuario la haga una funcionœ y asi encapsulamos un poco. lee fi @@ -190,3 +190,4 @@ fi mensaje "INSTALACION FINALIZADA CON EXITO" "\033[32m" "\033[0m" +mensaje "Puede que el programa arranque pero no le deje acceder a la informacion. En ese caso debe revisar la configuracion de postgres o rear un usuario para el acceso a las bases de datos." \ No newline at end of file --- bulmages-0.9.1.orig/bulmages/installbulmages/openreports/listado_normal.rml +++ bulmages-0.9.1/bulmages/installbulmages/openreports/listado_normal.rml @@ -1,7 +1,7 @@ - + -