File: pgsql

package info (click to toggle)
bulmages 0.11.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 59,620 kB
  • ctags: 8,483
  • sloc: cpp: 91,952; xml: 73,198; sql: 51,289; python: 3,476; sh: 972; php: 370; ansic: 117; makefile: 86
file content (3124 lines) | stat: -rw-r--r-- 405,358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
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);