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

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



Revision: 1701
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1701&view=rev
Author:   tetragon
Date:     2007-10-05 07:27:19 -0700 (Fri, 05 Oct 2007)

Log Message:
-----------
Merging am-list-accounts and gl-report templates into form-dynatable

Modified Paths:
--------------
    trunk/bin/am.pl
    trunk/bin/ca.pl
    trunk/bin/gl.pl

Added Paths:
-----------
    trunk/UI/form-dynatable.csv
    trunk/UI/form-dynatable.html
    trunk/UI/form-dynatable.odst
    trunk/UI/form-dynatable.xlst

Removed Paths:
-------------
    trunk/UI/am-list-accounts.csv
    trunk/UI/am-list-accounts.html
    trunk/UI/am-list-accounts.odst
    trunk/UI/am-list-accounts.xlst
    trunk/UI/gl-report.csv
    trunk/UI/gl-report.html

Deleted: trunk/UI/am-list-accounts.csv
===================================================================
--- trunk/UI/am-list-accounts.csv	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/UI/am-list-accounts.csv	2007-10-05 14:27:19 UTC (rev 1701)
@@ -1,3 +0,0 @@
-<?lsmb FOREACH column IN columns ?><?lsmb IF heading.$column.text; heading.$column.text; ELSE; heading.$column; END ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>
-<?lsmb FOREACH row IN rows ?><?lsmb FOREACH column IN columns ?><?lsmb IF row.$column.href; row.$column.text; ELSE; row.$column; END ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>
-<?lsmb END ?><?lsmb IF totals; t = []; FOREACH column IN columns; t.push(totals.$column); END; t.join(','); END ?>

Deleted: trunk/UI/am-list-accounts.html
===================================================================
--- trunk/UI/am-list-accounts.html	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/UI/am-list-accounts.html	2007-10-05 14:27:19 UTC (rev 1701)
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
-		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-	<title><?lsmb form.titlebar ?></title>
-	<meta http-equiv="Pragma" content="no-cache" />
-	<meta http-equiv="Expires" content="-1" />
-	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-	<link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
-
-	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-	<meta name="robots" content="noindex,nofollow" />
-        
-</head>
-<?lsmb PROCESS elements.html ?> 
-
-<body>
-
-<table width="100%">
-  <tr>
-    <th class="listtop" colspan="<?lsmb columns.size ?>"><?lsmb form.title ?></th>
-  </tr>
-  <tr><td colspan="<?lsmb columns.size ?>"></td></tr>
-  <tr class="listheading">
-<?lsmb FOREACH column IN columns ?>
-    <th class="listtop"><?lsmb heading.$column ?></th>
-<?lsmb END ?>
-  </tr>
-<?lsmb FOREACH row IN rows ?>
-  <?lsmb IF row.heading == 'H'; s = 'th'; c = 'listheading'; ELSE;
-                                s = 'td'; c = "listrow${row.i}"; END ?>
-<tr class="<?lsmb c ?>">
-  <?lsmb FOREACH column IN columns ?>
-  <<?lsmb s ?> class="<?lsmb c ?>" <?lsmb IF (!row.heading && (column == 'credit' || column == 'debit')) ?>align="right"<?lsmb END ?>>
-    <?lsmb IF row.$column.href ?>
-    <a href="<?lsmb row.$column.href?>"><?lsmb row.$column.text ?></a>
-    <?lsmb ELSIF column == 'link'; FOREACH l IN row.link.split(':'); l ?><br /><?lsmb END ?>
-    <?lsmb ELSE; row.$column; END ?>
-  </<?lsmb s ?>>
-  <?lsmb END ?>
-</tr>
-<?lsmb END ?>
-<?lsmb IF totals ?>
-<tr class="listtotal">
-  <?lsmb FOREACH column IN columns ?>
-  <th class="listtotal" align="right"><?lsmb totals.$column ?></th>
-  <?lsmb END ?>
-</tr>
-<?lsmb END ?>
-  <tr><td colspan="<?lsmb columns.size ?>"><hr size="3" /></td></tr>
-</table>
-
-<br />
-
-<form method="post" action="<?lsmb form.script ?>">
-<?lsmb FOREACH pair IN form.callback.split('&amp;') ?><?lsmb hidden = pair.split('=') ?><?lsmb IF NOT loop.first ?>
-<?lsmb PROCESS input element_data={type => 'hidden', name => hidden.0, value => hidden.1} ?><?lsmb END ?><?lsmb END ?>
-<?lsmb PROCESS input element_data={type => 'hidden', name => 'callback', value => form.callback} ?>
-
-<?lsmb FOREACH button IN buttons ?><?lsmb PROCESS button element_data=button ?><?lsmb END ?>
-</form>
-</body>
-</html>

