summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-13 00:36:33 +0000
committerlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-13 00:36:33 +0000
commita5b4492c809c787c61f613e08ac2ed46f67cf8b4 (patch)
tree82dd4d4c2c726f340fe39bd04be6e1c84882656a
parentddb34df1c58bb706b3e4c15644d50481e9fb2fdd (diff)
fix avgcost() and lastcost() to not use float
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1071 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--sql/Pg-database.sql10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql
index 525dc405..aae27abc 100644
--- a/sql/Pg-database.sql
+++ b/sql/Pg-database.sql
@@ -1014,12 +1014,12 @@ CREATE TRIGGER del_recurring AFTER DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE d
CREATE TRIGGER del_recurring AFTER DELETE ON gl FOR EACH ROW EXECUTE PROCEDURE del_recurring();
-- end trigger
--
-CREATE FUNCTION avgcost(int) RETURNS FLOAT AS '
+CREATE FUNCTION avgcost(int) RETURNS NUMERIC AS '
DECLARE
-v_cost float;
-v_qty float;
+v_cost numeric;
+v_qty numeric;
v_parts_id alias for $1;
BEGIN
@@ -1046,11 +1046,11 @@ END;
' language 'plpgsql';
-- end function
--
-CREATE FUNCTION lastcost(int) RETURNS FLOAT AS '
+CREATE FUNCTION lastcost(int) RETURNS numeric AS '
DECLARE
-v_cost float;
+v_cost numeric;
v_parts_id alias for $1;
BEGIN