Add a new table for inventory with for DIDs/serials/etc., and an additional
[freeside.git] / httemplate / search / inventory_item.html
diff --git a/httemplate/search/inventory_item.html b/httemplate/search/inventory_item.html
new file mode 100644 (file)
index 0000000..ff7f1fa
--- /dev/null
@@ -0,0 +1,35 @@
+<%
+
+my $classnum = $cgi->param('classnum');
+$classnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum";
+$classnum = $1;
+my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } );
+
+my $count_query =
+  "SELECT COUNT(*) FROM inventory_class WHERE classnum = $classnum";
+
+%><%= include( 'elements/search.html',
+                 'title'       => $inventory_class->classname. ' Inventory',
+
+                 #less lame to use Lingua:: something to pluralize
+                 'name'        => $inventory_class->classname. 's',
+
+                 'query'       => {
+                                    'table'   => 'inventory_item',
+                                    'hashref' => { 'classnum' => $classnum },
+                                  },
+
+                 'count_query' => $count_query,
+
+                 # XXX proper full service/customer link ala svc_acct
+                 'header'      => [ '#', $inventory_class->classname, 'svcnum' ],
+
+                 'fields'      => [
+                   'itemnum',
+                   'item',
+                   'svcnum', #XXX proper full service customer link ala svc_acct
+                             # "unallocated" ?  "available" ?
+                 ],
+
+             )
+%>