Deleted: trunk/UI/am-list-accounts.odst
===================================================================
--- trunk/UI/am-list-accounts.odst	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/UI/am-list-accounts.odst	2007-10-05 14:27:19 UTC (rev 1701)
@@ -1,46 +0,0 @@
-<workbook>
-	<worksheet name="test" rows="<?lsmb rows.size + 1 ?>" columns="<?lsmb columns.size + 1 ?>">
-		<format bottom="5" bg_color="lime" bottom_color="magenta"><row>
-	<?lsmb FOREACH column IN columns ?>
-	<?lsmb IF heading.$column.text ?><format italic="1">
-			<cell text="<?lsmb heading.$column.text ?>" /></format>
-	<?lsmb ELSE ?><format bold="1">
-			<cell text="<?lsmb heading.$column ?>" /></format>
-	<?lsmb END; END ?>
-	<format num_format="17">
-	<cell text="2007-08-05" />
-	</format>
-		</row></format>
-		<format align="right">
-	<?lsmb FOREACH row IN rows ?>
-		<row>
-		<?lsmb FOREACH column IN columns ?>
-		<?lsmb IF loop.first ?><format num_format="3">
-		<?lsmb END ?>
-			<?lsmb IF row.$column.href ?>
-			<italic>
-			<cell text="<?lsmb row.$column.text ?>" />
-			</italic>
-			<?lsmb ELSE ?>
-			<format font_outline="1">
-			<cell text="<?lsmb row.$column ?>" />
-			</format>
-			<?lsmb END ?>
-		<?lsmb IF loop.first ?></format><?lsmb END ?>
-		<?lsmb END ?>
-		</row>
-	<?lsmb END ?></format>
-	<?lsmb IF totals; t = [] ?>
-	<row>
-		<?lsmb FOREACH column IN columns ?>
-		<cell text="<?lsmb totals.$column ?>" />
-		<?lsmb END ?>
-	</row>
-	<?lsmb END ?>
-	</worksheet>
-	<worksheet name="test2" rows='3' columns='1'>
-	<row><cell text='1' type='number' /></row>
-	<row><cell text='2' type='number' /></row>
-	<row><formula text='sum(A1:A2)' type='formula' /></row>
-	</worksheet>
-</workbook>

Deleted: trunk/UI/am-list-accounts.xlst
===================================================================
--- trunk/UI/am-list-accounts.xlst	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/UI/am-list-accounts.xlst	2007-10-05 14:27:19 UTC (rev 1701)
@@ -1,30 +0,0 @@
-<workbook>
-	<worksheet name="test">
-		<format bottom="1"><row>
-	<?lsmb FOREACH column IN columns ?>
-	<?lsmb IF heading.$column.text ?>
-			<cell text="<?lsmb heading.$column.text ?>" />
-	<?lsmb ELSE ?>
-			<cell text="<?lsmb heading.$column ?>" />
-	<?lsmb END; END ?>
-		</row></format>
-	<?lsmb FOREACH row IN rows ?>
-		<row>
-		<?lsmb FOREACH column IN columns ?>
-			<?lsmb IF row.$column.href ?>
-			<cell text="<?lsmb row.$column.text ?>" />
-			<?lsmb ELSE ?>
-			<cell text="<?lsmb row.$column ?>" />
-			<?lsmb END ?>
-		<?lsmb END ?>
-		</row>
-	<?lsmb END ?>
-	<?lsmb IF totals; t = [] ?>
-	<row>
-		<?lsmb FOREACH column IN columns ?>
-		<cell text="<?lsmb totals.$column ?>" />
-		<?lsmb END ?>
-	</row>
-	<?lsmb END ?>
-	</worksheet>
-</workbook>

