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

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



Revision: 1845
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1845&view=rev
Author:   tetragon
Date:     2007-11-03 10:23:01 -0700 (Sat, 03 Nov 2007)

Log Message:
-----------
Template rc.pl's reconciliation

Modified Paths:
--------------
    trunk/bin/rc.pl

Added Paths:
-----------
    trunk/UI/rc-reconciliation.html

Added: trunk/UI/rc-reconciliation.html
===================================================================
--- trunk/UI/rc-reconciliation.html	                        (rev 0)
+++ trunk/UI/rc-reconciliation.html	2007-11-03 17:23:01 UTC (rev 1845)
@@ -0,0 +1,129 @@
+<?lsmb INCLUDE 'ui-header.html' ?> 
+<?lsmb PROCESS elements.html ?> 
+<body>
+<form method="post" action="<?lsmb form.script ?>">
+<table width="100%">
+  <tr><th class="listtop"><?lsmb form.title ?></th></tr>
+  <tr><td> </td></tr>
+  <tr>
+    <td>
+      <table>
+        <tr>
+          <th align="right"><?lsmb text('Account') ?></th>
+          <td colspan="3"><?lsmb PROCESS select element_data=form.accountselect ?></td>
+        </tr>
+        <tr>
+          <th align="right"><?lsmb text('From') ?></th>
+          <td colspan="3"><?lsmb PROCESS input element_data={
+  class => 'date',
+  name => 'fromdate',
+  size => '11',
+  title => user.dateformat,
+  } ?> <?lsmb text('To') ?> <?lsmb PROCESS input element_data={
+  class => 'date',
+  name => 'todate',
+  size => '11',
+  title => user.dateformat,
+  } ?>
+          </td>
+        </tr>
+<?lsmb IF form.all_years ?>
+        <tr>
+          <th align="right"><?lsmb text('Period') ?></th>
+          <td colspan="3">
+  <?lsmb PROCESS select element_data=form.selectaccountingmonth -?>
+  <?lsmb PROCESS select element_data=form.selectaccountingyear -?>
+  <?lsmb PROCESS input element_data={
+    name => 'interval',
+    type => 'radio',
+    value => '0',
+    label => text('Current'),
+    checked => 'checked',
+    } -?>
+  <?lsmb PROCESS input element_data={
+    name => 'interval',
+    type => 'radio',
+    value => '1',
+    label => text('Month'),
+    } -?>
+  <?lsmb PROCESS input element_data={
+    name => 'interval',
+    type => 'radio',
+    value => '3',
+    label => text('Quarter'),
+    } -?>
+  <?lsmb PROCESS input element_data={
+    name => 'interval',
+    type => 'radio',
+    value => '12',
+    label => text('Year'),
+    } -?>
+          </td>
+        </tr>
+<?lsmb END -?>
+<?lsmb IF form.report ?>
+        <tr>
+          <td colspan="2" align="right">
+  <?lsmb PROCESS input element_data={
+    type => 'checkbox',
+    name => 'outstanding',
+    value => '1',
+    label => text('Outstanding'),
+    checked => 'checked',
+    }; ?>
+          </td>
+          <td colspan="2" align="right">
+  <?lsmb PROCESS input element_data={
+    type => 'checkbox',
+    name => 'cleared',
+    value => '1',
+    label => text('Cleared'),
+    }; ?>
+          </td>
+        </tr>
+<?lsmb END ?>
+        <tr>
+          <td />
+          <td colspan="3">
+  <?lsmb PROCESS input element_data={
+    type => 'radio',
+    name => 'summary',
+    value => '1',
+    label => text('Summary'),
+    checked => 'checked',
+    };
+  PROCESS input element_data={
+    type => 'radio',
+    name => 'summary',
+    value => '0',
+    label => text('Detail'),
+    }; ?>
+          </td>
+        </tr>
+        <tr>
+          <td />
+          <td colspan="3">
+  <?lsmb PROCESS input element_data={
+    type => 'checkbox',
+    name => 'fx_transaction',
+    value => '1',
+    label => text('Include Exchange Rate Difference'),
+    checked => 'checked',
+    }; ?>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr><td colspan="2"><hr size="3" noshade="noshade" /></td></tr>
+</table>
+<?lsmb FOREACH hidden IN hiddens.keys;
+	PROCESS input element_data={
+		type => 'hidden',
+		name => hidden,
+		value => hiddens.item(hidden)
+		}; END ?>
+<?lsmb FOREACH button IN buttons; PROCESS button element_data=button; END ?>
+</form>
+</body>
+</html>

Modified: trunk/bin/rc.pl
===================================================================
--- trunk/bin/rc.pl	2007-11-03 16:53:36 UTC (rev 1844)
+++ trunk/bin/rc.pl	2007-11-03 17:23:01 UTC (rev 1845)
@@ -76,134 +76,73 @@
 
     RC->paymentaccounts( \%myconfig, \%$form );
 
