public void FinishPreOprDiggEnterprinor(ProdId _prodId, OprNum _oprNum, ProdParmReportFinished _prodParmReportFinished)
{
ProdParmReportFinished prodParmReportFinishedLoc;
select prodRoute where prodRoute.ProdId == _prodId &&
prodRoute.OprNum == _oprNum;
prodParmReportFinishedLoc.clear();
prodParmReportFinishedLoc.initValue();
prodParmReportFinishedLoc.initFromProdTable(ProdTable::find(_prodParmReportFinished.ProdId));
prodParmReportFinishedLoc.FromOprNum = _oprNum;
prodParmReportFinishedLoc.ToOprNum = _oprNum;
prodParmReportFinishedLoc.AcceptError = _prodParmReportFinished.AcceptError;
prodParmReportFinishedLoc.EndRouteCard = _prodParmReportFinished.EndRouteCard;
prodParmReportFinishedLoc.EndJob = _prodParmReportFinished.EndJob;
prodParmReportFinishedLoc.AutoUpdate = _prodParmReportFinished.AutoUpdate;
prodParmReportFinishedLoc.BOMJournalNameId = _prodParmReportFinished.BOMJournalNameId;
prodParmReportFinishedLoc.BOMAutoConsump = _prodParmReportFinished.BOMAutoConsump;
prodParmReportFinishedLoc.ExecutedDateTime = DateTimeUtil::getSystemDateTime();
prodParmReportFinishedLoc.JobStatus = ParmJobStatus::Executed;
prodParmReportFinishedLoc.JournalShowInfo = _prodParmReportFinished.JournalShowInfo;
prodParmReportFinishedLoc.LineNum = 1;
prodParmReportFinishedLoc.ParmId = _prodParmReportFinished.ParmId;
prodParmReportFinishedLoc.QtyGood = _prodParmReportFinished.QtyGood;
prodParmReportFinishedLoc.QtyError = _prodParmReportFinished.QtyError;
prodParmReportFinishedLoc.TransDate = _prodParmReportFinished.TransDate;
prodParmReportFinishedLoc.ProdJournalNameId = _prodParmReportFinished.ProdJournalNameId;
prodParmReportFinishedLoc.RouteJournalNameId = _prodParmReportFinished.RouteJournalNameId;
prodParmReportFinishedLoc.insert();
prodJournalCreate = ProdJournalCreateRoute::newReportFinished(_prodParmReportFinished);
prodJournalCreate.parmOprNumFrom(_oprNum);
prodJournalCreate.parmOprNumTo(_oprNum);
prodJournalCreate.run();
prodJournalTable = prodJournalCreate.usedProdJournalTable();
if (prodJournalTable.RecId && prodJournalTable.JournalId)
{
prodJournalCheckPostRoute = ProdJournalCheckPostRoute::newPostJournal(prodJournalTable.JournalId,_prodParmReportFinished.JournalShowInfo);
prodJournalCheckPostRoute.run();
}
}
------------------------------------------------------------
static void main(Args _args)
{
TDCFinishPreOperation tDCFinishPreOperation = new TDCFinishPreOperation();
ProdParmReportFinished parmReportFinished;
if (_args.dataset() == tableNum(ProdParmReportFinished))
{
parmReportFinished = _args.record();
}
tDCFinishPreOperation.ParmProdParmReportFinished(parmReportFinished);
tDCFinishPreOperation.run();
}
{
ProdParmReportFinished prodParmReportFinishedLoc;
select prodRoute where prodRoute.ProdId == _prodId &&
prodRoute.OprNum == _oprNum;
prodParmReportFinishedLoc.clear();
prodParmReportFinishedLoc.initValue();
prodParmReportFinishedLoc.initFromProdTable(ProdTable::find(_prodParmReportFinished.ProdId));
prodParmReportFinishedLoc.FromOprNum = _oprNum;
prodParmReportFinishedLoc.ToOprNum = _oprNum;
prodParmReportFinishedLoc.AcceptError = _prodParmReportFinished.AcceptError;
prodParmReportFinishedLoc.EndRouteCard = _prodParmReportFinished.EndRouteCard;
prodParmReportFinishedLoc.EndJob = _prodParmReportFinished.EndJob;
prodParmReportFinishedLoc.AutoUpdate = _prodParmReportFinished.AutoUpdate;
prodParmReportFinishedLoc.BOMJournalNameId = _prodParmReportFinished.BOMJournalNameId;
prodParmReportFinishedLoc.BOMAutoConsump = _prodParmReportFinished.BOMAutoConsump;
prodParmReportFinishedLoc.ExecutedDateTime = DateTimeUtil::getSystemDateTime();
prodParmReportFinishedLoc.JobStatus = ParmJobStatus::Executed;
prodParmReportFinishedLoc.JournalShowInfo = _prodParmReportFinished.JournalShowInfo;
prodParmReportFinishedLoc.LineNum = 1;
prodParmReportFinishedLoc.ParmId = _prodParmReportFinished.ParmId;
prodParmReportFinishedLoc.QtyGood = _prodParmReportFinished.QtyGood;
prodParmReportFinishedLoc.QtyError = _prodParmReportFinished.QtyError;
prodParmReportFinishedLoc.TransDate = _prodParmReportFinished.TransDate;
prodParmReportFinishedLoc.ProdJournalNameId = _prodParmReportFinished.ProdJournalNameId;
prodParmReportFinishedLoc.RouteJournalNameId = _prodParmReportFinished.RouteJournalNameId;
prodParmReportFinishedLoc.insert();
prodJournalCreate = ProdJournalCreateRoute::newReportFinished(_prodParmReportFinished);
prodJournalCreate.parmOprNumFrom(_oprNum);
prodJournalCreate.parmOprNumTo(_oprNum);
prodJournalCreate.run();
prodJournalTable = prodJournalCreate.usedProdJournalTable();
if (prodJournalTable.RecId && prodJournalTable.JournalId)
{
prodJournalCheckPostRoute = ProdJournalCheckPostRoute::newPostJournal(prodJournalTable.JournalId,_prodParmReportFinished.JournalShowInfo);
prodJournalCheckPostRoute.run();
}
}
------------------------------------------------------------
static void main(Args _args)
{
TDCFinishPreOperation tDCFinishPreOperation = new TDCFinishPreOperation();
ProdParmReportFinished parmReportFinished;
if (_args.dataset() == tableNum(ProdParmReportFinished))
{
parmReportFinished = _args.record();
}
tDCFinishPreOperation.ParmProdParmReportFinished(parmReportFinished);
tDCFinishPreOperation.run();
}
No comments:
Post a Comment