Copied: trunk/UI/form-dynatable.csv (from rev 1700, trunk/UI/gl-report.csv)
===================================================================
--- trunk/UI/form-dynatable.csv	                        (rev 0)
+++ trunk/UI/form-dynatable.csv	2007-10-05 14:27:19 UTC (rev 1701)
@@ -0,0 +1,3 @@
+<?lsmb FOREACH column IN columns ?><?lsmb IF heading.$column.text; heading.$column.text; ELSE; heading.$column; END ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>
+<?lsmb FOREACH row IN rows ?><?lsmb FOREACH column IN columns ?><?lsmb IF row.$column.text; row.$column.text; ELSE; row.$column; END ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>
+<?lsmb END ?><?lsmb IF totals; t = []; FOREACH column IN columns; t.push(totals.$column); END; t.join(','); END ?>

Copied: trunk/UI/form-dynatable.html (from rev 1700, trunk/UI/gl-report.html)
===================================================================
--- trunk/UI/form-dynatable.html	                        (rev 0)
+++ trunk/UI/form-dynatable.html	2007-10-05 14:27:19 UTC (rev 1701)
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+<head>
+	<title><?lsmb form.titlebar ?></title>
+	<meta http-equiv="Pragma" content="no-cache" />
+	<meta http-equiv="Expires" content="-1" />
+	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+	<link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+	<meta name="robots" content="noindex,nofollow" />
+        
+</head>
+<?lsmb PROCESS elements.html ?> 
+
+<body>
+
+<table width="100%">
+  <tr>
+    <th class="listtop" colspan="<?lsmb columns.size ?>"><?lsmb form.title ?></th>
+  </tr>
+  <tr>
+  <?lsmb IF options.defined ?>
+    <td><?lsmb FOREACH option IN options; option ?><br /><?lsmb END ?></td>
+  <?lsmb ELSE ?>
+    <td colspan="<?lsmb columns.size ?>"></td></tr>
+  <?lsmb END ?>
+  </tr>
+  <tr class="listheading">
+<?lsmb FOREACH column IN columns ?>
+    <th class="listtop">
+	<?lsmb IF heading.$column.href ?><a class="listtop" href="<?lsmb heading.$column.href ?>"><?lsmb heading.$column.text ?></a>
+	<?lsmb ELSE; heading.$column; END ?>
+    </th>
+<?lsmb END ?>
+  </tr>
+  <?lsmb USE dumper(indent=2, pad="<br>") ?>
+<?lsmb FOREACH row IN rows ?>
+<?lsmb IF row.class == 'heading';      s = 'th'; c = 'listheading';
+	ELSIF row.class == 'subtotal'; s = 'th'; c = 'listsubtotal';
+	ELSE;                          s = 'td'; c = "listrow${row.i}"; END ?>
+<tr class="<?lsmb c ?>">
+  <?lsmb FOREACH column IN columns ?>
+  <<?lsmb s ?> class="<?lsmb c ?>" <?lsmb IF (!row.class.defined || row.class != 'heading') && row_alignment.$column ?>align="<?lsmb row_alignment.$column ?>"<?lsmb END ?>>
+    <?lsmb IF row.$column.href ?>
+    <a href="<?lsmb row.$column.href?>"><?lsmb row.$column.text ?></a>
+    <?lsmb ELSIF row.$column.delimiter;
+	FOREACH l IN row.$column.text.split(row.$column.delimiter); l ?><br /><?lsmb END ?>
+    <?lsmb ELSE; row.$column; END ?>
+  </<?lsmb s ?>>
+  <?lsmb END ?>
+</tr>
+<?lsmb END ?>
+<?lsmb IF totals ?>
+<tr class="listtotal">
+  <?lsmb FOREACH column IN columns ?>
+  <th class="listtotal" align="right"><?lsmb totals.$column ?></th>
+  <?lsmb END ?>
+</tr>
+<?lsmb END ?>
+  <tr><td colspan="<?lsmb columns.size ?>"><hr size="3" /></td></tr>
+</table>
+
+<br />
+
+<form method="post" action="<?lsmb form.script ?>">
+<?lsmb FOREACH hidden IN hiddens.keys;
+	PROCESS input element_data={
+		type => 'hidden',
+		name => hidden,
+		value => hiddens.$hidden
+		}; END ?>
+<?lsmb FOREACH button IN buttons; PROCESS button element_data=button; END ?>
+</form>
+</body>
+</html>

