diff --git a/include/sql/patch/upgrade131.sql b/include/sql/patch/upgrade131.sql index 17dd1c86f..9a004b575 100644 --- a/include/sql/patch/upgrade131.sql +++ b/include/sql/patch/upgrade131.sql @@ -1,6 +1,6 @@ begin; -drop VIEW public.v_detail_sale; +drop VIEW if exists public.v_detail_sale; CREATE OR REPLACE VIEW public.v_detail_sale as WITH m AS ( @@ -145,6 +145,8 @@ join operation_currency as oc on (oc.j_id=q1.j_id) group by x.j_poste,x.j_id ; +drop view if exists v_all_card_currency; + create or replace view v_all_card_currency as select sum(oc_amount) as sum_oc_amount,sum(oc_vat_amount) as sum_oc_vat_amount,x.f_id,x.j_id from diff --git a/sql/upgrade.sql b/sql/upgrade.sql index e69de29bb..e8af5a3d7 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -0,0 +1,13 @@ +begin; +insert into "parameter" (pr_id ) values ('MY_DEFAULT_ROUND_ERROR_DEB'); +insert into "parameter" (pr_id ) values ('MY_DEFAULT_ROUND_ERROR_CRED'); +drop view if exists v_all_card_currency; + +create or replace view v_all_card_currency as +select sum(oc_amount) as sum_oc_amount,sum(oc_vat_amount) as sum_oc_vat_amount,f_id,j_id +from +operation_currency +join jrnx using (j_id) +group by f_id,j_id; + +commit ; \ No newline at end of file