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

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



Revision: 3600
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3600&view=rev
Author:   einhverfr
Date:     2011-07-30 17:26:34 +0000 (Sat, 30 Jul 2011)

Log Message:
-----------
Docstrings for EndOfYear.sql

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

Modified: trunk/sql/modules/EndOfYear.sql
===================================================================
--- trunk/sql/modules/EndOfYear.sql	2011-07-30 17:06:10 UTC (rev 3599)
+++ trunk/sql/modules/EndOfYear.sql	2011-07-30 17:26:34 UTC (rev 3600)
@@ -51,6 +51,13 @@
 END;
 $$ language plpgsql;
 
+COMMENT ON FUNCTION eoy_create_checkpoint(in_end_date date) IS
+$$Creates checkpoints for each account at a specific date.  Books are considered
+closed when they occur before the latest checkpoint timewise.  This means that
+balances (and credit/debit amounts) can be calculated starting at a checkpoint
+and moving forward (thus providing a mechanism for expunging old data while 
+keeping balances correct at some future point).$$;
+
 CREATE OR REPLACE FUNCTION eoy_zero_accounts
 (in_end_date date, in_reference text, in_description text, 
 in_retention_acc_id int)
@@ -90,6 +97,13 @@
 end;
 $$ language plpgsql;
 
+COMMENT ON FUNCTION eoy_zero_accounts
+(in_end_date date, in_reference text, in_description text,
+in_retention_acc_id int) IS
+$$ Posts a transaction which zeroes the income and expense accounts, moving the
+net balance there into a retained earnings account identified by 
+in_retention_acc_id.$$;
+
 CREATE OR REPLACE FUNCTION eoy_close_books
 (in_end_date date, in_reference text, in_description text, 
 in_retention_acc_id int)
@@ -105,6 +119,14 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION eoy_close_books
+(in_end_date date, in_reference text, in_description text,
+in_retention_acc_id int) IS
+$$ Zeroes accounts and then creates a checkpoint. in_end_date is the date when
+the books are to be closed, in_reference and in_description become the 
+reference and description of the gl transaction, and in_retention_acc_id is
+the retained earnings account id.$$;
+
 CREATE OR REPLACE FUNCTION eoy_reopen_books(in_end_date date)
 RETURNS bool AS
 $$
@@ -142,6 +164,10 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION eoy_reopen_books(in_end_date date) IS
+$$ Removes checkpoints and reverses yearend transactions starting on 
+in_end_date$$;
+
 CREATE OR REPLACE FUNCTION account__obtain_balance
 (in_transdate date, in_account_id int)
 RETURNS numeric AS
@@ -168,6 +194,11 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION account__obtain_balance 
+(in_transdate date, in_account_id int) is
+$$Returns the account balance at a given point in time, calculating forward 
+from most recent check point.$$;
+
 CREATE OR REPLACE FUNCTION eoy_earnings_accounts() RETURNS setof account AS 
 $$
     SELECT * 
@@ -175,3 +206,6 @@
      WHERE category = 'Q'
      ORDER BY accno;
 $$ language sql;
+
+COMMENT ON FUNCTION eoy_earnings_accounts() IS
+$$ Lists equity accounts for the retained earnings dropdown.$$;


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