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

SF.net SVN: ledger-smb:[4842] trunk/sql/modules/arap.sql



Revision: 4842
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4842&view=rev
Author:   einhverfr
Date:     2012-06-05 13:50:13 +0000 (Tue, 05 Jun 2012)
Log Message:
-----------
Transaction reports now run

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

Modified: trunk/sql/modules/arap.sql
===================================================================
--- trunk/sql/modules/arap.sql	2012-06-05 13:35:24 UTC (rev 4841)
+++ trunk/sql/modules/arap.sql	2012-06-05 13:50:13 UTC (rev 4842)
@@ -97,5 +97,29 @@
    HAVING in_source = ANY(array_agg(ac.source));
 END;
 $$ LANGUAGE PLPGSQL;
+CREATE OR REPLACE FUNCTION ar_ap__transaction_search_summary
+(in_account_id int, in_name_part text, in_meta_number text, in_invnumber text,
+ in_ordnumber text, in_ponumber text, in_source text, in_description text,
+ in_notes text, in_shipvia text, in_from_date date, in_to_date date, 
+ in_on_hold bool, in_inc_open bool, in_inc_closed bool, in_as_of date, 
+ in_entity_class int)
+RETURNS SETOF purchase_info AS
+$$
+BEGIN
+   RETURN QUERY
+       SELECT null::int, null::text, null::text, null::text, null::date
+              entity_name, meta_number, entity_id, sum(amount), 
+              sum(amount_paid), sum(tax), currency, null::date, null::date,
+              tull::text, null::text, null::text, null::text[]
+         FROM ar_ap__transaction_search
+              (in_account_id, in_name_part, in_meta_number, in_invnumber,
+              in_ordnumber, in_ponumber, in_source, in_description,
+              in_notes, in_shipvia, in_from_date, in_to_date,
+              in_on_hold, in_inc_open, in_inc_closed, in_as_of,  
+              in_entity_class)
+     GROUP BY entity_name, meta_number, entity_id;
+END;
+$$ language plpgsql;
 
+
 COMMIT;

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