[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Aug 5 08:20:04 EDT 2005


User:      heins
Date:      2005-08-05 12:20:04 GMT
Modified:  lib/Vend Interpolate.pm
Log:
* Fix bug introduced in discount_space change -- mv_discount would not
  work in all instances (for individual product pricing).

* Make item-difference work with mv_discount -- I don't believe it previously
  could or did, as it had no way to know of a discount.

Revision  Changes    Path
2.250     +6 -5      interchange/lib/Vend/Interpolate.pm


rev 2.250, prev_rev 2.249
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.249
retrieving revision 2.250
diff -u -r2.249 -r2.250
--- Interpolate.pm	9 Jun 2005 18:23:21 -0000	2.249
+++ Interpolate.pm	5 Aug 2005 12:20:04 -0000	2.250
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.249 2005/06/09 18:23:21 docelic Exp $
+# $Id: Interpolate.pm,v 2.250 2005/08/05 12:20:04 mheins Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.249 $, 10);
+$VERSION = substr(q$Revision: 2.250 $, 10);
 
 @EXPORT = qw (
 
@@ -4303,6 +4303,7 @@
 								$item->{code},
 								item_price($item, $item->{quantity}),
 								$item->{quantity},
+								$item,
 							),
 							$2,
 					)!ge;
@@ -4891,8 +4892,8 @@
 }
 
 sub item_difference {
-	my($code,$price,$q) = @_;
-	return $price - discount_price($code,$price,$q);
+	my($code,$price,$q,$item) = @_;
+	return $price - discount_price($item || $code,$price,$q);
 }
 
 sub item_discount {
@@ -4940,7 +4941,7 @@
 			||= {} if $Vend::Cfg->{DiscountSpacesOn};
 	}
 
-	return $price unless %$::Discounts;
+	return $price unless $extra || %$::Discounts;
 
 	$quantity = $item->{quantity};
 








More information about the interchange-cvs mailing list