So I see here:
http://www.weberp.org/forum/showthread.p...t=overhead
Phil states: "...so setting up an item for each type of labour or department/cost centre."
This seems to imply that Overhead might be addressed as a BoM item as Labour is addressed as a BoM Item. That makes sense to me as it would add Overhead to the item cost via costed BoM and we would have GL accounts to manage the same. However, if this is the case should we not remove or disable input for Labour and Overhead so these items work properly with Work Orders? Seems to me Labour and Overhead Std Cost inputs for "M" items are in conflict with the design and use of the Work Orders feature.
Do any of you have a sample Stock Category you are using for Overhead I can use as a guideline?
Also confusing to me...
In WorkOrderReceive.php we are checking current Std Cost (using Labour and Overhead) against WO costs and adjusting inventory to suit (i.e., Cost roll on release of WO...) but we still end up with mismatched reports. Perhaps this was simply overlooked?
Okay... So after creating a new Stock Category of type Labor and assigning GL codes for overhead I see all works as expected.
It seems this entire time I was thrown off by the Labour and Overhead Std Cost inputs for "M" items as well as the code in WorkOrderReceive.php that checks current Std Cost (using Labour and Overhead) against WO cost.
So correct me if I am wrong but this brings me to these conclusions:
1 - No Labour nor Overhead Std Cost inputs for "M" items used with Work Orders?
2 - No need to check current Std Cost (using Labour and Overhead) vs. WO cost?
<OR>
3 - Work Labour and Overhead costs in to the Work Orders so the GL balances?
Below are the lines of code that had me very confused and led me to believe Labour and Overhead Std Cost inputs were in scope for Work Orders:
PHP Code:
//if GL linked then do the GL entries to DR stock and CR invadj
if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($ItemCostRow['labourcost'] + $ItemCostRow['overheadcost'])!=0){
$WOIssueNo = GetNextTransNo(28, $db);
$PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db);
if ($ItemCostRow['labourcost']!=0 AND $ItemCostRow['overheadcost']!=0){
$Description = _('Labour+Overhead');
} elseif($ItemCostRow['overhead']!=0){
$Description = _('Overhead');
} else {
$Description = _('Labour');
}
$Description = $Description . _('cost') . ' x ' . $WORow['qtyreqd'] . ' @ ' . ($ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']);
$SQL = "INSERT INTO gltrans (type,
typeno,
trandate,
periodno,
account,
narrative,
amount)
VALUES (28,
'" . $WOIssueNo . "',
'" . Date('Y-m-d') . "',
'" . $PeriodNo . "',
'" . $StockGLCode['adjglact'] . "',
'" . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' -> ' . $Description . "',
'" . -($WORow['qtyreqd'] * ($ItemCostRow['labourcost'] + $ItemCostRow['overheadcost'])) . "')";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the stock cost adjustment posting could not be inserted because');
$DbgMsg = _('The following SQL to insert the WO issue GLTrans record was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
$SQL = "INSERT INTO gltrans (type,
typeno,
trandate,
periodno,
account,
narrative,
amount)
VALUES (28,
'" . $WOIssueNo . "',
'" . Date('Y-m-d') . "',
'" . $PeriodNo . "',
'" . $StockGLCode['stockact'] . "',
'" . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' -> ' . $Description . "',
'" . ($WORow['qtyreqd'] * ($ItemCostRow['labourcost'] + $ItemCostRow['overheadcost'])) . "')";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for the stock cost adjustment posting could not be inserted because');
$DbgMsg = _('The following SQL to insert the WO issue GLTrans record was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);