diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-04-26 20:28:38 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-04-26 20:28:38 +0000 |
commit | 6c5c1c36fa682244c355f6c06808ec715f0a2baa (patch) | |
tree | 632efc981a5735f7b8d424a680469b71597dd495 /bin/ir.pl | |
parent | 6a118bd31a09a9b8aaabd84f8876952e1cdd6459 (diff) |
Merging bugfixes from current branches/1.2
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1105 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin/ir.pl')
-rw-r--r-- | bin/ir.pl | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -484,12 +484,13 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta if ( !$form->{taxincluded} ) { my @taxset = Tax::init_taxes( $form, $form->{taxaccounts} ); - $form->{invtotal} += - $form->round_amount( - Tax::calculate_taxes( \@taxset, $form, $form->{invsubtotal}, 0 ), - 2 ); foreach $taxobj (@taxset) { $item = $taxobj->account; + $form->{invtotal} += $form->round_amount( + $form->{"${item}_rate"} * $form->{"${item}_base"}, 2); + $form->{"${item}_total"} = + $form->format_amount( \%myconfig, + $form->{"${item}_rate"} * $form->{"${item}_base"}, 2 ); if ( $form->{"${item}_base"} ) { $form->{"${item}_total"} = $form->format_amount( \%myconfig, @@ -692,9 +693,12 @@ qq|<td align=center><input name="memo_$i" size=11 value="$form->{"memo_$i"}"></t else { if ( $transdate > $closedto ) { - for ( 'update', 'post', 'schedule' ) { $a{$_} = 1 } + for ( 'update', 'post', 'schedule' ) { $allowed{$_} = 1 } + for ( keys %button ) { delete $button{$_} if !$allowed{$_} } + } + elsif ($closedto) { + %buttons = (); } - for ( keys %button ) { delete $button{$_} if !$a{$_} } } for ( sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button ) @@ -963,8 +967,11 @@ sub update { $form->{"${_}_base"} += $amount; } if ( !$form->{taxincluded} ) { - my @taxes = - Tax::init_taxes( $form, $form->{"taxaccounts_$i"} ); + my @taxes = Tax::init_taxes( + $form, + $form->{"taxaccounts_$i"}, + $form->{"taxaccounts"} + ); $amount += ( Tax::calculate_taxes( \@taxes, $form, $amount, 0 ) ); } |