[interchange-cvs] interchange - racke modified lib/Vend/Data.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Tue Sep 11 07:01:00 2001


User:      racke
Date:      2001-09-11 11:00:08 GMT
Modified:  lib/Vend Tag: LINUXIA Data.pm
Log:
merged changes 1.17.2.20 vs 1.17.2.21

Revision  Changes    Path
No                   revision



No                   revision



1.13.4.8  +15 -1     interchange/lib/Vend/Data.pm


rev 1.13.4.8, prev_rev 1.13.4.7
Index: Data.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Data.pm,v
retrieving revision 1.13.4.7
retrieving revision 1.13.4.8
diff -u -r1.13.4.7 -r1.13.4.8
--- Data.pm	2001/02/10 01:41:41	1.13.4.7
+++ Data.pm	2001/09/11 11:00:08	1.13.4.8
@@ -1,6 +1,6 @@
 # Data.pm - Interchange databases
 #
-# $Id: Data.pm,v 1.13.4.7 2001/02/10 01:41:41 racke Exp $
+# $Id: Data.pm,v 1.13.4.8 2001/09/11 11:00:08 racke Exp $
 # 
 # Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
 #
@@ -40,12 +40,14 @@
 export_database
 import_database
 increment_field
+item_category
 item_description
 item_field
 item_price
 item_subtotal
 sql_query
 open_database
+product_category
 product_code_exists_ref
 product_code_exists_tag
 product_description
@@ -173,6 +175,12 @@
 	);
 }
 
+sub product_category {
+	my ($code, $base) = @_;
+    return "" unless $base = product_code_exists_ref($code, $base || undef);
+    return database_field($base, $code, $Vend::Cfg->{CategoryField});
+}
+
 sub product_description {
     my ($code, $base) = @_;
     return "" unless $base = product_code_exists_ref($code, $base || undef);
@@ -1403,6 +1411,12 @@
 		if ! $quantity and exists $item->{mv_cache_price};
 #::logDebug("item_price final: $price");
 	return $price;
+}
+
+sub item_category {
+	my $item = shift;
+	my $base = $Vend::Database{$item->{mv_ib}} || $Products;
+	return database_field($base, $item->{code}, $Vend::Cfg->{CategoryField});
 }
 
 sub item_description {