I do not quite understand why the alternative item functionality is only available for sales not for production. Consider the following scenario: Cream typically is bought in small volumes at around $3.00 per KG. A large order of a special product might allow us to buy larger volumes at say $2.00 per KG. The price of the standard cream should not be change for the costing of standard jobs because when the large job ceases, the small jobs need to pay for themselves.
An easy solution would be the use of an alternative item with an independent price, but of course the the two items can be used interchangeably on the shopfloor.
A small mod in one of the ProdUpd… classes (e.g. ProdUpdStartup.updateBOMConsumption()) activates alternative items for production. It functions by checking the availablility of the BOMItems when starting the job. Depending on the configuration it might be more appropriatly placed in another of ther ProdUpd… classes.
void updateBOMConsumption()
{
[…]
{
[…]
Container c; //bw
ItemId altItemId; //bw
ItemId altItemId; //bw
InventDim altInventDim; //bw
;
[…]
while(loop)
{
prodBOM = recListProdBOM.peek();
{
prodBOM = recListProdBOM.peek();
if(!prodBOM.RecId)
{
loop = recListProdBOM.next();
continue;
}
{
loop = recListProdBOM.next();
continue;
}
prodBOM.selectForUpdate(true);
//bw start
//Changed on 30 Apr 2007 by TW
/* Description:
Allow for alternative ingredients
*/
//only if not yet consumed and no specific dimension has been assigned
//bw start
//Changed on 30 Apr 2007 by TW
/* Description:
Allow for alternative ingredients
*/
//only if not yet consumed and no specific dimension has been assigned
if(prodBOM.QtyInventCalc == prodBOM.RemainInventPhysical
&& (!prodBom.InventDimId || prodBom.InventDimId == InventDim::inventDimIdBlank()))
{
// use standard method to find an alternative item for the desired qty.
// use standard method to find an alternative item for the desired qty.
c = InventTable::findAlternativeItem(prodBom.ItemId,prodBom.InventDim(),prodBom.QtyInventCalc);
if (c)
{
altItemId = conpeek(c,1);
altInventDim = conpeek(c,2);
prodBom.ItemId = altItemId;
if (altInventDim)
prodBom.InventDimId = altInventDim.inventDimId;
else
prodBom.InventDimId = InventDim::inventDimIdBlank();
}
}
//bw end
if (c)
{
altItemId = conpeek(c,1);
altInventDim = conpeek(c,2);
prodBom.ItemId = altItemId;
if (altInventDim)
prodBom.InventDimId = altInventDim.inventDimId;
else
prodBom.InventDimId = InventDim::inventDimIdBlank();
}
}
//bw end
prodBOMCalc = ProdBOMCalc::newBOMCalcData(BOMCalcData,
prodBOM,
consumpProposal,
prodParmStartUp.BOMAutoConsump,
!prodBOM.ConstantReleased,
NoYes::No,
true);
[…]
prodBOM,
consumpProposal,
prodParmStartUp.BOMAutoConsump,
!prodBOM.ConstantReleased,
NoYes::No,
true);
[…]
}

Leave a Reply to Thomas Widmer Cancel reply