-    $selection = "";
+    $form->{accountselect} = {
+        name => 'accno',
+        options => [],
+        };
     for ( @{ $form->{PR} } ) {
-        $selection .= "<option>$_->{accno}--$_->{description}\n";
+        push @{$form->{accountselect}{options}}, {
+            value => "$_->{accno}--$_->{description}",
+            text => "$_->{accno}--$_->{description}",
+            };
     }
 
     $form->{title} = $locale->text('Reconciliation');
 
     if ( $form->{report} ) {
         $form->{title} = $locale->text('Reconciliation Report');
-        $cleared = qq|
-        <input type=hidden name=report value=1>
-        <tr>
-	  <td align=right><input type=checkbox class=checkbox name=outstanding value=1 checked></td>
-	  <td>| . $locale->text('Outstanding') . qq|</td>
-	  <td align=right><input type=checkbox class=checkbox name=cleared value=1></td>
-	  <td>| . $locale->text('Cleared') . qq|</td>
-	</tr>
-|;
-
+        $hiddens{report} = 1;
     }
 
     if ( @{ $form->{all_years} } ) {
 
         # accounting years
-        $form->{selectaccountingyear} = "<option>\n";
+        $form->{selectaccountingyear} = {
+            name => 'year',
+            options => [{text => '', value => ''}],
+            };
         for ( @{ $form->{all_years} } ) {
-            $form->{selectaccountingyear} .= qq|<option>$_\n|;
+            push @{$form->{selectaccountingyear}{options}},
+                {text => $_, value => $_};
         }
-        $form->{selectaccountingmonth} = "<option>\n";
+        $form->{selectaccountingmonth} = {
+            name => 'month',
+            options => [{text => '', value => ''}],
+            };
         for ( sort keys %{ $form->{all_month} } ) {
-            $form->{selectaccountingmonth} .=
-              qq|<option value=$_>|
-              . $locale->text( $form->{all_month}{$_} ) . qq|\n|;
+            push @{$form->{selectaccountingmonth}{options}}, {
+                value => $_,
+                text => $locale->text($form->{all_month}{$_})
+                };
         }
-
-        $selectfrom = qq|
-        <tr>
-	  <th align=right>| . $locale->text('Period') . qq|</th>
-	  <td colspan=3>
-	  <select name=month>$form->{selectaccountingmonth}</select>
-	  <select name=year>$form->{selectaccountingyear}</select>
-	  <input name=interval class=radio type=radio value=0 checked>&nbsp;|
-          . $locale->text('Current') . qq|
-	  <input name=interval class=radio type=radio value=1>&nbsp;|
-          . $locale->text('Month') . qq|
-	  <input name=interval class=radio type=radio value=3>&nbsp;|
-          . $locale->text('Quarter') . qq|
-	  <input name=interval class=radio type=radio value=12>&nbsp;|
-          . $locale->text('Year') . qq|
-	  </td>
-	</tr>
-|;
     }
 
-    $form->header;
+    $hiddens{nextsub} = 'get_payments';
+    $hiddens{$_} = $form->{$_} foreach qw(path login sessionid);
 
-    print qq|
-<body>
+    my @buttons = ({
+        name => 'action',
+        value => 'get_payments',
+        text => $locale->text('Continue'),
+        });
 
-<form method=post action=$form->{script}>
+##SC: Temporary removal
+##    if ( $form->{lynx} ) {
+##        require "bin/menu.pl";
+##        &menubar;
+##    }
 
-<table width=100%>
-  <tr>
-    <th class=listtop>$form->{title}</th>
-  </tr>
-  <tr height="5"></tr>
-  <tr>
-    <td>
-      <table>
-	<tr>
-	  <th align=right nowrap>| . $locale->text('Account') . qq|</th>
-	  <td colspan=3><select name=accno>$selection</select></td>
-	</tr>
-	<tr>
-	  <th align=right>| . $locale->text('From') . qq|</th>
-	  <td colspan=3><input class="date" name=fromdate size=11 title="$myconfig{dateformat}"> <b>|
-      . $locale->text('To')
-      . qq|</b> <input class="date" name=todate size=11 title="$myconfig{dateformat}"></td>
-	</tr>
-	$selectfrom
-	$cleared
-        <tr>
-	  <td></td>
-	  <td colspan=3><input type=radio style=radio name=summary value=1 checked> |
-      . $locale->text('Summary') . qq|
-	  <input type=radio style=radio name=summary value=0> |
-      . $locale->text('Detail')
-      . qq|</td>
-	</tr>
-	<tr>
-	  <td></td>
-	  <td colspan=3><input type=checkbox class=checkbox name=fx_transaction value=1 checked> |
-      . $locale->text('Include Exchange Rate Difference')
-      . qq|</td>
-	</tr>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td><hr size=3 noshade></td>
-  </tr>
-</table>
-
-<br>
-<input type=hidden name=nextsub value=get_payments>
-|;
-
-    $form->hide_form(qw(path login sessionid));
-
-    print qq|
-<button type="submit" class="submit" name="action" value="continue">|
-      . $locale->text('Continue')
-      . qq|</button>
-
-</form>
-|;
-
-    if ( $form->{lynx} ) {
-        require "bin/menu.pl";
-        &menubar;
-    }
-
-    print qq|
-
-</body>
-</html>
-|;
-
+    my $template = LedgerSMB::Template->new_UI(
+        user => \%myconfig, 
+        locale => $locale, 
+        template => 'rc-reconciliation',
+        );
+    $template->render({
+        form => $form,
+        user => \%myconfig, 
+        hiddens => \%hiddens,
+        buttons => ..hidden..,
+    });
 }
 
 sub continue { &{ $form->{nextsub} } }


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