Copied: trunk/UI/form-dynatable.odst (from rev 1700, trunk/UI/am-list-accounts.odst)
===================================================================
--- trunk/UI/form-dynatable.odst	                        (rev 0)
+++ trunk/UI/form-dynatable.odst	2007-10-05 14:27:19 UTC (rev 1701)
@@ -0,0 +1,46 @@
+<workbook>
+	<worksheet name="test" rows="<?lsmb rows.size + 1 ?>" columns="<?lsmb columns.size + 1 ?>">
+		<format bottom="5" bg_color="lime" bottom_color="magenta"><row>
+	<?lsmb FOREACH column IN columns ?>
+	<?lsmb IF heading.$column.text ?><format italic="1">
+			<cell text="<?lsmb heading.$column.text ?>" /></format>
+	<?lsmb ELSE ?><format bold="1">
+			<cell text="<?lsmb heading.$column ?>" /></format>
+	<?lsmb END; END ?>
+	<format num_format="17">
+	<cell text="2007-08-05" />
+	</format>
+		</row></format>
+		<format align="right">
+	<?lsmb FOREACH row IN rows ?>
+		<row>
+		<?lsmb FOREACH column IN columns ?>
+		<?lsmb IF loop.first ?><format num_format="3">
+		<?lsmb END ?>
+			<?lsmb IF row.$column.href ?>
+			<italic>
+			<cell text="<?lsmb row.$column.text ?>" />
+			</italic>
+			<?lsmb ELSE ?>
+			<format font_outline="1">
+			<cell text="<?lsmb row.$column ?>" />
+			</format>
+			<?lsmb END ?>
+		<?lsmb IF loop.first ?></format><?lsmb END ?>
+		<?lsmb END ?>
+		</row>
+	<?lsmb END ?></format>
+	<?lsmb IF totals; t = [] ?>
+	<row>
+		<?lsmb FOREACH column IN columns ?>
+		<cell text="<?lsmb totals.$column ?>" />
+		<?lsmb END ?>
+	</row>
+	<?lsmb END ?>
+	</worksheet>
+	<worksheet name="test2" rows='3' columns='1'>
+	<row><cell text='1' type='number' /></row>
+	<row><cell text='2' type='number' /></row>
+	<row><formula text='sum(A1:A2)' type='formula' /></row>
+	</worksheet>
+</workbook>

Copied: trunk/UI/form-dynatable.xlst (from rev 1700, trunk/UI/am-list-accounts.xlst)
===================================================================
--- trunk/UI/form-dynatable.xlst	                        (rev 0)
+++ trunk/UI/form-dynatable.xlst	2007-10-05 14:27:19 UTC (rev 1701)
@@ -0,0 +1,30 @@
+<workbook>
+	<worksheet name="test">
+		<format bottom="1"><row>
+	<?lsmb FOREACH column IN columns ?>
+	<?lsmb IF heading.$column.text ?>
+			<cell text="<?lsmb heading.$column.text ?>" />
+	<?lsmb ELSE ?>
+			<cell text="<?lsmb heading.$column ?>" />
+	<?lsmb END; END ?>
+		</row></format>
+	<?lsmb FOREACH row IN rows ?>
+		<row>
+		<?lsmb FOREACH column IN columns ?>
+			<?lsmb IF row.$column.href ?>
+			<cell text="<?lsmb row.$column.text ?>" />
+			<?lsmb ELSE ?>
+			<cell text="<?lsmb row.$column ?>" />
+			<?lsmb END ?>
+		<?lsmb END ?>
+		</row>
+	<?lsmb END ?>
+	<?lsmb IF totals; t = [] ?>
+	<row>
+		<?lsmb FOREACH column IN columns ?>
+		<cell text="<?lsmb totals.$column ?>" />
+		<?lsmb END ?>
+	</row>
+	<?lsmb END ?>
+	</worksheet>
+</workbook>

