From 9ab1d12a1a082968b1e61e2a51bee9ff26de7393 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 2 Apr 2006 21:02:14 +0000 Subject: [PATCH] =?UTF-8?q?task=20#4898,=20Import=20CSV=20op=C3=A9ration?= =?UTF-8?q?=20banquaire=20task=20#5023=20overview:=20Automatisation=20de?= =?UTF-8?q?=20certaines=20d=C3=A9penses=20non=20admises?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/admin/setup.php | 11 +++++++++-- html/admin/sql/patch/upgrade8.sql | 30 ++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/html/admin/setup.php b/html/admin/setup.php index 1f3a0667e..80398f667 100644 --- a/html/admin/setup.php +++ b/html/admin/setup.php @@ -153,8 +153,11 @@ function ExecuteScript($p_cn,$script) { // include_path ?> +

Info

+Vous utilisez le domaine

Php setting

9 + if ( GetVersion($db) == 8 ) { + ExecuteScript($db,'sql/patch/upgrade8.sql'); + } // version == 9 if ( DEBUG == 'false') ob_end_clean(); }//for @@ -449,13 +456,13 @@ if (DEBUG == 'false' ) ob_start(); $M=$Row['l']; ExecSql($db,"select setval('s_grpt',$M,true)"); } - } // version == 7 + } // version == 8 //-- // update to the version 9 //-- if ( GetVersion($db) == 8 ) { ExecuteScript($db,'sql/patch/upgrade8.sql'); - } // version == 7 + } // version == 9 if ( DEBUG == 'false') ob_end_clean(); } diff --git a/html/admin/sql/patch/upgrade8.sql b/html/admin/sql/patch/upgrade8.sql index dc656bc06..7b0e01c38 100644 --- a/html/admin/sql/patch/upgrade8.sql +++ b/html/admin/sql/patch/upgrade8.sql @@ -3,7 +3,7 @@ begin; insert into action values (21,'Import et export des écritures d''ouverture'); create sequence s_quantity; -create index idx_qs_internal on quant_sold(qs_internal); + CREATE TABLE quant_sold ( qs_id integer DEFAULT nextval('s_quantity'::text), qs_internal text NOT NULL, @@ -11,13 +11,30 @@ CREATE TABLE quant_sold ( qs_quantite integer NOT NULL, qs_price numeric(20,4), qs_vat numeric(20,4), - qs_vat_code integer + qs_vat_code integer, + qs_client integer not null ); + +create index idx_qs_internal on quant_sold(qs_internal); + create table format_csv_banque ( name text primary key, include_file text not null ); + +create sequence s_invoice; + +CREATE TABLE invoice ( + iv_id integer DEFAULT nextval('s_invoice'::text) NOT NULL, + iv_name text NOT NULL, + iv_file oid +); +alter TABLE invoice add primary key(iv_id); +create unique index ix_iv_name on invoice (upper(iv_name)); + + + -- drop trigger trim_space on format_csv_banque; -- -- drop function trim_space_format_csv_banque(); @@ -82,8 +99,13 @@ end; $trim$ language plpgsql; create trigger trim_quote before insert or update on import_tmp FOR EACH ROW execute procedure trim_cvs_quote(); - - +alter sequence s_attr_def restart 20; +insert into attr_def(ad_text) values ('Partie fiscalement non déductible'); +insert into attr_def(ad_text) values ('TVA non déductible'); +insert into attr_def(ad_text) values ('TVA non déductible récupérable par l''impôt'); +insert into tmp_pcmn( pcm_val,pcm_lib,pcm_val_parent,pcm_country) select distinct 6190,'TVA récupérable par l''impôt',61,'BE' from tmp_pcmn where pcm_country='BE'; +insert into tmp_pcmn( pcm_val,pcm_lib,pcm_val_parent,pcm_country) select distinct 6740,'Dépense non admise',67,'BE' from tmp_pcmn where pcm_country='BE' and not exists (select pcm_val from tmp_pcmn where pcm_val=6740); +alter table tmp_pcmn alter pcm_val type text; update version set val=9;