Production Process Steering - Tandembox
Genereert van een Toelevering de verpakkingsdefinitie
Prod.Product,BL.Prod.OptiBox,BL.PPS.TBX.Common,BL.Sys.Toegang,BL.Sys.Proxy
1
%RegisteredObject
4451
reverse order voor de kasten dit om het laden van de vrachtwagen in de juiste sequentie te brengen
-1
%String
%Boolean
%String
1
Debug
BatchID,ProdGrp
1
BatchID:%String
TECH.Iterator
s bl=##class(BL.PPS.TBX.Sequencer).Instantiate() d bl.Init(2168),bl.BldLeanV1SequenceNew() ]]>
TOENr
Set Sequence=0
Set ToeVolgNr=""
Set QtyLade=0
For BatchSeq=1:1:$LL(lbTOENrs) Do
. Kill Sort
. Set TOENr=$LI(lbTOENrs,BatchSeq)
. Set KLNr=$P($G(^KTO($$$LevHalux,TOENr,1)),"\",8)
. Set TLNr=100
. For Set TLNr=$O(^KTO($$$LevHalux,TOENr,TLNr)) Quit:TLNr="" Do
. . Set LRec=$G(^KTO($$$LevHalux,TOENr,TLNr))
. . Set TLUNr=$P(LRec,D,15)
. . Set PRNr=$P(LRec,D,2)
. . Quit:$P(LRec,D,3)<1
. . Quit:PRNr'?4.7N
. . Set SortKey=..SequenceKey(PRNr,TOENr,TLUNr)
. . Quit:SortKey=""
. . Quit:'ProductAPI.GeefProduct(PRNr).%Extends("DOM.PM.TBXProduct.TBXLade")
. . Set SortKey=SortKey_"-"_TOENr_"-"_TLUNr
. . Set $P(LRec,D)=TLUNr
. . Set Sort(SortKey)=LRec
.
. Set SortKey=""
. For Set SortKey=$O(Sort(SortKey),1) Quit:SortKey="" Do
. . Set LRec=Sort(SortKey)
. . Set Qty=$P(LRec,D,3)
. . Set PRNr=$P(LRec,D,2)
. . Quit:PRNr'?4.7N
. . Set TLUNr=$P(LRec,D,1)
. . For I=1:1:Qty Do
. . . Set oQ=##class(DS.PPS.TBX.Queue).%New()
. . . Do oQ.ProductSetObjectId(PRNr)
. . . Do oQ.KlantSetObjectId(KLNr)
. . . Set oQ.TOENr=TOENr
. . . Set oQ.TLUNr=TLUNr
. . . Set oQ.DOSNr=$P(^KPR(PRNr,"G"),D) ; Dossier
. . . Set oQ.Sequence=$I(Sequence)
. . . Set oQ.TotaalAantal=Qty
. . . Set oQ.DeelAantal=I
. . . Set oQ.BatchID=..BatchID
. . . Set oQ.Status=$$$tsWachtend
. . . Set oQ.WPVerpak=##class(BL.PPS.WPVerpak).Create(KLNr,TOENr,TLUNr,PRNr,Qty)
. . . Set oQ.WPLosOnderdeel=##class(BL.PPS.WPLosOnderdeel).Create(KLNr,TOENr,TLUNr,PRNr,Qty)
. . . Set oQ.WPPers=##class(WPPers).Create(KLNr,TOENr,TLUNr,PRNr,Qty)
. . . Set Status=oQ.%Save()
. . . Set QtyLade=QtyLade+1
. . If Status=$$$OK Set X=##class(BL.Legacy.HaluxProductieOpvolging).MARKPR(##class(BL.Legacy.HaluxProductieOpvolging).FABKEYT(TOENr,TLUNr),"B",Qty,Qty,$H) ; HADPR invullen met status "B"
set blPrebuild=##class(BL.PPS.TBX.Prebuild).Instantiate()
Do blPrebuild.Init(..BatchID)
]]>
1
PRNr,TOENr,TLUNr
Spoelbak of Syfon
PRNr
1
s bl=##class(BL.PPS.TBX.Sequencer).Instantiate() d bl.Init(4301),bl.BldProPlusSequence()]]>
0
TOENrs
Kill arFabKeys
Set blOptiVHoss=##class(BL.PPS.TBX.OptiVHoss).Instantiate()
Do blOptiVHoss.Init(lbTOENrs,..ProdGrp)
Do blOptiVHoss.OptimizeStorage() ; zoveel mogelijk in een kast
Do blOptiVHoss.SubOptimizeProduction(..VHOSSOrder()) ; productie : groeperen van gelijkaardige laden
Do blOptiVHoss.InitLoop(.lbIndex)
For Do blOptiVHoss.NextLoop(.lbIndex) Quit:lbIndex="" Do
. Do blOptiVHoss.GetLoop(lbIndex, .PRNr, .FabKey, .VHossNr, .Zijkant, .SlotLabel, .KlantSort, .ProductieSort)
. Set oQ=##class(DS.PPS.TBX.Queue).%New()
. Do oQ.ProductSetObjectId(PRNr)
. Set oQ.TOENr=$P(FabKey,";",1)
. Set oQ.TLUNr=$P(FabKey,";",2)
. Set KLNr=$P($G(^KTO($$$LevHalux,oQ.TOENr,1)),"\",8) ; klant
. Do oQ.KlantSetObjectId(KLNr)
. Set oQ.DOSNr=$P($G(^KPR(PRNr,"G")),"\",1) ; dossier
. Set oQ.Sequence=ProductieSort
. Do GetAantalViaFabKey(FabKey,.Totaal,.Deel,.arFabKeys)
. Set oQ.TotaalAantal=Totaal
. Set oQ.DeelAantal=Deel
. Set oQ.BatchID=..BatchID
. Set oQ.Status=$$$tsWachtend
. Set oQ.WPVerpak=##class(BL.PPS.WPVerpak).CreateVHoss(KLNr,oQ.TOENr,oQ.TLUNr,PRNr,1,VHossNr,Zijkant,SlotLabel,KlantSort)
. Set oQ.WPPers=##class(WPPers).Create(KLNr,oQ.TOENr,oQ.TLUNr,PRNr,1)
. ;Set oQ.WPZaag=##class(WPZaag).Create(KLNr,TOENr,TLUNr,PRNr,Qty)
. Set Status=oQ.%Save() D:$$$ISERR(Status) WE^vhDBG(Status,"PPSTBX AddBatch")
. Do ##class(APPS.Halux.AAP.DnaCodeService).%New().VulInSequentieId(oQ.Sequence,oQ.BatchID,oQ.TOENr,oQ.TLUNr)
. ; aanpassen HADPR
. If Status=$$$OK,(Deel=1) Set X=##class(BL.Legacy.HaluxProductieOpvolging).MARKPR(##class(BL.Legacy.HaluxProductieOpvolging).FABKEYT(TOENr,TLUNr),"B",Totaal,Totaal,$H) ; HADPR invullen met status "B"
;
Set SkippedTekst=blOptiVHoss.Skipped2Tekst() ; lade met foutieve afmetingen
Do blOptiVHoss.CountSlots(.QtyLade,.QtyEmpty,.QtyVHoss) ; aantal lades en aantal lege vakken
;Do blOptiVHoss.Export()
set blPrebuild=##class(BL.PPS.TBX.Prebuild).Instantiate()
Do blPrebuild.Init(..BatchID)
Do blPrebuild.ChkStock("+")
Quit
GetAantalViaFabKey(FabKey,Totaal,Deel,arFabKeys)
Set (Totaal,Deel)=1
Quit:FabKey=""
If $D(arFabKeys(FabKey)) Do ; volgende
. Set Totaal=$LI(arFabKeys(FabKey))
. Set Deel=$LI(arFabKeys(FabKey),2)+1
Else Do ; eerste keer
. ;ophalen totaal aantal in toelevering via FabKey
. Set TOENr=$P(FabKey,";",1)
. Set TLUNr=$P(FabKey,";",2)
. Set TLNr=$G(^TO("IU",TOENr,TLUNr))
. Set LEVNr=$P($G(^KTO1(TOENr)),"\")
. Set:LEVNr&TLNr Totaal=$P(^KTO(LEVNr,TOENr,TLNr),"\",3)
Set arFabKeys(FabKey)=$LB(Totaal,Deel)
Quit
]]>
Find the production orders in a Batch
Checks the existance of a batch in the sequence
%Boolean
0)
;Set pxUnits=##class(BL.PPS.TBX.sub.pxVHossUnits).%New()
;Set rs=##class(%ResultSet).%New("BL.PPS.TBX.Sequencer:GetSequence")
;Set sc=rs.Execute(..BatchID)
;For Quit:'rs.Next() Do Quit
;. Set Result=1
;Quit $G(Result)
]]>
Do ##class(BL.PPS.TBX.Sequencer).Instantiate(Id).DeleteBatch()]]>
Delete inactive Batches that are older than one month
%SQLQuery
BatchID
Select ID, Product, WPVerpak_KlantSort as KlantSort,WPVerpak_UnitNr as UnitNr,WPVerpak_SubNr as SubNr,WPVerpak_SlotNr as SlotNr, Sequence,Status
from PPS.TBX_Queue
where BatchID=:BatchID
order by SorteerSleutel,Sequence
%SQLQuery
Datum
Select ID
from PPS.TBX_Queue
where WPPers_FirstChanged like :Datum
order by SorteerSleutel,Sequence
%SQLQuery
BatchID
Select ID, Product, WPVerpak_KlantSort as KlantSort,WPVerpak_UnitNr as UnitNr,WPVerpak_SubNr as SubNr,WPVerpak_SlotNr as SlotNr, Sequence,Status
from PPS.TBX_Queue
where BatchID=:BatchID
order by KlantSort
TOENr