Deleted: trunk/UI/gl-report.csv
===================================================================
--- trunk/UI/gl-report.csv	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/UI/gl-report.csv	2007-10-05 14:27:19 UTC (rev 1701)
@@ -1,3 +0,0 @@
-<?lsmb FOREACH column IN columns ?><?lsmb IF heading.$column.text; heading.$column.text; ELSE; heading.$column; END ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>
-<?lsmb FOREACH row IN rows ?><?lsmb FOREACH column IN columns ?><?lsmb IF row.$column.text; row.$column.text; ELSE; row.$column; END ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>
-<?lsmb END ?><?lsmb FOREACH column IN columns ?><?lsmb totals.$column ?><?lsmb IF NOT loop.last ?>,<?lsmb END ?><?lsmb END ?>

Deleted: trunk/UI/gl-report.html
===================================================================
--- trunk/UI/gl-report.html	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/UI/gl-report.html	2007-10-05 14:27:19 UTC (rev 1701)
@@ -1,92 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
-		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
-<head>
-	<title><?lsmb form.titlebar ?></title>
-	<meta http-equiv="Pragma" content="no-cache" />
-	<meta http-equiv="Expires" content="-1" />
-	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-	<link rel="stylesheet" href="css/<?lsmb form.stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
-	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-	<meta name="robots" content="noindex,nofollow" />
-        
-</head>
-<?lsmb PROCESS elements.html ?>
-<body>
-
-<table width="100%">
-  <tr>
-    <th class="listtop"><?lsmb form.title ?></th>
-  </tr>
-  <tr><td colspan="<?lsmb columns.size ?>"> </td></tr>
-  <tr>
-    <td><?lsmb FOREACH option IN options; option ?><br /><?lsmb END ?></td>
-  </tr>
-  <tr>
-    <td>
-      <table width="100%">
-	<tr class="listheading">
-<?lsmb FOREACH column IN columns ?><?lsmb IF heading.$column.href ?>
-<th class="listheading"><a class="listheading" href="<?lsmb heading.$column.href ?>"><?lsmb heading.$column.text ?></a></th>
-<?lsmb ELSE ?>
-<th class="listheading"><?lsmb heading.$column ?></th>
-<?lsmb END ?>
-<?lsmb END ?>
-        </tr>
-
-<?lsmb FOREACH row IN rows ?>
-<?lsmb IF row.is_subtotal ?>
-   <tr class="listsubtotal">
-   <?lsmb FOREACH column IN columns ?>
-   <th align="right" class="listsubtotal"><?lsmb row.$column ?></th>
-   <?lsmb END ?>
-   </tr>
-<?lsmb ELSE ?>
-    <tr class="listrow<?lsmb row.i ?>">
-    <?lsmb FOREACH column IN columns ?>
-        <?lsmb IF column == 'balance' ?>
-   <td align="right">
-        <?lsmb ELSIF column == 'debit' ?>
-   <td align="right">
-        <?lsmb ELSIF column == 'credit' ?>
-   <td align="right">
-        <?lsmb ELSE ?>
-   <td>
-        <?lsmb END ?>
-<?lsmb IF row.$column.href ?>
-   <a href="<?lsmb row.$column.href?>"><?lsmb row.$column.text ?></a>
-<?lsmb ELSE ?>
-   <?lsmb row.$column ?>
-<?lsmb END ?>
-   </td>
-   <?lsmb END ?>
-   </tr>
-<?lsmb END ?>
-<?lsmb END ?>
-	<tr class="listtotal">
-<?lsmb FOREACH column IN columns ?>
-<th align="right" class="listtotal"><?lsmb totals.$column ?></th>
-<?lsmb END ?>
-        </tr>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td><hr size="3" noshade="noshade" /></td>
-  </tr>
-</table>
-
-<br />
-
-<form method="post" action="gl.pl">
-<?lsmb FOREACH pair IN form.callback.split('&amp;') ?><?lsmb hidden = pair.split('=') ?>
-<?lsmb IF NOT loop.first ?>
-<?lsmb PROCESS input element_data={type => 'hidden', name => hidden.0, value => hidden.1} ?>
-<?lsmb END ?><?lsmb END ?>
-<?lsmb PROCESS input element_data={type => 'hidden', name => 'callback', value => form.callback} ?>
-
-<?lsmb FOREACH button IN buttons ?><?lsmb PROCESS button element_data=button ?><?lsmb END ?>
-</form>
-
-</body>
-</html>

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/bin/am.pl	2007-10-05 14:27:19 UTC (rev 1701)
@@ -403,7 +403,7 @@
         $gifi_accno = $form->escape( $ca->{gifi_accno} );
 
         if ( $ca->{charttype} eq "H" ) {
-            $column_data{heading} = 'H';
+            $column_data{class} = 'heading';
             $column_data{accno} = {
               text => $ca->{accno},
               href => "$form->{script}?action=edit_account&id=$ca->{id}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&callback=$callback"};
@@ -429,7 +429,7 @@
             $column_data{description} = $ca->{description};
             $column_data{debit}       = $ca->{debit};
             $column_data{credit} = $ca->{credit};
-            $column_data{link}   = $ca->{link};
+	    $column_data{link}   = {text => $ca->{link}, delimiter => ':'};
 
         }
         push @rows, \%column_data;
