make patch upgrade108.sql with them
This commit is contained in:
parent
1fe8768d9c
commit
ff22aa42cb
4 changed files with 0 additions and 84 deletions
|
|
@ -1,43 +0,0 @@
|
|||
--drop view v_quant_detail;
|
||||
create or replace view v_quant_detail as
|
||||
with quant as
|
||||
(select
|
||||
j_id,
|
||||
qp_fiche as fiche_id,
|
||||
qp_supplier as tiers,
|
||||
qp_vat as vat_amount,
|
||||
qp_price as price,
|
||||
qp_vat_code as vat_code,
|
||||
qp_dep_priv as dep_priv,
|
||||
qp_nd_tva as nd_tva,
|
||||
qp_nd_tva_recup as nd_tva_recup,
|
||||
qp_nd_amount as nd_amount,
|
||||
qp_vat_sided as vat_sided
|
||||
from quant_purchase
|
||||
union all
|
||||
select
|
||||
j_id,
|
||||
qs_fiche,
|
||||
qs_client,
|
||||
qs_vat,
|
||||
qs_price,
|
||||
qs_vat_code,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
qs_vat_sided
|
||||
from
|
||||
quant_sold
|
||||
)
|
||||
select
|
||||
jr_id,quant.tiers,jrn_def_name,jrn_def_type,name,jr_comment,jr_montant,sum(price) as price,vat_code,sum(vat_amount) as vat_amount,sum(dep_priv) as dep_priv,sum(nd_tva) as nd_tva,sum(nd_tva_recup) as nd_tva_recup,sum(nd_amount) as nd_amount,vat_sided,tva_label
|
||||
from
|
||||
jrn
|
||||
join jrnx on (jrnx.j_grpt=jrn.jr_grpt_id)
|
||||
join quant using (j_id)
|
||||
left join vw_fiche_name on (tiers=vw_fiche_name.f_id)
|
||||
join jrn_def on (jrn_def_id=jr_def_id)
|
||||
join tva_rate on (tva_id=vat_code)
|
||||
group by
|
||||
jr_id,quant.tiers,jr_comment,jr_montant,vat_code,vat_sided,name,jrn_def_name,jrn_def_type,tva_label;
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
insert into menu_ref(me_code,me_menu,me_file, me_url,me_description,me_parameter,me_javascript,me_type,me_description_etendue)
|
||||
values
|
||||
('CSV:Reconciliation','Export opérations rapprochées','export_rec_csv.php',null,'Export opérations rapprochées en CSV',null,null,'PR','');
|
||||
|
||||
insert into profile_menu (me_code,me_code_dep,p_id,p_order, p_type_display,pm_default)
|
||||
values
|
||||
('CSV:Reconciliation',null,1,0,'P',0), ('CSV:Reconciliation',null,2,null,'P',0);
|
||||
|
|
@ -1 +0,0 @@
|
|||
alter table stock_change alter tech_date type time;
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
alter table jrn add column jr_date_paid date;
|
||||
|
||||
set search_path=public,comptaproc;
|
||||
|
||||
create or replace function set_paiement_date() returns void
|
||||
as
|
||||
$body$
|
||||
declare
|
||||
row_jrn jrn%ROWTYPE;
|
||||
cursor_jrn cursor for select * from jrn where substr(jr_internal,1,1) in ('A','V') and jr_date_paid is null;
|
||||
n_rec jrn_rapt.jr_id%TYPE;
|
||||
nCount integer;
|
||||
jrn_date jrn.jr_date%TYPE;
|
||||
begin
|
||||
for row_jrn in cursor_jrn
|
||||
loop
|
||||
select count(*) into nCount from jrn_rapt where jr_id=row_jrn.jr_id or jra_concerned=row_jrn.jr_id;
|
||||
if nCount = 1 then
|
||||
select jr_id into n_rec from jrn_rapt where jra_concerned=row_jrn.jr_id;
|
||||
if NOT FOUND then
|
||||
select jra_concerned into n_rec from jrn_rapt where jr_id=row_jrn.jr_id;
|
||||
end if;
|
||||
select jr_date into jrn_date from jrn where jr_id=n_rec;
|
||||
update jrn set jr_date_paid = jrn_date where current of cursor_jrn;
|
||||
end if;
|
||||
|
||||
end loop;
|
||||
|
||||
end;
|
||||
$body$
|
||||
language plpgsql;
|
||||
|
||||
select set_paiement_date();
|
||||
Loading…
Add table
Add a link
Reference in a new issue