6 include('includes/session.inc');
7 $title = _('Stock Of Controlled Items');
8 include('includes/header.inc');
11 if (isset($_GET['StockID'])){
12 $StockID = trim(strtoupper($_GET['StockID']));
14 prnMsg( _('This page must be called with parameters specifying the item to show the serial references and quantities') . '. ' . _('It cannot be displayed without the proper parameters being passed'),'error');
15 include('includes/footer.inc');
19 $result = DB_query("SELECT description,
26 WHERE stockid='$StockID'",
28 _('Could not retrieve the requested item because'));
30 $myrow = DB_fetch_row($result);
32 $DecimalPlaces = $myrow[3];
33 $Serialised = $myrow[4];
34 $Controlled = $myrow[5];
36 echo "<BR><FONT COLOR=BLUE SIZE=3><B>$StockID - $myrow[0] </B> (" . _('In units of') . ' ' . $myrow[1] . ')</FONT>';
38 if ($myrow[2]=='K' OR $myrow[2]=='A' OR $myrow[2]=='D'){
40 prnMsg(_('This item is either a kitset or assembly or a dummy part and cannot have a stock holding') . '. ' . _('This page cannot be displayed') . '. ' . _('Only serialised or controlled items can be displayed in this page'),'error');
41 include('includes/footer.inc');
46 echo '<BR><B>' . _('Serialised items in') . ' ';
48 echo '<BR><B>' . _('Controlled items in') . ' ';
52 $result = DB_query("SELECT locationname
54 WHERE loccode='" . $_GET['Location'] . "'",
56 _('Could not retrieve the stock location of the item because'),
57 _('The SQL used to lookup the location was'));
59 $myrow = DB_fetch_row($result);
62 $sql = "SELECT serialno,
65 WHERE loccode='" . $_GET['Location'] . "'
66 AND stockid = '" . $StockID . "'
70 $ErrMsg = _('The serial numbers/batches held cannot be retrieved because');
71 $LocStockResult = DB_query($sql, $db, $ErrMsg);
73 echo '<CENTER><TABLE CELLPADDING=2 BORDER=0>';
75 if ($Serialised == 1){
77 <TD class='tableheader'>" . _('Serial Number') . "</TD>
78 <TD class='tableheader'>" . _('Serial Number') . "</TD>
79 <TD class='tableheader'>" . _('Serial Number') . "</TD>
83 <TD class='tableheader'>" . _('Batch/Bundle Ref') . "</TD>
84 <TD class='tableheader'>" . _('Quantity On Hand') . "</TD>
85 <TD class='tableheader'>" . _('Batch/Bundle Ref') . "</TD>
86 <TD class='tableheader'>" . _('Quantity On Hand') . "</TD>
87 <TD class='tableheader'>" . _('Batch/Bundle Ref') . "</TD>
88 <TD class='tableheader'>" . _('Quantity On Hand') . "</TD>
96 while ($myrow=DB_fetch_array($LocStockResult)) {
98 if ($Col==0 AND $BGColor=='#EEEEEE'){
100 echo "<TR bgcolor=$BGColor>";
103 echo "<TR bgcolor=$BGColor>";
106 $TotalQuantity +
= $myrow['quantity'];
108 if ($Serialised == 1){
109 printf('<td>%s</td>',
114 <td ALIGN=RIGHT>%s</td>",
116 number_format($myrow['quantity'],$DecimalPlaces)
124 //end of page full new headings if
134 echo '<BR><B>' . _('Total quantity') . ': ' . number_format($TotalQuantity, $DecimalPlaces) . '<BR>';
137 include('includes/footer.inc');