[ic] Patch for taxable_amount() to see mv_discount

Josh Lavin josh at perusion.net
Mon Jul 11 19:19:55 UTC 2011


The taxable_amount() subroutine was not checking for the presence of the 
mv_discount item parameter, and thus was not using the discounted 
subtotal for the taxable amount.

Also changed logic to be clearer.

--- a/lib/Vend/Interpolate.pm
+++ b/lib/Vend/Interpolate.pm
@@ -5365,11 +5365,11 @@ sub taxable_amount {
         $item = $Vend::Items->[$i];
         next if is_yes( $item->{mv_nontaxable} );
         next if is_yes( item_field($item, $Vend::Cfg->{NonTaxableField}) );
-       unless (%$::Discounts) {
-           $taxable += item_subtotal($item);
+       if (%$::Discounts or $item->{mv_discount}) {
+           $taxable += apply_discount($item);
         }
         else {
-           $taxable += apply_discount($item);
+           $taxable += item_subtotal($item);
         }
      }



-- 
Josh Lavin
Perusion -- Expert Interchange Consulting    http://www.perusion.com/



More information about the interchange-users mailing list