[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri Dec 5 16:43:40 UTC 2008
User: heins
Date: 2008-12-05 16:43:40 GMT
Modified: lib/Vend Interpolate.pm
Log:
* Make TAX_CATEGORY_FIELD work as intended, where a colon-separated
table and field will work as well as a simple field in the same table
as the item.
Revision Changes Path
2.310 interchange/lib/Vend/Interpolate.pm
rev 2.310, prev_rev 2.309
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.309
retrieving revision 2.310
diff -u -r2.309 -r2.310
--- Interpolate.pm 16 Nov 2008 05:01:03 -0000 2.309
+++ Interpolate.pm 5 Dec 2008 16:43:40 -0000 2.310
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.309 2008-11-16 05:01:03 jon Exp $
+# $Id: Interpolate.pm,v 2.310 2008-12-05 16:43:40 mheins Exp $
#
# Copyright (C) 2002-2008 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.309 $, 10);
+$VERSION = substr(q$Revision: 2.310 $, 10);
@EXPORT = qw (
@@ -5539,8 +5539,15 @@
my @pfield = split /:+/, $pfield;
for my $item (@$Vend::Items) {
- my $rhash = tag_data($item->{mv_ib}, undef, $item->{code}, { hash => 1});
- my $cat = join ":", @{$rhash}{@pfield};
+ my ($tab, $col);
+ if($pfield[1]) {
+ ($tab, $col) = @pfield;
+ }
+ else {
+ $tab = $item->{mv_ib};
+ $col = $pfield[0];
+ }
+ my $cat = tag_data($tab, $col, $item->{code});
my $rate = defined $tax->{$cat} ? $tax->{$cat} : $tax->{default};
#::logDebug("item $item->{code} cat=$cat rate=$rate");
$rate = percent_rate($rate);
More information about the interchange-cvs
mailing list