15 |
update jrnx set j_tech_per = jr_tech_per from jrn where j_grpt=jr_grpt_id and j_tech_per is null; |
update jrnx set j_tech_per = jr_tech_per from jrn where j_grpt=jr_grpt_id and j_tech_per is null; |
16 |
alter table jrnx alter j_tech_per set not null; |
alter table jrnx alter j_tech_per set not null; |
17 |
alter table jrn alter jr_tech_per set not null; |
alter table jrn alter jr_tech_per set not null; |
18 |
alter table jrn alter jr_montant type numeric(8,4); |
alter table jrn alter jr_montant type numeric(20,4); |
19 |
alter table jrnx alter j_montant type numeric(8,4); |
alter table jrnx alter j_montant type numeric(20,4); |
20 |
|
alter table centralized alter c_montant type numeric(20,4); |
21 |
|
alter table parm_money alter pm_rate type numeric(20,4); |
22 |
|
drop view vw_fiche_attr; |
23 |
|
alter table tva_rate alter tva_rate type numeric(8,4); |
24 |
-- version 8 |
-- version 8 |
25 |
|
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, fiche_def.frd_id |
26 |
|
FROM ( SELECT fiche.f_id, fiche.fd_id, attr_value.av_text |
27 |
|
FROM fiche |
28 |
|
JOIN jnt_fic_att_value USING (f_id) |
29 |
|
JOIN attr_value USING (jft_id) |
30 |
|
JOIN attr_def USING (ad_id) |
31 |
|
WHERE jnt_fic_att_value.ad_id = 1) a |
32 |
|
LEFT JOIN ( SELECT fiche.f_id, attr_value.av_text |
33 |
|
FROM fiche |
34 |
|
JOIN jnt_fic_att_value USING (f_id) |
35 |
|
JOIN attr_value USING (jft_id) |
36 |
|
JOIN attr_def USING (ad_id) |
37 |
|
WHERE jnt_fic_att_value.ad_id = 6) b ON a.f_id = b.f_id |
38 |
|
LEFT JOIN ( SELECT fiche.f_id, attr_value.av_text |
39 |
|
FROM fiche |
40 |
|
JOIN jnt_fic_att_value USING (f_id) |
41 |
|
JOIN attr_value USING (jft_id) |
42 |
|
JOIN attr_def USING (ad_id) |
43 |
|
WHERE jnt_fic_att_value.ad_id = 7) c ON a.f_id = c.f_id |
44 |
|
LEFT JOIN ( SELECT fiche.f_id, attr_value.av_text |
45 |
|
FROM fiche |
46 |
|
JOIN jnt_fic_att_value USING (f_id) |
47 |
|
JOIN attr_value USING (jft_id) |
48 |
|
JOIN attr_def USING (ad_id) |
49 |
|
WHERE jnt_fic_att_value.ad_id = 2) d ON a.f_id = d.f_id |
50 |
|
LEFT JOIN ( SELECT fiche.f_id, attr_value.av_text |
51 |
|
FROM fiche |
52 |
|
JOIN jnt_fic_att_value USING (f_id) |
53 |
|
JOIN attr_value USING (jft_id) |
54 |
|
JOIN attr_def USING (ad_id) |
55 |
|
WHERE jnt_fic_att_value.ad_id = 14) e ON a.f_id = e.f_id |
56 |
|
LEFT JOIN ( SELECT fiche.f_id, attr_value.av_text |
57 |
|
FROM fiche |
58 |
|
JOIN jnt_fic_att_value USING (f_id) |
59 |
|
JOIN attr_value USING (jft_id) |
60 |
|
JOIN attr_def USING (ad_id) |
61 |
|
WHERE jnt_fic_att_value.ad_id = 15) f ON a.f_id = f.f_id |
62 |
|
LEFT JOIN tva_rate ON d.av_text = tva_rate.tva_id::text |
63 |
|
JOIN fiche_def USING (fd_id); |
64 |
|
|
65 |
|
|
66 |
create function check_balance (p_internal text) returns numeric as $$ |
create function check_balance (p_internal text) returns numeric as $$ |