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

SF.net SVN: ledger-smb:[6310] branches/1.3/sql/modules/Account.sql



Revision: 6310
          http://sourceforge.net/p/ledger-smb/code/6310
Author:   einhverfr
Date:     2013-11-30 12:43:06 +0000 (Sat, 30 Nov 2013)
Log Message:
-----------
Correcting omitted account__delete function

Modified Paths:
--------------
    branches/1.3/sql/modules/Account.sql

Modified: branches/1.3/sql/modules/Account.sql
===================================================================
--- branches/1.3/sql/modules/Account.sql	2013-11-29 13:37:05 UTC (rev 6309)
+++ branches/1.3/sql/modules/Account.sql	2013-11-30 12:43:06 UTC (rev 6310)
@@ -159,6 +159,22 @@
 based on the in_link array.
 $$;
 
+CREATE OR REPLACE FUNCTION account__delete(in_id int)
+RETURNS BOOL AS
+$$
+BEGIN
+DELETE FROM tax WHERE chart_id = in_id;
+DELETE FROM account_link WHERE account_id = in_id;
+DELETE FROM account WHERE id = in_id;
+RETURN FOUND;
+END;
+$$ LANGUAGE PLPGSQL;
+
+COMMENT ON FUNCTION account__delete(int) IS
+$$ This deletes an account with the id specified.  If the account has 
+transactions associated with it, it will fail and raise a foreign key constraint.
+$$;
+
 CREATE OR REPLACE FUNCTION account_heading_list()
 RETURNS SETOF account_heading AS
 $$

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits