70 |
diff numeric; |
diff numeric; |
71 |
tt text; |
tt text; |
72 |
begin |
begin |
|
raise notice 'tg_op is %', TG_OP; |
|
73 |
if TG_OP = 'INSERT' then |
if TG_OP = 'INSERT' then |
74 |
tt=NEW.jr_internal; |
tt=NEW.jr_internal; |
75 |
diff:=check_balance(tt); |
diff:=check_balance(tt); |
167 |
c_j_id integer, |
c_j_id integer, |
168 |
c_date date NOT NULL, |
c_date date NOT NULL, |
169 |
c_internal text NOT NULL, |
c_internal text NOT NULL, |
170 |
c_montant double precision NOT NULL, |
c_montant numeric(20,4) not null, |
171 |
c_debit boolean DEFAULT true, |
c_debit boolean DEFAULT true, |
172 |
c_jrn_def integer NOT NULL, |
c_jrn_def integer NOT NULL, |
173 |
c_poste integer, |
c_poste integer, |
330 |
CREATE TABLE jrn ( |
CREATE TABLE jrn ( |
331 |
jr_id integer DEFAULT nextval('s_jrn'::text) NOT NULL, |
jr_id integer DEFAULT nextval('s_jrn'::text) NOT NULL, |
332 |
jr_def_id integer NOT NULL, |
jr_def_id integer NOT NULL, |
333 |
jr_montant numeric(8,4) NOT NULL, |
jr_montant numeric(20,4) NOT NULL, |
334 |
jr_comment text, |
jr_comment text, |
335 |
jr_date date, |
jr_date date, |
336 |
jr_grpt_id integer NOT NULL, |
jr_grpt_id integer NOT NULL, |
457 |
CREATE TABLE jrnx ( |
CREATE TABLE jrnx ( |
458 |
j_id integer DEFAULT nextval('s_jrn_op'::text) NOT NULL, |
j_id integer DEFAULT nextval('s_jrn_op'::text) NOT NULL, |
459 |
j_date date DEFAULT now(), |
j_date date DEFAULT now(), |
460 |
j_montant numeric(8,4) DEFAULT 0, |
j_montant numeric(20,4) DEFAULT 0, |
461 |
j_poste integer NOT NULL, |
j_poste integer NOT NULL, |
462 |
j_grpt integer NOT NULL, |
j_grpt integer NOT NULL, |
463 |
j_rapt text, |
j_rapt text, |
500 |
CREATE TABLE parm_money ( |
CREATE TABLE parm_money ( |
501 |
pm_id integer DEFAULT nextval('s_currency'::text), |
pm_id integer DEFAULT nextval('s_currency'::text), |
502 |
pm_code character(3) NOT NULL, |
pm_code character(3) NOT NULL, |
503 |
pm_rate double precision |
pm_rate numeric (20,4) not null |
504 |
); |
); |
505 |
|
|
506 |
|
|
990 |
CREATE TABLE tva_rate ( |
CREATE TABLE tva_rate ( |
991 |
tva_id integer NOT NULL, |
tva_id integer NOT NULL, |
992 |
tva_label text NOT NULL, |
tva_label text NOT NULL, |
993 |
tva_rate double precision DEFAULT 0.0 NOT NULL, |
tva_rate numeric(6,4) DEFAULT 0.0 NOT NULL, |
994 |
tva_comment text, |
tva_comment text, |
995 |
tva_poste text |
tva_poste text |
996 |
); |
); |