|
From: <dai...@us...> - 2011-10-19 09:40:55
|
Revision: 4728
http://web-erp.svn.sourceforge.net/web-erp/?rev=4728&view=rev
Author: daintree
Date: 2011-10-19 09:40:44 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
number_formats
Modified Paths:
--------------
trunk/BOMExtendedQty.php
trunk/BOMs.php
Modified: trunk/BOMExtendedQty.php
===================================================================
--- trunk/BOMExtendedQty.php 2011-10-19 01:32:48 UTC (rev 4727)
+++ trunk/BOMExtendedQty.php 2011-10-19 09:40:44 UTC (rev 4728)
@@ -258,28 +258,37 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' .
_('Search') . '" alt="" />' . ' ' . $title.'</p><br />';
- echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">';
+ echo '<br />
+ <br />
+ <form action=' . $_SERVER['PHP_SELF'] . ' method="post">
+ <table class="selection">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<tr><td>' . _('Part') . ':</td>
+ echo '<tr>
+ <td>' . _('Part') . ':</td>
<td><input type ="text" name="Part" size="20">';
- echo '<tr><td>' . _('Quantity') . ':</td>
- <td><input type="text" class="number" name="Quantity" size="4"></td></tr>';
+ echo '<tr>
+ <td>' . _('Quantity') . ':</td>
+ <td><input type="text" class="number" name="Quantity" size="4" /></td></tr>';
- echo '<tr><td>' . _('Selection Option') . ':</td>
+ echo '<tr>
+ <td>' . _('Selection Option') . ':</td>
<td><select name="Select">
<option selected value="All">' . _('Show All Parts') . '</option>
<option value="Shortages">' . _('Only Show Shortages') . '</option>
- </select></td></tr>';
- echo '<tr><td>' . _('Print Option') . ':</td>
+ </select></td>
+ </tr>';
+ echo '<tr>
+ <td>' . _('Print Option') . ':</td>
<td><select name="Fill">
<option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option>
<option value="no">' . _('Plain Print') . '</option>
- </select></td></tr>';
+ </select></td>
+ </tr>';
echo '</table>
<br />
<br />
<div class="centre">
- <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '">
+ <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '" />
</div>';
include('includes/footer.inc');
Modified: trunk/BOMs.php
===================================================================
--- trunk/BOMs.php 2011-10-19 01:32:48 UTC (rev 4727)
+++ trunk/BOMs.php 2011-10-19 09:40:44 UTC (rev 4728)
@@ -72,30 +72,30 @@
global $ParentMBflag;
// Modified by POPAD&T
$sql = "SELECT bom.component,
- stockmaster.description,
- locations.locationname,
- workcentres.description,
- bom.quantity,
- bom.effectiveafter,
- bom.effectiveto,
- stockmaster.mbflag,
- bom.autoissue,
- stockmaster.controlled,
- locstock.quantity AS qoh,
- stockmaster.decimalplaces
- FROM bom,
- stockmaster,
- locations,
- workcentres,
- locstock
- WHERE bom.component='".$Component."'
- AND bom.parent = '".$Parent."'
- AND bom.component=stockmaster.stockid
- AND bom.loccode = locations.loccode
- AND locstock.loccode=bom.loccode
- AND bom.component = locstock.stockid
- AND bom.workcentreadded=workcentres.code
- AND stockmaster.stockid=bom.component";
+ stockmaster.description,
+ locations.locationname,
+ workcentres.description,
+ bom.quantity,
+ bom.effectiveafter,
+ bom.effectiveto,
+ stockmaster.mbflag,
+ bom.autoissue,
+ stockmaster.controlled,
+ locstock.quantity AS qoh,
+ stockmaster.decimalplaces
+ FROM bom,
+ stockmaster,
+ locations,
+ workcentres,
+ locstock
+ WHERE bom.component='".$Component."'
+ AND bom.parent = '".$Parent."'
+ AND bom.component=stockmaster.stockid
+ AND bom.loccode = locations.loccode
+ AND locstock.loccode=bom.loccode
+ AND bom.component = locstock.stockid
+ AND bom.workcentreadded=workcentres.code
+ AND stockmaster.stockid=bom.component";
$ErrMsg = _('Could not retrieve the BOM components because');
$DbgMsg = _('The SQL used to retrieve the components was');
@@ -132,38 +132,38 @@
$QuantityOnHand = locale_number_format($myrow[10],$myrow[11]);
}
printf('<td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td class=number>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td>%s</td>
- <td class=number>%s</td>
- <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td>
- <td>'.$DrillText.'</a></td>
- <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td>
- </tr>',
- $Level1,
- $myrow[0],
- $myrow[1],
- $myrow[2],
- $myrow[3],
- $myrow[4],
- ConvertSQLDate($myrow[5]),
- ConvertSQLDate($myrow[6]),
- $AutoIssue,
- $QuantityOnHand,
- $_SERVER['PHP_SELF'] . '?',
- $Parent,
- $myrow[0],
- $DrillLink,
- $DrillID,
- $_SERVER['PHP_SELF'] . '?',
- $Parent,
- $myrow[0],
- $UltimateParent);
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td class="number">%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td>%s</td>
+ <td class="number">%s</td>
+ <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td>
+ <td>'.$DrillText.'</a></td>
+ <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td>
+ </tr>',
+ $Level1,
+ $myrow[0],
+ $myrow[1],
+ $myrow[2],
+ $myrow[3],
+ locale_number_format($myrow[4],'Variable'),
+ ConvertSQLDate($myrow[5]),
+ ConvertSQLDate($myrow[6]),
+ $AutoIssue,
+ $QuantityOnHand,
+ $_SERVER['PHP_SELF'] . '?',
+ $Parent,
+ $myrow[0],
+ $DrillLink,
+ $DrillID,
+ $_SERVER['PHP_SELF'] . '?',
+ $Parent,
+ $myrow[0],
+ $UltimateParent);
} //END WHILE LIST LOOP
} //end of function DisplayBOMItems
@@ -232,7 +232,7 @@
$Errors[$i] = 'Quantity';
$i++;
}
- if (filter_number_format($_POST['Quantity']==0)) {
+ if (filter_number_format($_POST['Quantity'])==0) {
$InputError = 1;
prnMsg(_('The quantity entered cannot be zero'),'error');
$Errors[$i] = 'Quantity';
@@ -293,10 +293,10 @@
/*Now check to see that the component is not already on the BOM */
$sql = "SELECT component
FROM bom
- WHERE parent='".$SelectedParent."'
- AND component='" . $_POST['Component'] . "'
- AND workcentreadded='" . $_POST['WorkCentreAdded'] . "'
- AND loccode='" . $_POST['LocCode'] . "'" ;
+ WHERE parent='".$SelectedParent."'
+ AND component='" . $_POST['Component'] . "'
+ AND workcentreadded='" . $_POST['WorkCentreAdded'] . "'
+ AND loccode='" . $_POST['LocCode'] . "'" ;
$ErrMsg = _('An error occurred in checking the component is not already on the BOM');
$DbgMsg = _('The SQL that was used to check the component was not already on the BOM and that failed in the process was');
@@ -306,13 +306,13 @@
if (DB_num_rows($result)==0) {
$sql = "INSERT INTO bom (parent,
- component,
- workcentreadded,
- loccode,
- quantity,
- effectiveafter,
- effectiveto,
- autoissue)
+ component,
+ workcentreadded,
+ loccode,
+ quantity,
+ effectiveafter,
+ effectiveto,
+ autoissue)
VALUES ('".$SelectedParent."',
'" . $_POST['Component'] . "',
'" . $_POST['WorkCentreAdded'] . "',
@@ -330,7 +330,6 @@
UpdateCost($db, $_POST['Component']);
$msg = _('A new component part') . ' ' . $_POST['Component'] . ' ' . _('has been added to the bill of material for part') . ' - ' . $SelectedParent . '.';
-
} else {
/*The component must already be on the BOM */
@@ -350,13 +349,17 @@
//the link to delete a selected record was clicked instead of the Submit button
- $sql="DELETE FROM bom WHERE parent='".$SelectedParent."' AND component='".$SelectedComponent."'";
+ $sql="DELETE FROM bom
+ WHERE parent='".$SelectedParent."'
+ AND component='".$SelectedComponent."'";
$ErrMsg = _('Could not delete this BOM components because');
$DbgMsg = _('The SQL used to delete the BOM was');
$result = DB_query($sql,$db,$ErrMsg,$DbgMsg);
- $ComponentSQL = "SELECT component from bom where parent='" . $SelectedParent ."'";
+ $ComponentSQL = "SELECT component
+ FROM bom
+ WHERE parent='" . $SelectedParent ."'";
$ComponentResult = DB_query($ComponentSQL,$db);
$ComponentArray = DB_fetch_row($ComponentResult);
UpdateCost($db, $ComponentArray[0]);
@@ -505,7 +508,9 @@
echo '</table>
<br />
<table class="selection">';
- echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>';
+ echo '<tr>
+ <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th>
+ </tr>';
$BOMTree = array();
//BOMTree is a 2 dimensional array with three elements for each item in the array - Level, Parent, Component
@@ -514,20 +519,22 @@
display_children($SelectedParent, 1, $BOMTree);
$TableHeader = '<tr>
- <th>' . _('Level') . '</th>
- <th>' . _('Code') . '</th>
- <th>' . _('Description') . '</th>
- <th>' . _('Location') . '</th>
- <th>' . _('Work Centre') . '</th>
- <th>' . _('Quantity') . '</th>
- <th>' . _('Effective After') . '</th>
- <th>' . _('Effective To') . '</th>
- <th>' . _('Auto Issue') . '</th>
- <th>' . _('Qty On Hand') . '</th>
+ <th>' . _('Level') . '</th>
+ <th>' . _('Code') . '</th>
+ <th>' . _('Description') . '</th>
+ <th>' . _('Location') . '</th>
+ <th>' . _('Work Centre') . '</th>
+ <th>' . _('Quantity') . '</th>
+ <th>' . _('Effective After') . '</th>
+ <th>' . _('Effective To') . '</th>
+ <th>' . _('Auto Issue') . '</th>
+ <th>' . _('Qty On Hand') . '</th>
</tr>';
echo $TableHeader;
if(count($BOMTree) == 0) {
- echo '<tr class="OddTableRows"><td colspan="8">'._('No materials found.').'</td></tr>';
+ echo '<tr class="OddTableRows">
+ <td colspan="8">'._('No materials found.').'</td>
+ </tr>';
} else {
$UltimateParent = $SelectedParent;
$k = 0;
@@ -547,7 +554,8 @@
DisplayBOMItems($UltimateParent, $Parent, $Component, $Level, $db);
}
}
- echo '</table><br />';
+ echo '</table>
+ <br />';
if (! isset($_GET['delete'])) {
@@ -558,14 +566,14 @@
//editing a selected component from the link to the line item
$sql = "SELECT loccode,
- effectiveafter,
- effectiveto,
- workcentreadded,
- quantity,
- autoissue
- FROM bom
- WHERE parent='".$SelectedParent."'
- AND component='".$SelectedComponent."'";
+ effectiveafter,
+ effectiveto,
+ workcentreadded,
+ quantity,
+ autoissue
+ FROM bom
+ WHERE parent='".$SelectedParent."'
+ AND component='".$SelectedComponent."'";
$result = DB_query($sql, $db);
$myrow = DB_fetch_array($result);
@@ -574,7 +582,7 @@
$_POST['EffectiveAfter'] = ConvertSQLDate($myrow['effectiveafter']);
$_POST['EffectiveTo'] = ConvertSQLDate($myrow['effectiveto']);
$_POST['WorkCentreAdded'] = $myrow['workcentreadded'];
- $_POST['Quantity'] = $myrow['quantity'];
+ $_POST['Quantity'] = locale_number_format($myrow['quantity'],'Variable');
$_POST['AutoIssue'] = $myrow['autoissue'];
prnMsg(_('Edit the details of the selected component in the fields below') . '. <br />' . _('Click on the Enter Information button to update the component details'),'info');
@@ -582,8 +590,11 @@
<input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />';
echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />';
echo '<table class="selection">';
- echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>';
- echo '<tr><td>' . _('Component') . ':</td>
+ echo '<tr>
+ <th colspan="13"><div class="centre"><font color="blue" size="3"><b>'. ('Edit Component Details') .'</font></b></th>
+ </tr>';
+ echo '<tr>
+ <td>' . _('Component') . ':</td>
<td><b>' . $SelectedComponent . '</b></td>
</tr>';
@@ -593,8 +604,12 @@
/* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed.";
*/
echo '<table class="selection">';
- echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>';
- echo '<tr><td>' . _('Component code') . ':</td><td>';
+ echo '<tr>
+ <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . ('New Component Details') .'</font></b></th>
+ </tr>';
+ echo '<tr>
+ <td>' . _('Component code') . ':</td>
+ <td>';
echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">';
if ($ParentMBflag=='A'){ /*Its an assembly */
@@ -632,10 +647,12 @@
echo '<option value="' .$myrow['stockid'].'">' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description'] . '</option>';
} //end while loop
- echo '</select></td></tr>';
+ echo '</select></td>
+ </tr>';
}
- echo '<tr><td>' . _('Location') . ': </td>
+ echo '<tr>
+ <td>' . _('Location') . ': </td>
<td><select tabindex="2" name="LocCode">';
DB_free_result($result);
@@ -656,8 +673,9 @@
echo '</select></td>
</tr>
- <tr><td>' . _('Work Centre Added') . ': </td>
- <td><select tabindex="3" name="WorkCentreAdded">';
+ <tr>
+ <td>' . _('Work Centre Added') . ': </td>
+ <td><select tabindex="3" name="WorkCentreAdded">';
$sql = "SELECT code, description FROM workcentres";
$result = DB_query($sql,$db);
@@ -682,7 +700,8 @@
echo '</select></td>
</tr>
- <tr><td>' . _('Quantity') . ': </td>
+ <tr>
+ <td>' . _('Quantity') . ': </td>
<td><input ' . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" class="number" name="Quantity" class="number" size="10" maxlength="8" value="';
if (isset($_POST['Quantity'])){
echo $_POST['Quantity'];
@@ -690,7 +709,8 @@
echo 1;
}
- echo '"></td></tr>';
+ echo '" /></td>
+ </tr>';
if (!isset($_POST['EffectiveTo']) OR $_POST['EffectiveTo']=='') {
$_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d'),(Date('y')+20)));
@@ -699,10 +719,14 @@
$_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')-1,Date('y')));
}
- echo '<tr><td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
- <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'"></td></tr>
- <tr><td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
- <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'"></td></tr>';
+ echo '<tr>
+ <td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
+ <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'" /></td>
+ </tr>
+ <tr>
+ <td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td>
+ <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'" /></td>
+ </tr>';
if ($ParentMBflag=='M' OR $ParentMBflag=='G'){
echo '<tr><td>' . _('Auto Issue this Component to Work Orders') . ':</td>
@@ -723,11 +747,14 @@
echo '</select></td></tr>';
} else {
- echo '<input type=hidden name="AutoIssue" value="0">';
+ echo '<input type="hidden" name="AutoIssue" value="0" />';
}
echo '</table>
- <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '"></form></div>';
+ <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '" />
+
+ </form>
+ </div>';
} //end if record deleted no point displaying form to add record
@@ -752,16 +779,17 @@
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
stockmaster.units,
+ stockmaster.decimalplaces,
stockmaster.mbflag,
SUM(locstock.quantity) as totalonhand
- FROM stockmaster,
- locstock
- WHERE stockmaster.stockid = locstock.stockid
- AND stockmaster.description " . LIKE . " '".$SearchString."'
+ FROM stockmaster INNER JOIN locstock
+ ON stockmaster.stockid = locstock.stockid
+ WHERE stockmaster.description " . LIKE . " '".$SearchString."'
AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='A' OR stockmaster.mbflag='G')
GROUP BY stockmaster.stockid,
stockmaster.description,
stockmaster.units,
+ stockmaster.decimalplaces,
stockmaster.mbflag
ORDER BY stockmaster.stockid";
@@ -770,11 +798,11 @@
stockmaster.description,
stockmaster.units,
stockmaster.mbflag,
+ stockmaster.decimalplaces,
sum(locstock.quantity) as totalonhand
- FROM stockmaster,
- locstock
- WHERE stockmaster.stockid = locstock.stockid
- AND stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%'
+ FROM stockmaster INNER JOIN locstock
+ ON stockmaster.stockid = locstock.stockid
+ WHERE stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%'
AND (stockmaster.mbflag='M'
OR stockmaster.mbflag='K'
OR stockmaster.mbflag='G'
@@ -782,7 +810,8 @@
GROUP BY stockmaster.stockid,
stockmaster.description,
stockmaster.units,
- stockmaster.mbflag
+ stockmaster.mbflag,
+ stockmaster.decimalplaces
ORDER BY stockmaster.stockid";
}
@@ -797,74 +826,79 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title . '</p>';
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' .
- '<div class="page_help_text">'. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . _('to maintain the bill of material for using the options below') . '<br /><font size=1>' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. '</font>
+ '<div class="page_help_text">'. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . _('to maintain the bill of material for using the options below') . '<br /><font size="1">' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. '</font>
<br />
<table class="selection" cellpadding="3" colspan="4">
<tr><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td>
- <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td>
- <td><font size=3><b>' . _('OR') . '</b></font></td>
- <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td>
- <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td>
+ <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td>
+ <td><font size="3"><b>' . _('OR') . '</b></font></td>
+ <td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td>
+ <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18" /></td>
</tr>
</table>
- <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>';
+ <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '" /></div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
-if (isset($_POST['Search']) AND isset($result) AND !isset($SelectedParent)) {
-
- echo '<br /><table cellpadding="2" colspan="7" class="selection">';
- $TableHeader = '<tr><th>' . _('Code') . '</th>
- <th>' . _('Description') . '</th>
- <th>' . _('On Hand') . '</th>
- <th>' . _('Units') . '</th>
- </tr>';
-
- echo $TableHeader;
-
- $j = 1;
- $k=0; //row colour counter
- while ($myrow=DB_fetch_array($result)) {
- if ($k==1){
- echo '<tr class="EvenTableRows">';;
- $k=0;
- } else {
- echo '<tr class="OddTableRows">';;
- $k++;
+ if (isset($_POST['Search'])
+ AND isset($result)
+ AND !isset($SelectedParent)) {
+
+ echo '<br />
+ <table cellpadding="2" colspan="7" class="selection">';
+ $TableHeader = '<tr>
+ <th>' . _('Code') . '</th>
+ <th>' . _('Description') . '</th>
+ <th>' . _('On Hand') . '</th>
+ <th>' . _('Units') . '</th>
+ </tr>';
+
+ echo $TableHeader;
+
+ $j = 1;
+ $k=0; //row colour counter
+ while ($myrow=DB_fetch_array($result)) {
+ if ($k==1){
+ echo '<tr class="EvenTableRows">';;
+ $k=0;
+ } else {
+ echo '<tr class="OddTableRows">';;
+ $k++;
+ }
+ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){
+ $StockOnHand = _('N/A');
+ } else {
+ $StockOnHand = locale_number_format($myrow['totalonhand'],$myrow['decimalplaces']);
+ }
+ $tab = $j+3;
+ printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s" /></td>
+ <td>%s</td>
+ <td class="number">%s</td>
+ <td>%s</td>
+ </tr>',
+ $myrow['stockid'],
+ $myrow['description'],
+ $StockOnHand,
+ $myrow['units']);
+
+ $j++;
+ //end of page full new headings if
}
- if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){
- $StockOnHand = _('N/A');
- } else {
- $StockOnHand = locale_number_format($myrow['totalonhand'],2);
- }
- $tab = $j+3;
- printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td>
- <td>%s</td>
- <td class=number>%s</td>
- <td>%s</td></tr>',
- $myrow['stockid'],
- $myrow['description'],
- $StockOnHand,
- $myrow['units']);
-
- $j++;
-//end of page full new headings if
+ //end of while loop
+
+ echo '</table>';
+
}
-//end of while loop
+ //end if results to show
+
+ if (!isset($SelectedParent) or $SelectedParent=='') {
+ echo '<script>defaultControl(document.forms[0].StockCode);</script>';
+ } else {
+ echo '<script>defaultControl(document.form.JournalProcessDate);</script>';
+ }
+
+ echo '</form>';
- echo '</table>';
-
-}
-//end if results to show
-
-if (!isset($SelectedParent) or $SelectedParent=='') {
- echo '<script>defaultControl(document.forms[0].StockCode);</script>';
-} else {
- echo '<script>defaultControl(document.form.JournalProcessDate);</script>';
-}
-
-echo '</form>';
-
} //end StockID already selected
include('includes/footer.inc');
-?>
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|