[freeside-commits] freeside/httemplate/search inventory_item.html, 1.6, 1.7
Ivan,,,
ivan at wavetail.420.am
Fri Feb 12 18:16:02 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv27724
Modified Files:
inventory_item.html
Log Message:
fix inventory item search w/customer classes
Index: inventory_item.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/inventory_item.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- inventory_item.html 8 Oct 2007 19:14:28 -0000 1.6
+++ inventory_item.html 13 Feb 2010 02:16:00 -0000 1.7
@@ -6,7 +6,7 @@
'query' => {
'table' => 'inventory_item',
- 'hashref' => { 'classnum' => $classnum },
+ 'hashref' => {},
'select' => join(', ',
'inventory_item.*',
'cust_main.custnum',
@@ -79,6 +79,7 @@
my $classnum = $cgi->param('classnum');
$classnum =~ /^(\d+)$/ or errorpage("illegal classnum $classnum");
$classnum = $1;
+my $extra_sql = 'inventory_item.classnum = $classnum ';
my $inventory_class = qsearchs( {
'table' => 'inventory_class',
@@ -88,17 +89,16 @@
my $title = $inventory_class->classname. ' Inventory';
#little false laziness with SQL fragments in inventory_class.pm
-my $extra_sql = '';
if ( $cgi->param('avail') ) {
- $extra_sql = 'AND ( svcnum IS NULL OR svcnum = 0 )';
+ $extra_sql .= ' AND ( svcnum IS NULL OR svcnum = 0 )';
$title .= ' - Available';
} elsif ( $cgi->param('used') ) {
- $extra_sql = 'AND svcnum IS NOT NULL AND svcnum > 0';
+ $extra_sql .= ' AND svcnum IS NOT NULL AND svcnum > 0';
$title .= ' - In use';
}
my $count_query =
- "SELECT COUNT(*) FROM inventory_item WHERE classnum = $classnum $extra_sql";
+ "SELECT COUNT(*) FROM inventory_item WHERE $extra_sql";
my $link = sub {
my $inventory_item = shift;
More information about the freeside-commits
mailing list