CREATE AND PRODUCTION ROUTE JOURNAL USING PRODUCTION ORDER
static void createRouteCardJournalSample(Args _args)
{
ProdJournalTable prodJournalTable;
ProdJournalRoute prodJournalRoute;
ProdRoute prodRoute;
ProdId prodId = 'PO001';
OprNum oprNum = 20;
RouteOprId routeOprId;
ProdJournalCheckPostRoute prodJournalCheckPostRoute;
select firstonly prodRoute
where prodRoute.ProdId == prodId && prodRoute.OprNum == oprNum;
prodJournalTable.clear();
prodJournalTable.initValue();
prodJournalTable.JournalType = prodjournaltype::RouteCard;
prodJournalTable.ProdId = prodId;
prodJournalTable.JournalNameId = ProdParametersDim::findDefault().RouteJournalNameId;
prodJournalTable.Description = ProdJournalName::find(prodJournalTable.JournalNameId).Description;
prodJournalTable.VoucherSeqRecId = ProdJournalName::find(prodJournalTable.JournalNameId).VoucherSeqRecId;
prodJournalTable.VoucherDraw = journalVoucherDraw::Post;
prodJournalTable.NumOfLines = 1;
prodJournalTable.insert();
//Route card entry
prodJournalRoute.clear();
prodJournalRoute.JournalId = prodJournalTable.journalId;
prodJournalRoute.ProdId = prodId;
prodJournalRoute.initValue();
prodJournalRoute.OprNum = oprNum;
prodJournalRoute.OprId = prodRoute.OprId;
prodJournalRoute.JobType = RouteJobType::Process;
prodJournalRoute.CategoryHoursId = prodRoute.SetUpCategoryId;
prodJournalRoute.CategoryQtyId = prodRoute.ProcessCategoryId;
prodJournalRoute.DefaultDimension = prodRoute.DefaultDimension;
prodJournalRoute.WrkCtrId = prodRoute.WrkCtrIdCost;
prodJournalRoute.QtyGood = 2;
prodJournalRoute.Hours = 1;
prodJournalRoute.insert();
info(prodJournalTable.JournalId);
ProdJournalCheckPostRoute = ProdJournalCheckPostRoute::newPostJournal(prodJournalRoute.journalId,true);
ProdJournalCheckPostRoute.run();
}
No comments:
Post a Comment