@@ -445,20 +445,30 @@
             class => 'submit',
         };
     }
+    my %hiddens = (
+        callback => $callback,
+        action => 'list_account',
+        path => $form->{path},
+        login => $form->{login},
+        sessionid => $form->{sessionid},
+        );
 
+    my %row_alignment = ('credit' => 'right', 'debit' => 'right');
     my $format = uc substr($form->{action}, 0, 3);
     my $template = LedgerSMB::Template->new(
         user => \%myconfig, 
         locale => $locale,
         path => 'UI',
-        template => 'am-list-accounts',
+        template => 'form-dynatable',
         format => ($format ne 'LIS')? $format: 'HTML');
     $template->render({
-        form => \%$form,
+        form => $form,
         buttons => ..hidden..,
+	hiddens => \%hiddens,
         columns => ..hidden..,
         heading => \%column_header,
         rows => ..hidden..,
+	row_alignment => \%row_alignment,
     });
 }
 
@@ -496,11 +506,17 @@
     AM->gifi_accounts( \%myconfig, \%$form );
 
     $form->{title} = $locale->text('GIFI');
+    my %hiddens;
 
     # construct callback
     my $callback =
 "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
     $form->{callback} = $callback;
+    $hiddens{callback} = $callback;
+    $hiddens{action} = 'list_gifi';
+    $hiddens{path} = $form->{path};
+    $hiddens{login} = $form->{login};
+    $hiddens{sessionid} = $form->{sessionid};
 
     my @column_index = qw(accno description);
     my %column_header;
@@ -538,10 +554,11 @@
         user => \%myconfig, 
         locale => $locale,
         path => 'UI',
