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

SF.net SVN: ledger-smb:[3359] trunk



Revision: 3359
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3359&view=rev
Author:   einhverfr
Date:     2011-06-27 16:20:38 +0000 (Mon, 27 Jun 2011)

Log Message:
-----------
Comment on Drafts.sql, POD on Draft.pm and scripts/drafts.pl

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Draft.pm
    trunk/scripts/drafts.pl
    trunk/sql/modules/Drafts.sql

Modified: trunk/LedgerSMB/DBObject/Draft.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Draft.pm	2011-06-27 14:45:28 UTC (rev 3358)
+++ trunk/LedgerSMB/DBObject/Draft.pm	2011-06-27 16:20:38 UTC (rev 3359)
@@ -1,3 +1,5 @@
+=pod
+
 =head1 NAME
 
 LedgerSMB:DBObject::Draft, LedgerSMB base class for managing "drafts."
@@ -23,6 +25,16 @@
 returns a list of results for the search criteria.  This list is also stored 
 in $draft->{search_resuts}
 
+Requres $self->{type} to be one of 'ar', 'ap', or 'gl'
+
+Optional hash entries for search criteria are:
+
+with_accno: Draft transaction against a specific account.
+from_date:  Earliest date for match
+to_date: Latest date for match
+amount_le: total less than or equal to
+amount_ge: total greater than or equal to
+
 =cut
 
 sub search {

Modified: trunk/scripts/drafts.pl
===================================================================
--- trunk/scripts/drafts.pl	2011-06-27 14:45:28 UTC (rev 3358)
+++ trunk/scripts/drafts.pl	2011-06-27 16:20:38 UTC (rev 3359)
@@ -1,4 +1,23 @@
+=pod
 
+=head1 NAME
+
+LedgerSMB:Scripts::drafts, LedgerSMB workflow scripts for managing drafts
+
+=head1 SYNOPSIS
+
+This module contains the workflows for managing unapproved, unbatched financial 
+transactions.  This does not contain facities for creating such transactions, 
+only searching for them, and posting them to the books or deleting those
+which have not been approved yet.
+    
+=head1 METHODS
+        
+=over   
+        
+=cut
+
+
 package LedgerSMB::Scripts::drafts;
 our $VERSION = '0.1';
 
@@ -6,6 +25,21 @@
 use LedgerSMB::Template;
 use strict;
 
+=item search
+
+Displays the search filter screen.  No inputs required.
+
+The following inputs are optional and become defaults for the search criteria:
+
+type:  either 'ar', 'ap', or 'gl'
+with_accno: Draft transaction against a specific account.
+from_date:  Earliest date for match
+to_date: Latest date for match
+amount_le: total less than or equal to
+amount_ge: total greater than or equal to
+
+=cut
+
 sub search {
     my ($request) = @_;
     $request->{class_types} = [
@@ -23,6 +57,23 @@
     $template->render($request);
 }
 
+=item list_drafts_draft_approve
+
+Required hash entries (global):
+
+rowcount: number of total drafts in the list
+
+Required hash entries:
+row_$runningnumber: transaction id of the draft on that row.
+draft_$id:  true if selected.
+
+
+Approves selected drafts.  If close_form fails, does nothing and lists
+drafts again.  
+
+=cut
+
+
 sub list_drafts_draft_approve {
     my ($request) = @_;
     if (!$request->close_form){
@@ -39,6 +90,23 @@
     search($request);
 }
 
+
+=item list_drafts_draft_delete
+
+Required hash entries (global):
+
+rowcount: number of total drafts in the list
+
+Required hash entries:
+row_$runningnumber: transaction id of the draft on that row.
+draft_$id:  true if selected.
+
+
+Deletes selected drafts.  If close_form fails, does nothing and lists
+drafts again.  
+
+=cut
+
 sub list_drafts_draft_delete {
     my ($request) = @_;
     if (!$request->close_form){
@@ -55,6 +123,25 @@
     search($request);
 }
 
+=item list_drafts
+
+Searches for drafts and lists those matching criteria:
+
+Required hash variables:
+
+type:  either 'ar', 'ap', or 'gl'
+
+
+The following inputs are optional and used for filter criteria
+
+with_accno: Draft transaction against a specific account.
+from_date:  Earliest date for match
+to_date: Latest date for match
+amount_le: total less than or equal to
+amount_ge: total greater than or equal to
+
+=cut
+
 sub list_drafts {
     my ($request) = @_;
     $request->{action} = 'list_drafts';
@@ -166,7 +253,4 @@
 }
 
 
-
-sub delete_drafts {
-    my ($request) = @_;
-}
+1;

Modified: trunk/sql/modules/Drafts.sql
===================================================================
--- trunk/sql/modules/Drafts.sql	2011-06-27 14:45:28 UTC (rev 3358)
+++ trunk/sql/modules/Drafts.sql	2011-06-27 16:20:38 UTC (rev 3359)
@@ -57,6 +57,10 @@
 END;
 $$ language plpgsql;
 
+COMMENT ON FUNCTION draft__search(in_type text, in_with_accno text,
+in_from_date date, in_to_date date, in_amount_le numeric, in_amount_ge numeric)
+IS $$ Searches for drafts.  in_type may be any of 'ar', 'ap', or 'gl'.$$;
+
 CREATE OR REPLACE FUNCTION draft_approve(in_id int) returns bool as
 $$
 declare 
@@ -89,6 +93,9 @@
 END;
 $$ LANGUAGE PLPGSQL SECURITY DEFINER;
 
+COMMENT ON FUNCTION draft_approve(in_id int) IS
+$$ Posts draft to the books.  in_id is the id from the ar, ap, or gl table.$$;
+
 CREATE OR REPLACE FUNCTION draft_delete(in_id int) returns bool as
 $$
 declare 
@@ -117,3 +124,6 @@
 END;
 $$ LANGUAGE PLPGSQL SECURITY DEFINER;
 
+COMMENT ON FUNCTION draft_approve(in_id int) is
+$$ Deletes the draft from the book.  Only will delete unapproved transactions.
+Otherwise an exception is raised and the transaction terminated.$$;


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