From bfe58a603ffa5f6756f99a8aee2fcf7145ff411e Mon Sep 17 00:00:00 2001 From: sparkyx Date: Fri, 2 Nov 2007 15:08:22 +0000 Subject: [PATCH] Last changes before 3.0 --- html/admin/setup.php | 2 +- html/admin/sql/dossier1/comment.sql | 36 - html/admin/sql/dossier1/constraint.sql | 112 -- html/admin/sql/dossier1/data.sql | 1932 ------------------------ html/admin/sql/dossier1/function.sql | 582 ------- html/admin/sql/dossier1/index.sql | 24 - html/admin/sql/dossier1/make-sql | 21 - html/admin/sql/dossier1/schema.sql | 1195 --------------- html/admin/sql/dossier1/sequence.sql | 232 --- html/admin/sql/dossier1/table.sql | 280 ---- html/admin/sql/dossier1/view.sql | 12 - html/admin/sql/mod1/data.sql | 11 +- html/admin/sql/mod1/function.sql | 24 +- html/admin/sql/mod1/schema.sql | 30 +- html/admin/sql/mod2/data.sql | 3 +- html/admin/sql/mod2/function.sql | 582 ------- include/constant.php | 3 +- sql/upgrade.sql | 29 + 18 files changed, 74 insertions(+), 5036 deletions(-) delete mode 100644 html/admin/sql/dossier1/comment.sql delete mode 100644 html/admin/sql/dossier1/constraint.sql delete mode 100644 html/admin/sql/dossier1/data.sql delete mode 100644 html/admin/sql/dossier1/function.sql delete mode 100644 html/admin/sql/dossier1/index.sql delete mode 100755 html/admin/sql/dossier1/make-sql delete mode 100644 html/admin/sql/dossier1/schema.sql delete mode 100644 html/admin/sql/dossier1/sequence.sql delete mode 100644 html/admin/sql/dossier1/table.sql delete mode 100644 html/admin/sql/dossier1/view.sql delete mode 100644 html/admin/sql/mod2/function.sql diff --git a/html/admin/setup.php b/html/admin/setup.php index 1f141a171..75185fd69 100644 --- a/html/admin/setup.php +++ b/html/admin/setup.php @@ -165,7 +165,7 @@ function ExecuteScript($p_cn,$script) { */ function apply_patch($p_cn,$p_name) { - $MaxVersion=33; + $MaxVersion=34; for ( $i = 4;$i <= $MaxVersion;$i++) { $to=$i+1; diff --git a/html/admin/sql/dossier1/comment.sql b/html/admin/sql/dossier1/comment.sql deleted file mode 100644 index e48a04b72..000000000 --- a/html/admin/sql/dossier1/comment.sql +++ /dev/null @@ -1,36 +0,0 @@ -COMMENT ON SCHEMA public IS 'Standard public schema'; -COMMENT ON FUNCTION correct_sequence(p_sequence text, p_col text, p_table text) IS ' Often the primary key is a sequence number and sometimes the value of the sequence is not synchronized with the primary key ( p_sequence : sequence name, p_col : col of the pk,p_table : concerned table'; -COMMENT ON TABLE "action" IS 'The different privileges'; -COMMENT ON TABLE action_gestion IS 'Action for Managing'; -COMMENT ON TABLE attr_def IS 'The available attributs for the cards'; -COMMENT ON TABLE attr_min IS 'The value of attributs for the cards'; -COMMENT ON TABLE centralized IS 'The centralized journal'; -COMMENT ON TABLE document IS 'This table contains all the documents : summary and lob files'; -COMMENT ON TABLE document_modele IS ' contains all the template for the documents'; -COMMENT ON SEQUENCE document_seq IS 'Sequence for the sequence bound to the document modele'; -COMMENT ON TABLE document_state IS 'State of the document'; -COMMENT ON TABLE document_type IS 'Type of document : meeting, invoice,...'; -COMMENT ON TABLE fiche IS 'Cards'; -COMMENT ON TABLE fiche_def IS 'Cards definition'; -COMMENT ON TABLE fiche_def_ref IS 'Family Cards definition'; -COMMENT ON TABLE form IS 'Forms content'; -COMMENT ON TABLE jnt_fic_att_value IS 'join between the card and the attribut definition'; -COMMENT ON TABLE jnt_fic_attr IS 'join between the family card and the attribut definition'; -COMMENT ON TABLE jrn IS 'Journal: content one line for a group of accountancy writing'; -COMMENT ON TABLE jrn_action IS 'Possible action when we are in journal (menu)'; -COMMENT ON TABLE jrn_def IS 'Definition of a journal, his properties'; -COMMENT ON TABLE jrn_rapt IS 'Rapprochement between operation'; -COMMENT ON TABLE jrn_type IS 'Type of journal (Sell, Buy, Financial...)'; -COMMENT ON TABLE jrnx IS 'Journal: content one line for each accountancy writing'; -COMMENT ON TABLE parm_money IS 'Currency conversion'; -COMMENT ON TABLE parm_periode IS 'Periode definition'; -COMMENT ON TABLE quant_sold IS 'Contains about invoice for customer'; -COMMENT ON TABLE stock_goods IS 'About the goods'; -COMMENT ON TABLE tmp_pcmn IS 'Plan comptable minimum normalisé'; -COMMENT ON TABLE tva_rate IS 'Rate of vat'; -COMMENT ON TABLE user_local_pref IS 'The user''s local parameter '; -COMMENT ON COLUMN user_local_pref.user_id IS 'user''s login '; -COMMENT ON COLUMN user_local_pref.parameter_type IS 'the type of parameter '; -COMMENT ON COLUMN user_local_pref.parameter_value IS 'the value of parameter '; -COMMENT ON VIEW vw_fiche_def IS 'all the attributs for card family'; -COMMENT ON VIEW vw_fiche_min IS 'minimum attribut for reference card'; diff --git a/html/admin/sql/dossier1/constraint.sql b/html/admin/sql/dossier1/constraint.sql deleted file mode 100644 index b62b49467..000000000 --- a/html/admin/sql/dossier1/constraint.sql +++ /dev/null @@ -1,112 +0,0 @@ - SET client_encoding = 'LATIN1'; - SET check_function_bodies = false; - SET client_min_messages = warning; -SET search_path = public, pg_catalog; -ALTER TABLE ONLY action_gestion - ADD CONSTRAINT action_gestion_pkey PRIMARY KEY (ag_id); -ALTER TABLE ONLY "action" - ADD CONSTRAINT action_pkey PRIMARY KEY (ac_id); -ALTER TABLE ONLY attr_def - ADD CONSTRAINT attr_def_pkey PRIMARY KEY (ad_id); -ALTER TABLE ONLY centralized - ADD CONSTRAINT centralized_pkey PRIMARY KEY (c_id); -ALTER TABLE ONLY document_modele - ADD CONSTRAINT document_modele_pkey PRIMARY KEY (md_id); -ALTER TABLE ONLY document - ADD CONSTRAINT document_pkey PRIMARY KEY (d_id); -ALTER TABLE ONLY document_state - ADD CONSTRAINT document_state_pkey PRIMARY KEY (s_id); -ALTER TABLE ONLY document_type - ADD CONSTRAINT document_type_pkey PRIMARY KEY (dt_id); -ALTER TABLE ONLY fiche_def - ADD CONSTRAINT fiche_def_pkey PRIMARY KEY (fd_id); -ALTER TABLE ONLY fiche_def_ref - ADD CONSTRAINT fiche_def_ref_pkey PRIMARY KEY (frd_id); -ALTER TABLE ONLY fiche - ADD CONSTRAINT fiche_pkey PRIMARY KEY (f_id); -ALTER TABLE ONLY form - ADD CONSTRAINT form_pkey PRIMARY KEY (fo_id); -ALTER TABLE ONLY format_csv_banque - ADD CONSTRAINT format_csv_banque_pkey PRIMARY KEY (name); -ALTER TABLE ONLY formdef - ADD CONSTRAINT formdef_pkey PRIMARY KEY (fr_id); -ALTER TABLE ONLY invoice - ADD CONSTRAINT invoice_pkey PRIMARY KEY (iv_id); -ALTER TABLE ONLY jnt_fic_att_value - ADD CONSTRAINT jnt_fic_att_value_pkey PRIMARY KEY (jft_id); -ALTER TABLE ONLY jrn_action - ADD CONSTRAINT jrn_action_pkey PRIMARY KEY (ja_id); -ALTER TABLE ONLY jrn_def - ADD CONSTRAINT jrn_def_jrn_def_name_key UNIQUE (jrn_def_name); -ALTER TABLE ONLY jrn_def - ADD CONSTRAINT jrn_def_pkey PRIMARY KEY (jrn_def_id); -ALTER TABLE ONLY jrn - ADD CONSTRAINT jrn_pkey PRIMARY KEY (jr_id, jr_def_id); -ALTER TABLE ONLY jrn_rapt - ADD CONSTRAINT jrn_rapt_pkey PRIMARY KEY (jra_id); -ALTER TABLE ONLY jrn_type - ADD CONSTRAINT jrn_type_pkey PRIMARY KEY (jrn_type_id); -ALTER TABLE ONLY jrnx - ADD CONSTRAINT jrnx_pkey PRIMARY KEY (j_id); -ALTER TABLE ONLY parameter - ADD CONSTRAINT parameter_pkey PRIMARY KEY (pr_id); -ALTER TABLE ONLY parm_code - ADD CONSTRAINT parm_code_pkey PRIMARY KEY (p_code); -ALTER TABLE ONLY parm_money - ADD CONSTRAINT parm_money_pkey PRIMARY KEY (pm_code); -ALTER TABLE ONLY parm_periode - ADD CONSTRAINT parm_periode_pkey PRIMARY KEY (p_id); -ALTER TABLE ONLY jnt_fic_attr - ADD CONSTRAINT pk_jnt_fic_attr PRIMARY KEY (jnt_id); -ALTER TABLE ONLY user_local_pref - ADD CONSTRAINT pk_user_local_pref PRIMARY KEY (user_id, parameter_type); -ALTER TABLE ONLY quant_sold - ADD CONSTRAINT qs_id_pk PRIMARY KEY (qs_id); -ALTER TABLE ONLY stock_goods - ADD CONSTRAINT stock_goods_pkey PRIMARY KEY (sg_id); -ALTER TABLE ONLY tmp_pcmn - ADD CONSTRAINT tmp_pcmn_pkey PRIMARY KEY (pcm_val); -ALTER TABLE ONLY user_sec_act - ADD CONSTRAINT user_sec_act_pkey PRIMARY KEY (ua_id); -ALTER TABLE ONLY user_sec_jrn - ADD CONSTRAINT user_sec_jrn_pkey PRIMARY KEY (uj_id); -ALTER TABLE ONLY jrn_def - ADD CONSTRAINT "$1" FOREIGN KEY (jrn_def_type) REFERENCES jrn_type(jrn_type_id); -ALTER TABLE ONLY form - ADD CONSTRAINT "$1" FOREIGN KEY (fo_fr_id) REFERENCES formdef(fr_id); -ALTER TABLE ONLY centralized - ADD CONSTRAINT "$1" FOREIGN KEY (c_jrn_def) REFERENCES jrn_def(jrn_def_id); -ALTER TABLE ONLY user_sec_jrn - ADD CONSTRAINT "$1" FOREIGN KEY (uj_jrn_id) REFERENCES jrn_def(jrn_def_id); -ALTER TABLE ONLY user_sec_act - ADD CONSTRAINT "$1" FOREIGN KEY (ua_act_id) REFERENCES "action"(ac_id); -ALTER TABLE ONLY jrn_action - ADD CONSTRAINT "$1" FOREIGN KEY (ja_jrn_type) REFERENCES jrn_type(jrn_type_id); -ALTER TABLE ONLY fiche_def - ADD CONSTRAINT "$1" FOREIGN KEY (frd_id) REFERENCES fiche_def_ref(frd_id); -ALTER TABLE ONLY fiche - ADD CONSTRAINT "$1" FOREIGN KEY (fd_id) REFERENCES fiche_def(fd_id); -ALTER TABLE ONLY jnt_fic_att_value - ADD CONSTRAINT "$1" FOREIGN KEY (f_id) REFERENCES fiche(f_id); -ALTER TABLE ONLY attr_value - ADD CONSTRAINT "$1" FOREIGN KEY (jft_id) REFERENCES jnt_fic_att_value(jft_id); -ALTER TABLE ONLY jnt_fic_attr - ADD CONSTRAINT "$1" FOREIGN KEY (fd_id) REFERENCES fiche_def(fd_id); -ALTER TABLE ONLY jrn - ADD CONSTRAINT "$1" FOREIGN KEY (jr_def_id) REFERENCES jrn_def(jrn_def_id); -ALTER TABLE ONLY attr_min - ADD CONSTRAINT "$1" FOREIGN KEY (frd_id) REFERENCES fiche_def_ref(frd_id); -ALTER TABLE ONLY jrnx - ADD CONSTRAINT "$1" FOREIGN KEY (j_poste) REFERENCES tmp_pcmn(pcm_val); -ALTER TABLE ONLY jrnx - ADD CONSTRAINT "$2" FOREIGN KEY (j_jrn_def) REFERENCES jrn_def(jrn_def_id); -ALTER TABLE ONLY jnt_fic_att_value - ADD CONSTRAINT "$2" FOREIGN KEY (ad_id) REFERENCES attr_def(ad_id); -ALTER TABLE ONLY jnt_fic_attr - ADD CONSTRAINT "$2" FOREIGN KEY (ad_id) REFERENCES attr_def(ad_id); -ALTER TABLE ONLY attr_min - ADD CONSTRAINT "$2" FOREIGN KEY (ad_id) REFERENCES attr_def(ad_id); -ALTER TABLE ONLY centralized - ADD CONSTRAINT "$2" FOREIGN KEY (c_poste) REFERENCES tmp_pcmn(pcm_val); -ALTER TABLE ONLY document_modele - ADD CONSTRAINT md_type FOREIGN KEY (md_type) REFERENCES document_type(dt_id); diff --git a/html/admin/sql/dossier1/data.sql b/html/admin/sql/dossier1/data.sql deleted file mode 100644 index c923ce3a4..000000000 --- a/html/admin/sql/dossier1/data.sql +++ /dev/null @@ -1,1932 +0,0 @@ --- --- PostgreSQL database dump --- - -SET client_encoding = 'LATIN1'; -SET check_function_bodies = false; -SET client_min_messages = warning; - -SET search_path = public, pg_catalog; - --- --- Name: action_gestion_ag_id_seq; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('action_gestion', 'ag_id'), 1, true); - - --- --- Name: document_d_id_seq; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('document', 'd_id'), 35, true); - - --- --- Name: document_modele_md_id_seq; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('document_modele', 'md_id'), 1, true); - - --- --- Name: document_seq; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('document_seq', 1, true); - - --- --- Name: document_state_s_id_seq; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('document_state', 's_id'), 3, true); - - --- --- Name: document_type_dt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('document_type', 'dt_id'), 10, false); - - --- --- Name: s_jnt_id; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jnt_id', 84, true); - - --- --- Name: s_attr_def; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_attr_def', 27, true); - - --- --- Name: s_cbc; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_cbc', 1, false); - - --- --- Name: s_central; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_central', 1, false); - - --- --- Name: s_central_order; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_central_order', 1, false); - - --- --- Name: s_centralized; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_centralized', 1, false); - - --- --- Name: s_currency; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_currency', 1, true); - - --- --- Name: s_fdef; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_fdef', 11, true); - - --- --- Name: s_fiche; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_fiche', 21, true); - - --- --- Name: s_fiche_def_ref; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_fiche_def_ref', 16, true); - - --- --- Name: s_form; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_form', 1, false); - - --- --- Name: s_formdef; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_formdef', 1, false); - - --- --- Name: s_grpt; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_grpt', 62, true); - - --- --- Name: s_idef; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_idef', 2, true); - - --- --- Name: s_internal; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_internal', 61, true); - - --- --- Name: s_invoice; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_invoice', 1, false); - - --- --- Name: s_jnt_fic_att_value; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jnt_fic_att_value', 413, true); - - --- --- Name: s_jrn; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn', 200, true); - - --- --- Name: s_jrn_1; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_1', 1, false); - - --- --- Name: s_jrn_2; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_2', 1, false); - - --- --- Name: s_jrn_3; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_3', 1, false); - - --- --- Name: s_jrn_4; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_4', 1, false); - - --- --- Name: s_jrn_def; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_def', 5, false); - - --- --- Name: s_jrn_op; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_op', 632, true); - - --- --- Name: s_jrn_rapt; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrn_rapt', 14, true); - - --- --- Name: s_jrnaction; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrnaction', 7, true); - - --- --- Name: s_jrnx; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_jrnx', 1, false); - - --- --- Name: s_periode; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_periode', 65, true); - - --- --- Name: s_quantity; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_quantity', 56, true); - - --- --- Name: s_stock_goods; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_stock_goods', 99, true); - - --- --- Name: s_user_act; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_user_act', 15, true); - - --- --- Name: s_user_jrn; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('s_user_jrn', 12, true); - - --- --- Name: seq_doc_type_1; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_1', 1, false); - - --- --- Name: seq_doc_type_2; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_2', 1, false); - - --- --- Name: seq_doc_type_3; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_3', 1, false); - - --- --- Name: seq_doc_type_4; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_4', 47, true); - - --- --- Name: seq_doc_type_5; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_5', 1, false); - - --- --- Name: seq_doc_type_6; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_6', 1, false); - - --- --- Name: seq_doc_type_7; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_7', 1, false); - - --- --- Name: seq_doc_type_8; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_8', 1, false); - - --- --- Name: seq_doc_type_9; Type: SEQUENCE SET; Schema: public; Owner: phpcompta --- - -SELECT pg_catalog.setval('seq_doc_type_9', 1, false); - - --- --- Data for Name: action; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO "action" (ac_id, ac_description) VALUES (1, 'Journaux'); -INSERT INTO "action" (ac_id, ac_description) VALUES (2, 'Facturation'); -INSERT INTO "action" (ac_id, ac_description) VALUES (4, 'Impression'); -INSERT INTO "action" (ac_id, ac_description) VALUES (5, 'Formulaire'); -INSERT INTO "action" (ac_id, ac_description) VALUES (6, 'Mise à jour Plan Comptable'); -INSERT INTO "action" (ac_id, ac_description) VALUES (7, 'Gestion Journaux'); -INSERT INTO "action" (ac_id, ac_description) VALUES (8, 'Paramètres'); -INSERT INTO "action" (ac_id, ac_description) VALUES (9, 'Sécurité'); -INSERT INTO "action" (ac_id, ac_description) VALUES (10, 'Centralise'); -INSERT INTO "action" (ac_id, ac_description) VALUES (3, 'Fiche Read'); -INSERT INTO "action" (ac_id, ac_description) VALUES (16, 'Voir le stock'); -INSERT INTO "action" (ac_id, ac_description) VALUES (17, 'Modifie le stock'); -INSERT INTO "action" (ac_id, ac_description) VALUES (15, 'Fiche ajout'); -INSERT INTO "action" (ac_id, ac_description) VALUES (18, 'Devise'); -INSERT INTO "action" (ac_id, ac_description) VALUES (19, 'Période'); -INSERT INTO "action" (ac_id, ac_description) VALUES (20, 'Voir la balance des comptes'); -INSERT INTO "action" (ac_id, ac_description) VALUES (21, 'Import et export des écritures d''ouverture'); -INSERT INTO "action" (ac_id, ac_description) VALUES (28, 'Module Suivi Document'); -INSERT INTO "action" (ac_id, ac_description) VALUES (22, 'Module Client'); -INSERT INTO "action" (ac_id, ac_description) VALUES (24, 'Module Fournisseur'); -INSERT INTO "action" (ac_id, ac_description) VALUES (26, 'Module Administration'); -INSERT INTO "action" (ac_id, ac_description) VALUES (30, 'Module Gestion'); - - --- --- Data for Name: action_gestion; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO action_gestion (ag_id, ag_type, f_id_dest, f_id_exp, ag_title, ag_timestamp, ag_cal, ag_ref_ag_id, ag_comment, ag_ref) VALUES (1, 1, 2, 0, 'Document Interne', '2007-04-14 00:00:00', 'C', 0, 'qsqsqsqsqsqsqsqsqs', '1/1'); - - --- --- Data for Name: attr_def; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO attr_def (ad_id, ad_text) VALUES (1, 'Nom'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (2, 'Taux TVA'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (3, 'Numéro de compte'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (4, 'Nom de la banque'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (5, 'Poste Comptable'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (6, 'Prix vente'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (7, 'Prix achat'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (8, 'Durée Amortissement'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (9, 'Description'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (10, 'Date début'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (11, 'Montant initial'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (12, 'Personne de contact '); -INSERT INTO attr_def (ad_id, ad_text) VALUES (13, 'numéro de tva '); -INSERT INTO attr_def (ad_id, ad_text) VALUES (14, 'Adresse '); -INSERT INTO attr_def (ad_id, ad_text) VALUES (16, 'pays '); -INSERT INTO attr_def (ad_id, ad_text) VALUES (17, 'téléphone '); -INSERT INTO attr_def (ad_id, ad_text) VALUES (18, 'email '); -INSERT INTO attr_def (ad_id, ad_text) VALUES (19, 'Gestion stock'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (20, 'Partie fiscalement non déductible'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (21, 'TVA non déductible'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (22, 'TVA non déductible récupérable par l''impôt'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (23, 'Quick Code'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (24, 'Ville'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (25, 'Société'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (26, 'Fax'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (27, 'GSM'); -INSERT INTO attr_def (ad_id, ad_text) VALUES (15, 'code postal'); - - --- --- Data for Name: attr_min; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 2); -INSERT INTO attr_min (frd_id, ad_id) VALUES (2, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (2, 2); -INSERT INTO attr_min (frd_id, ad_id) VALUES (3, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (3, 2); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 3); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 4); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 13); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 14); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 15); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 16); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 17); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 18); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 13); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 14); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 15); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 16); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 17); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 18); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 13); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 14); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 16); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 17); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 18); -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 6); -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 7); -INSERT INTO attr_min (frd_id, ad_id) VALUES (2, 6); -INSERT INTO attr_min (frd_id, ad_id) VALUES (2, 7); -INSERT INTO attr_min (frd_id, ad_id) VALUES (3, 7); -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 19); -INSERT INTO attr_min (frd_id, ad_id) VALUES (2, 19); -INSERT INTO attr_min (frd_id, ad_id) VALUES (14, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (5, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (5, 4); -INSERT INTO attr_min (frd_id, ad_id) VALUES (5, 10); -INSERT INTO attr_min (frd_id, ad_id) VALUES (5, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (6, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (6, 4); -INSERT INTO attr_min (frd_id, ad_id) VALUES (6, 10); -INSERT INTO attr_min (frd_id, ad_id) VALUES (6, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (10, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (10, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (11, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (11, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (12, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (12, 12); -INSERT INTO attr_min (frd_id, ad_id) VALUES (13, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (13, 9); -INSERT INTO attr_min (frd_id, ad_id) VALUES (7, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (7, 8); -INSERT INTO attr_min (frd_id, ad_id) VALUES (7, 9); -INSERT INTO attr_min (frd_id, ad_id) VALUES (7, 10); -INSERT INTO attr_min (frd_id, ad_id) VALUES (5, 11); -INSERT INTO attr_min (frd_id, ad_id) VALUES (6, 11); -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 15); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 15); -INSERT INTO attr_min (frd_id, ad_id) VALUES (15, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (15, 9); -INSERT INTO attr_min (frd_id, ad_id) VALUES (1, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (2, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (3, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (4, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (5, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (6, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (10, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (11, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (12, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (13, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (14, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (15, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (7, 23); -INSERT INTO attr_min (frd_id, ad_id) VALUES (9, 24); -INSERT INTO attr_min (frd_id, ad_id) VALUES (8, 24); -INSERT INTO attr_min (frd_id, ad_id) VALUES (14, 24); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 1); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 17); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 18); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 25); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 26); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 27); -INSERT INTO attr_min (frd_id, ad_id) VALUES (16, 23); - - --- --- Data for Name: attr_value; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO attr_value (jft_id, av_text) VALUES (12, '4000001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (13, 'Client 1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (14, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (15, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (16, 'Rue du Client 1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (17, '99999'); -INSERT INTO attr_value (jft_id, av_text) VALUES (18, 'Belgique'); -INSERT INTO attr_value (jft_id, av_text) VALUES (19, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (20, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (21, '4000002'); -INSERT INTO attr_value (jft_id, av_text) VALUES (22, 'Client 2'); -INSERT INTO attr_value (jft_id, av_text) VALUES (23, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (24, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (25, 'Rue du client 2'); -INSERT INTO attr_value (jft_id, av_text) VALUES (26, '108000'); -INSERT INTO attr_value (jft_id, av_text) VALUES (27, 'Belgique'); -INSERT INTO attr_value (jft_id, av_text) VALUES (28, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (29, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (34, 'Marchandise B'); -INSERT INTO attr_value (jft_id, av_text) VALUES (35, '1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (47, '70002'); -INSERT INTO attr_value (jft_id, av_text) VALUES (36, '150'); -INSERT INTO attr_value (jft_id, av_text) VALUES (37, '140'); -INSERT INTO attr_value (jft_id, av_text) VALUES (50, '4400001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (51, 'Fournisseur A'); -INSERT INTO attr_value (jft_id, av_text) VALUES (52, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (53, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (54, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (55, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (56, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (57, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (58, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (59, '4400002'); -INSERT INTO attr_value (jft_id, av_text) VALUES (60, 'Fournisseur B'); -INSERT INTO attr_value (jft_id, av_text) VALUES (61, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (62, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (63, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (64, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (65, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (66, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (67, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (68, '610001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (69, 'fourniture A'); -INSERT INTO attr_value (jft_id, av_text) VALUES (70, '1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (71, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (76, '55000002'); -INSERT INTO attr_value (jft_id, av_text) VALUES (77, 'Argenta'); -INSERT INTO attr_value (jft_id, av_text) VALUES (78, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (79, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (80, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (81, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (82, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (83, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (84, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (85, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (86, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (87, '4000003'); -INSERT INTO attr_value (jft_id, av_text) VALUES (88, '4000004'); -INSERT INTO attr_value (jft_id, av_text) VALUES (89, 'Toto'); -INSERT INTO attr_value (jft_id, av_text) VALUES (90, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (91, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (92, 'Maison de toto'); -INSERT INTO attr_value (jft_id, av_text) VALUES (93, 'cp'); -INSERT INTO attr_value (jft_id, av_text) VALUES (94, 'pays'); -INSERT INTO attr_value (jft_id, av_text) VALUES (95, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (96, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (97, '4000005'); -INSERT INTO attr_value (jft_id, av_text) VALUES (98, 'NOUVEAU CLIENT'); -INSERT INTO attr_value (jft_id, av_text) VALUES (99, 'Toto'); -INSERT INTO attr_value (jft_id, av_text) VALUES (100, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (101, 'Adresse'); -INSERT INTO attr_value (jft_id, av_text) VALUES (102, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (103, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (104, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (105, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (42, 'Marchandise D'); -INSERT INTO attr_value (jft_id, av_text) VALUES (43, '15'); -INSERT INTO attr_value (jft_id, av_text) VALUES (49, '70004'); -INSERT INTO attr_value (jft_id, av_text) VALUES (44, '150'); -INSERT INTO attr_value (jft_id, av_text) VALUES (45, '75'); -INSERT INTO attr_value (jft_id, av_text) VALUES (38, 'Marchandise C'); -INSERT INTO attr_value (jft_id, av_text) VALUES (39, '20'); -INSERT INTO attr_value (jft_id, av_text) VALUES (48, '70003'); -INSERT INTO attr_value (jft_id, av_text) VALUES (40, '200'); -INSERT INTO attr_value (jft_id, av_text) VALUES (41, '100'); -INSERT INTO attr_value (jft_id, av_text) VALUES (107, 'Marchandise Ex'); -INSERT INTO attr_value (jft_id, av_text) VALUES (108, '10'); -INSERT INTO attr_value (jft_id, av_text) VALUES (111, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (109, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (110, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (112, '4400003'); -INSERT INTO attr_value (jft_id, av_text) VALUES (113, 'Fournisseur E'); -INSERT INTO attr_value (jft_id, av_text) VALUES (114, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (115, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (116, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (117, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (118, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (119, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (120, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (121, '4400004'); -INSERT INTO attr_value (jft_id, av_text) VALUES (122, 'Propriétaire bureau'); -INSERT INTO attr_value (jft_id, av_text) VALUES (123, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (124, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (125, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (126, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (127, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (128, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (129, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (73, 'Loyer'); -INSERT INTO attr_value (jft_id, av_text) VALUES (74, '4'); -INSERT INTO attr_value (jft_id, av_text) VALUES (72, '610002'); -INSERT INTO attr_value (jft_id, av_text) VALUES (75, '400'); -INSERT INTO attr_value (jft_id, av_text) VALUES (130, '4400005'); -INSERT INTO attr_value (jft_id, av_text) VALUES (131, 'Fournisseur Eau Gaz'); -INSERT INTO attr_value (jft_id, av_text) VALUES (132, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (133, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (134, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (135, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (136, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (137, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (138, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (140, 'eau, gaz electricité'); -INSERT INTO attr_value (jft_id, av_text) VALUES (141, '1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (139, '610003'); -INSERT INTO attr_value (jft_id, av_text) VALUES (142, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (2, 'Banque 1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (3, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (4, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (1, '550'); -INSERT INTO attr_value (jft_id, av_text) VALUES (5, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (6, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (7, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (8, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (9, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (10, 'a'); -INSERT INTO attr_value (jft_id, av_text) VALUES (11, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (106, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (349, 'FID1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (350, 'FID2'); -INSERT INTO attr_value (jft_id, av_text) VALUES (351, 'FID3'); -INSERT INTO attr_value (jft_id, av_text) VALUES (352, 'FID4'); -INSERT INTO attr_value (jft_id, av_text) VALUES (353, 'FID5'); -INSERT INTO attr_value (jft_id, av_text) VALUES (354, 'FID6'); -INSERT INTO attr_value (jft_id, av_text) VALUES (355, 'FID7'); -INSERT INTO attr_value (jft_id, av_text) VALUES (356, 'FID8'); -INSERT INTO attr_value (jft_id, av_text) VALUES (357, 'FID9'); -INSERT INTO attr_value (jft_id, av_text) VALUES (358, 'FID10'); -INSERT INTO attr_value (jft_id, av_text) VALUES (359, 'FID11'); -INSERT INTO attr_value (jft_id, av_text) VALUES (360, 'FID12'); -INSERT INTO attr_value (jft_id, av_text) VALUES (361, 'FID13'); -INSERT INTO attr_value (jft_id, av_text) VALUES (362, 'FID14'); -INSERT INTO attr_value (jft_id, av_text) VALUES (363, 'FID15'); -INSERT INTO attr_value (jft_id, av_text) VALUES (364, 'FID16'); -INSERT INTO attr_value (jft_id, av_text) VALUES (365, 'FID17'); -INSERT INTO attr_value (jft_id, av_text) VALUES (366, 'FID18'); -INSERT INTO attr_value (jft_id, av_text) VALUES (367, 'FID19'); -INSERT INTO attr_value (jft_id, av_text) VALUES (368, 'FID20'); -INSERT INTO attr_value (jft_id, av_text) VALUES (369, 'FID21'); -INSERT INTO attr_value (jft_id, av_text) VALUES (371, 'Test1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (372, '2400001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (373, '2400002'); -INSERT INTO attr_value (jft_id, av_text) VALUES (406, '2400003'); -INSERT INTO attr_value (jft_id, av_text) VALUES (407, '2400004'); -INSERT INTO attr_value (jft_id, av_text) VALUES (408, '2400005'); -INSERT INTO attr_value (jft_id, av_text) VALUES (409, '2400006'); -INSERT INTO attr_value (jft_id, av_text) VALUES (410, '2400001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (411, '2400001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (412, '2400001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (144, 'Achat Marchandise A'); -INSERT INTO attr_value (jft_id, av_text) VALUES (145, '3'); -INSERT INTO attr_value (jft_id, av_text) VALUES (143, '6040001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (146, '350'); -INSERT INTO attr_value (jft_id, av_text) VALUES (147, ''); -INSERT INTO attr_value (jft_id, av_text) VALUES (148, 'MARCHA'); -INSERT INTO attr_value (jft_id, av_text) VALUES (30, 'Marchandise A'); -INSERT INTO attr_value (jft_id, av_text) VALUES (31, '1'); -INSERT INTO attr_value (jft_id, av_text) VALUES (46, '70001'); -INSERT INTO attr_value (jft_id, av_text) VALUES (32, '100'); -INSERT INTO attr_value (jft_id, av_text) VALUES (33, '120'); -INSERT INTO attr_value (jft_id, av_text) VALUES (413, 'MARCHA'); - - --- --- Data for Name: centralized; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - - - --- --- Data for Name: document; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - - - --- --- Data for Name: document_modele; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - - - --- --- Data for Name: document_state; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO document_state (s_id, s_value) VALUES (1, 'Envoyé'); -INSERT INTO document_state (s_id, s_value) VALUES (2, 'Brouillon'); -INSERT INTO document_state (s_id, s_value) VALUES (3, 'A envoyer'); -INSERT INTO document_state (s_id, s_value) VALUES (4, 'Reçu'); - - --- --- Data for Name: document_type; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO document_type (dt_id, dt_value) VALUES (1, 'Document Interne'); -INSERT INTO document_type (dt_id, dt_value) VALUES (2, 'Bons de commande client'); -INSERT INTO document_type (dt_id, dt_value) VALUES (3, 'Bon de commande Fournisseur'); -INSERT INTO document_type (dt_id, dt_value) VALUES (4, 'Facture'); -INSERT INTO document_type (dt_id, dt_value) VALUES (5, 'Lettre de rappel'); -INSERT INTO document_type (dt_id, dt_value) VALUES (6, 'Courrier'); -INSERT INTO document_type (dt_id, dt_value) VALUES (7, 'Proposition'); -INSERT INTO document_type (dt_id, dt_value) VALUES (8, 'Email'); -INSERT INTO document_type (dt_id, dt_value) VALUES (9, 'Divers'); - - --- --- Data for Name: fiche; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO fiche (f_id, fd_id) VALUES (1, 1); -INSERT INTO fiche (f_id, fd_id) VALUES (2, 2); -INSERT INTO fiche (f_id, fd_id) VALUES (3, 2); -INSERT INTO fiche (f_id, fd_id) VALUES (4, 3); -INSERT INTO fiche (f_id, fd_id) VALUES (5, 3); -INSERT INTO fiche (f_id, fd_id) VALUES (6, 3); -INSERT INTO fiche (f_id, fd_id) VALUES (7, 3); -INSERT INTO fiche (f_id, fd_id) VALUES (8, 4); -INSERT INTO fiche (f_id, fd_id) VALUES (9, 4); -INSERT INTO fiche (f_id, fd_id) VALUES (10, 5); -INSERT INTO fiche (f_id, fd_id) VALUES (11, 5); -INSERT INTO fiche (f_id, fd_id) VALUES (12, 1); -INSERT INTO fiche (f_id, fd_id) VALUES (13, 2); -INSERT INTO fiche (f_id, fd_id) VALUES (14, 2); -INSERT INTO fiche (f_id, fd_id) VALUES (15, 2); -INSERT INTO fiche (f_id, fd_id) VALUES (16, 3); -INSERT INTO fiche (f_id, fd_id) VALUES (17, 4); -INSERT INTO fiche (f_id, fd_id) VALUES (18, 4); -INSERT INTO fiche (f_id, fd_id) VALUES (19, 4); -INSERT INTO fiche (f_id, fd_id) VALUES (20, 5); -INSERT INTO fiche (f_id, fd_id) VALUES (21, 6); -INSERT INTO fiche (f_id, fd_id) VALUES (23, 11); - - --- --- Data for Name: fiche_def; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (1, 5500, 'Banque', true, 4); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (2, 400, 'Client', true, 9); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (4, 440, 'Fournisseur', true, 8); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (5, 61, 'Charges', true, 3); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (6, 604, 'Marchandise', true, 2); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (9, NULL, 'Taxes & impot', false, 14); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (7, 604, 'March Cat A', true, 2); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (8, 700, 'March Cat b', false, 1); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (3, 700, 'Vente', false, 1); -INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (11, 2400, 'matos', true, 7); - - --- --- Data for Name: fiche_def_ref; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (1, 'Vente Service', 700); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (2, 'Achat Marchandises', 604); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (3, 'Achat Service et biens divers', 61); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (4, 'Banque', 5500); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (5, 'Prêt > a un an', 17); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (6, 'Prêt < a un an', 430); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (8, 'Fournisseurs', 440); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (9, 'Clients', 400); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (10, 'Salaire Administrateur', 6200); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (11, 'Salaire Ouvrier', 6203); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (12, 'Salaire Employé', 6202); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (13, 'Dépenses non admises', 674); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (14, 'Administration des Finances', NULL); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (15, 'Autres fiches', NULL); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (7, 'Matériel à amortir', 2400); -INSERT INTO fiche_def_ref (frd_id, frd_text, frd_class_base) VALUES (16, 'Contact', NULL); - - --- --- Data for Name: form; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000398, 3000000, 1, 'Prestation [ case 03 ]', '[700%]-[7000005]'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000399, 3000000, 2, 'Prestation intra [ case 47 ]', '[7000005]'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000400, 3000000, 3, 'Tva due [case 54]', '[4513]+[4512]+[4511] FROM=01.2005'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000401, 3000000, 4, 'Marchandises, matière première et auxiliaire [case 81 ]', '[60%]'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000402, 3000000, 7, 'Service et bien divers [case 82]', '[61%]'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000403, 3000000, 8, 'bien d''invest [ case 83 ]', '[2400%]'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000404, 3000000, 9, 'TVA déductible [ case 59 ]', 'abs([4117]-[411%])'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000405, 3000000, 8, 'TVA non ded -> voiture', '[610022]*0.21/2'); -INSERT INTO form (fo_id, fo_fr_id, fo_pos, fo_label, fo_formula) VALUES (3000406, 3000000, 9, 'Acompte TVA', '[4117]'); - - --- --- Data for Name: format_csv_banque; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO format_csv_banque (name, include_file) VALUES ('Fortis', 'fortis_be.inc.php'); -INSERT INTO format_csv_banque (name, include_file) VALUES ('EUB', 'eub_be.inc.php'); -INSERT INTO format_csv_banque (name, include_file) VALUES ('ING', 'ing_be.inc.php'); -INSERT INTO format_csv_banque (name, include_file) VALUES ('CBC', 'cbc_be.inc.php'); -INSERT INTO format_csv_banque (name, include_file) VALUES ('Argenta Belgique', 'argenta_be.inc.php'); -INSERT INTO format_csv_banque (name, include_file) VALUES ('CBC Belgique', 'cbc_be.inc.php'); -INSERT INTO format_csv_banque (name, include_file) VALUES ('Dexia', 'dexia_be.inc.php'); - - --- --- Data for Name: formdef; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO formdef (fr_id, fr_label) VALUES (3000000, 'TVA déclaration Belge'); - - --- --- Data for Name: import_tmp; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00002/0038', '2007-01-11', '2007-01-11', '-200.00', 'EUR', '000-0000050-50', 'MEXICAN EXPRESS VOTRE DOMICILIATION 053-2648377-37 POUR AMERICAN EXPRESS INTERNAT - ddr374188753761015 REF. : 008316635267', '000-0000050-50 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00002/0037', '2007-01-11', '2007-01-11', '150.00', 'EUR', '000-0000050-50', 'JEANNE TARZANNE STREET 1000 BXL LOYER MENSUEL', '000-0000051-51 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0036', '2007-01-09', '2007-01-09', '200.00', 'EUR', '000-0000050-50', 'ZWARTE PIET STREET 1001 BXL LOYER MENSUEL', '000-0000052-52 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0035', '2007-01-09', '2007-01-09', '250.00', 'EUR', '000-0000050-50', 'XMAS FATHER STREET 1002 BXL LOYER MENSUEL', '000-0000053-53 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0034', '2007-01-09', '2007-01-09', '300.00', 'EUR', '000-0000050-50', 'ELVIS PRESSELAIT STREET 1003 BXL LOYER MENSUEL', '000-0000054-54 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0033', '2007-01-09', '2007-01-01', '0.00', 'EUR', '000-0000050-50', ' PARTICIPATION AUX FRAIS DE TENUE DE VOTRE COMPTE A VUE POUR LE TRIMESTRE EN COURS', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0032', '2007-01-09', '2007-01-02', '-5.00', 'EUR', '000-0000050-50', ' COUT GESTION CARTE DE DEBIT', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0031', '2007-01-09', '2007-01-01', '-5.00', 'EUR', '000-0000050-50', ' COUT GESTION CARTE DE DEBIT', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0030', '2007-01-09', '2007-01-02', '-14.00', 'EUR', '000-0000050-50', ' COUT SERVICE BANCONTACT/MISTER CASH', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0029', '2007-01-09', '2007-01-01', '5.00', 'EUR', '000-0000050-50', ' INTERETS 01/10/2006 - 31/12/2006', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0028', '2007-01-09', '2007-01-01', '-1.00', 'EUR', '000-0000050-50', ' FRAIS D''EXPEDITION DE VOS AVIS BANCAIRES', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0027', '2007-01-08', '2007-01-08', '350.00', 'EUR', '000-0000050-50', 'MICHEL DUPOND STREET 1004 BXL LOYER MENSUEL', '000-0000055-55 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0026', '2007-01-05', '2007-01-05', '400.00', 'EUR', '000-0000050-50', 'MARIE BASDELAINE STREET 1005 BXL LOYER MENSUEL', '000-0000055-56 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0025', '2007-01-03', '2007-01-03', '450.00', 'EUR', '000-0000050-50', 'JOHN DOE STREET 1006 BXL ', '000-0000057-57 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0024', '2007-01-03', '2007-01-03', '500.00', 'EUR', '000-0000050-50', 'JAY PLUSDIDEE STREET 1007 BXL LOYER MENSUEL', '000-0000058-58 ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0023', '2007-01-03', '2007-01-02', '-177.00', 'EUR', '000-0000050-50', 'MAKRAU ACHAT MISTER CASH', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0022', '2007-01-02', '2007-01-02', '-25.00', 'EUR', '000-0000050-50', 'BRIKOSHOP ACHAT MISTER CASH', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0021', '2007-01-02', '2007-01-02', '-20.00', 'EUR', '000-0000050-50', 'POST CHARGEMENT PROTON', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0020', '2007-01-02', '2007-01-02', '-100.00', 'EUR', '000-0000050-50', 'MAKRAU ACHAT MISTER CASH', ' ', NULL, 'n', 55000001, 1, NULL); -INSERT INTO import_tmp (code, date_exec, date_valeur, montant, devise, compte_ordre, detail, num_compte, poste_comptable, status, bq_account, jrn, jr_rapt) VALUES ('00001/0019', '2007-01-02', '2006-12-31', '-1000.00', 'EUR', '000-0000050-50', ' CHARGES ECHUES', ' ', NULL, 'n', 55000001, 1, NULL); - - --- --- Data for Name: invoice; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - - - --- --- Data for Name: jnt_fic_att_value; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (1, 1, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (2, 1, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (3, 1, 3); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (4, 1, 4); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (5, 1, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (6, 1, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (7, 1, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (8, 1, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (9, 1, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (10, 1, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (11, 1, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (12, 2, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (13, 2, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (14, 2, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (15, 2, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (16, 2, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (17, 2, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (18, 2, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (19, 2, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (20, 2, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (21, 3, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (22, 3, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (23, 3, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (24, 3, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (25, 3, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (26, 3, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (27, 3, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (28, 3, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (29, 3, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (30, 4, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (31, 4, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (32, 4, 6); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (33, 4, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (34, 5, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (35, 5, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (36, 5, 6); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (37, 5, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (38, 6, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (39, 6, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (40, 6, 6); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (41, 6, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (42, 7, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (43, 7, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (44, 7, 6); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (45, 7, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (46, 4, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (47, 5, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (48, 6, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (49, 7, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (50, 8, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (51, 8, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (52, 8, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (53, 8, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (54, 8, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (55, 8, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (56, 8, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (57, 8, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (58, 8, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (59, 9, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (60, 9, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (61, 9, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (62, 9, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (63, 9, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (64, 9, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (65, 9, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (66, 9, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (67, 9, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (68, 10, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (69, 10, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (70, 10, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (71, 10, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (72, 11, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (73, 11, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (74, 11, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (75, 11, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (76, 12, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (77, 12, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (78, 12, 3); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (79, 12, 4); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (80, 12, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (81, 12, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (82, 12, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (83, 12, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (84, 12, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (85, 12, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (86, 12, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (87, 13, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (88, 14, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (89, 14, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (90, 14, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (91, 14, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (92, 14, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (93, 14, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (94, 14, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (95, 14, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (96, 14, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (97, 15, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (98, 15, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (99, 15, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (100, 15, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (101, 15, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (102, 15, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (103, 15, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (104, 15, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (105, 15, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (106, 1, 19); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (107, 16, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (108, 16, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (109, 16, 6); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (110, 16, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (111, 16, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (112, 17, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (113, 17, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (114, 17, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (115, 17, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (116, 17, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (117, 17, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (118, 17, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (119, 17, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (120, 17, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (121, 18, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (122, 18, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (123, 18, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (124, 18, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (125, 18, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (126, 18, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (127, 18, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (128, 18, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (129, 18, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (130, 19, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (131, 19, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (132, 19, 12); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (133, 19, 13); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (134, 19, 14); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (135, 19, 15); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (136, 19, 16); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (137, 19, 17); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (138, 19, 18); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (139, 20, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (140, 20, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (141, 20, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (142, 20, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (143, 21, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (144, 21, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (145, 21, 2); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (146, 21, 6); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (147, 21, 7); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (148, 21, 19); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (349, 1, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (350, 2, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (351, 3, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (352, 4, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (353, 5, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (354, 6, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (355, 7, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (356, 8, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (357, 9, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (358, 10, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (359, 11, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (360, 12, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (361, 13, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (362, 14, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (363, 15, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (364, 16, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (365, 17, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (366, 18, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (367, 19, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (368, 20, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (369, 21, 23); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (371, 23, 1); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (372, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (373, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (406, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (407, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (408, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (409, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (410, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (411, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (412, 23, 5); -INSERT INTO jnt_fic_att_value (jft_id, f_id, ad_id) VALUES (413, 4, 19); - - --- --- Data for Name: jnt_fic_attr; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 5, 1); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 1, 2); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 3, 3); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 4, 4); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 12, 5); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 13, 6); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 14, 7); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 15, 8); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 16, 9); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 17, 10); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 18, 11); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 5, 12); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 1, 13); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 12, 14); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 13, 15); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 14, 16); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 15, 17); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 16, 18); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 17, 19); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 18, 20); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 1, 21); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 2, 22); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 6, 23); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 7, 24); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 5, 25); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 5, 26); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 1, 27); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 12, 28); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 13, 29); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 14, 30); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 15, 31); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 16, 32); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 17, 33); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 18, 34); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (5, 5, 35); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (5, 1, 36); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (5, 2, 37); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (5, 7, 38); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 5, 39); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 1, 40); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 2, 41); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 6, 42); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 7, 43); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 19, 44); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 5, 45); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 1, 46); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 2, 47); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 6, 48); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 7, 49); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 19, 50); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (8, 1, 51); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (8, 2, 52); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (8, 6, 53); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (8, 7, 54); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (8, 19, 55); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 1, 56); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 5, 57); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 9, 58); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 12, 59); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 14, 60); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 15, 61); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 17, 62); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 18, 63); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 16, 64); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (1, 23, 65); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 23, 66); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 23, 67); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 23, 68); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (5, 23, 69); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (6, 23, 70); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (9, 23, 71); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (7, 23, 72); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (8, 23, 73); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (2, 24, 74); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (4, 24, 75); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (11, 5, 77); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (11, 1, 78); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (11, 8, 79); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (11, 9, 80); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (11, 10, 81); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (11, 23, 82); -INSERT INTO jnt_fic_attr (fd_id, ad_id, jnt_id) VALUES (3, 19, 83); - - --- --- Data for Name: jrn; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - - - --- --- Data for Name: jrn_action; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (2, 'Voir', 'Voir toutes les factures', 'user_jrn.php', 'action=voir_jrn', 'FR', 'VEN'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (4, 'Voir Impayés', 'Voir toutes les factures non payées', 'user_jrn.php', 'action=voir_jrn_non_paye', 'FR', 'VEN'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (1, 'Nouvelle', 'Création d''une facture', 'user_jrn.php', 'action=insert_vente&blank', 'FR', 'VEN'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (10, 'Nouveau', 'Encode un nouvel achat (matériel, marchandises, services et biens divers)', 'user_jrn.php', 'action=new&blank', 'FR', 'ACH'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (12, 'Voir', 'Voir toutes les factures', 'user_jrn.php', 'action=voir_jrn', 'FR', 'ACH'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (14, 'Voir Impayés', 'Voir toutes les factures non payées', 'user_jrn.php', 'action=voir_jrn_non_paye', 'FR', 'ACH'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (20, 'Nouveau', 'Encode un nouvel achat (matériel, marchandises, services et biens divers)', 'user_jrn.php', 'action=new&blank', 'FR', 'FIN'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (22, 'Voir', 'Voir toutes les factures', 'user_jrn.php', 'action=voir_jrn', 'FR', 'FIN'); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (30, 'Nouveau', NULL, 'user_jrn.php', 'action=new&blank', 'FR', 'OD '); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (32, 'Voir', 'Voir toutes les factures', 'user_jrn.php', 'action=voir_jrn', 'FR', 'OD '); -INSERT INTO jrn_action (ja_id, ja_name, ja_desc, ja_url, ja_action, ja_lang, ja_jrn_type) VALUES (40, 'Soldes', 'Voir les soldes des comptes en banques', 'user_jrn.php', 'action=solde', 'FR', 'FIN'); - - --- --- Data for Name: jrn_def; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO jrn_def (jrn_def_id, jrn_def_name, jrn_def_class_deb, jrn_def_class_cred, jrn_def_fiche_deb, jrn_def_fiche_cred, jrn_deb_max_line, jrn_cred_max_line, jrn_def_ech, jrn_def_ech_lib, jrn_def_type, jrn_def_code) VALUES (4, 'Opération Diverses', NULL, NULL, NULL, NULL, 5, 5, false, NULL, 'OD ', 'OD-01'); -INSERT INTO jrn_def (jrn_def_id, jrn_def_name, jrn_def_class_deb, jrn_def_class_cred, jrn_def_fiche_deb, jrn_def_fiche_cred, jrn_deb_max_line, jrn_cred_max_line, jrn_def_ech, jrn_def_ech_lib, jrn_def_type, jrn_def_code) VALUES (2, 'Vente', '7*', '4*', '2', '3', 1, 3, true, 'échéance', 'VEN', 'VEN-01'); -INSERT INTO jrn_def (jrn_def_id, jrn_def_name, jrn_def_class_deb, jrn_def_class_cred, jrn_def_fiche_deb, jrn_def_fiche_cred, jrn_deb_max_line, jrn_cred_max_line, jrn_def_ech, jrn_def_ech_lib, jrn_def_type, jrn_def_code) VALUES (1, 'Financier', '5* ', '5*', '1,2,4,9', '1,2,4,9', 5, 5, false, NULL, 'FIN', 'FIN-01'); -INSERT INTO jrn_def (jrn_def_id, jrn_def_name, jrn_def_class_deb, jrn_def_class_cred, jrn_def_fiche_deb, jrn_def_fiche_cred, jrn_deb_max_line, jrn_cred_max_line, jrn_def_ech, jrn_def_ech_lib, jrn_def_type, jrn_def_code) VALUES (3, 'Achat', '6*', '4*', '5,6', '4', 1, 1, true, 'échéance', 'ACH', 'ACH-01'); - - --- --- Data for Name: jrn_rapt; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO jrn_rapt (jra_id, jr_id, jra_concerned) VALUES (14, 189, 189); - - --- --- Data for Name: jrn_type; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO jrn_type (jrn_type_id, jrn_desc) VALUES ('FIN', 'Financier'); -INSERT INTO jrn_type (jrn_type_id, jrn_desc) VALUES ('VEN', 'Vente'); -INSERT INTO jrn_type (jrn_type_id, jrn_desc) VALUES ('ACH', 'Achat'); -INSERT INTO jrn_type (jrn_type_id, jrn_desc) VALUES ('OD ', 'Opérations Diverses'); - - --- --- Data for Name: jrnx; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - - - --- --- Data for Name: parameter; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_NAME', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_CP', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_COMMUNE', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_TVA', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_STREET', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_NUMBER', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_TEL', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_PAYS', NULL); -INSERT INTO parameter (pr_id, pr_value) VALUES ('MY_FAX', NULL); - - --- --- Data for Name: parm_code; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('DNA', '6740', 'Dépense non déductible'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('CUSTOMER', '400', 'Poste comptable de base pour les clients'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('COMPTE_TVA', '451', 'TVA à payer'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('BANQUE', '550', 'Poste comptable de base pour les banques'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('VIREMENT_INTERNE', '58', 'Poste Comptable pour les virements internes'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('COMPTE_COURANT', '56', 'Poste comptable pour le compte courant'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('CAISSE', '57', 'Poste comptable pour la caisse'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('TVA_DNA', '6740', 'Tva non déductible s'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('TVA_DED_IMPOT', '619000', 'Tva déductible par l''impôt'); -INSERT INTO parm_code (p_code, p_value, p_comment) VALUES ('VENTE', '70', 'Poste comptable de base pour les ventes'); - - --- --- Data for Name: parm_money; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO parm_money (pm_id, pm_code, pm_rate) VALUES (1, 'EUR', 1.0000); - - --- --- Data for Name: parm_periode; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (40, '2005-01-01', '2005-01-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (41, '2005-02-01', '2005-02-28', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (42, '2005-03-01', '2005-03-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (43, '2005-04-01', '2005-04-30', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (44, '2005-05-01', '2005-05-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (45, '2005-06-01', '2005-06-30', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (46, '2005-07-01', '2005-07-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (47, '2005-08-01', '2005-08-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (48, '2005-09-01', '2005-09-30', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (49, '2005-10-01', '2005-10-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (50, '2005-11-01', '2005-11-30', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (51, '2005-12-01', '2005-12-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (52, '2005-12-31', '2005-12-31', '2005', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (53, '2006-01-01', '2006-01-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (54, '2006-02-01', '2006-02-28', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (55, '2006-03-01', '2006-03-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (56, '2006-04-01', '2006-04-30', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (57, '2006-05-01', '2006-05-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (58, '2006-06-01', '2006-06-30', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (59, '2006-07-01', '2006-07-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (60, '2006-08-01', '2006-08-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (61, '2006-09-01', '2006-09-30', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (62, '2006-10-01', '2006-10-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (63, '2006-11-01', '2006-11-30', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (64, '2006-12-01', '2006-12-31', '2006', false, false); -INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) VALUES (65, '2006-12-31', '2006-12-31', '2006', false, false); - - --- --- Data for Name: quant_sold; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (1, '1VEN-01-1', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (2, '1VEN-01-2', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (3, '1VEN-01-3', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (4, '1VEN-01-4', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (5, '1VEN-01-5', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (6, '1VEN-01-6', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (7, '1VEN-01-7', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (8, '1VEN-01-8', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (9, '1VEN-01-9', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (10, '1VEN-01-16', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (11, '1VEN-01-17', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (12, '1VEN-01-18', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (13, '1VEN-01-19', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (14, '1VEN-01-20', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (15, '1VEN-01-21', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (16, '1VEN-01-22', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (17, '1VEN-01-23', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (18, '1VEN-01-24', 7, 1.0000, 150.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (19, '1VEN-01-25', 7, 1.0000, 150.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (20, '1VEN-01-34', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (21, '1VEN-01-35', 7, 1.0000, 150.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (22, '1VEN-01-36', 7, 1.0000, 150.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (23, '1VEN-01-37', 7, 1.0000, 150.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (24, '1VEN-01-38', 7, 1.0000, 150.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (25, '1VEN-01-39', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (26, '1VEN-01-40', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (27, '1VEN-01-41', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (28, '1VEN-01-48', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (29, '1VEN-01-49', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (30, '1VEN-01-50', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (31, '1VEN-01-51', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (32, '1VEN-01-52', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (33, '1VEN-01-53', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (34, '1VEN-01-54', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (35, '1VEN-01-55', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (36, '1VEN-01-56', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (37, '1VEN-01-57', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (38, '1VEN-01-64', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (39, '1VEN-01-65', 4, 10.0000, 1000.0000, 210.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (40, '1VEN-01-66', 4, 95.5000, 9550.0000, 2005.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (41, '1VEN-01-66', 4, 20.0000, 4000.0000, 840.0000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (42, '1VEN-01-68', 4, 123.0000, 147.6000, 0.0000, NULL, 2); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (43, '1VEN-01-68', 4, 5.8000, 5.2200, 0.0000, NULL, 2); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (44, '1VEN-01-70', 4, 1.0000, 120.0000, 0.0000, NULL, 2); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (45, '1VEN-01-71', 4, 10.0000, 10.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (46, '1VEN-01-80', 4, 10.2000, 1022.0400, 214.6300, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (47, '1VEN-01-80', 5, 1.0000, 150.0000, 31.5000, 1, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (48, '1VEN-01-82', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (49, '1VEN-01-83', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (50, '1VEN-01-84', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (51, '1VEN-01-85', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (52, '1VEN-01-86', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (53, '1VEN-01-87', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (54, '1VEN-01-88', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (55, '1VEN-01-89', 6, 1.0000, 200.0000, 0.0000, NULL, 3); -INSERT INTO quant_sold (qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat, qs_vat_code, qs_client) VALUES (56, '1VEN-01-96', 6, 1.0000, 200.0000, 0.0000, NULL, 3); - - --- --- Data for Name: stock_goods; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (79, 590, 21, 'MARCHA', 100.0000, 'd', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (80, 591, 21, 'MARCHA', 45.5000, 'd', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (81, 595, 4, 'MARCHA', 1.0000, 'c', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (82, NULL, 0, 'MARCHA', 2.0000, 'c', '2007-04-17', '2007-04-17', 'phpcompta', NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (83, 598, 4, 'MARCHA', 10.0000, 'c', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (85, 603, 21, 'MARCHA', -5.0000, 'd', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (86, NULL, 0, 'MARCHA', 5.0000, 'd', '2007-04-17', '2007-04-17', 'phpcompta', NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (87, NULL, 0, 'MARCHA', 5.0000, 'd', '2007-04-17', '2007-04-17', 'phpcompta', NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (88, 607, 4, 'MARCHA', 10.2000, 'c', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (89, 608, 5, '', 1.0000, 'c', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (90, 610, 21, 'MARCHA', 1.0000, 'd', NULL, '2007-04-17', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (91, 614, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (92, 616, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (93, 618, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (94, 620, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (95, 622, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (96, 624, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (97, 626, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (98, 628, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); -INSERT INTO stock_goods (sg_id, j_id, f_id, sg_code, sg_quantity, sg_type, sg_date, sg_tech_date, sg_tech_user, sg_comment, sg_exercice) VALUES (99, 630, 6, '', 1.0000, 'c', NULL, '2007-04-19', NULL, NULL, NULL); - - --- --- Data for Name: tmp_pcmn; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (10, 'Capital ', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (100, ' Capital souscrit', 10, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (11, 'Prime d''émission ', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (12, 'Plus Value de réévaluation ', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (13, 'Réserve ', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (130, 'Réserve légale', 13, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (131, 'Réserve indisponible', 13, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1310, 'Réserve pour actions propres', 131, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1311, ' Autres réserves indisponibles', 131, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (132, ' Réserves immunisées', 13, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (133, 'Réserves disponibles', 13, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (14, 'Bénéfice ou perte reportée', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (140, 'Bénéfice reporté', 14, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (141, 'Perte reportée', 14, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (15, 'Subside en capital', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (16, 'Provisions pour risques et charges', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (160, 'Provisions pour pensions et obligations similaires', 16, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (161, 'Provisions pour charges fiscales', 16, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (162, 'Provisions pour grosses réparation et gros entretien', 16, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (17, ' Dettes à plus d''un an', 1, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (170, 'Emprunts subordonnés', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1700, 'convertibles', 170, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1701, 'non convertibles', 170, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (171, 'Emprunts subordonnés', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1710, 'convertibles', 170, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1711, 'non convertibles', 170, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (172, ' Dettes de locations financement', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (173, ' Etablissement de crédit', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1730, 'Dettes en comptes', 173, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1731, 'Promesses', 173, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1732, 'Crédits d''acceptation', 173, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (174, 'Autres emprunts', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (175, 'Dettes commerciales', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1750, 'Fournisseurs', 175, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1751, 'Effets à payer', 175, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (176, 'Acomptes reçus sur commandes', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (178, 'Cautionnement reçus en numéraires', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (179, 'Dettes diverses', 17, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (20, 'Frais d''établissement', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (200, 'Frais de constitution et d''augmentation de capital', 20, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (201, ' Frais d''émission d''emprunts et primes de remboursement', 20, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (202, 'Autres frais d''établissement', 20, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (204, 'Frais de restructuration', 20, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (21, 'Immobilisations incorporelles', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (210, 'Frais de recherche et de développement', 21, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (211, 'Concessions, brevet, licence savoir faire, marque et droit similaires', 21, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (212, 'Goodwill', 21, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (213, 'Acomptes versés', 21, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (22, 'Terrains et construction', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (220, 'Terrains', 22, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (221, 'Construction', 22, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (222, 'Terrains bâtis', 22, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (223, 'Autres droits réels sur des immeubles', 22, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (23, ' Installations, machines et outillages', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (24, 'Mobilier et Matériel roulant', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (25, 'Immobilisations détenus en location-financement et droits similaires', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (250, 'Terrains', 25, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (251, 'Construction', 25, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (252, 'Terrains bâtis', 25, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (253, 'Mobilier et matériels roulants', 25, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (26, 'Autres immobilisations corporelles', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (27, 'Immobilisations corporelles en cours et acomptes versés', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (28, 'Immobilisations financières', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (280, 'Participation dans des entreprises liées', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2800, 'Valeur d''acquisition', 280, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2801, 'Montants non-appelés(-)', 280, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2808, 'Plus-values actées', 280, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2809, 'Réductions de valeurs actées', 280, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (281, 'Créance sur des entreprises liées', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2810, 'Créance en compte', 281, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2811, 'Effets à recevoir', 281, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2812, 'Titre à reveny fixe', 281, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2817, 'Créances douteuses', 281, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2819, 'Réduction de valeurs actées', 281, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (282, 'Participations dans des entreprises avec lesquelles il existe un lien de participation', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2820, 'Valeur d''acquisition', 282, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2821, 'Montants non-appelés(-)', 282, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2828, 'Plus-values actées', 282, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2829, 'Réductions de valeurs actées', 282, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (283, 'Créances sur des entreprises avec lesquelles existe un lien de participation', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2830, 'Créance en compte', 283, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2831, 'Effets à recevoir', 283, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2832, 'Titre à revenu fixe', 283, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2837, 'Créances douteuses', 283, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2839, 'Réduction de valeurs actées', 283, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (284, 'Autres actions et parts', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2840, 'Valeur d''acquisition', 284, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2841, 'Montants non-appelés(-)', 284, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2848, 'Plus-values actées', 284, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2849, 'Réductions de valeurs actées', 284, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (285, 'Autres créances', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2850, 'Créance en compte', 285, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2851, 'Effets à recevoir', 285, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2852, 'Titre à revenu fixe', 285, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2857, 'Créances douteuses', 285, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2859, 'Réductions de valeurs actées', 285, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (288, 'Cautionnements versés en numéraires', 28, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (29, 'Créances à plus d''un an', 2, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (290, 'Créances commerciales', 29, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2900, 'Clients', 290, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2901, 'Effets à recevoir', 290, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2906, 'Acomptes versés', 290, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2907, 'Créances douteuses', 290, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2909, 'Réductions de valeurs actées', 290, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (291, 'Autres créances', 29, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2910, 'Créances en comptes', 291, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2911, 'Effets à recevoir', 291, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2917, 'Créances douteuses', 291, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2919, 'Réductions de valeurs actées(-)', 291, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (30, 'Approvisionements - Matières premières', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (300, 'Valeur d''acquisition', 30, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (309, 'Réductions de valeur actées', 30, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (31, 'Approvisionnements - fournitures', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (310, 'Valeur d''acquisition', 31, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (319, 'Réductions de valeurs actées(-)', 31, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (32, 'En-cours de fabrication', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (320, 'Valeurs d''acquisition', 32, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (329, 'Réductions de valeur actées', 32, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (33, 'Produits finis', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (330, 'Valeur d''acquisition', 33, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (339, 'Réductions de valeur actées', 33, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (34, 'Marchandises', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (340, 'Valeur d''acquisition', 34, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (349, 'Réductions de valeur actées', 34, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (35, 'Immeubles destinés à la vente', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (350, 'Valeur d''acquisition', 35, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (359, 'Réductions de valeur actées', 35, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (36, 'Acomptes versés sur achats pour stocks', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (360, 'Valeur d''acquisition', 36, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (369, 'Réductions de valeur actées', 36, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (37, 'Commandes en cours éxécution', 3, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (370, 'Valeur d''acquisition', 37, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (371, 'Bénéfice pris en compte ', 37, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (379, 'Réductions de valeur actées', 37, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (40, 'Créances commerciales', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (400, 'Clients', 40, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (401, 'Effets à recevoir', 40, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (404, 'Produits à recevoir', 40, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (406, 'Acomptes versés', 40, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (407, 'Créances douteuses', 40, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (409, 'Réductions de valeur actées', 40, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (41, 'Autres créances', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (410, 'Capital appelé non versé', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (411, 'TVA à récupérer', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (412, 'Impôts et précomptes à récupérer', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4120, 'Impôt belge sur le résultat', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4121, 'Impôt belge sur le résultat', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4122, 'Impôt belge sur le résultat', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4123, 'Impôt belge sur le résultat', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4124, 'Impôt belge sur le résultat', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4125, 'Autres impôts et taxes belges', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4126, 'Autres impôts et taxes belges', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4127, 'Autres impôts et taxes belges', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4128, 'Impôts et taxes étrangers', 412, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (414, 'Produits à recevoir', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (416, 'Créances diverses', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4160, 'Comptes de l''exploitant', 416, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (417, 'Créances douteuses', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (418, 'Cautionnements versés en numéraires', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (419, 'Réductions de valeur actées', 41, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (42, 'Dettes à plus dun an échéant dans l''année', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (420, 'Emprunts subordonnés', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4200, 'convertibles', 420, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4201, 'non convertibles', 420, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (421, 'Emprunts subordonnés', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4210, 'convertibles', 420, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4211, 'non convertibles', 420, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (422, ' Dettes de locations financement', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (423, ' Etablissement de crédit', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4230, 'Dettes en comptes', 423, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4231, 'Promesses', 423, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4232, 'Crédits d''acceptation', 423, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (424, 'Autres emprunts', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (425, 'Dettes commerciales', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4250, 'Fournisseurs', 425, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4251, 'Effets à payer', 425, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (426, 'Acomptes reçus sur commandes', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (428, 'Cautionnement reçus en numéraires', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (429, 'Dettes diverses', 42, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (43, 'Dettes financières', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (430, 'Etablissements de crédit - Emprunts à compte à terme fixe', 43, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (431, 'Etablissements de crédit - Promesses', 43, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (432, ' Etablissements de crédit - Crédits d''acceptation', 43, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (433, 'Etablissements de crédit -Dettes en comptes courant', 43, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (439, 'Autres emprunts', 43, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (44, 'Dettes commerciales', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (440, 'Fournisseurs', 44, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (441, 'Effets à payer', 44, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (444, 'Factures à recevoir', 44, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (45, 'Dettes fiscales, salariales et sociales', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (450, 'Dettes fiscales estimées', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4500, 'Impôts belges sur le résultat', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4501, 'Impôts belges sur le résultat', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4502, 'Impôts belges sur le résultat', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4503, 'Impôts belges sur le résultat', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4504, 'Impôts belges sur le résultat', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4505, 'Autres impôts et taxes belges', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4506, 'Autres impôts et taxes belges', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4507, 'Autres impôts et taxes belges', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4508, 'Impôts et taxes étrangers', 450, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (451, 'TVA à payer', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (452, 'Impôts et taxes à payer', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4520, 'Impôts belges sur le résultat', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4521, 'Impôts belges sur le résultat', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4522, 'Impôts belges sur le résultat', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4523, 'Impôts belges sur le résultat', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4524, 'Impôts belges sur le résultat', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4525, 'Autres impôts et taxes belges', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4526, 'Autres impôts et taxes belges', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4527, 'Autres impôts et taxes belges', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4528, 'Impôts et taxes étrangers', 452, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (453, 'Précomptes retenus', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (454, 'Office National de la Sécurité Sociales', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (455, 'Rémunérations', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (456, 'Pécules de vacances', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (459, 'Autres dettes sociales', 45, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (46, 'Acomptes reçus sur commandes', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (47, 'Dettes découlant de l''affectation du résultat', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (470, 'Dividendes et tantièmes d''exercices antérieurs', 47, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (471, 'Dividendes de l''exercice', 47, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (472, 'Tantièmes de l''exercice', 47, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (473, 'Autres allocataires', 47, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (48, 'Dettes diverses', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (480, 'Obligations et coupons échus', 48, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (488, 'Cautionnements reçus en numéraires', 48, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (489, 'Autres dettes diverses', 48, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4890, 'Compte de l''exploitant', 489, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (49, 'Comptes de régularisation', 4, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (490, 'Charges à reporter', 49, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (491, 'Produits acquis', 49, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (492, 'Charges à imputer', 49, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (493, 'Produits à reporter', 49, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (499, 'Comptes d''attentes', 49, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (50, 'Actions propres', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (51, 'Actions et parts', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (510, 'Valeur d''acquisition', 51, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (511, 'Montant non appelés', 51, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (519, 'Réductions de valeur actées', 51, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (52, 'Titres à revenu fixe', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (520, 'Valeur d''acquisition', 52, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (529, 'Réductions de valeur actées', 52, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (53, 'Dépôts à terme', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (530, 'de plus d''un an', 53, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (531, 'de plus d''un mois et d''un an au plus', 53, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (532, 'd''un mois au plus', 53, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (539, 'Réductions de valeur actées', 53, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (54, 'Valeurs échues à l''encaissement', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (55, 'Etablissement de crédit', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5500, 'Comptes courants', 550, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5501, 'Chèques émis (-)', 550, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5509, 'Réduction de valeur actée', 550, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5510, 'Comptes courants', 551, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5511, 'Chèques émis (-)', 551, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5519, 'Réduction de valeur actée', 551, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5520, 'Comptes courants', 552, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5521, 'Chèques émis (-)', 552, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5529, 'Réduction de valeur actée', 552, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5530, 'Comptes courants', 553, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5531, 'Chèques émis (-)', 553, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5539, 'Réduction de valeur actée', 553, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5540, 'Comptes courants', 554, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5541, 'Chèques émis (-)', 554, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5549, 'Réduction de valeur actée', 554, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5550, 'Comptes courants', 555, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5551, 'Chèques émis (-)', 555, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5559, 'Réduction de valeur actée', 555, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5560, 'Comptes courants', 556, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5561, 'Chèques émis (-)', 556, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5569, 'Réduction de valeur actée', 556, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5570, 'Comptes courants', 557, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5571, 'Chèques émis (-)', 557, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5579, 'Réduction de valeur actée', 557, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5580, 'Comptes courants', 558, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5581, 'Chèques émis (-)', 558, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5589, 'Réduction de valeur actée', 558, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5590, 'Comptes courants', 559, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5591, 'Chèques émis (-)', 559, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5599, 'Réduction de valeur actée', 559, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (56, 'Office des chèques postaux', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (560, 'Compte courant', 56, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (561, 'Chèques émis', 56, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (57, 'Caisses', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (578, 'Caisse timbre', 57, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (58, 'Virement interne', 5, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (60, 'Approvisionnement et marchandises', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (600, 'Achats de matières premières', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (601, 'Achats de fournitures', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (602, 'Achats de services, travaux et études', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (603, 'Sous-traitances générales', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (604, 'Achats de marchandises', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (605, 'Achats d''immeubles destinés à la vente', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (608, 'Remises, ristournes et rabais obtenus(-)', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (609, 'Variation de stock', 60, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6090, 'de matières premières', 609, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6091, 'de fournitures', 609, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6094, 'de marchandises', 609, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6095, 'immeubles achetés destinés à la vente', 609, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (61, 'Services et biens divers', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (62, 'Rémunérations, charges sociales et pensions', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (620, 'Rémunérations et avantages sociaux directs', 62, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6200, 'Administrateurs ou gérants', 620, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6201, 'Personnel de directions', 620, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6202, 'Employés,620', 6202, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6203, 'Ouvriers', 620, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6204, 'Autres membres du personnel', 620, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (621, 'Cotisations patronales d''assurances sociales', 62, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (622, 'Primes partonales pour assurances extra-légales', 62, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (623, 'Autres frais de personnel', 62, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (624, 'Pensions de retraite et de survie', 62, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6240, 'Administrateurs ou gérants', 624, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6241, 'Personnel', 624, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (63, 'Amortissements, réductions de valeurs et provisions pour risques et charges', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (630, 'Dotations aux amortissements et réduction de valeurs sur immobilisations', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6300, ' Dotations aux amortissements sur frais d''établissement', 630, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (705, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6301, 'Dotations aux amortissements sur immobilisations incorporelles', 630, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6302, 'Dotations aux amortissements sur immobilisations corporelles', 630, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6308, 'Dotations aux réductions de valeur sur immobilisations incorporelles', 630, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6309, 'Dotations aux réductions de valeur sur immobilisations corporelles', 630, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (631, 'Réductions de valeur sur stocks', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6310, 'Dotations', 631, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6311, 'Reprises(-)', 631, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (632, 'Réductions de valeur sur commande en cours d''éxécution', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6320, 'Dotations', 632, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6321, 'Reprises(-)', 632, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (633, 'Réductions de valeurs sur créances commerciales à plus d''un an', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6330, 'Dotations', 633, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6331, 'Reprises(-)', 633, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (634, 'Réductions de valeur sur créances commerciales à un an au plus', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6340, 'Dotations', 634, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6341, 'Reprise', 634, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (635, 'Provisions pour pensions et obligations similaires', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6350, 'Dotations', 635, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6351, 'Utilisation et reprises', 635, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (636, 'Provisions pour grosses réparations et gros entretien', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6360, 'Dotations', 636, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6361, 'Reprises(-)', 636, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (637, 'Provisions pour autres risques et charges', 63, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6370, 'Dotations', 637, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6371, 'Reprises(-)', 637, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (64, 'Autres charges d''exploitation', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (640, 'Charges fiscales d''exploitation', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (641, 'Moins-values sur réalisations courantes d''immobilisations corporelles', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (642, 'Moins-value sur réalisation de créances commerciales', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (643, 'Charges d''exploitations', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (644, 'Charges d''exploitations', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (645, 'Charges d''exploitations', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (646, 'Charges d''exploitations', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (647, 'Charges d''exploitations', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (648, 'Charges d''exploitations', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (649, 'Charges d''exploitation portées à l''actif au titre de frais de restructuration(-)', 64, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (65, 'Charges financières', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (650, 'Charges des dettes', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6500, 'Intérêts, commmissions et frais afférents aux dettes', 650, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6501, 'Amortissements des frais d''émissions d''emrunts et des primes de remboursement', 650, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6502, 'Autres charges des dettes', 650, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6503, 'Intérêts intercalaires portés à l''actif(-)', 650, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (651, 'Réductions de valeur sur actifs circulants', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6510, 'Dotations', 651, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6511, 'Reprises(-)', 651, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (652, 'Moins-value sur réalisation d''actifs circulants', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (653, 'Charges d''escompte de créances', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (654, 'Différences de changes', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (655, 'Ecarts de conversion des devises', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (656, 'Charges financières diverses', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (657, 'Charges financières diverses', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (658, 'Charges financières diverses', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (659, 'Charges financières diverses', 65, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (66, 'Charges exceptionnelles', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (660, 'Amortissements et réductions de valeur exceptionnels (dotations)', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6600, 'sur frais d''établissement', 660, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6601, 'sur immobilisations incorporelles', 660, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6602, 'sur immobilisations corporelles', 660, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (661, 'Réductions de valeur sur immobilisations financières (dotations)', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (662, 'Provisions pour risques et charges exceptionnels', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (663, 'Moins-values sur réalisations d''actifs immobilisés', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (664, 'Autres charges exceptionnelles', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (665, 'Autres charges exceptionnelles', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (666, 'Autres charges exceptionnelles', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (667, 'Autres charges exceptionnelles', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (668, 'Autres charges exceptionnelles', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (669, ' Charges exceptionnelles portées à l''actif au titre de frais de restructuration', 66, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (67, 'impôts sur le résultat', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (670, 'Impôts belge sur le résultat de l''exercice', 67, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6700, 'Impôts et précomptes dus ou versés', 670, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6701, 'Excédents de versement d''impôts et de précomptes portés à l''actifs (-)', 670, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6702, 'Charges fiscales estimées', 670, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (671, 'Impôts belges sur le résultats d''exercices antérieures', 67, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6710, 'Suppléments d''impôt dus ou versés', 671, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6711, 'Suppléments d''impôts estimés', 671, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6712, 'Provisions fiscales constituées', 671, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (672, 'Impôts étrangers sur le résultat de l''exercice', 67, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (673, 'Impôts étrangers sur le résultat d''exercice antérieures', 67, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (68, 'Transferts aux réserves immunisées', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (69, 'Affectations et prélévements', 6, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (690, 'Perte reportée de l''exercice précédent', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (691, 'Dotation à la réserve légale', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (692, 'Dotation aux autres réserves', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (693, 'Bénéfice à reporter', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (694, 'Rémunération du capital', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (695, 'Administrateurs ou gérants', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (696, 'Autres allocataires', 69, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (70, 'Chiffre d''affaire', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (700, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (701, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (702, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (703, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (704, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (706, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (707, 'Ventes et prestations de services', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (709, 'Remises, ristournes et rabais accordés(-)', 70, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (71, 'Variations des stocks et commandes en cours d''éxécution', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (712, 'des en-cours de fabrication', 71, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (713, 'des produits finis', 71, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (715, 'des immeubles construits destinés à la vente', 71, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (717, ' des commandes en cours d''éxécution', 71, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7170, 'Valeur d''acquisition', 717, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7171, 'Bénéfice pris en compte', 717, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (72, 'Production immobilisée', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (74, 'Autres produits d''exploitation', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (740, 'Subsides d'' exploitation et montants compensatoires', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (741, 'Plus-values sur réalisation courantes d'' immobilisations corporelles', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (742, 'Plus-values sur réalisations de créances commerciales', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (743, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (744, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (745, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (746, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (747, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (748, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (749, 'Produits d''exploitations divers', 74, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (75, 'Produits financiers', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (750, 'Produits sur immobilisations financières', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (751, 'Produits des actifs circulants', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (752, 'Plus-value sur réalisations d''actis circulants', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (753, 'Subsides en capital et intérêts', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (754, 'Différences de change', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (755, 'Ecarts de conversion des devises', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (756, 'Produits financiers divers', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (757, 'Produits financiers divers', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (758, 'Produits financiers divers', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (759, 'Produits financiers divers', 75, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (76, 'Produits exceptionnels', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (760, 'Reprise d''amortissements et de réductions de valeur', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7601, 'sur immobilisations corporelles', 760, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7602, 'sur immobilisations incorporelles', 760, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (761, 'Reprises de réductions de valeur sur immobilisations financières', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (762, 'Reprises de provisions pour risques et charges exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (763, 'Plus-value sur réalisation d''actifs immobilisé', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (764, 'Autres produits exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (765, 'Autres produits exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (766, 'Autres produits exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (767, 'Autres produits exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (768, 'Autres produits exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (769, 'Autres produits exceptionnels', 76, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (77, 'Régularisations d''impôts et reprises de provisions fiscales', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (771, 'impôts belges sur le résultat', 77, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7710, 'Régularisations d''impôts dus ou versé', 771, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7711, 'Régularisations d''impôts estimés', 771, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7712, 'Reprises de provisions fiscales', 771, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (773, 'Impôts étrangers sur le résultats', 77, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (79, 'Affectations et prélévements', 7, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (790, 'Bénéfice reporté de l''exercice précédent', 79, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (791, 'Prélévement sur le capital et les primes d''émission', 79, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (792, 'Prélévement sur les réserves', 79, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (793, 'Perte à reporter', 79, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (794, 'Intervention d''associés (ou du propriétaire) dans la perte', 79, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (1, 'Fonds propres, provisions pour risques et charges à plus d''un an', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2, 'Frais d''établissement, actifs immobilisés et créances à plus d''un an', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (3, 'Stocks et commandes en cours d''éxécution', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4, 'Créances et dettes à un an au plus', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (5, 'Placements de trésorerie et valeurs disponibles', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6, 'Charges', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (7, 'Produits', 0, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4000001, 'Client 1', 400, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4000002, 'Client 2', 400, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (70002, 'Marchandise B', 700, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4400001, 'Fournisseur A', 440, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4400002, 'Fournisseur B', 440, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (610001, 'fourniture A', 61, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (55000002, 'Argenta', 5500, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (55000001, 'Banque 1', 5500, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4000003, 'Client fiche', 400, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4000004, 'Toto', 400, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4000005, 'NOUVEAU CLIENT', 400, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4511, 'TVA à payer 21%', 451, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4512, 'TVA à payer 12%', 451, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4513, 'TVA à payer 6%', 451, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4514, 'TVA à payer 0%', 451, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4111, 'TVA à récupérer 21%', 411, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4112, 'TVA à récupérer 12%', 411, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4113, 'TVA à récupérer 6% ', 411, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4114, 'TVA à récupérer 0%', 411, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (70004, 'Marchandise D', 700, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (70003, 'Marchandise C', 700, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (70001, 'Marchandise A', 700, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4400003, 'Fournisseur E', 440, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4400004, 'Propriétaire bureau', 440, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (101, 'Capital non appelé', 10, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (610002, 'Loyer', 61, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (4400005, 'Fournisseur Eau Gaz', 440, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (610003, 'eau, gaz electricité', 61, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (550, 'Banque 1', 55, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6040001, 'Marchandise A', 604, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6190, 'TVA récupérable par l''impôt', 61, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (6740, 'Dépense non admise', 67, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2400, 'matos', 24, 'BE'); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent, pcm_country) VALUES (2400001, 'Test1', 2400, 'BE'); - - --- --- Data for Name: tva_rate; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO tva_rate (tva_id, tva_label, tva_rate, tva_comment, tva_poste) VALUES (1, '21%', 0.2100, 'Tva applicable à tout ce qui bien et service divers', '4111,4511'); -INSERT INTO tva_rate (tva_id, tva_label, tva_rate, tva_comment, tva_poste) VALUES (2, '12%', 0.1200, 'Tva ', '4112,4512'); -INSERT INTO tva_rate (tva_id, tva_label, tva_rate, tva_comment, tva_poste) VALUES (3, '6%', 0.0600, 'Tva applicable aux journaux et livres', '4113,4513'); -INSERT INTO tva_rate (tva_id, tva_label, tva_rate, tva_comment, tva_poste) VALUES (4, '0%', 0.0000, 'Tva applicable lors de vente/achat intracommunautaire', '4114,4514'); - - --- --- Data for Name: user_local_pref; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO user_local_pref (user_id, parameter_type, parameter_value) VALUES ('france', 'PERIODE', '1'); -INSERT INTO user_local_pref (user_id, parameter_type, parameter_value) VALUES ('dany', 'PERIODE', '30'); -INSERT INTO user_local_pref (user_id, parameter_type, parameter_value) VALUES ('phpcompta', 'PERIODE', '57'); - - --- --- Data for Name: user_sec_act; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (1, 'france', 2); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (2, 'france', 1); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (3, 'france', 3); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (4, 'demo', 10); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (5, 'demo', 2); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (7, 'demo', 3); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (8, 'demo', 5); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (9, 'demo', 7); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (10, 'demo', 4); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (11, 'demo', 1); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (12, 'demo', 6); -INSERT INTO user_sec_act (ua_id, ua_login, ua_act_id) VALUES (13, 'demo', 8); - - --- --- Data for Name: user_sec_jrn; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (1, 'phpcompta', 1, ''); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (2, 'phpcompta', 2, ''); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (3, 'phpcompta', 3, ''); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (4, 'phpcompta', 4, ''); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (6, 'dany', 2, 'NO'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (7, 'dany', 1, 'NO'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (9, 'france', 4, 'W'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (10, 'france', 2, 'W'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (11, 'france', 1, 'R'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (12, 'france', 3, 'R'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (5, 'dany', 4, 'R'); -INSERT INTO user_sec_jrn (uj_id, uj_login, uj_jrn_id, uj_priv) VALUES (8, 'dany', 3, 'R'); - - --- --- Data for Name: version; Type: TABLE DATA; Schema: public; Owner: phpcompta --- - -INSERT INTO version (val) VALUES (28); - - --- --- PostgreSQL database dump complete --- - diff --git a/html/admin/sql/dossier1/function.sql b/html/admin/sql/dossier1/function.sql deleted file mode 100644 index 3480ab5f5..000000000 --- a/html/admin/sql/dossier1/function.sql +++ /dev/null @@ -1,582 +0,0 @@ -CREATE FUNCTION account_add(p_id poste_comptable, p_name character varying) RETURNS void - AS $$ -declare - nParent tmp_pcmn.pcm_val_parent%type; - nCount integer; -begin - select count(*) into nCount from tmp_pcmn where pcm_val=p_id; - if nCount = 0 then - nParent=account_parent(p_id); - insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) - values (p_id, p_name,nParent); - end if; -return; -end ; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_auto(p_fd_id integer) RETURNS boolean - AS $$ -declare - l_auto bool; -begin - select fd_create_account into l_auto from fiche_def where fd_id=p_fd_id; - if l_auto is null then - l_auto:=false; - end if; - return l_auto; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_compute(p_f_id integer) RETURNS poste_comptable - AS $$ -declare - class_base poste_comptable; - maxcode poste_comptable; -begin - select fd_class_base into class_base - from - fiche_def join fiche using (fd_id) - where - f_id=p_f_id; - raise notice 'account_compute class base %',class_base; - select count (pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base; - if maxcode = 0 then - maxcode:=class_base; - else - select max (pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base; - end if; - if maxcode = class_base then - maxcode:=class_base*1000; - end if; - maxcode:=maxcode+1; - raise notice 'account_compute Max code %',maxcode; - return maxcode; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_insert(p_f_id integer, p_account poste_comptable) RETURNS integer - AS $$ -declare -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nNew tmp_pcmn.pcm_val%type; -bAuto bool; -nFd_id integer; -nCount integer; -begin - - if length(trim(p_account)) != 0 then - raise notice 'p_account is not empty'; - select * into nCount from tmp_pcmn where pcm_val=p_account; - if nCount !=0 then - raise notice 'this account exists in tmp_pcmn '; - perform attribut_insert(p_f_id,5,to_char(p_account,'999999999999999999999999')); - else - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=account_parent(p_account); - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - perform attribut_insert(p_f_id,5,to_char(p_account,'999999999999999999999999')); - - end if; - else - raise notice 'p_account is empty'; - select fd_id into nFd_id from fiche where f_id=p_f_id; - bAuto:= account_auto(nFd_id); - if bAuto = true then - raise notice 'account generated automatically'; - nNew:=account_compute(p_f_id); - raise notice 'nNew %', nNew; - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=account_parent(nNew); - perform account_add (nNew,sName); - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999')); - - else - select fd_class_base into nNew from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if nNew is null or length(trim(nNew)) = 0 then - raise notice 'count is null'; - perform attribut_insert(p_f_id,5,null); - else - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999')); - end if; - end if; - end if; - -return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_parent(p_account poste_comptable) RETURNS poste_comptable - AS $$ -declare - nParent tmp_pcmn.pcm_val_parent%type; - sParent varchar; - nCount integer; -begin - sParent:=to_char(p_account,'9999999999999999'); - sParent:=trim(sParent); - nParent:=0; - while nParent = 0 loop - select count(*) into nCount - from tmp_pcmn - where - pcm_val = to_number(sParent,'9999999999999999'); - if nCount != 0 then - nParent:=to_number(sParent,'9999999999999999'); - end if; - sParent:= substr(sParent,1,length(sParent)-1); - if length(sParent) <= 0 then - raise exception 'Impossible de trouver le compte parent pour %',p_account; - end if; - end loop; - raise notice 'account_parent : Parent is %',nParent; - return nParent; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_update(p_f_id integer, p_account poste_comptable) RETURNS integer - AS $$ -declare -nMax fiche.f_id%type; -nCount integer; -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nJft_id attr_value.jft_id%type; -begin - - if length(trim(p_account)) != 0 then - select count(*) into nCount from tmp_pcmn where pcm_val=p_account; - if nCount = 0 then - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=fiche_account_parent(p_f_id); - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - end if; - end if; - select jft_id into njft_id from jnt_fic_att_value where f_id=p_f_id and ad_id=5; - update attr_value set av_text=p_account where jft_id=njft_id; - -return njft_id; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION attribut_insert(p_f_id integer, p_ad_id integer, p_value character varying) RETURNS void - AS $$ -declare - n_jft_id integer; -begin - select nextval('s_jnt_fic_att_value') into n_jft_id; - insert into jnt_fic_att_value (jft_id,f_id,ad_id) values (n_jft_id,p_f_id,p_ad_id); - insert into attr_value (jft_id,av_text) values (n_jft_id,trim(p_value)); -return; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION card_class_base(p_f_id integer) RETURNS poste_comptable - AS $$ -declare - n_poste fiche_def.fd_class_base%type; -begin - select fd_class_base into n_poste from fiche_def join fiche using -(fd_id) - where f_id=p_f_id; - if not FOUND then - raise exception 'Invalid fiche card_class_base(%)',p_f_id; - end if; -return n_poste; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION check_balance(p_grpt integer) RETURNS numeric - AS $$ -declare - amount_jrnx_debit numeric; - amount_jrnx_credit numeric; - amount_jrn numeric; -begin - select sum (j_montant) into amount_jrnx_credit - from jrnx - where - j_grpt=p_grpt - and j_debit=false; - select sum (j_montant) into amount_jrnx_debit - from jrnx - where - j_grpt=p_grpt - and j_debit=true; - select jr_montant into amount_jrn - from jrn - where - jr_grpt_id=p_grpt; - if ( amount_jrnx_debit != amount_jrnx_credit ) - then - return abs(amount_jrnx_debit-amount_jrnx_credit); - end if; - if ( amount_jrn != amount_jrnx_credit) - then - return -1*abs(amount_jrn - amount_jrnx_credit); - end if; - return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION correct_sequence(p_sequence text, p_col text, p_table text) RETURNS integer - AS $$ -declare -last_sequence int8; -max_sequence int8; -n integer; -begin - select count(*) into n from pg_class where relkind='S' and relname=lower(p_sequence); - if n = 0 then - raise exception ' Unknow sequence % ',p_sequence; - end if; - select count(*) into n from pg_class where relkind='r' and relname=lower(p_table); - if n = 0 then - raise exception ' Unknow table % ',p_table; - end if; - execute 'select last_value from '||p_sequence into last_sequence; - raise notice 'Last value of the sequence is %', last_sequence; - execute 'select max('||p_col||') from '||p_table into max_sequence; - if max_sequence is null then - max_sequence := 0; - end if; - raise notice 'Max value of the sequence is %', max_sequence; - max_sequence:= max_sequence +1; - execute 'alter sequence '||p_sequence||' restart with '||max_sequence; -return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION drop_it(p_constraint character varying) RETURNS void - AS $$ -declare - nCount integer; -begin - select count(*) into nCount from pg_constraint where conname=p_constraint; - if nCount = 1 then - execute 'alter table parm_periode drop constraint '||p_constraint ; - end if; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION fiche_account_parent(p_f_id integer) RETURNS poste_comptable - AS $$ -declare -ret poste_comptable; -begin - select fd_class_base into ret from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if not FOUND then - raise exception '% N''existe pas',p_f_id; - end if; - return ret; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_jrnx(p_date character varying, p_montant numeric, p_poste integer, p_grpt integer, p_jrn_def integer, p_debit boolean, p_tech_user text, p_tech_per integer, p_qcode text) RETURNS void - AS $$ -declare - sCode varchar; - nCount_qcode integer; -begin - sCode=trim(p_qcode); - if length(sCode) = 0 or p_qcode is null then - select count(*) into nCount_qcode - from vw_poste_qcode where j_poste=p_poste; - if nCount_qcode = 1 then - select j_qcode into sCode - from vw_poste_qcode where j_poste=p_poste; - else - sCode=NULL; - end if; - - end if; - if p_montant = 0.0 then - return; - end if; - insert into jrnx - ( - j_date, - j_montant, - j_poste, - j_grpt, - j_jrn_def, - j_debit, - j_tech_user, - j_tech_per, - j_qcode - ) values - ( - to_date(p_date,'DD.MM.YYYY'), - p_montant, - p_poste, - p_grpt, - p_jrn_def, - p_debit, - p_tech_user, - p_tech_per, - sCode - ); -return; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_quant_sold(p_internal text, p_fiche character varying, p_quant numeric, p_price numeric, p_vat numeric, p_vat_code integer, p_client character varying) RETURNS void - AS $$ -declare - fid_client integer; - fid_good integer; -begin - select f_id into fid_client from - attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_client); - select f_id into fid_good from - attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_fiche); - insert into quant_sold - (qs_internal,qs_fiche,qs_quantite,qs_price,qs_vat,qs_vat_code,qs_client) - values - (p_internal,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client); - return; -end; - $$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_quick_code(nf_id integer, tav_text text) RETURNS integer - AS $$ - declare - ns integer; - nExist integer; - tText text; - begin - tText := upper(trim(tav_text)); - tText := replace(tText,' ',''); - - loop - select nextval('s_jnt_fic_att_value') into ns; - if length (tText) = 0 or tText is null then - tText := 'FID'||ns; - end if; - select count(*) into nExist - from jnt_fic_att_value join attr_value using (jft_id) - where - ad_id=23 and av_text=upper(tText); - if nExist = 0 then - exit; - end if; - tText:='FID'||ns; - end loop; - insert into jnt_fic_att_value values (ns,nf_id,23); - insert into attr_value values (ns,upper(tText)); - return ns; - end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION proc_check_balance() RETURNS "trigger" - AS $$ -declare - diff numeric; - tt integer; -begin - if TG_OP = 'INSERT' then - tt=NEW.jr_grpt_id; - diff:=check_balance(tt); - if diff != 0 then - raise exception 'balance error %',diff ; - end if; - return NEW; - end if; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION t_document_type_insert() RETURNS "trigger" - AS $$ -declare -nCounter integer; - BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.dt_id; -if nCounter = 0 then - execute 'create sequence seq_doc_type_'||NEW.dt_id; -raise notice 'Creating sequence seq_doc_type_%',NEW.dt_id; -end if; - RETURN NEW; - END; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION t_jrn_def_sequence() RETURNS "trigger" - AS $$ -declare -nCounter integer; - BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.jrn_def_id; -if nCounter = 0 then - execute 'create sequence s_jrn_'||NEW.jrn_def_id; - raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; -end if; - RETURN NEW; - END; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION trim_cvs_quote() RETURNS "trigger" - AS $$ -declare - modified import_tmp%ROWTYPE; -begin - modified:=NEW; - modified.devise=replace(new.devise,'"',''); - modified.poste_comptable=replace(new.poste_comptable,'"',''); - modified.compte_ordre=replace(NEW.COMPTE_ORDRE,'"',''); - modified.detail=replace(NEW.DETAIL,'"',''); - modified.num_compte=replace(NEW.NUM_COMPTE,'"',''); - return modified; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION trim_space_format_csv_banque() RETURNS "trigger" - AS $$ -declare - modified format_csv_banque%ROWTYPE; -begin - modified.name=trim(NEW.NAME); - modified.include_file=trim(new.include_file); - if ( length(modified.name) = 0 ) then - modified.name=null; - end if; - if ( length(modified.include_file) = 0 ) then - modified.include_file=null; - end if; - return modified; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_delete(integer) RETURNS void - AS $_$ -declare - p_tva_id alias for $1; - nCount integer; -begin - nCount=0; - select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id; - if nCount = 0 then - delete from tva_rate where tva_id=p_tva_id; - end if; - return; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_insert(integer, text, numeric, text, text) RETURNS integer - AS $_$ -declare -p_tva_id alias for $1; -p_tva_label alias for $2; -p_tva_rate alias for $3; -p_tva_comment alias for $4; -p_tva_poste alias for $5; -debit text; -credit text; -nCount integer; -begin -if length(trim(p_tva_label)) = 0 then - return 3; -end if; -select count(*) into nCount from tva_rate - where tva_id=p_tva_id; -if nCount != 0 then - return 5; -end if; -if length(trim(p_tva_poste)) != 0 then - if position (',' in p_tva_poste) = 0 then return 4; end if; - debit = split_part(p_tva_poste,',',1); - credit = split_part(p_tva_poste,',',2); - select count(*) into nCount from tmp_pcmn where pcm_val=debit; - if nCount = 0 then return 4; end if; - select count(*) into nCount from tmp_pcmn where pcm_val=credit; - if nCount = 0 then return 4; end if; - -end if; -insert into tva_rate(tva_id,tva_label,tva_rate,tva_comment,tva_poste) - values (p_tva_id,p_tva_label,p_tva_rate,p_tva_comment,p_tva_poste); -return 0; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_modify(integer, text, numeric, text, text) RETURNS integer - AS $_$declare -p_tva_id alias for $1; -p_tva_label alias for $2; -p_tva_rate alias for $3; -p_tva_comment alias for $4; -p_tva_poste alias for $5; -debit text; -credit text; -nCount integer; -begin -if length(trim(p_tva_label)) = 0 then - return 3; -end if; -if length(trim(p_tva_poste)) != 0 then - if position (',' in p_tva_poste) = 0 then return 4; end if; - debit = split_part(p_tva_poste,',',1); - credit = split_part(p_tva_poste,',',2); - select count(*) into nCount from tmp_pcmn where pcm_val=debit; - if nCount = 0 then return 4; end if; - select count(*) into nCount from tmp_pcmn where pcm_val=credit; - if nCount = 0 then return 4; end if; - -end if; -update tva_rate set tva_label=p_tva_label,tva_rate=p_tva_rate,tva_comment=p_tva_comment,tva_poste=p_tva_poste - where tva_id=p_tva_id; -return 0; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION update_quick_code(njft_id integer, tav_text text) RETURNS integer - AS $$ - declare - ns integer; - nExist integer; - tText text; - old_qcode varchar; - begin - select av_text into old_qcode from attr_value where jft_id=njft_id; - if tav_text = upper( trim(old_qcode)) then - return 0; - end if; - - tText := trim(upper(tav_text)); - tText := replace(tText,' ',''); - if length ( tText) = 0 or tText is null then - return 0; - end if; - - ns := njft_id; - loop - select count(*) into nExist - from jnt_fic_att_value join attr_value using (jft_id) - where - ad_id=23 and av_text=tText; - if nExist = 0 then - exit; - end if; - if tText = 'FID'||ns then - select nextval('s_jnt_fic_att_value') into ns; - end if; - tText :='FID'||ns; - - end loop; - update attr_value set av_text = tText where jft_id=njft_id; - update attr_value set av_text = tText - where jft_id in - ( select jft_id - from jnt_fic_att_value join attr_value using (jft_id) - where ad_id=25 and av_text=old_qcode); - update jrnx set j_qcode=tText where j_qcode = old_qcode; - return ns; - end; -$$ - LANGUAGE plpgsql; diff --git a/html/admin/sql/dossier1/index.sql b/html/admin/sql/dossier1/index.sql deleted file mode 100644 index fc9949796..000000000 --- a/html/admin/sql/dossier1/index.sql +++ /dev/null @@ -1,24 +0,0 @@ -CREATE UNIQUE INDEX attr_value_jft_id ON attr_value USING btree (jft_id); -CREATE UNIQUE INDEX fd_id_ad_id_x ON jnt_fic_attr USING btree (fd_id, ad_id); -CREATE INDEX fk_attr_value_jft_id ON attr_value USING btree (jft_id); -CREATE INDEX fk_centralized_c_jrn_def ON centralized USING btree (c_jrn_def); -CREATE INDEX fk_centralized_c_poste ON centralized USING btree (c_poste); -CREATE INDEX fk_fiche_def_frd_id ON fiche_def USING btree (frd_id); -CREATE INDEX fk_fiche_fd_id ON fiche USING btree (fd_id); -CREATE INDEX fk_form_fo_fr_id ON form USING btree (fo_fr_id); -CREATE INDEX fk_jrn_action_ja_jrn_type ON jrn_action USING btree (ja_jrn_type); -CREATE INDEX fk_jrn_def ON jrnx USING btree (j_jrn_def); -CREATE INDEX fk_jrnx_j_poste ON jrnx USING btree (j_poste); -CREATE INDEX fk_stock_goods_f_id ON stock_goods USING btree (f_id); -CREATE INDEX fk_stock_goods_j_id ON stock_goods USING btree (j_id); -CREATE INDEX fk_user_sec_act ON user_sec_act USING btree (ua_act_id); -CREATE INDEX fk_user_sec_jrn ON user_sec_jrn USING btree (uj_jrn_id); -CREATE UNIQUE INDEX idx_case ON format_csv_banque USING btree (upper(name)); -CREATE INDEX idx_qs_internal ON quant_sold USING btree (qs_internal); -CREATE UNIQUE INDEX ix_iv_name ON invoice USING btree (upper(iv_name)); -CREATE UNIQUE INDEX k_ag_ref ON action_gestion USING btree (ag_ref); -CREATE UNIQUE INDEX x_act ON "action" USING btree (ac_description); -CREATE UNIQUE INDEX x_jrn_jr_id ON jrn USING btree (jr_id); -CREATE UNIQUE INDEX x_periode ON parm_periode USING btree (p_start, p_end); -CREATE INDEX x_poste ON jrnx USING btree (j_poste); -CREATE UNIQUE INDEX x_usr_jrn ON user_sec_jrn USING btree (uj_login, uj_jrn_id); diff --git a/html/admin/sql/dossier1/make-sql b/html/admin/sql/dossier1/make-sql deleted file mode 100755 index 30d1687cf..000000000 --- a/html/admin/sql/dossier1/make-sql +++ /dev/null @@ -1,21 +0,0 @@ -pg_dump -O -U phpcompta -s dossier1 | awk '!/--/ {if ( ! /^$/) print $0;}'|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" > schema.sql -awk '/SEQUENCE/,/;/ { print $0;}' < schema.sql > sequence.sql -awk '/CREATE DOMAIN/,/;/ { print $0;}' < schema.sql > table.sql -awk '/CREATE TABLE/,/;/ { print $0;}' < schema.sql >> table.sql -awk '/CREATE VIEW/,/;/ { print $0;}' < schema.sql > view.sql -awk '/INDEX/,/;/ { print $0;}' < schema.sql > index.sql -( -echo " SET client_encoding = 'LATIN1';" -echo " SET check_function_bodies = false;" -echo " SET client_min_messages = warning;" -echo "SET search_path = public, pg_catalog;" -)> constraint.sql - -awk '/ALTER TABLE/,/;/ { print $0;}' < schema.sql >> constraint.sql -awk '/CREATE FUNCTION/,/LANGUAGE/ { print $0;}' < schema.sql > function.sql -awk '/COMMENT/,/;/ {print $0;}' < schema.sql > comment.sql -sed -i -e "/ALTER TABLE.*/d" -e "/ADD CONSTRAINT/d" -e "/CREATE PROCEDURAL/d" schema.sql - -grep setval schema.sql >> sequence.sql -pg_dump -U phpcompta -D -a -O dossier1 > data.sql - diff --git a/html/admin/sql/dossier1/schema.sql b/html/admin/sql/dossier1/schema.sql deleted file mode 100644 index 315233f47..000000000 --- a/html/admin/sql/dossier1/schema.sql +++ /dev/null @@ -1,1195 +0,0 @@ -SET client_encoding = 'LATIN1'; -SET check_function_bodies = false; -SET client_min_messages = warning; - -SET search_path = public, pg_catalog; -CREATE DOMAIN poste_comptable AS numeric(25,0); -CREATE FUNCTION account_add(p_id poste_comptable, p_name character varying) RETURNS void - AS $$ -declare - nParent tmp_pcmn.pcm_val_parent%type; - nCount integer; -begin - select count(*) into nCount from tmp_pcmn where pcm_val=p_id; - if nCount = 0 then - nParent=account_parent(p_id); - insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) - values (p_id, p_name,nParent); - end if; -return; -end ; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_auto(p_fd_id integer) RETURNS boolean - AS $$ -declare - l_auto bool; -begin - select fd_create_account into l_auto from fiche_def where fd_id=p_fd_id; - if l_auto is null then - l_auto:=false; - end if; - return l_auto; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_compute(p_f_id integer) RETURNS poste_comptable - AS $$ -declare - class_base poste_comptable; - maxcode poste_comptable; -begin - select fd_class_base into class_base - from - fiche_def join fiche using (fd_id) - where - f_id=p_f_id; - raise notice 'account_compute class base %',class_base; - select count (pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base; - if maxcode = 0 then - maxcode:=class_base; - else - select max (pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base; - end if; - if maxcode = class_base then - maxcode:=class_base*1000; - end if; - maxcode:=maxcode+1; - raise notice 'account_compute Max code %',maxcode; - return maxcode; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_insert(p_f_id integer, p_account poste_comptable) RETURNS integer - AS $$ -declare -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nNew tmp_pcmn.pcm_val%type; -bAuto bool; -nFd_id integer; -nCount integer; -begin - - if length(trim(p_account)) != 0 then - raise notice 'p_account is not empty'; - select * into nCount from tmp_pcmn where pcm_val=p_account; - if nCount !=0 then - raise notice 'this account exists in tmp_pcmn '; - perform attribut_insert(p_f_id,5,to_char(p_account,'999999999999999999999999')); - else - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=account_parent(p_account); - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - perform attribut_insert(p_f_id,5,to_char(p_account,'999999999999999999999999')); - - end if; - else - raise notice 'p_account is empty'; - select fd_id into nFd_id from fiche where f_id=p_f_id; - bAuto:= account_auto(nFd_id); - if bAuto = true then - raise notice 'account generated automatically'; - nNew:=account_compute(p_f_id); - raise notice 'nNew %', nNew; - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=account_parent(nNew); - perform account_add (nNew,sName); - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999')); - - else - select fd_class_base into nNew from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if nNew is null or length(trim(nNew)) = 0 then - raise notice 'count is null'; - perform attribut_insert(p_f_id,5,null); - else - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999')); - end if; - end if; - end if; - -return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_parent(p_account poste_comptable) RETURNS poste_comptable - AS $$ -declare - nParent tmp_pcmn.pcm_val_parent%type; - sParent varchar; - nCount integer; -begin - sParent:=to_char(p_account,'9999999999999999'); - sParent:=trim(sParent); - nParent:=0; - while nParent = 0 loop - select count(*) into nCount - from tmp_pcmn - where - pcm_val = to_number(sParent,'9999999999999999'); - if nCount != 0 then - nParent:=to_number(sParent,'9999999999999999'); - end if; - sParent:= substr(sParent,1,length(sParent)-1); - if length(sParent) <= 0 then - raise exception 'Impossible de trouver le compte parent pour %',p_account; - end if; - end loop; - raise notice 'account_parent : Parent is %',nParent; - return nParent; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_update(p_f_id integer, p_account poste_comptable) RETURNS integer - AS $$ -declare -nMax fiche.f_id%type; -nCount integer; -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nJft_id attr_value.jft_id%type; -begin - - if length(trim(p_account)) != 0 then - select count(*) into nCount from tmp_pcmn where pcm_val=p_account; - if nCount = 0 then - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=fiche_account_parent(p_f_id); - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - end if; - end if; - select jft_id into njft_id from jnt_fic_att_value where f_id=p_f_id and ad_id=5; - update attr_value set av_text=p_account where jft_id=njft_id; - -return njft_id; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION attribut_insert(p_f_id integer, p_ad_id integer, p_value character varying) RETURNS void - AS $$ -declare - n_jft_id integer; -begin - select nextval('s_jnt_fic_att_value') into n_jft_id; - insert into jnt_fic_att_value (jft_id,f_id,ad_id) values (n_jft_id,p_f_id,p_ad_id); - insert into attr_value (jft_id,av_text) values (n_jft_id,trim(p_value)); -return; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION card_class_base(p_f_id integer) RETURNS poste_comptable - AS $$ -declare - n_poste fiche_def.fd_class_base%type; -begin - select fd_class_base into n_poste from fiche_def join fiche using -(fd_id) - where f_id=p_f_id; - if not FOUND then - raise exception 'Invalid fiche card_class_base(%)',p_f_id; - end if; -return n_poste; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION check_balance(p_grpt integer) RETURNS numeric - AS $$ -declare - amount_jrnx_debit numeric; - amount_jrnx_credit numeric; - amount_jrn numeric; -begin - select sum (j_montant) into amount_jrnx_credit - from jrnx - where - j_grpt=p_grpt - and j_debit=false; - select sum (j_montant) into amount_jrnx_debit - from jrnx - where - j_grpt=p_grpt - and j_debit=true; - select jr_montant into amount_jrn - from jrn - where - jr_grpt_id=p_grpt; - if ( amount_jrnx_debit != amount_jrnx_credit ) - then - return abs(amount_jrnx_debit-amount_jrnx_credit); - end if; - if ( amount_jrn != amount_jrnx_credit) - then - return -1*abs(amount_jrn - amount_jrnx_credit); - end if; - return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION correct_sequence(p_sequence text, p_col text, p_table text) RETURNS integer - AS $$ -declare -last_sequence int8; -max_sequence int8; -n integer; -begin - select count(*) into n from pg_class where relkind='S' and relname=lower(p_sequence); - if n = 0 then - raise exception ' Unknow sequence % ',p_sequence; - end if; - select count(*) into n from pg_class where relkind='r' and relname=lower(p_table); - if n = 0 then - raise exception ' Unknow table % ',p_table; - end if; - execute 'select last_value from '||p_sequence into last_sequence; - raise notice 'Last value of the sequence is %', last_sequence; - execute 'select max('||p_col||') from '||p_table into max_sequence; - if max_sequence is null then - max_sequence := 0; - end if; - raise notice 'Max value of the sequence is %', max_sequence; - max_sequence:= max_sequence +1; - execute 'alter sequence '||p_sequence||' restart with '||max_sequence; -return 0; -end; -$$ - LANGUAGE plpgsql; -COMMENT ON FUNCTION correct_sequence(p_sequence text, p_col text, p_table text) IS ' Often the primary key is a sequence number and sometimes the value of the sequence is not synchronized with the primary key ( p_sequence : sequence name, p_col : col of the pk,p_table : concerned table'; -CREATE FUNCTION drop_it(p_constraint character varying) RETURNS void - AS $$ -declare - nCount integer; -begin - select count(*) into nCount from pg_constraint where conname=p_constraint; - if nCount = 1 then - execute 'alter table parm_periode drop constraint '||p_constraint ; - end if; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION fiche_account_parent(p_f_id integer) RETURNS poste_comptable - AS $$ -declare -ret poste_comptable; -begin - select fd_class_base into ret from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if not FOUND then - raise exception '% N''existe pas',p_f_id; - end if; - return ret; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_jrnx(p_date character varying, p_montant numeric, p_poste integer, p_grpt integer, p_jrn_def integer, p_debit boolean, p_tech_user text, p_tech_per integer, p_qcode text) RETURNS void - AS $$ -declare - sCode varchar; - nCount_qcode integer; -begin - sCode=trim(p_qcode); - if length(sCode) = 0 or p_qcode is null then - select count(*) into nCount_qcode - from vw_poste_qcode where j_poste=p_poste; - if nCount_qcode = 1 then - select j_qcode into sCode - from vw_poste_qcode where j_poste=p_poste; - else - sCode=NULL; - end if; - - end if; - if p_montant = 0.0 then - return; - end if; - insert into jrnx - ( - j_date, - j_montant, - j_poste, - j_grpt, - j_jrn_def, - j_debit, - j_tech_user, - j_tech_per, - j_qcode - ) values - ( - to_date(p_date,'DD.MM.YYYY'), - p_montant, - p_poste, - p_grpt, - p_jrn_def, - p_debit, - p_tech_user, - p_tech_per, - sCode - ); -return; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_quant_sold(p_internal text, p_fiche character varying, p_quant numeric, p_price numeric, p_vat numeric, p_vat_code integer, p_client character varying) RETURNS void - AS $$ -declare - fid_client integer; - fid_good integer; -begin - select f_id into fid_client from - attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_client); - select f_id into fid_good from - attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_fiche); - insert into quant_sold - (qs_internal,qs_fiche,qs_quantite,qs_price,qs_vat,qs_vat_code,qs_client) - values - (p_internal,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client); - return; -end; - $$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_quick_code(nf_id integer, tav_text text) RETURNS integer - AS $$ - declare - ns integer; - nExist integer; - tText text; - begin - tText := upper(trim(tav_text)); - tText := replace(tText,' ',''); - - loop - select nextval('s_jnt_fic_att_value') into ns; - if length (tText) = 0 or tText is null then - tText := 'FID'||ns; - end if; - select count(*) into nExist - from jnt_fic_att_value join attr_value using (jft_id) - where - ad_id=23 and av_text=upper(tText); - if nExist = 0 then - exit; - end if; - tText:='FID'||ns; - end loop; - insert into jnt_fic_att_value values (ns,nf_id,23); - insert into attr_value values (ns,upper(tText)); - return ns; - end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION proc_check_balance() RETURNS "trigger" - AS $$ -declare - diff numeric; - tt integer; -begin - if TG_OP = 'INSERT' then - tt=NEW.jr_grpt_id; - diff:=check_balance(tt); - if diff != 0 then - raise exception 'balance error %',diff ; - end if; - return NEW; - end if; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION t_document_type_insert() RETURNS "trigger" - AS $$ -declare -nCounter integer; - BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.dt_id; -if nCounter = 0 then - execute 'create sequence seq_doc_type_'||NEW.dt_id; -raise notice 'Creating sequence seq_doc_type_%',NEW.dt_id; -end if; - RETURN NEW; - END; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION t_jrn_def_sequence() RETURNS "trigger" - AS $$ -declare -nCounter integer; - BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.jrn_def_id; -if nCounter = 0 then - execute 'create sequence s_jrn_'||NEW.jrn_def_id; - raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; -end if; - RETURN NEW; - END; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION trim_cvs_quote() RETURNS "trigger" - AS $$ -declare - modified import_tmp%ROWTYPE; -begin - modified:=NEW; - modified.devise=replace(new.devise,'"',''); - modified.poste_comptable=replace(new.poste_comptable,'"',''); - modified.compte_ordre=replace(NEW.COMPTE_ORDRE,'"',''); - modified.detail=replace(NEW.DETAIL,'"',''); - modified.num_compte=replace(NEW.NUM_COMPTE,'"',''); - return modified; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION trim_space_format_csv_banque() RETURNS "trigger" - AS $$ -declare - modified format_csv_banque%ROWTYPE; -begin - modified.name=trim(NEW.NAME); - modified.include_file=trim(new.include_file); - if ( length(modified.name) = 0 ) then - modified.name=null; - end if; - if ( length(modified.include_file) = 0 ) then - modified.include_file=null; - end if; - return modified; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_delete(integer) RETURNS void - AS $_$ -declare - p_tva_id alias for $1; - nCount integer; -begin - nCount=0; - select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id; - if nCount = 0 then - delete from tva_rate where tva_id=p_tva_id; - end if; - return; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_insert(integer, text, numeric, text, text) RETURNS integer - AS $_$ -declare -p_tva_id alias for $1; -p_tva_label alias for $2; -p_tva_rate alias for $3; -p_tva_comment alias for $4; -p_tva_poste alias for $5; -debit text; -credit text; -nCount integer; -begin -if length(trim(p_tva_label)) = 0 then - return 3; -end if; -select count(*) into nCount from tva_rate - where tva_id=p_tva_id; -if nCount != 0 then - return 5; -end if; -if length(trim(p_tva_poste)) != 0 then - if position (',' in p_tva_poste) = 0 then return 4; end if; - debit = split_part(p_tva_poste,',',1); - credit = split_part(p_tva_poste,',',2); - select count(*) into nCount from tmp_pcmn where pcm_val=debit; - if nCount = 0 then return 4; end if; - select count(*) into nCount from tmp_pcmn where pcm_val=credit; - if nCount = 0 then return 4; end if; - -end if; -insert into tva_rate(tva_id,tva_label,tva_rate,tva_comment,tva_poste) - values (p_tva_id,p_tva_label,p_tva_rate,p_tva_comment,p_tva_poste); -return 0; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_modify(integer, text, numeric, text, text) RETURNS integer - AS $_$declare -p_tva_id alias for $1; -p_tva_label alias for $2; -p_tva_rate alias for $3; -p_tva_comment alias for $4; -p_tva_poste alias for $5; -debit text; -credit text; -nCount integer; -begin -if length(trim(p_tva_label)) = 0 then - return 3; -end if; -if length(trim(p_tva_poste)) != 0 then - if position (',' in p_tva_poste) = 0 then return 4; end if; - debit = split_part(p_tva_poste,',',1); - credit = split_part(p_tva_poste,',',2); - select count(*) into nCount from tmp_pcmn where pcm_val=debit; - if nCount = 0 then return 4; end if; - select count(*) into nCount from tmp_pcmn where pcm_val=credit; - if nCount = 0 then return 4; end if; - -end if; -update tva_rate set tva_label=p_tva_label,tva_rate=p_tva_rate,tva_comment=p_tva_comment,tva_poste=p_tva_poste - where tva_id=p_tva_id; -return 0; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION update_quick_code(njft_id integer, tav_text text) RETURNS integer - AS $$ - declare - ns integer; - nExist integer; - tText text; - old_qcode varchar; - begin - select av_text into old_qcode from attr_value where jft_id=njft_id; - if tav_text = upper( trim(old_qcode)) then - return 0; - end if; - - tText := trim(upper(tav_text)); - tText := replace(tText,' ',''); - if length ( tText) = 0 or tText is null then - return 0; - end if; - - ns := njft_id; - loop - select count(*) into nExist - from jnt_fic_att_value join attr_value using (jft_id) - where - ad_id=23 and av_text=tText; - if nExist = 0 then - exit; - end if; - if tText = 'FID'||ns then - select nextval('s_jnt_fic_att_value') into ns; - end if; - tText :='FID'||ns; - - end loop; - update attr_value set av_text = tText where jft_id=njft_id; - update attr_value set av_text = tText - where jft_id in - ( select jft_id - from jnt_fic_att_value join attr_value using (jft_id) - where ad_id=25 and av_text=old_qcode); - update jrnx set j_qcode=tText where j_qcode = old_qcode; - return ns; - end; -$$ - LANGUAGE plpgsql; -SET default_tablespace = ''; -SET default_with_oids = false; -CREATE TABLE "action" ( - ac_id integer NOT NULL, - ac_description text NOT NULL -); -COMMENT ON TABLE "action" IS 'The different privileges'; -CREATE TABLE action_gestion ( - ag_id serial NOT NULL, - ag_type integer, - f_id_dest integer NOT NULL, - f_id_exp integer NOT NULL, - ag_title character varying(70), - ag_timestamp timestamp without time zone DEFAULT now(), - ag_cal character(1) DEFAULT 'C'::bpchar, - ag_ref_ag_id integer, - ag_comment text, - ag_ref text -); -COMMENT ON TABLE action_gestion IS 'Action for Managing'; -CREATE TABLE attr_def ( - ad_id integer DEFAULT nextval(('s_attr_def'::text)::regclass) NOT NULL, - ad_text text -); -COMMENT ON TABLE attr_def IS 'The available attributs for the cards'; -CREATE TABLE attr_min ( - frd_id integer, - ad_id integer -); -COMMENT ON TABLE attr_min IS 'The value of attributs for the cards'; -CREATE TABLE attr_value ( - jft_id integer, - av_text text -); -CREATE TABLE centralized ( - c_id integer DEFAULT nextval(('s_centralized'::text)::regclass) NOT NULL, - c_j_id integer, - c_date date NOT NULL, - c_internal text NOT NULL, - c_montant numeric(20,4) NOT NULL, - c_debit boolean DEFAULT true, - c_jrn_def integer NOT NULL, - c_poste poste_comptable, - c_description text, - c_grp integer NOT NULL, - c_comment text, - c_rapt text, - c_periode integer, - c_order integer -); -COMMENT ON TABLE centralized IS 'The centralized journal'; -CREATE TABLE document ( - d_id serial NOT NULL, - ag_id integer NOT NULL, - d_lob oid, - d_number bigint NOT NULL, - d_filename text, - d_mimetype text, - d_state integer -); -COMMENT ON TABLE document IS 'This table contains all the documents : summary and lob files'; -CREATE TABLE document_modele ( - md_id serial NOT NULL, - md_name text NOT NULL, - md_lob oid, - md_type integer NOT NULL, - md_filename text, - md_mimetype text -); -COMMENT ON TABLE document_modele IS ' contains all the template for the documents'; -CREATE SEQUENCE document_seq - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -COMMENT ON SEQUENCE document_seq IS 'Sequence for the sequence bound to the document modele'; -CREATE TABLE document_state ( - s_id serial NOT NULL, - s_value character varying(50) NOT NULL -); -COMMENT ON TABLE document_state IS 'State of the document'; -CREATE TABLE document_type ( - dt_id serial NOT NULL, - dt_value character varying(80) -); -COMMENT ON TABLE document_type IS 'Type of document : meeting, invoice,...'; -CREATE TABLE fiche ( - f_id integer DEFAULT nextval(('s_fiche'::text)::regclass) NOT NULL, - fd_id integer -); -COMMENT ON TABLE fiche IS 'Cards'; -CREATE TABLE fiche_def ( - fd_id integer DEFAULT nextval(('s_fdef'::text)::regclass) NOT NULL, - fd_class_base poste_comptable, - fd_label text NOT NULL, - fd_create_account boolean DEFAULT false, - frd_id integer NOT NULL -); -COMMENT ON TABLE fiche_def IS 'Cards definition'; -CREATE TABLE fiche_def_ref ( - frd_id integer DEFAULT nextval(('s_fiche_def_ref'::text)::regclass) NOT NULL, - frd_text text, - frd_class_base integer -); -COMMENT ON TABLE fiche_def_ref IS 'Family Cards definition'; -CREATE TABLE form ( - fo_id integer DEFAULT nextval(('s_form'::text)::regclass) NOT NULL, - fo_fr_id integer, - fo_pos integer, - fo_label text, - fo_formula text -); -COMMENT ON TABLE form IS 'Forms content'; -CREATE TABLE format_csv_banque ( - name text NOT NULL, - include_file text NOT NULL -); -CREATE TABLE formdef ( - fr_id integer DEFAULT nextval(('s_formdef'::text)::regclass) NOT NULL, - fr_label text -); -CREATE TABLE import_tmp ( - code text, - date_exec date, - date_valeur date, - montant text, - devise text, - compte_ordre text, - detail text, - num_compte text, - poste_comptable text, - status character varying(1) DEFAULT 'n'::character varying NOT NULL, - bq_account integer NOT NULL, - jrn integer NOT NULL, - jr_rapt text, - CONSTRAINT import_tmp_status_check CHECK ((((((status)::text = 't'::text) OR ((status)::text = 'd'::text)) OR ((status)::text = 'w'::text)) OR ((status)::text = 'n'::text))) -); -CREATE TABLE invoice ( - iv_id integer DEFAULT nextval(('s_invoice'::text)::regclass) NOT NULL, - iv_name text NOT NULL, - iv_file oid -); -CREATE TABLE jnt_fic_att_value ( - jft_id integer DEFAULT nextval(('s_jnt_fic_att_value'::text)::regclass) NOT NULL, - f_id integer, - ad_id integer -); -COMMENT ON TABLE jnt_fic_att_value IS 'join between the card and the attribut definition'; -CREATE SEQUENCE s_jnt_id - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE TABLE jnt_fic_attr ( - fd_id integer, - ad_id integer, - jnt_id bigint DEFAULT nextval('s_jnt_id'::regclass) NOT NULL -); -COMMENT ON TABLE jnt_fic_attr IS 'join between the family card and the attribut definition'; -CREATE TABLE jrn ( - jr_id integer DEFAULT nextval(('s_jrn'::text)::regclass) NOT NULL, - jr_def_id integer NOT NULL, - jr_montant numeric(20,4) NOT NULL, - jr_comment text, - jr_date date, - jr_grpt_id integer NOT NULL, - jr_internal text, - jr_tech_date timestamp without time zone DEFAULT now() NOT NULL, - jr_tech_per integer NOT NULL, - jrn_ech date, - jr_ech date, - jr_rapt text, - jr_valid boolean DEFAULT true, - jr_opid integer, - jr_c_opid integer, - jr_pj oid, - jr_pj_name text, - jr_pj_type text -); -COMMENT ON TABLE jrn IS 'Journal: content one line for a group of accountancy writing'; -CREATE TABLE jrn_action ( - ja_id integer DEFAULT nextval(('s_jrnaction'::text)::regclass) NOT NULL, - ja_name text NOT NULL, - ja_desc text, - ja_url text NOT NULL, - ja_action text NOT NULL, - ja_lang text DEFAULT 'FR'::text, - ja_jrn_type character(3) -); -COMMENT ON TABLE jrn_action IS 'Possible action when we are in journal (menu)'; -CREATE TABLE jrn_def ( - jrn_def_id integer DEFAULT nextval(('s_jrn_def'::text)::regclass) NOT NULL, - jrn_def_name text NOT NULL, - jrn_def_class_deb text, - jrn_def_class_cred text, - jrn_def_fiche_deb text, - jrn_def_fiche_cred text, - jrn_deb_max_line integer DEFAULT 1, - jrn_cred_max_line integer DEFAULT 1, - jrn_def_ech boolean DEFAULT false, - jrn_def_ech_lib text, - jrn_def_type character(3) NOT NULL, - jrn_def_code text NOT NULL -); -COMMENT ON TABLE jrn_def IS 'Definition of a journal, his properties'; -CREATE TABLE jrn_rapt ( - jra_id integer DEFAULT nextval(('s_jrn_rapt'::text)::regclass) NOT NULL, - jr_id integer NOT NULL, - jra_concerned integer NOT NULL -); -COMMENT ON TABLE jrn_rapt IS 'Rapprochement between operation'; -CREATE TABLE jrn_type ( - jrn_type_id character(3) NOT NULL, - jrn_desc text -); -COMMENT ON TABLE jrn_type IS 'Type of journal (Sell, Buy, Financial...)'; -CREATE TABLE jrnx ( - j_id integer DEFAULT nextval(('s_jrn_op'::text)::regclass) NOT NULL, - j_date date DEFAULT now(), - j_montant numeric(20,4) DEFAULT 0, - j_poste poste_comptable NOT NULL, - j_grpt integer NOT NULL, - j_rapt text, - j_jrn_def integer NOT NULL, - j_debit boolean DEFAULT true, - j_text text, - j_centralized boolean DEFAULT false, - j_internal text, - j_tech_user text NOT NULL, - j_tech_date timestamp without time zone DEFAULT now() NOT NULL, - j_tech_per integer NOT NULL, - j_qcode text -); -COMMENT ON TABLE jrnx IS 'Journal: content one line for each accountancy writing'; -CREATE TABLE parameter ( - pr_id text NOT NULL, - pr_value text -); -CREATE TABLE parm_code ( - p_code text NOT NULL, - p_value text, - p_comment text -); -CREATE TABLE parm_money ( - pm_id integer DEFAULT nextval(('s_currency'::text)::regclass), - pm_code character(3) NOT NULL, - pm_rate numeric(20,4) -); -COMMENT ON TABLE parm_money IS 'Currency conversion'; -CREATE TABLE parm_periode ( - p_id integer DEFAULT nextval(('s_periode'::text)::regclass) NOT NULL, - p_start date NOT NULL, - p_end date NOT NULL, - p_exercice text DEFAULT to_char(now(), 'YYYY'::text) NOT NULL, - p_closed boolean DEFAULT false, - p_central boolean DEFAULT false, - CONSTRAINT parm_periode_check CHECK ((p_end >= p_start)) -); -COMMENT ON TABLE parm_periode IS 'Periode definition'; -CREATE TABLE quant_sold ( - qs_id integer DEFAULT nextval(('s_quantity'::text)::regclass) NOT NULL, - qs_internal text NOT NULL, - qs_fiche integer NOT NULL, - qs_quantite numeric(20,4) NOT NULL, - qs_price numeric(20,4), - qs_vat numeric(20,4), - qs_vat_code integer, - qs_client integer NOT NULL -); -COMMENT ON TABLE quant_sold IS 'Contains about invoice for customer'; -CREATE SEQUENCE s_attr_def - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_cbc - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_central - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_central_order - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_centralized - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_currency - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_fdef - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_fiche - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_fiche_def_ref - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_form - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_formdef - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_grpt - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_idef - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_internal - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_invoice - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jnt_fic_att_value - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_1 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_2 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_3 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_4 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_def - START WITH 5 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_op - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_rapt - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrnaction - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrnx - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_periode - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_quantity - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_stock_goods - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_user_act - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_user_jrn - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_1 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_2 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_3 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_4 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_5 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_6 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_7 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_8 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_9 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE TABLE stock_goods ( - sg_id integer DEFAULT nextval(('s_stock_goods'::text)::regclass) NOT NULL, - j_id integer, - f_id integer NOT NULL, - sg_code text, - sg_quantity numeric(8,4) DEFAULT 0, - sg_type character(1) DEFAULT 'c'::bpchar NOT NULL, - sg_date date, - sg_tech_date date DEFAULT now(), - sg_tech_user text, - sg_comment character varying(80), - sg_exercice character varying(4), - CONSTRAINT stock_goods_sg_type CHECK (((sg_type = 'c'::bpchar) OR (sg_type = 'd'::bpchar))) -); -COMMENT ON TABLE stock_goods IS 'About the goods'; -CREATE TABLE tmp_pcmn ( - pcm_val poste_comptable NOT NULL, - pcm_lib text, - pcm_val_parent poste_comptable DEFAULT 0, - pcm_country character(2) DEFAULT 'BE'::bpchar NOT NULL -); -COMMENT ON TABLE tmp_pcmn IS 'Plan comptable minimum normalisé'; -CREATE TABLE tva_rate ( - tva_id integer NOT NULL, - tva_label text NOT NULL, - tva_rate numeric(8,4) DEFAULT 0.0 NOT NULL, - tva_comment text, - tva_poste text -); -COMMENT ON TABLE tva_rate IS 'Rate of vat'; -CREATE TABLE user_local_pref ( - user_id text NOT NULL, - parameter_type text NOT NULL, - parameter_value text -); -COMMENT ON TABLE user_local_pref IS 'The user''s local parameter '; -COMMENT ON COLUMN user_local_pref.user_id IS 'user''s login '; -COMMENT ON COLUMN user_local_pref.parameter_type IS 'the type of parameter '; -COMMENT ON COLUMN user_local_pref.parameter_value IS 'the value of parameter '; -CREATE TABLE user_sec_act ( - ua_id integer DEFAULT nextval(('s_user_act'::text)::regclass) NOT NULL, - ua_login text, - ua_act_id integer -); -CREATE TABLE user_sec_jrn ( - uj_id integer DEFAULT nextval(('s_user_jrn'::text)::regclass) NOT NULL, - uj_login text, - uj_jrn_id integer, - uj_priv text -); -CREATE TABLE version ( - val integer -); -CREATE VIEW vw_client AS - SELECT a.f_id, a.av_text AS name, a1.av_text AS quick_code, b.av_text AS tva_num, c.av_text AS poste_comptable, d.av_text AS rue, e.av_text AS code_postal, f.av_text AS pays, g.av_text AS telephone, h.av_text AS email FROM (((((((((SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 1)) a JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 13)) b USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 23)) a1 USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 5)) c USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 14)) d USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 15)) e USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 16)) f USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 17)) g USING (f_id)) LEFT JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 18)) h USING (f_id)) WHERE (a.frd_id = 9); -CREATE VIEW vw_fiche_attr AS - SELECT a.f_id, a.fd_id, a.av_text AS vw_name, b.av_text AS vw_sell, c.av_text AS vw_buy, d.av_text AS tva_code, tva_rate.tva_id, tva_rate.tva_rate, tva_rate.tva_label, e.av_text AS vw_addr, f.av_text AS vw_cp, j.av_text AS quick_code, fiche_def.frd_id FROM (((((((((SELECT fiche.f_id, fiche.fd_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 1)) a LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 6)) b ON ((a.f_id = b.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 7)) c ON ((a.f_id = c.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 2)) d ON ((a.f_id = d.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 14)) e ON ((a.f_id = e.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 15)) f ON ((a.f_id = f.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 23)) j ON ((a.f_id = j.f_id))) LEFT JOIN tva_rate ON ((d.av_text = (tva_rate.tva_id)::text))) JOIN fiche_def USING (fd_id)); -CREATE VIEW vw_fiche_def AS - SELECT jnt_fic_attr.fd_id, jnt_fic_attr.ad_id, attr_def.ad_text, attr_value.av_text, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def.frd_id FROM (((((jnt_fic_att_value JOIN attr_value USING (jft_id)) JOIN fiche USING (f_id)) JOIN jnt_fic_attr USING (fd_id)) JOIN attr_def ON ((attr_def.ad_id = jnt_fic_attr.ad_id))) JOIN fiche_def USING (fd_id)); -COMMENT ON VIEW vw_fiche_def IS 'all the attributs for card family'; -CREATE VIEW vw_fiche_min AS - SELECT attr_min.frd_id, attr_min.ad_id, attr_def.ad_text, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base FROM ((attr_min JOIN attr_def USING (ad_id)) JOIN fiche_def_ref USING (frd_id)); -COMMENT ON VIEW vw_fiche_min IS 'minimum attribut for reference card'; -CREATE VIEW vw_poste_qcode AS - SELECT a.f_id, a.av_text AS j_poste, b.av_text AS j_qcode FROM ((SELECT jnt_fic_att_value.f_id, attr_value.av_text FROM (attr_value JOIN jnt_fic_att_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 5)) a JOIN (SELECT jnt_fic_att_value.f_id, attr_value.av_text FROM (attr_value JOIN jnt_fic_att_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 23)) b USING (f_id)); -CREATE VIEW vw_supplier AS - SELECT a.f_id, a.av_text AS name, a1.av_text AS quick_code, b.av_text AS tva_num, c.av_text AS poste_comptable, d.av_text AS rue, e.av_text AS code_postal, f.av_text AS pays, g.av_text AS telephone, h.av_text AS email FROM (((((((((SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 1)) a JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 13)) b USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 23)) a1 USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 5)) c USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 14)) d USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 15)) e USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 16)) f USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 17)) g USING (f_id)) LEFT JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 18)) h USING (f_id)) WHERE (a.frd_id = 8); -CREATE UNIQUE INDEX attr_value_jft_id ON attr_value USING btree (jft_id); -CREATE UNIQUE INDEX fd_id_ad_id_x ON jnt_fic_attr USING btree (fd_id, ad_id); -CREATE INDEX fk_attr_value_jft_id ON attr_value USING btree (jft_id); -CREATE INDEX fk_centralized_c_jrn_def ON centralized USING btree (c_jrn_def); -CREATE INDEX fk_centralized_c_poste ON centralized USING btree (c_poste); -CREATE INDEX fk_fiche_def_frd_id ON fiche_def USING btree (frd_id); -CREATE INDEX fk_fiche_fd_id ON fiche USING btree (fd_id); -CREATE INDEX fk_form_fo_fr_id ON form USING btree (fo_fr_id); -CREATE INDEX fk_jrn_action_ja_jrn_type ON jrn_action USING btree (ja_jrn_type); -CREATE INDEX fk_jrn_def ON jrnx USING btree (j_jrn_def); -CREATE INDEX fk_jrnx_j_poste ON jrnx USING btree (j_poste); -CREATE INDEX fk_stock_goods_f_id ON stock_goods USING btree (f_id); -CREATE INDEX fk_stock_goods_j_id ON stock_goods USING btree (j_id); -CREATE INDEX fk_user_sec_act ON user_sec_act USING btree (ua_act_id); -CREATE INDEX fk_user_sec_jrn ON user_sec_jrn USING btree (uj_jrn_id); -CREATE UNIQUE INDEX idx_case ON format_csv_banque USING btree (upper(name)); -CREATE INDEX idx_qs_internal ON quant_sold USING btree (qs_internal); -CREATE UNIQUE INDEX ix_iv_name ON invoice USING btree (upper(iv_name)); -CREATE UNIQUE INDEX k_ag_ref ON action_gestion USING btree (ag_ref); -CREATE UNIQUE INDEX x_act ON "action" USING btree (ac_description); -CREATE UNIQUE INDEX x_jrn_jr_id ON jrn USING btree (jr_id); -CREATE UNIQUE INDEX x_periode ON parm_periode USING btree (p_start, p_end); -CREATE INDEX x_poste ON jrnx USING btree (j_poste); -CREATE UNIQUE INDEX x_usr_jrn ON user_sec_jrn USING btree (uj_login, uj_jrn_id); -CREATE TRIGGER tr_jrn_check_balance - AFTER INSERT ON jrn - FOR EACH ROW - EXECUTE PROCEDURE proc_check_balance(); -CREATE TRIGGER trigger_document_type_i - AFTER INSERT ON document_type - FOR EACH ROW - EXECUTE PROCEDURE t_document_type_insert(); -CREATE TRIGGER trigger_jrn_def_sequence_i - AFTER INSERT ON jrn_def - FOR EACH ROW - EXECUTE PROCEDURE t_jrn_def_sequence(); -CREATE TRIGGER trim_quote - BEFORE INSERT OR UPDATE ON import_tmp - FOR EACH ROW - EXECUTE PROCEDURE trim_cvs_quote(); -CREATE TRIGGER trim_space - BEFORE INSERT OR UPDATE ON format_csv_banque - FOR EACH ROW - EXECUTE PROCEDURE trim_space_format_csv_banque(); -REVOKE ALL ON SCHEMA public FROM PUBLIC; -REVOKE ALL ON SCHEMA public FROM postgres; -GRANT ALL ON SCHEMA public TO postgres; -GRANT ALL ON SCHEMA public TO PUBLIC; diff --git a/html/admin/sql/dossier1/sequence.sql b/html/admin/sql/dossier1/sequence.sql deleted file mode 100644 index 5ef596611..000000000 --- a/html/admin/sql/dossier1/sequence.sql +++ /dev/null @@ -1,232 +0,0 @@ -CREATE SEQUENCE document_seq - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -COMMENT ON SEQUENCE document_seq IS 'Sequence for the sequence bound to the document modele'; -CREATE SEQUENCE s_jnt_id - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_attr_def - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_cbc - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_central - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_central_order - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_centralized - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_currency - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_fdef - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_fiche - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_fiche_def_ref - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_form - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_formdef - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_grpt - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_idef - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_internal - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_invoice - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jnt_fic_att_value - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_1 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_2 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_3 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_4 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_def - START WITH 5 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_op - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrn_rapt - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrnaction - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_jrnx - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_periode - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_quantity - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_stock_goods - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_user_act - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE s_user_jrn - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_1 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_2 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_3 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_4 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_5 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_6 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_7 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_8 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; -CREATE SEQUENCE seq_doc_type_9 - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; diff --git a/html/admin/sql/dossier1/table.sql b/html/admin/sql/dossier1/table.sql deleted file mode 100644 index d210d5ebb..000000000 --- a/html/admin/sql/dossier1/table.sql +++ /dev/null @@ -1,280 +0,0 @@ -CREATE DOMAIN poste_comptable AS numeric(25,0); -CREATE TABLE "action" ( - ac_id integer NOT NULL, - ac_description text NOT NULL -); -CREATE TABLE action_gestion ( - ag_id serial NOT NULL, - ag_type integer, - f_id_dest integer NOT NULL, - f_id_exp integer NOT NULL, - ag_title character varying(70), - ag_timestamp timestamp without time zone DEFAULT now(), - ag_cal character(1) DEFAULT 'C'::bpchar, - ag_ref_ag_id integer, - ag_comment text, - ag_ref text -); -CREATE TABLE attr_def ( - ad_id integer DEFAULT nextval(('s_attr_def'::text)::regclass) NOT NULL, - ad_text text -); -CREATE TABLE attr_min ( - frd_id integer, - ad_id integer -); -CREATE TABLE attr_value ( - jft_id integer, - av_text text -); -CREATE TABLE centralized ( - c_id integer DEFAULT nextval(('s_centralized'::text)::regclass) NOT NULL, - c_j_id integer, - c_date date NOT NULL, - c_internal text NOT NULL, - c_montant numeric(20,4) NOT NULL, - c_debit boolean DEFAULT true, - c_jrn_def integer NOT NULL, - c_poste poste_comptable, - c_description text, - c_grp integer NOT NULL, - c_comment text, - c_rapt text, - c_periode integer, - c_order integer -); -CREATE TABLE document ( - d_id serial NOT NULL, - ag_id integer NOT NULL, - d_lob oid, - d_number bigint NOT NULL, - d_filename text, - d_mimetype text, - d_state integer -); -CREATE TABLE document_modele ( - md_id serial NOT NULL, - md_name text NOT NULL, - md_lob oid, - md_type integer NOT NULL, - md_filename text, - md_mimetype text -); -CREATE TABLE document_state ( - s_id serial NOT NULL, - s_value character varying(50) NOT NULL -); -CREATE TABLE document_type ( - dt_id serial NOT NULL, - dt_value character varying(80) -); -CREATE TABLE fiche ( - f_id integer DEFAULT nextval(('s_fiche'::text)::regclass) NOT NULL, - fd_id integer -); -CREATE TABLE fiche_def ( - fd_id integer DEFAULT nextval(('s_fdef'::text)::regclass) NOT NULL, - fd_class_base poste_comptable, - fd_label text NOT NULL, - fd_create_account boolean DEFAULT false, - frd_id integer NOT NULL -); -CREATE TABLE fiche_def_ref ( - frd_id integer DEFAULT nextval(('s_fiche_def_ref'::text)::regclass) NOT NULL, - frd_text text, - frd_class_base integer -); -CREATE TABLE form ( - fo_id integer DEFAULT nextval(('s_form'::text)::regclass) NOT NULL, - fo_fr_id integer, - fo_pos integer, - fo_label text, - fo_formula text -); -CREATE TABLE format_csv_banque ( - name text NOT NULL, - include_file text NOT NULL -); -CREATE TABLE formdef ( - fr_id integer DEFAULT nextval(('s_formdef'::text)::regclass) NOT NULL, - fr_label text -); -CREATE TABLE import_tmp ( - code text, - date_exec date, - date_valeur date, - montant text, - devise text, - compte_ordre text, - detail text, - num_compte text, - poste_comptable text, - status character varying(1) DEFAULT 'n'::character varying NOT NULL, - bq_account integer NOT NULL, - jrn integer NOT NULL, - jr_rapt text, - CONSTRAINT import_tmp_status_check CHECK ((((((status)::text = 't'::text) OR ((status)::text = 'd'::text)) OR ((status)::text = 'w'::text)) OR ((status)::text = 'n'::text))) -); -CREATE TABLE invoice ( - iv_id integer DEFAULT nextval(('s_invoice'::text)::regclass) NOT NULL, - iv_name text NOT NULL, - iv_file oid -); -CREATE TABLE jnt_fic_att_value ( - jft_id integer DEFAULT nextval(('s_jnt_fic_att_value'::text)::regclass) NOT NULL, - f_id integer, - ad_id integer -); -CREATE TABLE jnt_fic_attr ( - fd_id integer, - ad_id integer, - jnt_id bigint DEFAULT nextval('s_jnt_id'::regclass) NOT NULL -); -CREATE TABLE jrn ( - jr_id integer DEFAULT nextval(('s_jrn'::text)::regclass) NOT NULL, - jr_def_id integer NOT NULL, - jr_montant numeric(20,4) NOT NULL, - jr_comment text, - jr_date date, - jr_grpt_id integer NOT NULL, - jr_internal text, - jr_tech_date timestamp without time zone DEFAULT now() NOT NULL, - jr_tech_per integer NOT NULL, - jrn_ech date, - jr_ech date, - jr_rapt text, - jr_valid boolean DEFAULT true, - jr_opid integer, - jr_c_opid integer, - jr_pj oid, - jr_pj_name text, - jr_pj_type text -); -CREATE TABLE jrn_action ( - ja_id integer DEFAULT nextval(('s_jrnaction'::text)::regclass) NOT NULL, - ja_name text NOT NULL, - ja_desc text, - ja_url text NOT NULL, - ja_action text NOT NULL, - ja_lang text DEFAULT 'FR'::text, - ja_jrn_type character(3) -); -CREATE TABLE jrn_def ( - jrn_def_id integer DEFAULT nextval(('s_jrn_def'::text)::regclass) NOT NULL, - jrn_def_name text NOT NULL, - jrn_def_class_deb text, - jrn_def_class_cred text, - jrn_def_fiche_deb text, - jrn_def_fiche_cred text, - jrn_deb_max_line integer DEFAULT 1, - jrn_cred_max_line integer DEFAULT 1, - jrn_def_ech boolean DEFAULT false, - jrn_def_ech_lib text, - jrn_def_type character(3) NOT NULL, - jrn_def_code text NOT NULL -); -CREATE TABLE jrn_rapt ( - jra_id integer DEFAULT nextval(('s_jrn_rapt'::text)::regclass) NOT NULL, - jr_id integer NOT NULL, - jra_concerned integer NOT NULL -); -CREATE TABLE jrn_type ( - jrn_type_id character(3) NOT NULL, - jrn_desc text -); -CREATE TABLE jrnx ( - j_id integer DEFAULT nextval(('s_jrn_op'::text)::regclass) NOT NULL, - j_date date DEFAULT now(), - j_montant numeric(20,4) DEFAULT 0, - j_poste poste_comptable NOT NULL, - j_grpt integer NOT NULL, - j_rapt text, - j_jrn_def integer NOT NULL, - j_debit boolean DEFAULT true, - j_text text, - j_centralized boolean DEFAULT false, - j_internal text, - j_tech_user text NOT NULL, - j_tech_date timestamp without time zone DEFAULT now() NOT NULL, - j_tech_per integer NOT NULL, - j_qcode text -); -CREATE TABLE parameter ( - pr_id text NOT NULL, - pr_value text -); -CREATE TABLE parm_code ( - p_code text NOT NULL, - p_value text, - p_comment text -); -CREATE TABLE parm_money ( - pm_id integer DEFAULT nextval(('s_currency'::text)::regclass), - pm_code character(3) NOT NULL, - pm_rate numeric(20,4) -); -CREATE TABLE parm_periode ( - p_id integer DEFAULT nextval(('s_periode'::text)::regclass) NOT NULL, - p_start date NOT NULL, - p_end date NOT NULL, - p_exercice text DEFAULT to_char(now(), 'YYYY'::text) NOT NULL, - p_closed boolean DEFAULT false, - p_central boolean DEFAULT false, - CONSTRAINT parm_periode_check CHECK ((p_end >= p_start)) -); -CREATE TABLE quant_sold ( - qs_id integer DEFAULT nextval(('s_quantity'::text)::regclass) NOT NULL, - qs_internal text NOT NULL, - qs_fiche integer NOT NULL, - qs_quantite numeric(20,4) NOT NULL, - qs_price numeric(20,4), - qs_vat numeric(20,4), - qs_vat_code integer, - qs_client integer NOT NULL -); -CREATE TABLE stock_goods ( - sg_id integer DEFAULT nextval(('s_stock_goods'::text)::regclass) NOT NULL, - j_id integer, - f_id integer NOT NULL, - sg_code text, - sg_quantity numeric(8,4) DEFAULT 0, - sg_type character(1) DEFAULT 'c'::bpchar NOT NULL, - sg_date date, - sg_tech_date date DEFAULT now(), - sg_tech_user text, - sg_comment character varying(80), - sg_exercice character varying(4), - CONSTRAINT stock_goods_sg_type CHECK (((sg_type = 'c'::bpchar) OR (sg_type = 'd'::bpchar))) -); -CREATE TABLE tmp_pcmn ( - pcm_val poste_comptable NOT NULL, - pcm_lib text, - pcm_val_parent poste_comptable DEFAULT 0, - pcm_country character(2) DEFAULT 'BE'::bpchar NOT NULL -); -CREATE TABLE tva_rate ( - tva_id integer NOT NULL, - tva_label text NOT NULL, - tva_rate numeric(8,4) DEFAULT 0.0 NOT NULL, - tva_comment text, - tva_poste text -); -CREATE TABLE user_local_pref ( - user_id text NOT NULL, - parameter_type text NOT NULL, - parameter_value text -); -CREATE TABLE user_sec_act ( - ua_id integer DEFAULT nextval(('s_user_act'::text)::regclass) NOT NULL, - ua_login text, - ua_act_id integer -); -CREATE TABLE user_sec_jrn ( - uj_id integer DEFAULT nextval(('s_user_jrn'::text)::regclass) NOT NULL, - uj_login text, - uj_jrn_id integer, - uj_priv text -); -CREATE TABLE version ( - val integer -); diff --git a/html/admin/sql/dossier1/view.sql b/html/admin/sql/dossier1/view.sql deleted file mode 100644 index 8623b5a36..000000000 --- a/html/admin/sql/dossier1/view.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE VIEW vw_client AS - SELECT a.f_id, a.av_text AS name, a1.av_text AS quick_code, b.av_text AS tva_num, c.av_text AS poste_comptable, d.av_text AS rue, e.av_text AS code_postal, f.av_text AS pays, g.av_text AS telephone, h.av_text AS email FROM (((((((((SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 1)) a JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 13)) b USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 23)) a1 USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 5)) c USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 14)) d USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 15)) e USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 16)) f USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 17)) g USING (f_id)) LEFT JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 18)) h USING (f_id)) WHERE (a.frd_id = 9); -CREATE VIEW vw_fiche_attr AS - SELECT a.f_id, a.fd_id, a.av_text AS vw_name, b.av_text AS vw_sell, c.av_text AS vw_buy, d.av_text AS tva_code, tva_rate.tva_id, tva_rate.tva_rate, tva_rate.tva_label, e.av_text AS vw_addr, f.av_text AS vw_cp, j.av_text AS quick_code, fiche_def.frd_id FROM (((((((((SELECT fiche.f_id, fiche.fd_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 1)) a LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 6)) b ON ((a.f_id = b.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 7)) c ON ((a.f_id = c.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 2)) d ON ((a.f_id = d.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 14)) e ON ((a.f_id = e.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 15)) f ON ((a.f_id = f.f_id))) LEFT JOIN (SELECT fiche.f_id, attr_value.av_text FROM (((fiche JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) JOIN attr_def USING (ad_id)) WHERE (jnt_fic_att_value.ad_id = 23)) j ON ((a.f_id = j.f_id))) LEFT JOIN tva_rate ON ((d.av_text = (tva_rate.tva_id)::text))) JOIN fiche_def USING (fd_id)); -CREATE VIEW vw_fiche_def AS - SELECT jnt_fic_attr.fd_id, jnt_fic_attr.ad_id, attr_def.ad_text, attr_value.av_text, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def.frd_id FROM (((((jnt_fic_att_value JOIN attr_value USING (jft_id)) JOIN fiche USING (f_id)) JOIN jnt_fic_attr USING (fd_id)) JOIN attr_def ON ((attr_def.ad_id = jnt_fic_attr.ad_id))) JOIN fiche_def USING (fd_id)); -CREATE VIEW vw_fiche_min AS - SELECT attr_min.frd_id, attr_min.ad_id, attr_def.ad_text, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base FROM ((attr_min JOIN attr_def USING (ad_id)) JOIN fiche_def_ref USING (frd_id)); -CREATE VIEW vw_poste_qcode AS - SELECT a.f_id, a.av_text AS j_poste, b.av_text AS j_qcode FROM ((SELECT jnt_fic_att_value.f_id, attr_value.av_text FROM (attr_value JOIN jnt_fic_att_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 5)) a JOIN (SELECT jnt_fic_att_value.f_id, attr_value.av_text FROM (attr_value JOIN jnt_fic_att_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 23)) b USING (f_id)); -CREATE VIEW vw_supplier AS - SELECT a.f_id, a.av_text AS name, a1.av_text AS quick_code, b.av_text AS tva_num, c.av_text AS poste_comptable, d.av_text AS rue, e.av_text AS code_postal, f.av_text AS pays, g.av_text AS telephone, h.av_text AS email FROM (((((((((SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 1)) a JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 13)) b USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 23)) a1 USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 5)) c USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 14)) d USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 15)) e USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 16)) f USING (f_id)) JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 17)) g USING (f_id)) LEFT JOIN (SELECT jnt_fic_att_value.jft_id, fiche.f_id, fiche_def.frd_id, fiche.fd_id, fiche_def.fd_class_base, fiche_def.fd_label, fiche_def.fd_create_account, fiche_def_ref.frd_text, fiche_def_ref.frd_class_base, jnt_fic_att_value.ad_id, attr_value.av_text FROM ((((fiche JOIN fiche_def USING (fd_id)) JOIN fiche_def_ref USING (frd_id)) JOIN jnt_fic_att_value USING (f_id)) JOIN attr_value USING (jft_id)) WHERE (jnt_fic_att_value.ad_id = 18)) h USING (f_id)) WHERE (a.frd_id = 8); diff --git a/html/admin/sql/mod1/data.sql b/html/admin/sql/mod1/data.sql index dd9421ce8..983f94cc9 100644 --- a/html/admin/sql/mod1/data.sql +++ b/html/admin/sql/mod1/data.sql @@ -1,5 +1,6 @@ SET client_encoding = 'LATIN1'; +SET check_function_bodies = false; SET client_min_messages = warning; SET search_path = public, pg_catalog; @@ -1004,12 +1005,15 @@ INSERT INTO parm_periode (p_id, p_start, p_end, p_exercice, p_closed, p_central) INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (10, 'Capital ', 1); +INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (6040003, 'Petit matériel', 604); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (11, 'Prime d''émission ', 1); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (12, 'Plus Value de réévaluation ', 1); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (13, 'Réserve ', 1); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (130, 'Réserve légale', 13); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (131, 'Réserve indisponible', 13); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (1310, 'Réserve pour actions propres', 131); +INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (6040004, 'Assurance', 604); +INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (55000001, 'Caisse', 5500); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (133, 'Réserves disponibles', 13); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (14, 'Bénéfice ou perte reportée', 1); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (140, 'Bénéfice reporté', 14); @@ -1082,6 +1086,7 @@ INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (2829, 'R INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (283, 'Créances sur des entreprises avec lesquelles existe un lien de participation', 28); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (2830, 'Créance en compte', 283); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (2831, 'Effets à recevoir', 283); +INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (57, 'Caisse', 5); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (2832, 'Titre à revenu fixe', 283); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (2837, 'Créances douteuses', 283); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (2839, 'Réduction de valeurs actées', 283); @@ -1486,10 +1491,6 @@ INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (4000002, 'Client INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (4000003, 'Client 3', 400); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (6040001, 'Electricité', 604); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (6040002, 'Loyer', 604); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (6040003, 'Petit matériel', 604); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (6040004, 'Assurance', 604); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (55000001, 'Caisse', 5500); -INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (57, 'Caisse', 5); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (55000002, 'Banque 1', 5500); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (55000003, 'Banque 2', 5500); INSERT INTO tmp_pcmn (pcm_val, pcm_lib, pcm_val_parent) VALUES (4400001, 'Fournisseur 1', 440); @@ -1529,7 +1530,7 @@ INSERT INTO user_local_pref (user_id, parameter_type, parameter_value) VALUES (' -INSERT INTO version (val) VALUES (34); +INSERT INTO version (val) VALUES (35); diff --git a/html/admin/sql/mod1/function.sql b/html/admin/sql/mod1/function.sql index 341f1b2c3..bd1ab575d 100644 --- a/html/admin/sql/mod1/function.sql +++ b/html/admin/sql/mod1/function.sql @@ -496,11 +496,13 @@ declare nCounter integer; BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.jrn_def_id; -if nCounter = 0 then - execute 'create sequence s_jrn_'||NEW.jrn_def_id; - raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; -end if; + select count(*) into nCounter + from pg_class where relname='s_jrn_'||NEW.jrn_def_id; + if nCounter = 0 then + execute 'create sequence s_jrn_'||NEW.jrn_def_id; + raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; + end if; + RETURN NEW; END; $$ @@ -546,9 +548,17 @@ declare begin nCount=0; select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id; - if nCount = 0 then - delete from tva_rate where tva_id=p_tva_id; + if nCount != 0 then + return; + end if; + select count(*) into nCount from quant_purchase where qp_vat_code=p_tva_id; + if nCount != 0 then + return; + + end if; + +delete from tva_rate where tva_id=p_tva_id; return; end; $_$ diff --git a/html/admin/sql/mod1/schema.sql b/html/admin/sql/mod1/schema.sql index 6642714c4..1065e529e 100644 --- a/html/admin/sql/mod1/schema.sql +++ b/html/admin/sql/mod1/schema.sql @@ -1,9 +1,7 @@ SET client_encoding = 'LATIN1'; -SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; -SET escape_string_warning = off; @@ -577,11 +575,13 @@ declare nCounter integer; BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.jrn_def_id; -if nCounter = 0 then - execute 'create sequence s_jrn_'||NEW.jrn_def_id; - raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; -end if; + select count(*) into nCounter + from pg_class where relname='s_jrn_'||NEW.jrn_def_id; + if nCounter = 0 then + execute 'create sequence s_jrn_'||NEW.jrn_def_id; + raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; + end if; + RETURN NEW; END; $$ @@ -636,9 +636,17 @@ declare begin nCount=0; select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id; - if nCount = 0 then - delete from tva_rate where tva_id=p_tva_id; + if nCount != 0 then + return; + end if; + select count(*) into nCount from quant_purchase where qp_vat_code=p_tva_id; + if nCount != 0 then + return; + + end if; + +delete from tva_rate where tva_id=p_tva_id; return; end; $_$ @@ -2358,10 +2366,6 @@ CREATE TRIGGER trim_space -REVOKE ALL ON SCHEMA public FROM PUBLIC; -REVOKE ALL ON SCHEMA public FROM postgres; -GRANT ALL ON SCHEMA public TO postgres; -GRANT ALL ON SCHEMA public TO PUBLIC; diff --git a/html/admin/sql/mod2/data.sql b/html/admin/sql/mod2/data.sql index fd34851b1..b80833950 100644 --- a/html/admin/sql/mod2/data.sql +++ b/html/admin/sql/mod2/data.sql @@ -1,6 +1,7 @@ SET client_encoding = 'LATIN1'; SET check_function_bodies = false; +SET client_min_messages = warning; SET search_path = public, pg_catalog; @@ -1839,7 +1840,7 @@ INSERT INTO tva_rate (tva_id, tva_label, tva_rate, tva_comment, tva_poste) VALUE -INSERT INTO version (val) VALUES (34); +INSERT INTO version (val) VALUES (35); diff --git a/html/admin/sql/mod2/function.sql b/html/admin/sql/mod2/function.sql deleted file mode 100644 index 8d165aa46..000000000 --- a/html/admin/sql/mod2/function.sql +++ /dev/null @@ -1,582 +0,0 @@ -CREATE FUNCTION account_add(p_id poste_comptable, p_name character varying) RETURNS void - AS $$ -declare - nParent tmp_pcmn.pcm_val_parent%type; - nCount integer; -begin - select count(*) into nCount from tmp_pcmn where pcm_val=p_id; - if nCount = 0 then - nParent=account_parent(p_id); - insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) - values (p_id, p_name,nParent); - end if; -return; -end ; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_auto(p_fd_id integer) RETURNS boolean - AS $$ -declare - l_auto bool; -begin - select fd_create_account into l_auto from fiche_def where fd_id=p_fd_id; - if l_auto is null then - l_auto:=false; - end if; - return l_auto; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_compute(p_f_id integer) RETURNS poste_comptable - AS $$ -declare - class_base poste_comptable; - maxcode poste_comptable; -begin - select fd_class_base into class_base - from - fiche_def join fiche using (fd_id) - where - f_id=p_f_id; - raise notice 'account_compute class base %',class_base; - select count (pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base; - if maxcode = 0 then - maxcode:=class_base; - else - select max (pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base; - end if; - if maxcode = class_base then - maxcode:=class_base*1000; - end if; - maxcode:=maxcode+1; - raise notice 'account_compute Max code %',maxcode; - return maxcode; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_insert(p_f_id integer, p_account poste_comptable) RETURNS integer - AS $$ -declare -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nNew tmp_pcmn.pcm_val%type; -bAuto bool; -nFd_id integer; -nCount integer; -begin - - if length(trim(p_account)) != 0 then - raise notice 'p_account is not empty'; - select * into nCount from tmp_pcmn where pcm_val=p_account; - if nCount !=0 then - raise notice 'this account exists in tmp_pcmn '; - perform attribut_insert(p_f_id,5,to_char(p_account,'999999999999999999999999')); - else - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=account_parent(p_account); - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - perform attribut_insert(p_f_id,5,to_char(p_account,'999999999999999999999999')); - - end if; - else - raise notice 'p_account is empty'; - select fd_id into nFd_id from fiche where f_id=p_f_id; - bAuto:= account_auto(nFd_id); - if bAuto = true then - raise notice 'account generated automatically'; - nNew:=account_compute(p_f_id); - raise notice 'nNew %', nNew; - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=account_parent(nNew); - perform account_add (nNew,sName); - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999')); - - else - select fd_class_base into nNew from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if nNew is null or length(trim(nNew)) = 0 then - raise notice 'count is null'; - perform attribut_insert(p_f_id,5,null); - else - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999')); - end if; - end if; - end if; - -return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_parent(p_account poste_comptable) RETURNS poste_comptable - AS $$ -declare - nParent tmp_pcmn.pcm_val_parent%type; - sParent varchar; - nCount integer; -begin - sParent:=to_char(p_account,'9999999999999999'); - sParent:=trim(sParent); - nParent:=0; - while nParent = 0 loop - select count(*) into nCount - from tmp_pcmn - where - pcm_val = to_number(sParent,'9999999999999999'); - if nCount != 0 then - nParent:=to_number(sParent,'9999999999999999'); - end if; - sParent:= substr(sParent,1,length(sParent)-1); - if length(sParent) <= 0 then - raise exception 'Impossible de trouver le compte parent pour %',p_account; - end if; - end loop; - raise notice 'account_parent : Parent is %',nParent; - return nParent; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION account_update(p_f_id integer, p_account poste_comptable) RETURNS integer - AS $$ -declare -nMax fiche.f_id%type; -nCount integer; -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nJft_id attr_value.jft_id%type; -begin - - if length(trim(p_account)) != 0 then - select count(*) into nCount from tmp_pcmn where pcm_val=p_account; - if nCount = 0 then - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - nParent:=fiche_account_parent(p_f_id); - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - end if; - end if; - select jft_id into njft_id from jnt_fic_att_value where f_id=p_f_id and ad_id=5; - update attr_value set av_text=p_account where jft_id=njft_id; - -return njft_id; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION attribut_insert(p_f_id integer, p_ad_id integer, p_value character varying) RETURNS void - AS $$ -declare - n_jft_id integer; -begin - select nextval('s_jnt_fic_att_value') into n_jft_id; - insert into jnt_fic_att_value (jft_id,f_id,ad_id) values (n_jft_id,p_f_id,p_ad_id); - insert into attr_value (jft_id,av_text) values (n_jft_id,trim(p_value)); -return; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION card_class_base(p_f_id integer) RETURNS poste_comptable - AS $$ -declare - n_poste fiche_def.fd_class_base%type; -begin - select fd_class_base into n_poste from fiche_def join fiche using -(fd_id) - where f_id=p_f_id; - if not FOUND then - raise exception 'Invalid fiche card_class_base(%)',p_f_id; - end if; -return n_poste; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION check_balance(p_grpt integer) RETURNS numeric - AS $$ -declare - amount_jrnx_debit numeric; - amount_jrnx_credit numeric; - amount_jrn numeric; -begin - select sum (j_montant) into amount_jrnx_credit - from jrnx - where - j_grpt=p_grpt - and j_debit=false; - select sum (j_montant) into amount_jrnx_debit - from jrnx - where - j_grpt=p_grpt - and j_debit=true; - select jr_montant into amount_jrn - from jrn - where - jr_grpt_id=p_grpt; - if ( amount_jrnx_debit != amount_jrnx_credit ) - then - return abs(amount_jrnx_debit-amount_jrnx_credit); - end if; - if ( amount_jrn != amount_jrnx_credit) - then - return -1*abs(amount_jrn - amount_jrnx_credit); - end if; - return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION correct_sequence(p_sequence text, p_col text, p_table text) RETURNS integer - AS $$ -declare -last_sequence int8; -max_sequence int8; -n integer; -begin - select count(*) into n from pg_class where relkind='S' and relname=lower(p_sequence); - if n = 0 then - raise exception ' Unknow sequence % ',p_sequence; - end if; - select count(*) into n from pg_class where relkind='r' and relname=lower(p_table); - if n = 0 then - raise exception ' Unknow table % ',p_table; - end if; - execute 'select last_value from '||p_sequence into last_sequence; - raise notice 'Last value of the sequence is %', last_sequence; - execute 'select max('||p_col||') from '||p_table into max_sequence; - if max_sequence is null then - max_sequence := 0; - end if; - raise notice 'Max value of the sequence is %', max_sequence; - max_sequence:= max_sequence +1; - execute 'alter sequence '||p_sequence||' restart with '||max_sequence; -return 0; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION drop_it(p_constraint character varying) RETURNS void - AS $$ -declare - nCount integer; -begin - select count(*) into nCount from pg_constraint where conname=p_constraint; - if nCount = 1 then - execute 'alter table parm_periode drop constraint '||p_constraint ; - end if; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION fiche_account_parent(p_f_id integer) RETURNS poste_comptable - AS $$ -declare -ret poste_comptable; -begin - select fd_class_base into ret from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if not FOUND then - raise exception '% N''existe pas',p_f_id; - end if; - return ret; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_jrnx(p_date character varying, p_montant numeric, p_poste integer, p_grpt integer, p_jrn_def integer, p_debit boolean, p_tech_user text, p_tech_per integer, p_qcode text) RETURNS void - AS $$ -declare - sCode varchar; - nCount_qcode integer; -begin - sCode=trim(p_qcode); - if length(sCode) = 0 or p_qcode is null then - select count(*) into nCount_qcode - from vw_poste_qcode where j_poste=p_poste; - if nCount_qcode = 1 then - select j_qcode into sCode - from vw_poste_qcode where j_poste=p_poste; - else - sCode=NULL; - end if; - - end if; - if p_montant = 0.0 then - return; - end if; - insert into jrnx - ( - j_date, - j_montant, - j_poste, - j_grpt, - j_jrn_def, - j_debit, - j_tech_user, - j_tech_per, - j_qcode - ) values - ( - to_date(p_date,'DD.MM.YYYY'), - p_montant, - p_poste, - p_grpt, - p_jrn_def, - p_debit, - p_tech_user, - p_tech_per, - sCode - ); -return; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_quant_sold(p_internal text, p_fiche character varying, p_quant numeric, p_price numeric, p_vat numeric, p_vat_code integer, p_client character varying) RETURNS void - AS $$ -declare - fid_client integer; - fid_good integer; -begin - select f_id into fid_client from - attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_client); - select f_id into fid_good from - attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_fiche); - insert into quant_sold - (qs_internal,qs_fiche,qs_quantite,qs_price,qs_vat,qs_vat_code,qs_client) - values - (p_internal,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client); - return; -end; - $$ - LANGUAGE plpgsql; -CREATE FUNCTION insert_quick_code(nf_id integer, tav_text text) RETURNS integer - AS $$ - declare - ns integer; - nExist integer; - tText text; - begin - tText := upper(trim(tav_text)); - tText := replace(tText,' ',''); - - loop - select nextval('s_jnt_fic_att_value') into ns; - if length (tText) = 0 or tText is null then - tText := 'FID'||ns; - end if; - select count(*) into nExist - from jnt_fic_att_value join attr_value using (jft_id) - where - ad_id=23 and av_text=upper(tText); - if nExist = 0 then - exit; - end if; - tText:='FID'||ns; - end loop; - insert into jnt_fic_att_value values (ns,nf_id,23); - insert into attr_value values (ns,upper(tText)); - return ns; - end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION proc_check_balance() RETURNS "trigger" - AS $$ -declare - diff numeric; - tt integer; -begin - if TG_OP = 'INSERT' then - tt=NEW.jr_grpt_id; - diff:=check_balance(tt); - if diff != 0 then - raise exception 'balance error %',diff ; - end if; - return NEW; - end if; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION t_document_type_insert() RETURNS "trigger" - AS $$ -declare -nCounter integer; - BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.dt_id; -if nCounter = 0 then - execute 'create sequence seq_doc_type_'||NEW.dt_id; -raise notice 'Creating sequence seq_doc_type_%',NEW.dt_id; -end if; - RETURN NEW; - END; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION t_jrn_def_sequence() RETURNS "trigger" - AS $$ -declare -nCounter integer; - BEGIN -select count(*) into nCounter from pg_class where relname='seq_doc_type_'||NEW.jrn_def_id; -if nCounter = 0 then - execute 'create sequence s_jrn_'||NEW.jrn_def_id; - raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; -end if; - RETURN NEW; - END; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION trim_cvs_quote() RETURNS "trigger" - AS $$ -declare - modified import_tmp%ROWTYPE; -begin - modified:=NEW; - modified.devise=replace(new.devise,'"',''); - modified.poste_comptable=replace(new.poste_comptable,'"',''); - modified.compte_ordre=replace(NEW.COMPTE_ORDRE,'"',''); - modified.detail=replace(NEW.DETAIL,'"',''); - modified.num_compte=replace(NEW.NUM_COMPTE,'"',''); - return modified; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION trim_space_format_csv_banque() RETURNS "trigger" - AS $$ -declare - modified format_csv_banque%ROWTYPE; -begin - modified.name=trim(NEW.NAME); - modified.include_file=trim(new.include_file); - if ( length(modified.name) = 0 ) then - modified.name=null; - end if; - if ( length(modified.include_file) = 0 ) then - modified.include_file=null; - end if; - return modified; -end; -$$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_delete(integer) RETURNS void - AS $_$ -declare - p_tva_id alias for $1; - nCount integer; -begin - nCount=0; - select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id; - if nCount = 0 then - delete from tva_rate where tva_id=p_tva_id; - end if; - return; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_insert(integer, text, numeric, text, text) RETURNS integer - AS $_$ -declare -p_tva_id alias for $1; -p_tva_label alias for $2; -p_tva_rate alias for $3; -p_tva_comment alias for $4; -p_tva_poste alias for $5; -debit text; -credit text; -nCount integer; -begin -if length(trim(p_tva_label)) = 0 then - return 3; -end if; -select count(*) into nCount from tva_rate - where tva_id=p_tva_id; -if nCount != 0 then - return 5; -end if; -if length(trim(p_tva_poste)) != 0 then - if position (',' in p_tva_poste) = 0 then return 4; end if; - debit = split_part(p_tva_poste,',',1); - credit = split_part(p_tva_poste,',',2); - select count(*) into nCount from tmp_pcmn where pcm_val=debit; - if nCount = 0 then return 4; end if; - select count(*) into nCount from tmp_pcmn where pcm_val=credit; - if nCount = 0 then return 4; end if; - -end if; -insert into tva_rate(tva_id,tva_label,tva_rate,tva_comment,tva_poste) - values (p_tva_id,p_tva_label,p_tva_rate,p_tva_comment,p_tva_poste); -return 0; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION tva_modify(integer, text, numeric, text, text) RETURNS integer - AS $_$declare -p_tva_id alias for $1; -p_tva_label alias for $2; -p_tva_rate alias for $3; -p_tva_comment alias for $4; -p_tva_poste alias for $5; -debit text; -credit text; -nCount integer; -begin -if length(trim(p_tva_label)) = 0 then - return 3; -end if; -if length(trim(p_tva_poste)) != 0 then - if position (',' in p_tva_poste) = 0 then return 4; end if; - debit = split_part(p_tva_poste,',',1); - credit = split_part(p_tva_poste,',',2); - select count(*) into nCount from tmp_pcmn where pcm_val=debit; - if nCount = 0 then return 4; end if; - select count(*) into nCount from tmp_pcmn where pcm_val=credit; - if nCount = 0 then return 4; end if; - -end if; -update tva_rate set tva_label=p_tva_label,tva_rate=p_tva_rate,tva_comment=p_tva_comment,tva_poste=p_tva_poste - where tva_id=p_tva_id; -return 0; -end; -$_$ - LANGUAGE plpgsql; -CREATE FUNCTION update_quick_code(njft_id integer, tav_text text) RETURNS integer - AS $$ - declare - ns integer; - nExist integer; - tText text; - old_qcode varchar; - begin - select av_text into old_qcode from attr_value where jft_id=njft_id; - if tav_text = upper( trim(old_qcode)) then - return 0; - end if; - - tText := trim(upper(tav_text)); - tText := replace(tText,' ',''); - if length ( tText) = 0 or tText is null then - return 0; - end if; - - ns := njft_id; - loop - select count(*) into nExist - from jnt_fic_att_value join attr_value using (jft_id) - where - ad_id=23 and av_text=tText; - if nExist = 0 then - exit; - end if; - if tText = 'FID'||ns then - select nextval('s_jnt_fic_att_value') into ns; - end if; - tText :='FID'||ns; - - end loop; - update attr_value set av_text = tText where jft_id=njft_id; - update attr_value set av_text = tText - where jft_id in - ( select jft_id - from jnt_fic_att_value join attr_value using (jft_id) - where ad_id=25 and av_text=old_qcode); - update jrnx set j_qcode=tText where j_qcode = old_qcode; - return ns; - end; -$$ - LANGUAGE plpgsql; diff --git a/include/constant.php b/include/constant.php index e64d5b4dd..ef204d722 100644 --- a/include/constant.php +++ b/include/constant.php @@ -25,6 +25,7 @@ */ date_default_timezone_set ('Europe/Brussels'); + $_ENV['TMP']="/tmp"; define ("phpcompta_password","dany"); define ("phpcompta_psql_port","5432"); @@ -35,7 +36,7 @@ define ("domaine",""); define ("MAX_COMPTE",4); -define ("DEBUG","true"); +define ("DEBUG","false"); // securite correspond a la table // action diff --git a/sql/upgrade.sql b/sql/upgrade.sql index 0b099ddd5..91c563c59 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -40,4 +40,33 @@ $$ select correct_sequence_jrn(); drop function correct_sequence_jrn(); + + + +CREATE OR REPLACE FUNCTION tva_delete(int4) + RETURNS void AS +$BODY$ +declare + p_tva_id alias for $1; + nCount integer; +begin + nCount=0; + select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id; + if nCount != 0 then + return; + + end if; + select count(*) into nCount from quant_purchase where qp_vat_code=p_tva_id; + if nCount != 0 then + return; + + end if; + +delete from tva_rate where tva_id=p_tva_id; + return; +end; +$BODY$ + LANGUAGE 'plpgsql' VOLATILE; + + commit; \ No newline at end of file