-        template => 'am-list-accounts',
+	template => 'form-dynatable',
         format => ($form->{action} =~ /^csv/)? 'CSV': 'HTML');
     $template->render({
         form => \%$form,
+        hiddens => \%hiddens,
         buttons => ..hidden..,
         columns => ..hidden..,
         heading => \%column_header,

Modified: trunk/bin/ca.pl
===================================================================
--- trunk/bin/ca.pl	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/bin/ca.pl	2007-10-05 14:27:19 UTC (rev 1701)
@@ -84,6 +84,7 @@
 sub chart_of_accounts {
 
     CA->all_accounts( \%myconfig, \%$form );
+    my %hiddens;
 
     @column_index = qw(accno gifi_accno description debit credit);
 
@@ -96,6 +97,11 @@
     $form->{title} = $locale->text('Chart of Accounts');
     $form->{callback} = 
       qq|$form->{script}?path=$form->{path}&action=chart_of_accounts&login=$form->{login}&sessionid=$form->{sessionid}|;
+    $hiddens{callback} = $form->{callback};
+    $hiddens{path} = $form->{path};
+    $hiddens{action} = 'chart_of_accounts';
+    $hiddens{login} = $form->{login};
+    $hiddens{sessionid} = $form->{sessionid};
 
     my @rows;
     my $totaldebit = 0;
@@ -110,7 +116,7 @@
 qq|$form->{script}?path=$form->{path}&action=list&accno=$ca->{accno}&login=$form->{login}&sessionid=$form->{sessionid}&description=$description&gifi_accno=$ca->{gifi_accno}&gifi_description=$gifi_description|;
 
         if ( $ca->{charttype} eq "H" ) {
-            $column_data{heading} = 'H';
+            $column_data{class} = 'heading';
             for (qw(accno description)) {
                 $column_data{$_} = $ca->{$_};
             }
@@ -160,15 +166,17 @@
         user => \%myconfig, 
         locale => $locale,
         path => 'UI',
-        template => 'am-list-accounts',
+        template => 'form-dynatable',
         format => ($form->{action} =~ /^csv/)? 'CSV': 'HTML');
     $template->render({
         form => \%$form,
         buttons => ..hidden..,
+        hiddens => \%hiddens,
         columns => ..hidden..,
         heading => \%column_header,
-	totals => \%column_data,
+        totals => \%column_data,
         rows => ..hidden..,
+        row_alignment => {'credit' => 'right', 'debit' => 'right'},
     });
 }
 

Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl	2007-10-04 18:22:07 UTC (rev 1700)
+++ trunk/bin/gl.pl	2007-10-05 14:27:19 UTC (rev 1701)
@@ -445,6 +445,14 @@
     $callback =
 "$form->{script}?action=generate_report&direction=$form->{direction}&oldsort=$form->{oldsort}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
 
+    my %hiddens = (
+        'action' => 'generate_report',
+        'direction' => $form->{direction},
+        'oldsort' => $form->{oldsort},
+        'path' => $form->{path},
+        'login' => $form->{login},
+        'sessionid' => $form->{sessionid},
+        );
     %acctype = (
         'A' => $locale->text('Asset'),
         'L' => $locale->text('Liability'),
@@ -465,33 +473,39 @@
     if ( $form->{accno} ) {
         $href .= "&accno=" . $form->escape( $form->{accno} );
         $callback .= "&accno=" . $form->escape( $form->{accno}, 1 );
+        $hiddens{accno} = $form->{accno};
         push @options, $locale->text('Account')
           . " : $form->{accno} $form->{account_description}";
     }
     if ( $form->{gifi_accno} ) {
         $href     .= "&gifi_accno=" . $form->escape( $form->{gifi_accno} );
         $callback .= "&gifi_accno=" . $form->escape( $form->{gifi_accno}, 1 );
+        $hiddens{gifi_accno} = $form->{gifi_accno};
         push @options, $locale->text('GIFI')
           . " : $form->{gifi_accno} $form->{gifi_account_description}";
     }
     if ( $form->{source} ) {
         $href     .= "&source=" . $form->escape( $form->{source} );
         $callback .= "&source=" . $form->escape( $form->{source}, 1 );
+        $hiddens{source} = $form->{source};
         push @options, $locale->text('Source') . " : $form->{source}";
     }
     if ( $form->{memo} ) {
         $href     .= "&memo=" . $form->escape( $form->{memo} );
         $callback .= "&memo=" . $form->escape( $form->{memo}, 1 );
+        $hiddens{memo} = $form->{memo};
         push @options, $locale->text('Memo') . " : $form->{memo}";
     }
     if ( $form->{reference} ) {
         $href     .= "&reference=" . $form->escape( $form->{reference} );
         $callback .= "&reference=" . $form->escape( $form->{reference}, 1 );
+        $hiddens{reference} = $form->{reference};
         push @options, $locale->text('Reference') . " : $form->{reference}";
     }
     if ( $form->{department} ) {
         $href .= "&department=" . $form->escape( $form->{department} );
         $callback .= "&department=" . $form->escape( $form->{department}, 1 );
+        $hiddens{department} = $form->{department};
         ($department) = split /--/, $form->{department};
         push @options, $locale->text('Department') . " : $department";
     }
@@ -499,23 +513,27 @@
     if ( $form->{description} ) {
         $href     .= "&description=" . $form->escape( $form->{description} );
         $callback .= "&description=" . $form->escape( $form->{description}, 1 );
+        $hiddens{description} = $form->{description};
         push @options, $locale->text('Description') . " : $form->{description}";
     }
     if ( $form->{notes} ) {
         $href     .= "&notes=" . $form->escape( $form->{notes} );
         $callback .= "&notes=" . $form->escape( $form->{notes}, 1 );
+        $hiddens{notes} = $form->{notes};
         push @options, $locale->text('Notes') . " : $form->{notes}";
     }
 
     if ( $form->{datefrom} ) {
         $href     .= "&datefrom=$form->{datefrom}";
         $callback .= "&datefrom=$form->{datefrom}";
+        $hiddens{datefrom} = $form->{datefrom};
         push @options, $locale->text('From') . " "
           . $locale->date( \%myconfig, $form->{datefrom}, 1 );
     }
     if ( $form->{dateto} ) {
         $href     .= "&dateto=$form->{dateto}";
         $callback .= "&dateto=$form->{dateto}";
+        $hiddens{dateto} = $form->{dateto};
         my $option = $locale->text('To') . " "
           . $locale->date( \%myconfig, $form->{dateto}, 1 );
         if ( $form->{datefrom} ) {
@@ -529,12 +547,14 @@
     if ( $form->{amountfrom} ) {
         $href     .= "&amountfrom=$form->{amountfrom}";
         $callback .= "&amountfrom=$form->{amountfrom}";
+        $hiddens{amountfrom} = $form->{amountfrom};
         push @options, $locale->text('Amount') . " >= "
           . $form->format_amount( \%myconfig, $form->{amountfrom}, 2 );
     }
     if ( $form->{amountto} ) {
         $href     .= "&amountto=$form->{amountto}";
         $callback .= "&amountto=$form->{amountto}";
+        $hiddens{amountto} = $form->{amountto};
         my $option .= $form->format_amount( \%myconfig, $form->{amountto}, 2 );
         if ( $form->{amountfrom} ) {
             $options[$#options] .= " <= $option";
@@ -571,16 +591,19 @@
             # add column to href and callback
             $callback .= "&l_$item=Y";
             $href     .= "&l_$item=Y";
+            $hiddens{"l_$item"} = 'Y';
         }
     }
 
     if ( $form->{l_subtotal} eq 'Y' ) {
         $callback .= "&l_subtotal=Y";
         $href     .= "&l_subtotal=Y";
+        $hiddens{l_subtotal} = 'Y';
     }
 
     $callback .= "&category=$form->{category}";
     $href     .= "&category=$form->{category}";
+    $hiddens{category} = $form->{category};
 
     $column_header{id} =
         {text => $locale->text('ID'), href=> "$href&sort=id"};
@@ -609,6 +632,8 @@
     # add sort to callback
     $form->{callback} = "$callback&sort=$form->{sort}";
     $callback = $form->escape( $form->{callback} );
+    $hiddens{sort} = $form->{sort};
+    $hiddens{callback} = $form->{callback};
 
     $cml = 1;
 
@@ -761,7 +786,7 @@
         text => $locale->text('CSV Report'),
         type => 'submit',
         class => 'submit',
-        };
+    };
 
 ##SC: Taking this out for now...
 ##    if ( $form->{lynx} ) {
@@ -769,33 +794,29 @@
 ##        &menubar;
 ##    }
 
+    my %row_alignment = (
+        'balance' => 'right',
+        'debit' => 'right',
+        'credit' => 'right'
+        );
     my $template;
-    if ($form->{action} eq 'csv_gl_report') {
-        $template = LedgerSMB::Template->new(
-            user => \%myconfig, 
-            locale => $locale,
-            path => 'UI',
-            template => 'gl-report',
-            format => 'CSV'
-        );
-    } else {
-        $template = LedgerSMB::Template->new(
-            user => \%myconfig, 
-            locale => $locale,
-            path => 'UI',
-            template => 'gl-report',
-            format => 'HTML',
-        #    no_escape => 1
-        );
-    }
+    my $format = uc substr($form->{action}, 0, 3);
+    my $template = LedgerSMB::Template->new(
+        user => \%myconfig,
+        locale => $locale,
+        path => 'UI',
+        template => 'form-dynatable',
+        format => ($format ne 'CSV')? 'HTML': 'CSV');
     $template->render({
         form => \%$form,
         buttons => ..hidden..,
+        hiddens => \%hiddens,
         options => ..hidden..,
         columns => ..hidden..,
         heading => \%column_header,
         rows => ..hidden..,
-        totals => \%column_data
+        row_alignment => \%row_alignment,
+        totals => \%column_data,
     });
 
 }
@@ -811,7 +832,7 @@
       $form->format_amount( \%myconfig, $subtotalcredit, 2, " " );
 
     for (@column_index) { $column_data{$_} = " " }
-    $column_data{'is_subtotal'} = 1;
+    $column_data{class} = 'subtotal';
 
     $column_data{debit} = $subtotaldebit;
     $column_data{credit} = $subtotalcredit;


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