diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-01-12 06:05:26 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-01-12 06:05:26 +0000 |
commit | be948c97547fd7924f4967a3057ccfe0988ae329 (patch) | |
tree | 669a17373c74e0b7791401978871947e65013d51 /sql | |
parent | ba966358f4b3f5cbe0f0ecc5136445024f7b5a37 (diff) |
Fixing (in Pg-database) 1771834, inventory lost when converting order to invoice
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2040 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r-- | sql/Pg-database.sql | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index 72011251..866a89f3 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -1549,32 +1549,6 @@ CREATE TRIGGER del_exchangerate BEFORE DELETE ON ap FOR EACH ROW EXECUTE PROCEDU CREATE TRIGGER del_exchangerate BEFORE DELETE ON oe FOR EACH ROW EXECUTE PROCEDURE del_exchangerate(); -- end trigger -- -CREATE FUNCTION check_inventory() RETURNS TRIGGER AS ' - -declare - itemid int; - row_data inventory%rowtype; - -begin - - if not old.quotation then - for row_data in select * from inventory where trans_id = old.id loop - select into itemid id from orderitems where trans_id = old.id and id = row_data.orderitems_id; - - if itemid is null then - delete from inventory where trans_id = old.id and orderitems_id = row_data.orderitems_id; - end if; - end loop; - end if; -return old; -end; -' language 'plpgsql'; --- end function --- -CREATE TRIGGER check_inventory AFTER UPDATE ON oe FOR EACH ROW EXECUTE PROCEDURE check_inventory(); --- end trigger --- --- CREATE FUNCTION check_department() RETURNS TRIGGER AS ' declare |