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

SF.net SVN: ledger-smb:[6019] trunk/sql/modules/TaxForm.sql



Revision: 6019
          http://sourceforge.net/p/ledger-smb/code/6019
Author:   einhverfr
Date:     2013-09-14 07:47:05 +0000 (Sat, 14 Sep 2013)
Log Message:
-----------
fixed country name not showing on tax form list, trunk only

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

Modified: trunk/sql/modules/TaxForm.sql
===================================================================
--- trunk/sql/modules/TaxForm.sql	2013-09-14 07:41:37 UTC (rev 6018)
+++ trunk/sql/modules/TaxForm.sql	2013-09-14 07:47:05 UTC (rev 6019)
@@ -42,10 +42,24 @@
 COMMENT ON FUNCTION tax_form__get(in_form_id int) IS
 $$ Retrieves specified tax form information from the database.$$;
 
+DROP TYPE IF EXISTS tax_form_list;
+
+CREATE TYPE tax_form_list AS (
+   id int,
+   form_name text,
+   country_name text,
+   default_reportable bool,
+   is_accrual bool
+);
+
+DROP FUNCTION IF EXISTS tax_form__list_all();
 CREATE OR REPLACE FUNCTION tax_form__list_all()
-RETURNS SETOF country_tax_form AS
+RETURNS SETOF tax_form_list AS
 $BODY$
-SELECT * FROM country_tax_form ORDER BY country_id, id;
+SELECT tf.id, tf.form_name, c.name, tf.default_reportable, tf.is_accrual
+  FROM country c
+  JOIN country_tax_form tf ON c.id = tf.country_id
+ ORDER BY country_id, form_name;
 $BODY$ LANGUAGE SQL;
 
 COMMENT ON FUNCTION tax_form__list_all() IS

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


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits