diff options
-rwxr-xr-x | bin/ir.pl | 9 | ||||
-rwxr-xr-x | bin/is.pl | 6 | ||||
-rwxr-xr-x | bin/oe.pl | 6 |
3 files changed, 11 insertions, 10 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, @@ -540,10 +540,10 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta if ( !$form->{taxincluded} ) { my @taxes = Tax::init_taxes( $form, $form->{taxaccounts} ); - $form->{invtotal} += - Tax::calculate_taxes( \@taxes, $form, $form->{invsubtotal}, 0 ); foreach $item (@taxes) { my $taccno = $item->account; + $form->{invtotal} += $form->round_amount( + $form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2); $form->{"${taccno}_total"} = $form->format_amount( \%myconfig, $form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2 ); @@ -552,7 +552,7 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta <th align=right>$form->{"${taccno}_description"}</th> <td align=right>$form->{"${taccno}_total"}</td> </tr> - | if $item->value; + | if $form->{"${taccno}_base"}; } $form->{invsubtotal} = @@ -682,10 +682,10 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta if ( !$form->{taxincluded} ) { my @taxes = Tax::init_taxes( $form, $form->{taxaccounts} ); - $form->{invtotal} += - Tax::calculate_taxes( \@taxes, $form, $form->{invsubtotal}, 0 ); foreach my $item (@taxes) { my $taccno = $item->account; + $form->{invtotal} += $form->round_amount( + $form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2); $form->{"${taccno}_total"} = $form->format_amount( \%myconfig, $form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2 ); @@ -695,7 +695,7 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta <th align=right>$form->{"${taccno}_description"}</th> <td align=right>$form->{"${taccno}_total"}</td> </tr> - | if $item->value; + | if $form->{"${taccno}_base"}; } $form->{invsubtotal} = |