[ic] subtotal_nodisc

Salvador Caballe ea3bkz at amsat.org
Thu Apr 7 18:06:31 EDT 2005


I try to use the [subtotal_nodisc] usertag by Kevin  Walsh
 it runs OK with 5.3.0 but  not with IC 5.3.1 version,

does any one know how to fix it?

Salvador

	subtotal_nodisc.usertag
#	-----------------------
#	Kevin Walsh <kevin at cursor.biz>
#
#	Copyright (c) 2002 Cursor Software Limited.
#	All Rights Reserved.
#
#	This program is free software; you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation; either version 2 of the License, or
#	(at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public
#	License along with this program; if not, write to the Free
#	Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#	MA  02111-1307  USA.
#
#	Summary:
#
#	    Returns the current subtotal with no discounts
#	    applied.
#
#	Parameters:
#
#	    noformat:
#		0 (Default) = Format the amount (ie. 1234.56 -> $1,234.56)
#		1 = Get a "raw" amount (no currency formatting)
#
#	Usage example:
#
#	    Subtotal:                [subtotal-nodisc]<br>
#	    Including your discount: [subtotal]<br>
#
UserTag subtotal_nodisc Order noformat
UserTag subtotal_nodisc Routine <<EOR
sub {
	my $noformat = shift;

	my $save = delete $Vend::Session->{discount};
	my $subtotal = Vend::Interpolate::subtotal();
	$Vend::Session->{discount} = $save if $save;

	return $noformat =~ /^(yes|1)$/i ? $subtotal : 
Vend::Util::currency($subtotal);
}
EOR



More information about the interchange-users mailing list