Last changes before 3.0

This commit is contained in:
sparkyx 2007-11-02 15:08:22 +00:00
parent 8793b3dc0b
commit bfe58a603f
18 changed files with 74 additions and 5036 deletions

View file

@ -40,4 +40,33 @@ $$
select correct_sequence_jrn();
drop function correct_sequence_jrn();
CREATE OR REPLACE FUNCTION tva_delete(int4)
RETURNS void AS
$BODY$
declare
p_tva_id alias for $1;
nCount integer;
begin
nCount=0;
select count(*) into nCount from quant_sold where qs_vat_code=p_tva_id;
if nCount != 0 then
return;
end if;
select count(*) into nCount from quant_purchase where qp_vat_code=p_tva_id;
if nCount != 0 then
return;
end if;
delete from tva_rate where tva_id=p_tva_id;
return;
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
commit;