diff options
-rw-r--r-- | UI/rc-reconciliation.html | 129 | ||||
-rw-r--r-- | bin/rc.pl | 153 |
2 files changed, 175 insertions, 107 deletions
diff --git a/UI/rc-reconciliation.html b/UI/rc-reconciliation.html new file mode 100644 index 00000000..b0174ba4 --- /dev/null +++ b/UI/rc-reconciliation.html @@ -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> @@ -76,134 +76,73 @@ sub reconciliation { 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> | - . $locale->text('Current') . qq| - <input name=interval class=radio type=radio value=1> | - . $locale->text('Month') . qq| - <input name=interval class=radio type=radio value=3> | - . $locale->text('Quarter') . qq| - <input name=interval class=radio type=radio value=12> | - . $locale->text('Year') . qq| - </td> - </tr> -|; } - $form->header; - - print qq| -<body> - -<form method=post action=$form->{script}> - -<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; - } + $hiddens{nextsub} = 'get_payments'; + $hiddens{$_} = $form->{$_} foreach qw(path login sessionid); - print qq| + my @buttons = ({ + name => 'action', + value => 'get_payments', + text => $locale->text('Continue'), + }); -</body> -</html> -|; +##SC: Temporary removal +## if ( $form->{lynx} ) { +## require "bin/menu.pl"; +## &menubar; +## } + my $template = LedgerSMB::Template->new_UI( + user => \%myconfig, + locale => $locale, + template => 'rc-reconciliation', + ); + $template->render({ + form => $form, + user => \%myconfig, + hiddens => \%hiddens, + buttons => \@buttons, + }); } sub continue { &{ $form->{nextsub} } } |