-| Code |
+Code |
|
|
@@ -124,10 +124,10 @@ $hidden=($this->has_quantity()==0)?'d-none':'';
';
-// echo "";
+ echo " | ";
echo $item['quick_code'];
// echo " | ";
-echo ''.$item['bt'].$item['card_add'].' | ';
+echo $item['bt'].$item['card_add'].'';
?>
|
';
|
|
- |
- |
+ |
0.0 |
|
@@ -166,13 +165,13 @@ echo '';
|
+ |
|
|
|
- |
- |
+
|
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 92014f93a..efaad1ec9 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -1,65 +1,80 @@
-begin;
-with correct_periode as (select jr_tech_per, jr_grpt_id from jrn)
-update jrnx set j_tech_per = jr_tech_per from correct_periode where correct_periode.jr_grpt_id=j_grpt and correct_periode.jr_tech_per != j_tech_per;
+
+update menu_ref set me_menu='Navigateur 🧭' where me_code ~ 'NAVI';
+
+update menu_ref set me_menu='Configuration 🔧' where me_code='CFG';
+ALTER TABLE public.tva_rate ADD CONSTRAINT tva_code_number_check CHECK (isnumeric(tva_code) = false);
-ALTER TABLE public.tva_rate ADD tva_code text ;
-ALTER TABLE public.tva_rate ADD CONSTRAINT tva_code_unique UNIQUE (tva_code);
-update tva_rate set tva_code=null;
+drop view if exists public.vw_fiche_attr;
-
-drop VIEW public.v_tva_rate;
-
-CREATE OR REPLACE VIEW public.v_tva_rate
-AS SELECT tva_rate.tva_id,
+CREATE OR REPLACE VIEW public.vw_fiche_attr
+AS SELECT a.f_id,
+ a.fd_id,
+ a.ad_value AS vw_name,
+ k.ad_value AS vw_first_name,
+ b.ad_value AS vw_sell,
+ c.ad_value AS vw_buy,
+ d.ad_value AS tva_code,
+ tva_rate.tva_id,
tva_rate.tva_rate,
- tva_rate.tva_code,
tva_rate.tva_label,
- tva_rate.tva_comment,
- split_part(tva_rate.tva_poste, ','::text, 1) AS tva_purchase,
- split_part(tva_rate.tva_poste, ','::text, 2) AS tva_sale,
- tva_rate.tva_both_side,
- tva_rate.tva_payment_purchase,
- tva_rate.tva_payment_sale
- FROM tva_rate;
+ e.ad_value AS vw_addr,
+ f.ad_value AS vw_cp,
+ j.ad_value AS quick_code,
+ h.ad_value AS vw_description,
+ i.ad_value AS tva_num,
+ fiche_def.frd_id,
+ l.ad_value AS accounting,
+ a.f_enable
+ FROM ( SELECT fiche.f_id,
+ fiche.fd_id,
+ fiche.f_enable,
+ fiche_detail.ad_value
+ FROM fiche
+ LEFT JOIN fiche_detail USING (f_id)
+ WHERE fiche_detail.ad_id = 1) a
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 6) b ON a.f_id = b.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 7) c ON a.f_id = c.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 2) d ON a.f_id = d.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 14) e ON a.f_id = e.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 15) f ON a.f_id = f.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 23) j ON a.f_id = j.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 9) h ON a.f_id = h.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 13) i ON a.f_id = i.f_id
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 32) k ON a.f_id = k.f_id
+ LEFT JOIN tva_rate ON d.ad_value = tva_rate.tva_id::text
+ JOIN fiche_def USING (fd_id)
+ LEFT JOIN ( SELECT fiche_detail.f_id,
+ fiche_detail.ad_value
+ FROM fiche_detail
+ WHERE fiche_detail.ad_id = 5) l ON a.f_id = l.f_id;
-CREATE OR REPLACE FUNCTION update_tva_code ()
- returns int4
-AS
-$BODY$
-declare
-/*
- * Section for variables
- */
- counter int:=0;
- letter int;
- x record;
- e record;
- str_tva_code text;
-begin
- -- basic loop
- for x in select distinct tva_rate from public.tva_rate order by tva_rate
- loop
- letter :=65;
- for e in select * from public.tva_rate where tva_rate = x.tva_rate loop
- str_tva_code := round(e.tva_rate*1000)::text||chr(letter);
- update tva_rate set tva_code=str_tva_code where tva_id=e.tva_id;
- letter := letter+1;
- counter := counter+1;
- end loop;
-
- end loop;
- return counter;
-end;
-$BODY$
-LANGUAGE plpgsql;
-
-select update_tva_code();
-
-drop function update_tva_code();
-alter table public.tva_rate alter tva_code set not null;
-
-ALTER TABLE public.op_predef_detail ALTER COLUMN opd_tva_id TYPE text USING opd_tva_id::text;
-insert into version (val,v_description) values (197,'Adapt for VAT CODE');
-commit;
+COMMENT ON VIEW public.vw_fiche_attr IS 'Some attribute for all cards';
\ No newline at end of file
|