[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2662] trunk/sql/modules/chart.sql



Revision: 2662
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2662&view=rev
Author:   einhverfr
Date:     2009-06-12 18:48:59 +0000 (Fri, 12 Jun 2009)

Log Message:
-----------
Correcting lost function in chart.sql

Modified Paths:
--------------
    trunk/sql/modules/chart.sql

Modified: trunk/sql/modules/chart.sql
===================================================================
--- trunk/sql/modules/chart.sql	2009-06-12 17:59:56 UTC (rev 2661)
+++ trunk/sql/modules/chart.sql	2009-06-12 18:48:59 UTC (rev 2662)
@@ -139,5 +139,26 @@
 END;
 $$ language plpgsql;
 
+CREATE OR REPLACE FUNCTION chart_list_cash(in_account_class int)
+returns setof chart
+as $$
+ DECLARE resultrow record;
+         link_string text;
+ BEGIN
+         IF in_account_class = 1 THEN
+            link_string := '%AP_paid%';
+         ELSE 
+            link_string := '%AR_paid%';
+         END IF;
+ 
+         FOR resultrow IN
+           SELECT *  FROM chart
+           WHERE link LIKE link_string
+           ORDER BY accno
+           LOOP
+           return next resultrow;
+         END LOOP;
+ END;
+$$ language plpgsql;
 COMMENT ON FUNCTION chart_list_cash(in_account_class int) IS
 $$ This function returns the overpayment accounts acording with in_account_class which must be 1 or 2 $$;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.