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

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



Revision: 2374
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2374&view=rev
Author:   einhverfr
Date:     2008-10-20 01:05:26 +0000 (Mon, 20 Oct 2008)

Log Message:
-----------
Removing references to ca.pl's list_transactions function and moving these to a gl report.

Modified Paths:
--------------
    trunk/LedgerSMB/Auth/DB.pm
    trunk/LedgerSMB/GL.pm
    trunk/UI/ca-list-selector.html
    trunk/bin/gl.pl
    trunk/bin/rp.pl

Modified: trunk/LedgerSMB/Auth/DB.pm
===================================================================
--- trunk/LedgerSMB/Auth/DB.pm	2008-10-17 23:46:20 UTC (rev 2373)
+++ trunk/LedgerSMB/Auth/DB.pm	2008-10-20 01:05:26 UTC (rev 2374)
@@ -70,6 +70,7 @@
       || $form->dberror(
         __FILE__ . ':' . __LINE__ . ': Looking for session: ' );
     my $sessionValid = $checkQuery->rows;
+    $dbh->commit;
 
     if ($sessionValid) {
 
@@ -112,7 +113,6 @@
         print qq|Set-Cookie: ${LedgerSMB::Sysconfig::cookie_name}=; path=$path;\n|;
         return 0;
     }
-    $dbh->commit;
 }
 
 sub session_create {

Modified: trunk/LedgerSMB/GL.pm
===================================================================
--- trunk/LedgerSMB/GL.pm	2008-10-17 23:46:20 UTC (rev 2373)
+++ trunk/LedgerSMB/GL.pm	2008-10-20 01:05:26 UTC (rev 2374)
@@ -234,6 +234,12 @@
     my $sth;
     my $var;
     my $null;
+    if ($form->{accno} and !$form->{chart_id}){
+       my $sth = $dbh->prepare('SELECT id FROM chart WHERE accno = ?');
+       $sth->execute($form->{accno});
+       ($form->{chart_id}) = $sth->fetchrow_array();
+       delete $form->{accno};
+    }
 
     my ( $glwhere, $arwhere, $apwhere ) = ( "1 = 1", "1 = 1", "1 = 1" );
 
@@ -304,13 +310,13 @@
 
         $var = $dbh->quote( $form->like( lc $form->{description} ) );
         $glwhere .= " AND lower(g.description) LIKE $var";
-        $arwhere .= " AND (lower(ct.name) LIKE $var
+        $arwhere .= " AND (lower(e.name) LIKE $var
 					   OR lower(ac.memo) LIKE $var
 					   OR a.id IN (SELECT DISTINCT trans_id
 					 FROM invoice
 					WHERE lower(description) LIKE $var))";
 
-        $apwhere .= " AND (lower(ct.name) LIKE $var
+        $apwhere .= " AND (lower(e.name) LIKE $var
 					   OR lower(ac.memo) LIKE $var
 					   OR a.id IN (SELECT DISTINCT trans_id
 					 FROM invoice
@@ -485,7 +491,6 @@
 						$approved = 
 					        (ac.approved AND a.approved))
 				 ORDER BY $sortorder|;
-
     my $sth = $dbh->prepare($query);
     $sth->execute || $form->dberror($query);
 

Modified: trunk/UI/ca-list-selector.html
===================================================================
--- trunk/UI/ca-list-selector.html	2008-10-17 23:46:20 UTC (rev 2373)
+++ trunk/UI/ca-list-selector.html	2008-10-20 01:05:26 UTC (rev 2374)
@@ -16,9 +16,9 @@
 <?lsmb PROCESS elements.html ?> 
 <body>
 
-<form method="post" action="ca.pl">
-
-<?lsmb FOREACH hidden IN ['accno', 'description', 'sort', 'oldsort', 'accounttype', 'gifi_accno', 'gifi_description'];
+<form method="post" action="gl.pl">
+<?lsmb IF form.accounttype == '' ; form.accounttype = 'standard'; END ?>
+<?lsmb FOREACH hidden IN ['accno', 'sort', 'oldsort', 'accounttype', 'gifi_accno', 'gifi_description'];
     PROCESS input element_data={type => 'hidden', name => hidden, value => form.item(hidden)}; END ?>
 <table border="0" width="100%">
   <tr><th class="listtop"><?lsmb form.title ?></th></tr>
@@ -29,9 +29,9 @@
         
 	<tr>
 	  <th align="right"><?lsmb text('From') ?></th>
