noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 157/162: Currency - fix view


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 157/162: Currency - fix view
Date: Sat, 11 Jul 2020 13:24:11 -0400 (EDT)

sparkyx pushed a commit to annotated tag E-4
in repository noalyss.

commit 588442f9336997e9ff61f0dca9394c5fb7c146e1
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sat Jan 12 13:44:37 2019 +0100

    Currency - fix view
---
 include/sql/patch/upgrade131.sql |  4 +++-
 sql/upgrade.sql                  | 13 +++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/sql/patch/upgrade131.sql b/include/sql/patch/upgrade131.sql
index 17dd1c8..9a004b5 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 e69de29..e8af5a3 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]