Index: BL/MB/UGLYPicking/OrderReservatie.cls.xml
===================================================================
diff -u -r7693 -r57947
--- BL/MB/UGLYPicking/OrderReservatie.cls.xml (.../OrderReservatie.cls.xml) (revision 7693)
+++ BL/MB/UGLYPicking/OrderReservatie.cls.xml (.../OrderReservatie.cls.xml) (revision 57947)
@@ -385,7 +385,7 @@
1
-ProdNr:%Library.Integer
+ProdNr:%Library.Integer,ConsolidatiePalletten:%ListOfDataTypes=##class(%ListOfDataTypes).%New()
cache
0
%Library.Status
@@ -394,19 +394,19 @@
=2) and (Loc.loc_m<=4) AND NOT (Loc.loc_m = 4 AND Loc.loc_g = 2 and Loc.loc_x = 1 and Loc.loc_y = 1)
- ORDER BY loc.loc_m asc,is_full DESC,qty_pcs,Inv.insert_time)
- ; AND (Loc.loc_m>=2) and (Loc.loc_m<=4) bijgevoegd door PV 14-5
- ; ORDER BY loc.loc_m asc bijgevoegd door PV 25-08-08
+ SELECT Inv.insert_time,is_full,Inv.loc_id,Inv.loc_m,qty_pcs,qty_res,sectie,Loc.loc_m,Loc.loc_g,loc.loc_x,loc.loc_y,loc.loc_z,state,inv.batch,quality,owner,Trans.loc_ispickbaar
+ INTO InsertTime,IsFull,LocID,LocM,QtyPcs,QtyRes,Sectie,LLocM,LocG,LocX,LocY,LocZ,State,Batch,Quality,Owner,IsPickbaar
+ FROM EWMS.Inventory Inv
+ JOIN EWMS.Locations Loc ON Inv.loc_id = Loc.loc_id
+ LEFT JOIN EWMS.TransLoc Trans ON Trans.loc_m = Loc.loc_m AND Trans.loc_g = Loc.loc_g AND Trans.loc_x = Loc.loc_x AND Trans.loc_y = Loc.loc_y
+ WHERE product = :ProdNr AND Inv.loc_m < 5 AND NOT (Loc.loc_m = 4 AND Loc.loc_g = 2 and Loc.loc_x = 1 and Loc.loc_y = 1)
+ ORDER BY Trans.loc_ispickbaar DESC , Inv.Is_Full ASC ,Inv.Insert_Time ASC )
&sql(OPEN crPPP)
Quit:((SQLCODE<0) || ($L($G(%msg)))) $$$ERROR($$$GeneralError,%msg) //ERROR? -> Quit+return status
@@ -416,11 +416,16 @@
New locMagazijn,PLNode,InsertDate
Kill PalletGroup,PalletGroupCnt
For &sql(FETCH crPPP) Quit:(SQLCODE || FatalErr) Do
+ . Set:IsPickbaar InsertTime="2000-01-01"
. Quit:(+QtyRes'<+QtyPcs) //Alles is gereserveerd?->Quit pallet!, Reservatie>AantalAanwezig->Quit
. Quit:(+QtyPcs'>0) //Geen Pieces meer->Quit pallet!
. Set:((SQLCODE<0) || ($L($G(%msg)))) FatalErr=1 //Foutje?
. Quit:(##class(Prod.Product).GetMagViaOpslagzone(LocM)="CONS")
. Quit:($D(IDList(LocID))) //Vermijden van dubbels...
+ . ;JWI hier checken in ConsolidatiePalletten -> quit indien niet.
+ . $$$WriteToLog("filtering " _ LocID)
+ . Quit:(ConsolidatiePalletten.Count() && 'ConsolidatiePalletten.Find(LocID)) // overslaan indien niet in de DnaCodeTabel en DnaCodeTabel matches opleverde
+ . $$$WriteToLog(" behouden")
. Set IDList(LocID)="" //Lijst bijhouden van Ids
. Set locMagazijn=##class(Prod.Product).GetMagViaOpslagzone(LLocM)
. Set InsertDate=$ZDATEH($E(InsertTime,1,10),3)
@@ -575,9 +580,43 @@
]]>
+
+1
+ConsolidatieNr:%String
+%ListOfDataTypes
+
+
+
1
-ConsolidatieNr:%Library.Integer,Magazijn:%Library.String,ProductNr:%Library.String,AantalTePicken:%Library.Integer,AssociatedZeroPalletID:Flow.OrderWMS.PalletReservatie
+ConsolidatieNr:%Library.Integer,Magazijn:%Library.String,ProductNr:%Library.String,AantalTePicken:%Library.Integer,AssociatedZeroPalletID:Flow.OrderWMS.PalletReservatie,ConsolidatiePalletten:%ListOfDataTypes=##class(%ListOfDataTypes).%New()
cache
0
%Library.String
@@ -595,11 +634,11 @@
Set MAXReserveCount=5
For Quit:(ReserveSuccess || (ReserveCount=MAXReserveCount) || (tmpResult'="")) Do
- . Set tmpResult=..FPalletsPerProdNr(ProductNr) //Creatie PalletList met palletten bevattende product (met ProductNr)
+ . Set tmpResult=..FPalletsPerProdNr(ProductNr,ConsolidatiePalletten) //Creatie PalletList met palletten bevattende product (met ProductNr)
. If $$$ISERR(tmpResult) Do Quit
- .. Set tmpResult=$$ParseStatus^vhLib(tmpResult)
+ . . Set tmpResult=$$ParseStatus^vhLib(tmpResult)
. Else Do
- .. Set tmpResult=""
+ . . Set tmpResult=""
. Kill BookedPallets //BookedPallets: hier komen alle palletten die geboekt moeten worden
. Set tmpResult=$$EnumReserve(AantalTePicken,.Rest)
. If $$$ISERR(tmpResult) Do Quit
@@ -700,6 +739,9 @@
New ProdLoop,tmpStatus,AantalTePicken,ZeroPalletID,ErrorOccured
#Define tmpAantalTePicken 1
#Define tmpZeroPalletID 2
+ ; Bepaal mogelijke palleten via EWPAL, picking producten van de juiste order
+ New ConsolidatiePalletten
+ Set ConsolidatiePalletten = ..GeefPallettenVoorConsolidatie(ConsNr)
Set ProdLoop="", ErrorOccured=0
For Set ProdLoop=$O(ZeroPallets(ProdLoop)) Quit:(ProdLoop="") Do
@@ -709,13 +751,19 @@
. Set AantalTePicken=$LI(ZeroPallets(ProdLoop),$$$tmpAantalTePicken)
. Quit:(AantalTePicken=0)
. Set ZeroPalletID=$LI(ZeroPallets(ProdLoop),$$$tmpZeroPalletID)
- . Set tmpStatus=..FStartReservePallets(ConsNr,Magazijn,ProdLoop,AantalTePicken,ZeroPalletID)
+ . Set tmpStatus=..FStartReservePallets(ConsNr,Magazijn,ProdLoop,AantalTePicken,ZeroPalletID,ConsolidatiePalletten)
. If tmpStatus'="" Do //Indien '="" is er een fout opgetreden
- .. Set ErrorOccured=1
- .. $$$WriteToLog("ERROR: "_tmpStatus)
- .. Do ##class(Flow.OrderWMS.PalletReservatie).SetReservationIsDone(ConsNr,Magazijn,ProdLoop,0,tmpStatus)
+ . . $$$WriteToLog("################### reservatie niet gelukt met info uit EWPAL, fallback hier nodig ########################")
+ . . Set tmpStatus=..FStartReservePallets(ConsNr,Magazijn,ProdLoop,AantalTePicken,ZeroPalletID) ; om fallback te activeren, laatste parameter laten defaulten.
+ . . If tmpStatus'="" Do //Indien '="" is er een fout opgetreden
+ . . . $$$WriteToLog("################### fallback ook mislukt ########################")
+ . . . Set ErrorOccured=1
+ . . . $$$WriteToLog("ERROR: "_tmpStatus)
+ . . . Do ##class(Flow.OrderWMS.PalletReservatie).SetReservationIsDone(ConsNr,Magazijn,ProdLoop,0,tmpStatus)
+ . . Else Do
+ . . . Do ##class(Flow.OrderWMS.PalletReservatie).SetReservationIsDone(ConsNr,Magazijn,ProdLoop,1) //Reservation=OK
. Else Do
- .. Do ##class(Flow.OrderWMS.PalletReservatie).SetReservationIsDone(ConsNr,Magazijn,ProdLoop,1) //Reservation=OK
+ . . Do ##class(Flow.OrderWMS.PalletReservatie).SetReservationIsDone(ConsNr,Magazijn,ProdLoop,1) //Reservation=OK
$$$WriteToLog("ProcessUnFinishedZeroPalletIDs "_$S(ErrorOccured:"failed",1:"success")_".")