Module: Reorg / Cleanup
This commit is contained in:
47
archive/Modules/Archiv/Packtisch/IsOrderAvailable.vbs
Normal file
47
archive/Modules/Archiv/Packtisch/IsOrderAvailable.vbs
Normal file
@@ -0,0 +1,47 @@
|
||||
' IsOrderAvailable()
|
||||
' ---------------------------------------------------------
|
||||
' Überprüft, ob Auftrag noch (teilweise) offen ist
|
||||
'
|
||||
' Rückgabewert: OrderAvailable: Boolean
|
||||
' ---------------------------------------------------------
|
||||
Function IsOrderAvailable(OrderNumber)
|
||||
Set mywin = CWLStart.CurrentModule.Windows.Item(WINDOW_ID)
|
||||
Set Grid = mywin.Controls.Item(GRID_ID).Grid
|
||||
|
||||
IsOrderAvailable = False
|
||||
|
||||
SQL = ""
|
||||
SQL = SQL & "(c044 = '"& OrderNumber &"')"
|
||||
SQL = SQL & "AND (c025 IN ('M', 'A', 'S'))"
|
||||
SQL = SQL & SQLQuery_BasicWhere
|
||||
|
||||
Set Result = CWLStart.CurrentCompany.SearchRecord(TABLE_25, SQL)
|
||||
|
||||
If DEBUG_ON = True Then
|
||||
MsgBox "SQL: ... FROM "& TABLE_25 & " WHERE " & SQL, vbOkonly, DEBUG_TITLE
|
||||
|
||||
AddDebugLine "Checking For Order by OrderId.." & vbNewline & vbNewline
|
||||
AddDebugLine "Result Columns: " & Result & vbNewline
|
||||
AddDebugLine "Result Rows: " & Result.RowCount & vbNewline
|
||||
AddDebugLine "SQL: " & SQL
|
||||
|
||||
ShowDebugBox "IsOrderAvailable"
|
||||
End If
|
||||
|
||||
If Result < 0 Then
|
||||
If err <> 0 Then
|
||||
Msgbox "Fehler bei Abfrage:" & vbNewline & err.description, vbExclamation, DEFAULT_TITLE & " - IsOrderAvailable"
|
||||
Exit Function
|
||||
Else
|
||||
Msgbox "Der Auftrag " & _
|
||||
OrderNumber & _
|
||||
" wurde bereits vollständig erledigt oder als abgeschlossen markiert!", _
|
||||
vbExclamation, DEFAULT_TITLE & " - IsOrderAvailable"
|
||||
Exit Function
|
||||
End If
|
||||
End If
|
||||
|
||||
If Result.RowCount > 0 Then
|
||||
IsOrderAvailable = True
|
||||
End If
|
||||
End Function
|
||||
Reference in New Issue
Block a user