From b094dd8ef0254e1ac73bb4b2127288aad41d6d55 Mon Sep 17 00:00:00 2001 From: tetragon Date: Sat, 6 Oct 2007 00:33:18 +0000 Subject: Template the tax config screen Add UI header file git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1708 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/am.pl | 118 +++++++++++++++++++------------------------------------------- 1 file changed, 36 insertions(+), 82 deletions(-) (limited to 'bin') diff --git a/bin/am.pl b/bin/am.pl index 800b0dce..9627cea5 100644 --- a/bin/am.pl +++ b/bin/am.pl @@ -1763,31 +1763,14 @@ sub taxes { sub display_taxes { $form->{title} = $locale->text('Taxes'); + my %hiddens = ( + path => $form->{path}, + login => $form->{login}, + sessionid => $form->{sessionid}, + type => 'taxes', + ); - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - -
$form->{title}
- - - - - - - - - -|; - + my @rows; for ( split( / /, $form->{taxaccounts} ) ) { ( $null, $i ) = split /_/, $_; @@ -1795,81 +1778,52 @@ sub display_taxes { $form->{"taxrate_$i"} = $form->format_amount( \%myconfig, $form->{"taxrate_$i"} ); - $form->hide_form("taxdescription_$i"); - - print qq| - - - - - - - - |; - $sametax = $form->{"taxdescription_$i"}; + if ( $form->{"taxdescription_$i"} eq $sametax ) { + push @rows, ["", \%select]; + } else { + push @rows, [$form->{"taxdescription_$i"}, \%select]; + } - } + $sametax = $form->{"taxdescription_$i"}; - print qq| -
| . $locale->text('Rate') . qq| (%)| . $locale->text('Number') . qq|| . $locale->text('Valid To') . qq|| . $locale->text('Ordering') . qq|| . $locale->text('Tax Rules') . qq|
|; - - if ( $form->{"taxdescription_$i"} eq $sametax ) { - print ""; - } - else { - print qq|$form->{"taxdescription_$i"}|; - } + $hiddens{"taxdescription_$i"} = $form->{"taxdescription_$i"}; - print qq|{"taxrate_$i"}>
-

-|; + } - $form->hide_form(qw(taxaccounts path login sessionid)); + $hiddens{taxaccounts} = $form->{taxaccounts}; foreach my $taxmodule ( sort keys %$form ) { next if ( $taxmodule !~ /^taxmodule_/ ); next if ( $taxmodule =~ /^taxmodule_id_/ ); - $form->hide_form("$taxmodule"); - } - - print qq| - -|; - - if ( $form->{lynx} ) { - require "bin/menu.pl"; - &menubar; + $hiddens{$taxmodule}; } - print qq| -
- - - -|; +##SC: Temporary removal +## if ( $form->{lynx} ) { +## require "bin/menu.pl"; +## &menubar; +## } + my $template = LedgerSMB::Template->new_UI( + user => \%myconfig, + locale => $locale, + template => 'am-taxes'); + $template->render({ + form => $form, + hiddens => \%hiddens, + selects => \%selects, + rows => \@rows, + }); } sub update { -- cgit v1.2.3