Restructure file , remove html/admin , backup ...
This commit is contained in:
parent
b57df7c0e8
commit
896f3624c7
169 changed files with 48 additions and 54 deletions
44
include/sql/patch/upgrade88.sql
Normal file
44
include/sql/patch/upgrade88.sql
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
begin;
|
||||
|
||||
update quant_sold set qs_price=abs(qs_price)*(-1), qs_vat=abs(qs_vat)*(-1), qs_quantite=abs(qs_quantite)*(-1) where qs_price < 0 or qs_quantite < 0 or qs_vat < 0;
|
||||
|
||||
update quant_purchase set qp_price=abs(qp_price)*(-1), qp_vat=abs(qp_vat)*(-1), qp_quantite=abs(qp_quantite)*(-1) where qp_price < 0 or qp_quantite < 0 or qp_vat < 0;
|
||||
|
||||
|
||||
select comptaproc.fill_quant_fin();
|
||||
|
||||
create function comptaproc.quant_purchase_ins_upd () returns trigger
|
||||
as
|
||||
$$
|
||||
begin
|
||||
if NEW.qp_price < 0 OR NEW.qp_quantite <0 THEN
|
||||
NEW.qp_price := abs (NEW.qp_price)*(-1);
|
||||
NEW.qp_quantite := abs (NEW.qp_quantite)*(-1);
|
||||
end if;
|
||||
return NEW;
|
||||
end;
|
||||
$$
|
||||
language plpgsql;
|
||||
|
||||
drop trigger if exists quant_purchase_ins_upd_tr on quant_purchase ;
|
||||
create trigger quant_sold_ins_upd_tr after insert or update on quant_purchase for each row execute procedure comptaproc.quant_purchase_ins_upd();
|
||||
|
||||
create function comptaproc.quant_sold_ins_upd () returns trigger
|
||||
as
|
||||
$$
|
||||
begin
|
||||
if NEW.qs_price < 0 OR NEW.qs_quantite <0 THEN
|
||||
NEW.qs_price := abs (NEW.qs_price)*(-1);
|
||||
NEW.qs_quantite := abs (NEW.qs_quantite)*(-1);
|
||||
end if;
|
||||
return NEW;
|
||||
end;
|
||||
$$
|
||||
language plpgsql;
|
||||
|
||||
drop trigger if exists quant_sold_ins_upd_tr on quant_sold ;
|
||||
create trigger quant_sold_ins_upd_tr after insert or update on quant_sold for each row execute procedure comptaproc.quant_sold_ins_upd();
|
||||
|
||||
update version set val=89;
|
||||
|
||||
commit;
|
||||
Loading…
Add table
Add a link
Reference in a new issue