Thread Rating:
  • 0 Vote(s) - 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-17-2014, 05:22 PM,
#1
Items Other than those in BOM are not listed in Status of Work Order even if issued
Hi,

Say a work order is created for a Manufactured item M made of A + B + C as per BOM.

Now if an extra item D is also issued for this WO, and we check the status, it does not show the extra item D that is issued. Though this is accounted for and shown in the costing screen. It will be good if all the issued items are shown in the status screen / issue screen and not only those that are in the BOM of that manufactured item.

May be this issue is discussed earlier, but I searched and could not find previous posts and hence this post.

Thanks
Reply
03-18-2014, 10:41 PM, (This post was last modified: 03-18-2014, 11:06 PM by Forums3.)
#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
Reply
03-19-2014, 01:56 PM,
#3
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Hi, newuser990 and Tim,

Thank you very much for your report and patch. I've commit it to trunk.

Best regards!

Exson
Reply
03-19-2014, 07:17 PM,
#4
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Dear Tim and Exsonqu_qu

Thanks for the commit. Its working Great. Smile

I was thinking a similar change is required to WorkOrderIssue.php since it is important to display all that is already issued while issuing the materials.

Thanks

Reply
03-21-2014, 01:51 PM,
#5
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Hi, newuser990,

Thank you for your report. Now the problem also fixed in WorkOrderIssue.php in the trunk.

Best regards!

Exson
Reply
03-23-2014, 08:19 PM, (This post was last modified: 03-23-2014, 08:19 PM by Uhuru.)
#6
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Hi Exson,

Apologies for the delay, I have only just got around to reviewing this commit. There are a couple of errors in the WorkOrderissue.php script. In the sql statement at line 658 you have descrption, which should be description.

On line 629 you have

$IssuedMaterials[$myrow['stockid']]['description'] = $myrow['description'];

but the sql that $myrow refers to only has two fields "SELECT stockid, SUM(-qty) as total FROM stockmoves WHERE stockmoves.type=28AND reference='" . $_POST['WO'] . "' GROUP BY stockid" so no reference to description field.

If you refer to the way I did WorkOrderStatus.php you can see what I mean.

Errors like these can be found more easily if you set error_reporting to be -1 at development time.

Thanks
Tim
Reply
03-24-2014, 12:59 AM,
#7
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Hi, Tim,

Thank you for your review.

It's fixed now.

Best regards!

Exson
Reply
03-28-2014, 05:40 AM,
#8
RE: Items Other than those in BOM are not listed in Status of Work Order even if issued
Conceptually I would think that if we issue something to a W/O that is not in the worequirements table then we should create the worequirements record with qtypu = 0 so that everything required and or issued is in 1 table.
Is there a reason doing this would not be warranted? It would simplify many queries and reports downstream is a company often uses substitute items in their processes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)