[wiaflos-devel] COMMIT - r238 - trunk/wiaflos/server

svn at linuxrulz.org svn at linuxrulz.org
Sun Aug 17 13:21:33 GMT 2008


Author: nkukard
Date: 2008-08-17 13:21:33 +0000 (Sun, 17 Aug 2008)
New Revision: 238

Modified:
   trunk/wiaflos/server/GL.pm
Log:
* changed rwcats to reportwriter_categories


Modified: trunk/wiaflos/server/GL.pm
===================================================================
--- trunk/wiaflos/server/GL.pm	2008-08-17 13:19:30 UTC (rev 237)
+++ trunk/wiaflos/server/GL.pm	2008-08-17 13:21:33 UTC (rev 238)
@@ -276,7 +276,7 @@
 		SELECT 
 			ID
 		FROM
-			gl_reportwrite_categories
+			gl_reportwriter_categories
 		WHERE
 			Code = ".DBQuote($rwCatCode)."
 	");
@@ -298,6 +298,39 @@
 }
 
 
+# Return report writer categories
+sub getGLRwCats
+{
+	# Select reporting category
+	my $sth = DBSelect("
+		SELECT 
+			ID, Code, Description
+		FROM
+			gl_reportwriter_categories
+	");
+	if (!$sth) {
+		setError(wiaflos::server::dblayer::Error());
+		return ERR_DB;
+	}
+
+	# Fetch rows
+	my @entries;
+	while (my $row = $sth->fetchrow_hashref()) {
+		my $entry;
+
+		$entry->{'ID'} = $row->{'ID'};
+		$entry->{'Code'} = $row->{'Code'};
+		$entry->{'Description'} = $row->{'Description'};
+
+		push(@entries,$entry);
+	}
+
+	DBFreeRes($sth);
+
+	return \@entries;
+}
+
+
 # Resolve the full GL account reference 
 sub getGLAccountNumberFromID
 {
@@ -462,12 +495,12 @@
 		SELECT 
 			gl_accounts.ID, gl_accounts.ParentGLAccountID, gl_accounts.Code, gl_accounts.Name,
 			gl_financial_categories.Code AS FinCatCode, gl_financial_categories.Description AS FinCatDescription,
-			gl_reportwrite_categories.Code AS RwCatCode, gl_reportwrite_categories.Description AS RwCatDescription
+			gl_reportwriter_categories.Code AS RwCatCode, gl_reportwriter_categories.Description AS RwCatDescription
 		FROM
-			gl_accounts, gl_financial_categories, gl_reportwrite_categories
+			gl_accounts, gl_financial_categories, gl_reportwriter_categories
 		WHERE
 			gl_financial_categories.ID = gl_accounts.FinCatID
-			AND gl_reportwrite_categories.ID = gl_accounts.RwCatID
+			AND gl_reportwriter_categories.ID = gl_accounts.RwCatID
 	");
 	if (!$sth) {
 		setError(wiaflos::server::dblayer::Error());
@@ -525,13 +558,13 @@
 		SELECT 
 			gl_accounts.ID, gl_accounts.ParentGLAccountID, gl_accounts.Code, gl_accounts.Name,
 			gl_financial_categories.Code AS FinCatCode, gl_financial_categories.Description AS FinCatDescription,
-			gl_reportwrite_categories.Code AS RwCatCode, gl_reportwrite_categories.Description AS RwCatDescription
+			gl_reportwriter_categories.Code AS RwCatCode, gl_reportwriter_categories.Description AS RwCatDescription
 		FROM
-			gl_accounts, gl_financial_categories, gl_reportwrite_categories
+			gl_accounts, gl_financial_categories, gl_reportwriter_categories
 		WHERE
 			gl_accounts.ID = ".DBQuote($GLAccID)."
 			AND gl_financial_categories.ID = gl_accounts.FinCatID
-			AND gl_reportwrite_categories.ID = gl_accounts.RwCatID
+			AND gl_reportwriter_categories.ID = gl_accounts.RwCatID
 	");
 	if (!$sth) {
 		setError(wiaflos::server::dblayer::Error());



More information about the wiaflos-devel mailing list