Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Items Other than those in BOM are not listed in Status of Work Order even if issued
03-18-2014, 10:41 PM (This post was last modified: 03-18-2014 11:06 PM by Forums3.)
Post: #2
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Yes, this looks like a bug. I agree it ought to show.

Tim
(03-18-2014 10:41 PM)Forums3 Wrote:  Yes, this looks like a bug. I agree it ought to show.

Tim

There is almost certainly a better way of doing it but if you remove lines 113 to 132 of WorkOrderStatus.php and replace them with:

$IssuedAlreadyResult = DB_query("SELECT stockid,
SUM(-qty) AS total
FROM stockmoves
WHERE stockmoves.type=28
AND reference='" . $SelectedWO . "'
GROUP BY stockid", $db);

while ($IssuedRow = DB_fetch_array($IssuedAlreadyResult)) {
$IssuedAlreadyRow[$IssuedRow['stockid']] = $IssuedRow['total'];
}

while ($RequirementsRow = DB_fetch_array($RequirmentsResult)) {
if ($RequirementsRow['autoissue'] == 0) {
echo '<tr>
<td>' . _('Manual Issue') . '</td>
<td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>';
} else {
echo '<tr>
<td class="notavailable">' . _('Auto Issue') . '</td>
<td class="notavailable">' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>';
}
if (isset($IssuedAlreadyRow[$RequirementsRow['stockid']])) {
$Issued = $IssuedAlreadyRow[$RequirementsRow['stockid']];
unset($IssuedAlreadyRow[$RequirementsRow['stockid']]);
} else {
$Issued= 0;
}
echo '<td class="number">' . locale_number_format($WORow['qtyreqd'] * $RequirementsRow['qtypu'], $RequirementsRow['decimalplaces']) . '</td>
<td class="number">' . locale_number_format($Issued, $RequirementsRow['decimalplaces']) . '</td></tr>';
}

/* Now do any additional issues of items not in the BOM */
foreach ($IssuedAlreadyRow as $StockID=>$Issued) {
$RequirementsSQL = "SELECT stockmaster.description,
stockmaster.decimalplaces
FROM stockmaster
WHERE stockid='" . $StockID . "'";
$RequirmentsResult = DB_query($RequirementsSQL, $db);
$RequirementsRow = DB_fetch_array($RequirmentsResult);
echo '<tr>
<td>' . _('Additional Issue') . '</td>
<td>' . $StockID . ' - ' . $RequirementsRow['description'] . '</td>';
echo '<td class="number">0</td>
<td class="number">' . locale_number_format($Issued, $RequirementsRow['decimalplaces']) . '</td>
</tr>';
}

it should work. Let me know if it works for you.

Thanks Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued - Forums3 - 03-18-2014 10:41 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)