-	  <td><?lsmb PROCESS input element_data={class => 'date', name => 'fromdate' size => '11', title="yyyy-mm-dd"} ?></td>
+	  <td><?lsmb PROCESS input element_data={class => 'date', name => 'datefrom' size => '11', title="yyyy-mm-dd"} ?></td>
 	  <th align="right"><?lsmb text('To') ?></th>
-	  <td><?lsmb PROCESS input element_data={class => 'date', name => 'todate' size => '11', title="yyyy-mm-dd"} ?></td>
+	  <td><?lsmb PROCESS input element_data={class => 'date', name => 'dateto' size => '11', title="yyyy-mm-dd"} ?></td>
 	</tr>
 
 <?lsmb IF form.all_department ?>
@@ -69,9 +69,20 @@
 
 <?lsmb FOREACH hidden IN ['login', 'path', 'sessionid'];
     PROCESS input element_data={type => 'hidden', name => hidden, value => form.$hidden}; END ?>
+<?lsmb FOREACH hidden IN ['l_transdate', 'l_reference', 'l_description', 'l_debit', 'l_credit', 'l_balance'];
+	PROCESS input element_data = {
+		type = 'hidden'
+		name = hidden
+		value = 'Y'
+	}; END ?>
 
+	<?lsmb PROCESS input element_data = {
+		type = 'hidden'
+		name = 'category'
+		value = 'X'
+	};?>
 <br />
-<?lsmb PROCESS button element_data={class => "submit", name => "action", value => "list_transactions", text => text('List Transactions')} ?>
+<?lsmb PROCESS button element_data={class => "submit", name => "action", value => "generate_report", text => text('List Transactions')} ?>
 </form>
 
 </body>

Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl	2008-10-17 23:46:20 UTC (rev 2373)
+++ trunk/bin/gl.pl	2008-10-20 01:05:26 UTC (rev 2374)
@@ -403,6 +403,11 @@
       . $locale->text('Subtotal')
       . qq|</td>
 		  </tr>
+		  <tr>
+		    <td nowrap><input name="l_balance" class=checkbox type=checkbox value=Y> |
+      . $locale->text('Balance')
+      . qq|</td>
+		  </tr>
 		</table>
 	      </tr>
 	    </table>
@@ -478,7 +483,7 @@
 
     $ml = ( $form->{category} =~ /(A|E)/ ) ? -1 : 1;
 
-    unless ( $form->{category} eq 'X' ) {
+    if (defined $form->{category} and $form->{category} ne 'X' ) {
         $form->{title} .=
           " : " . $locale->text( $acctype{ $form->{category} } );
     }
@@ -590,7 +595,7 @@
         $form->{l_cleared} = "Y";
     }
 
-    if ( $form->{accno} || $form->{gifi_accno} ) {
+    if ( $form->{chart_id} || $form->{gifi_accno} ) {
         @columns = grep !/(accno|gifi_accno)/, @columns;
         push @columns, "balance";
         $form->{l_balance} = "Y";

Modified: trunk/bin/rp.pl
===================================================================
--- trunk/bin/rp.pl	2008-10-17 23:46:20 UTC (rev 2373)
+++ trunk/bin/rp.pl	2008-10-20 01:05:26 UTC (rev 2374)
@@ -715,8 +715,10 @@
         my %column_data;
         my $description = $form->escape( $ref->{description} );
 
+	# gl.pl requires datefrom instead of fromdate, etc.  We will get this
+	# consistent.... eventually....  --CT
         my $href =
-qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&sessionid=$form->{sessionid}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}&prevreport=$form->{callback}|;
+qq|gl.pl?path=$form->{path}&action=generate_report&accounttype=$form->{accounttype}&datefrom=$form->{fromdate}&dateto=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&l_balance=Y&department=$department&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}&prevreport=$form->{callback}&category=X&l_reference=Y&l_transdate=Y&l_description=Y&l_debit=Y&l_credit=Y|;
 
         if ( $form->{accounttype} eq 'gifi' ) {
             $href .= "&gifi_accno=$ref->{accno}&gifi_description=$description";
@@ -726,7 +728,7 @@
             }
         }
         else {
-            $href .= "&accno=$ref->{accno}&description=$description";
+            $href .= "&accno=$ref->{accno}";
         }
 
         $ml = ( $ref->{category} =~ /(A|E)/ ) ? -1 : 1;


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