Index: EWMS/Inventory.cls.xml
===================================================================
diff -u -r8070 -r12384
--- EWMS/Inventory.cls.xml (.../Inventory.cls.xml) (revision 8070)
+++ EWMS/Inventory.cls.xml (.../Inventory.cls.xml) (revision 12384)
@@ -512,6 +512,7 @@
If InventoryID="" Do ;Opgegeven Pallet met Sectie bestaat NIET, maak een nieuwe aan: *** CREATE ***
. If '##class(EWMS.Inventory).New(LocID,Sectie,Product,,,,.InventoryID,SQLGCWrapper) Do Quit
.. Set Status=$LB(-3,"Kan geen nieuw Inventory object aanmaken (LocID: "_LocID_", Sectie: "_Sectie_", Product: "_Product_").")
+ . Do WLIP^vhDBG(127,"EWMS.Inventory : Before %OpenId("_InventoryID_")")
. Set InventoryObj=##class(EWMS.Inventory).%OpenId(InventoryID)
. If InventoryObj=$$$NULLOREF Do Quit
.. Set Status=$LB(-5,"Kan zonet gecreƫerd Inventory object met ID '"_InventoryID_"' niet openen.")
@@ -732,29 +733,42 @@
"insert_time,loc_m,qty_pcs,qty_in_box,qty_res,qty_block,reason_block,reservator,exp_day,last_cycle_count,pcs_vol,pcs_weight,pcs_price,box_vol,box_weight,box_price,is_full) VALUES "_
"(?,?,?,?,?,?,0,0,0,0,0,'','','','','','','','','','',0,0,0,0,0,0,0,0,0,0,?,0,0,0,0,0,'',0,'0000-00-00-00.00.00.000000','0000-00-00-00.00.00.000000',0,0,0,0,0,0,0)"
- //Prepare SQL
- Quit:('SQLGCWrapper.Prepare(SQL)) 0
+ If 'SQLGCWrapper.Prepare(SQL) Do Quit 0
+ . Do ..LogError("New","Prepare niet gelukt.")
- //Decribe parameters, worden dan gebruikt bij Bind ParametersSQLGCWrapper..
- Quit:('SQLGCWrapper.DescribeParameters()) 0
+ If 'SQLGCWrapper.DescribeParameters() Do Quit 0
+ . Do ..LogError("New","DescribeParameters niet gelukt.")
- //Bind Parameters
- Quit:('SQLGCWrapper.BindParameters()) 0
+ If 'SQLGCWrapper.BindParameters() Do Quit 0
+ . Do ..LogError("New","BindParameters niet gelukt.")
- //Parameters invullen
- Quit:('SQLGCWrapper.SetParameter(1,LocID)) 0
- Quit:('SQLGCWrapper.SetParameter(2,Sectie)) 0
- Quit:('SQLGCWrapper.SetParameter(3,ProductNr)) 0
- Quit:('SQLGCWrapper.SetParameter(4,Batch)) 0
- Quit:('SQLGCWrapper.SetParameter(5,Quality)) 0
- Quit:('SQLGCWrapper.SetParameter(6,Owner)) 0
- Quit:('SQLGCWrapper.SetParameter(7,$$GetEWMSInsertTime^vhLib())) 0
- //Execute SQL
- Quit:('SQLGCWrapper.Execute()) 0
+ If 'SQLGCWrapper.SetParameter(1,LocID) Do Quit 0
+ . Do ..LogError("New","SetParameter 1 niet gelukt.")
+
+ If 'SQLGCWrapper.SetParameter(2,Sectie) Do Quit 0
+ . Do ..LogError("New","SetParameter 2 niet gelukt.")
+
+ If 'SQLGCWrapper.SetParameter(3,ProductNr) Do Quit 0
+ . Do ..LogError("New","SetParameter 3 niet gelukt.")
+
+ If 'SQLGCWrapper.SetParameter(4,Batch) Do Quit 0
+ . Do ..LogError("New","SetParameter 4 niet gelukt.")
+
+ If 'SQLGCWrapper.SetParameter(5,Quality) Do Quit 0
+ . Do ..LogError("New","SetParameter 5 niet gelukt.")
+
+ If 'SQLGCWrapper.SetParameter(6,Owner) Do Quit 0
+ . Do ..LogError("New","SetParameter 6 niet gelukt.")
+
+ If 'SQLGCWrapper.SetParameter(7,$$GetEWMSInsertTime^vhLib()) Do Quit 0
+ . Do ..LogError("New","SetParameter 7 niet gelukt.")
- //UnBind Params
- Quit:('SQLGCWrapper.UnBindParameters()) 0
+ If 'SQLGCWrapper.Execute() Do Quit 0
+ . Do ..LogError("New","Execute niet gelukt.")
+
+ If 'SQLGCWrapper.UnBindParameters() Do Quit 0
+ . Do ..LogError("New","UnBindParameters niet gelukt.")
//ID teruggeven
Set:($D(CreatedID)) CreatedID=##class(EWMS.Inventory).ComposeID(LocID,Sectie,ProductNr,Batch,Quality,Owner)
@@ -764,6 +778,18 @@
]]>
+
+1
+Method:%String,Melding:%String
+1
+
+
+
1
code
Index: BL/MB/UGLYPicking/ReceptieProductie.cls.xml
===================================================================
diff -u -r8305 -r12384
--- BL/MB/UGLYPicking/ReceptieProductie.cls.xml (.../ReceptieProductie.cls.xml) (revision 8305)
+++ BL/MB/UGLYPicking/ReceptieProductie.cls.xml (.../ReceptieProductie.cls.xml) (revision 12384)
@@ -989,13 +989,30 @@
. ;het toch een 'nieuwe' pallet worden, in tegenstelling tot wat de variabele eerst bevatte (anders
. ;waren we nooit in deze 'else' lus beland)
. Set Result=##class(BL.MB.UGLYPicking.General).CompleteLocationViaPalletID(.lbLocation,PalletID,.IsNewPallet,1)
- . D WLIP^vhDBG(127,"CompleteLocationViaPalletID("_$$LCVT^vhLib(lbLocation)_","_$g(PalletID)_",,1) = '"_Result_"'")
- . Do:(IsNewPallet) AddToEndOfLog("verwijderen (consolidatie): ")
+ . Do AddToLog("CompleteLocationViaPalletID("_$$LCVT^vhLib(lbLocation)_","_$g(PalletID)_",,1) = '"_Result_"'")
+ . Do:(IsNewPallet) AddToLog("verwijderen (consolidatie): ")
+
+ New VerwijderQuery,SelectQueryInventory,AantalRecords,AantalProducten
+ If Result = "?" {
+ Do AddToLog("Result = '?' dus is niet goed gecreeerd inventory object.")
+ Set SelectQueryInventory = "SELECT COUNT(1) As AantalRecords, SUM(qty_pcs) As AantalProducten FROM EWMS.Inventory where loc_id = ?"
+ Set RS = $$ExecDynQuery^vhQUERYLIB(SelectQueryInventory,$LB(PalletID))
+ While RS.Next() {
+ Set AantalRecords = RS.Data("AantalRecords")
+ Set AantalProducten = RS.Data("AantalProducten")
+ Do AddToLog("Voor Inventory met loc_id '"_PalletID_"' zijn gevonden : AantalProducten : "_AantalProducten_", AantalRecords : "_AantalRecords)
+ If (AantalRecords = 1) && ((AantalProducten = 0)||(AantalProducten = "0.0") ) {
+ Do AddToLog("Verwijder slecht gecreƫerd inventory object met loc_id : "_PalletID)
+ Set VerwijderQuery = "DELETE FROM EWMS.Inventory where loc_id = ?"
+ Do ExecDynQuery^vhQUERYLIB(VerwijderQuery,$LB(PalletID))
+
+ Do AddToLog("U moet de buffer een tweede keer doorsturen.")
+ }
+ }
+ }
If Result="" Do
- . D WLIP^vhDBG(127,"OK")
. Do AddToEndOfLog("Ok.")
Else Do Quit $LB(-1,Result)
- . D WLIP^vhDBG(127,"ERROR")
. Do AddToEndOfLog("ERROR.")
; COMMIT ADD STOCK (HistoryRemark=TLNr)