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

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



Revision: 3598
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3598&view=rev
Author:   einhverfr
Date:     2011-07-30 16:08:13 +0000 (Sat, 30 Jul 2011)

Log Message:
-----------
Doc strings for tax forms and 1099 reporting

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

Modified: trunk/sql/modules/1099_reports.sql
===================================================================
--- trunk/sql/modules/1099_reports.sql	2011-07-30 06:38:33 UTC (rev 3597)
+++ trunk/sql/modules/1099_reports.sql	2011-07-30 16:08:13 UTC (rev 3598)
@@ -1,3 +1,16 @@
+-- First a couple of notes about this file and what will probably change in the
+-- future.
+--
+-- The current generation here of reports assumes that we are providing 
+-- reporting of purchases or sales to one country only.  If this ever changes
+-- we will need an abstraction layer like we use with fixed assets.  I suspect
+-- we will go that way anyway since it will make some things easier. 
+--
+-- This file provides 1099 reporting (MISC and INT).  It does NOT provide 1099-K
+-- and we'd need an abstraction layer for that. --CT
+
+
+
 CREATE TYPE tax_form_report_item AS (
     legal_name text, 
     entity_id integer, 
@@ -101,6 +114,11 @@
 END;
 $BODY$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION tax_form_summary_report
+(in_tax_form_id int, in_begin date, in_end date) IS
+$$This provides the total reportable value per vendor.  As per 1099 forms, these
+are cash-basis documents and show amounts paid.$$;
+
 CREATE OR REPLACE FUNCTION tax_form_details_report(in_tax_form_id int, in_begin date, in_end date, in_meta_number text) 
 RETURNS SETOF tax_form_report_detail_item AS $BODY$
 DECLARE
@@ -179,3 +197,9 @@
 	END LOOP;
 END;
 $BODY$ LANGUAGE PLPGSQL;
+
+COMMENT ON FUNCTION tax_form_details_report
+(in_tax_form_id int, in_begin date, in_end date, in_meta_number text) IS
+$$ This provides a list of invoices and transactions that a report hits.  This 
+is intended to allow an organization to adjust what is reported on the 1099 
+before printing them.$$;

Modified: trunk/sql/modules/TaxForm.sql
===================================================================
--- trunk/sql/modules/TaxForm.sql	2011-07-30 06:38:33 UTC (rev 3597)
+++ trunk/sql/modules/TaxForm.sql	2011-07-30 16:08:13 UTC (rev 3598)
@@ -21,18 +21,28 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION tax_form__save(in_id int, in_country_id int,
+                          in_form_name text, in_default_reportable bool) IS
+$$Saves tax form information to the database.$$;
+
 CREATE OR REPLACE FUNCTION tax_form__get(in_form_id int) 
 returns country_tax_form
 as $$
 SELECT * FROM country_tax_form where id = $1;
 $$ language sql;
 
+COMMENT ON FUNCTION tax_form__get(in_form_id int) IS
+$$ Retrieves specified tax form information from the database.$$;
+
 CREATE OR REPLACE FUNCTION tax_form__list_all()
 RETURNS SETOF country_tax_form AS
 $BODY$
-SELECT * FROM country_tax_form ORDER BY country_id;
+SELECT * FROM country_tax_form ORDER BY country_id, id;
 $BODY$ LANGUAGE SQL;
 
+COMMENT ON FUNCTION tax_form__list_all() IS
+$$ Returns a set of all tax forms, ordered by country_id and id$$; 
+
 CREATE TYPE taxform_list AS (
    id int,
    form_name text,
@@ -49,3 +59,7 @@
   JOIN country c ON c.id = t.country_id
  ORDER BY c.name, t.form_name;
 $BODY$ language sql;
+
+COMMENT ON function tax_form__list_ext() IS
+$$ Returns a list of tax forms with an added field, country_name, to specify the
+name of the country.$$;


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