Merge with the branches/rel400
* New module budget * Detail for impress of account * Code rewrited * Group in analytic accountancy * Fix Bug
This commit is contained in:
parent
4e4529c51a
commit
cd96d07c1e
113 changed files with 1193 additions and 1104 deletions
|
|
@ -10,7 +10,6 @@ INSERT INTO parm_poste (p_value, p_type) VALUES (47, 'PAS');
|
|||
INSERT INTO parm_poste (p_value, p_type) VALUES (48, 'PAS');
|
||||
INSERT INTO parm_poste (p_value, p_type) VALUES (492, 'PAS');
|
||||
INSERT INTO parm_poste (p_value, p_type) VALUES (493, 'PAS');
|
||||
INSERT INTO parm_poste (p_value, p_type) VALUES (2409, 'ACTINV');
|
||||
INSERT INTO parm_poste (p_value, p_type) VALUES (2, 'ACT');
|
||||
INSERT INTO parm_poste (p_value, p_type) VALUES (2409, 'ACTINV');
|
||||
INSERT INTO parm_poste (p_value, p_type) VALUES (3, 'ACT');
|
||||
|
|
|
|||
99
html/admin/sql/patch/upgrade41.sql
Normal file
99
html/admin/sql/patch/upgrade41.sql
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
begin;
|
||||
|
||||
CREATE TABLE del_action
|
||||
(
|
||||
del_id serial NOT NULL,
|
||||
del_name text NOT NULL,
|
||||
del_time timestamp,
|
||||
CONSTRAINT del_action_pkey PRIMARY KEY (del_id)
|
||||
) ;
|
||||
|
||||
|
||||
CREATE TABLE del_jrn
|
||||
(
|
||||
jr_id int4,
|
||||
jr_def_id int4,
|
||||
jr_montant numeric(20,4),
|
||||
jr_comment text,
|
||||
jr_date date,
|
||||
jr_grpt_id int4,
|
||||
jr_internal text,
|
||||
jr_tech_date timestamp,
|
||||
jr_tech_per int4,
|
||||
jrn_ech date,
|
||||
jr_ech date,
|
||||
jr_rapt text,
|
||||
jr_valid bool,
|
||||
jr_opid int4,
|
||||
jr_c_opid int4,
|
||||
jr_pj oid,
|
||||
jr_pj_name text,
|
||||
jr_pj_type text,
|
||||
del_jrn_date timestamp
|
||||
) ;
|
||||
ALTER TABLE del_jrn
|
||||
ADD CONSTRAINT jr_id PRIMARY KEY(jr_id);
|
||||
|
||||
|
||||
CREATE TABLE del_jrnx
|
||||
(
|
||||
j_id int4,
|
||||
j_date date,
|
||||
j_montant numeric(20,4),
|
||||
j_poste poste_comptable,
|
||||
j_grpt int4,
|
||||
j_rapt text,
|
||||
j_jrn_def int4,
|
||||
j_debit bool,
|
||||
j_text text,
|
||||
j_centralized bool,
|
||||
j_internal text,
|
||||
j_tech_user text,
|
||||
j_tech_date timestamp,
|
||||
j_tech_per int4,
|
||||
j_qcode text
|
||||
) ;
|
||||
|
||||
ALTER TABLE del_jrnx
|
||||
ADD CONSTRAINT j_id PRIMARY KEY(j_id);
|
||||
|
||||
CREATE OR REPLACE FUNCTION jrn_del()
|
||||
RETURNS "trigger" AS
|
||||
$BODY$
|
||||
declare
|
||||
row jrn%ROWTYPE;
|
||||
begin
|
||||
row:=OLD;
|
||||
insert into del_jrn select *,now() from jrn where jr_id=row.jr_id;
|
||||
return row;
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE 'plpgsql' VOLATILE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION jrnx_del()
|
||||
RETURNS "trigger" AS
|
||||
$BODY$
|
||||
declare
|
||||
row jrnx%ROWTYPE;
|
||||
begin
|
||||
row:=OLD;
|
||||
insert into del_jrnx select * from jrnx where j_id=row.j_id;
|
||||
return row;
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE 'plpgsql' VOLATILE;
|
||||
|
||||
CREATE TRIGGER t_jrnx_del
|
||||
BEFORE DELETE
|
||||
ON jrnx
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE jrnx_del();
|
||||
|
||||
CREATE TRIGGER t_jrn_del
|
||||
BEFORE DELETE
|
||||
ON jrn
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE jrn_del();
|
||||
|
||||
update version set val=42;
|
||||
commit;
|
||||
12
html/admin/sql/patch/upgrade42.sql
Normal file
12
html/admin/sql/patch/upgrade42.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
begin;
|
||||
|
||||
delete from tva_rate where tva_id in (select tva_id from tva_rate group by tva_id having count(tva_id) > 1);
|
||||
update quant_sold set qs_vat_code = null where qs_vat_Code not in (select tva_id from tva_rate);
|
||||
update quant_purchase set qp_vat_code = null where qp_vat_Code not in (select tva_id from tva_rate);
|
||||
|
||||
alter table tva_rate add constraint tva_id_pk primary key (tva_id);
|
||||
alter table quant_purchase add constraint qp_vat_code_fk foreign key(qp_vat_code) references tva_rate(tva_id);
|
||||
alter table quant_sold add constraint qs_vat_code_fk foreign key(qs_vat_code) references tva_rate(tva_id);
|
||||
|
||||
update version set val=43;
|
||||
commit;
|
||||
4
html/admin/sql/patch/upgrade43.sql
Normal file
4
html/admin/sql/patch/upgrade43.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
begin;
|
||||
delete from bud_detail where bd_id not in (select bd_id from bud_detail_periode);
|
||||
update version set val=44;
|
||||
commit;
|
||||
Loading…
Add table
Add a link
Reference in a new issue