Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. Private Sub FctProcessProducts()
  2. On Error GoTo errorhandler
  3. '
  4. Dim recBuffer As New ADODB.recordSet
  5. Dim strSqlBuffer As String
  6. Dim strStatusboxpicker As String
  7. Dim strProductsNotBrought As String
  8. Dim blnAtLeast1productNotBrought As Boolean
  9. Dim strSqlUpdateLocatie As String
  10. Dim strsqlDelete205 As String
  11.  
  12. '1 x products are being brought
  13. intTobeBrought = fktRecordCounterExtended("select count(*) as Totaal from tblbuffer where statusboxpicker = " & enumBoxpickerStatus.PickRequest & " or statusboxpicker = " & enumBoxpickerStatus.PickInProgress)
  14. lblInformativeText.Caption = GetTxt("UZGentProductsBeingBrought1") & " " & intTobeBrought & " " & GetTxt("UZGentProductsBeingBrought2")
  15. '2 x product could not be delivered
  16. 'TBU UZGentRobot
  17. If gcnExtendedConnection.State = adStateClosed Then
  18. Call FctCreateDBConnection_Extended
  19. End If
  20. strSqlBuffer = "select count(*) as Totaal,Article,Description from tblbuffer where outputchannel =" & gstrMediTech_ChannelOutput & " and statusboxpicker = " & enumBoxpickerStatus.PickNotInBoxpicker & " group by article, Description"
  21. recBuffer.Open strSqlBuffer, gcnExtendedConnection, adOpenStatic, adLockReadOnly, adCmdText
  22. '
  23. If Not (recBuffer.EOF And recBuffer.BOF) Then
  24. Do While recBuffer.EOF = False
  25. If (strProductsNotBrought = "") Then
  26. strProductsNotBrought = GetTxt("UzGentProductsNotBrought1") & " " & recBuffer!Description & " " & GetTxt("UzGentProductsNotBrought2") & " " & recBuffer!Totaal & " " & GetTxt("UzGentProductsNotBrought3")
  27. Else
  28. strProductsNotBrought = strProductsNotBrought & vbNewLine & GetTxt("UzGentProductsNotBrought1") & " " & recBuffer!Description & " " & GetTxt("UzGentProductsNotBrought2") & " " & recBuffer!Totaal & " " & GetTxt("UzGentProductsNotBrought3")
  29. End If
  30. blnAtLeast1productNotBrought = True
  31. recBuffer.MoveNext
  32. Loop
  33. End If
  34. lblErrorInfo.Caption = strProductsNotBrought
  35. recBuffer.Close
  36. '3 message to go to balie
  37. If (blnAtLeast1productNotBrought) Then
  38. If gblnSwitchToDoctor Then
  39. lblErrorOccurred.Caption = GetTxt("DoctorErrorMsg")
  40. Else
  41. lblErrorOccurred.Caption = GetTxt("UzGentProductsNotBroughtBalie")
  42. End If
  43. End If
  44. '4 Process delivered boxes
  45. If gcnExtendedConnection.State = adStateClosed Then
  46. Call FctCreateDBConnection_Extended
  47. End If
  48. strSqlBuffer = "select article,location,Quantity,description,ArtikelCode,Packid from tblbuffer where outputchannel =" & gstrMediTech_ChannelOutput & " and statusboxpicker = " & enumBoxpickerStatus.PickExecuted
  49. recBuffer.Open strSqlBuffer, gcnExtendedConnection, adOpenStatic, adLockReadOnly, adCmdText
  50. '
  51. If Not (recBuffer.EOF And recBuffer.BOF) Then
  52. Do While recBuffer.EOF = False
  53. If IsNull(recBuffer!Artikelcode) Then
  54. strArtikleCode = recBuffer!Article
  55. Else
  56. strArtikleCode = recBuffer!Artikelcode
  57. End If
  58. '
  59. strSqlUpdateLocatie = "update locations set Article = NULL, lotnbr = NULL, reserved = 0, Stock = 0, Trans_date = NULL, Inventory = NULL, Vervaldatum = NULL, Containernr = NULL, HcStatus = 1, PackID = NULL where location ='" & recBuffer!location & "'"
  60. '
  61. If gcnExtendedConnection.State = adStateClosed Then
  62. Call FctCreateDBConnection_Extended
  63. End If
  64. '
  65. gcnExtendedConnection.Execute strSqlUpdateLocatie
  66. 'Marian B. UZGentRobot history
  67. Call FctWriteToHistory_RobotMutation("Robot.Out", 0 - recBuffer!Quantity, "0", strArtikleCode, "Volle verpakking ophalen.")
  68. recBuffer.MoveNext
  69. Loop
  70. End If
  71. '5 delete 205 lines (already processed)
  72. If gcnExtendedConnection.State = adStateClosed Then
  73. Call FctCreateDBConnection_Extended
  74. End If
  75. strsqlDelete205 = "Delete from tblbuffer where (statusboxpicker = " & enumBoxpickerStatus.PickExecuted & ") and outputchannel = " & gstrMediTech_ChannelOutput
  76. gcnExtendedConnection.Execute strsqlDelete205
  77. '
  78. Exit Sub
  79. '
  80. errorhandler:
  81. Select Case FctShowErrorBox("frmPatientPickList.frm", "FctProcessProducts")
  82. Case vbAbort
  83. Case vbRetry: Resume
  84. Case vbIgnore: Resume Next
  85. End Select
  86. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement