This commit is contained in:
2023-07-24 17:19:06 +02:00

View File

@@ -209,6 +209,7 @@ Public Class frmHauptfenster
Else
cboGrenzstelle.Items.Clear()
cboGrenzstelle.fillWithSQL("SELECT [grz_Grenzstelle],[grz_BezeichnungCBO] FROM tblGrenzstelle where ([grz_Firma]='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR grz_Cluster='" & VERAG_PROG_ALLGEMEIN.cAllgemein.CLUSTER & "') AND grz_Aktiv=1 order by grz_Reihenfolge, grz_Grenzstelle", False, "AVISO", True,, "ALLE")
cboGrenzstelle.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ALLE WARENORTE", "ALLE_WO"))
cboGrenzstelle.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("??? - Andere", "???"))
End If
@@ -249,6 +250,7 @@ Public Class frmHauptfenster
''''End If
cboMy_Grenzstelle.fillWithSQL("SELECT [grz_Grenzstelle],[grz_BezeichnungCBO] FROM tblGrenzstelle where ([grz_Firma]='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR grz_Cluster='" & VERAG_PROG_ALLGEMEIN.cAllgemein.CLUSTER & "') AND grz_Aktiv=1 order by grz_Reihenfolge, grz_Grenzstelle", False, "AVISO", True, False, "ALLE")
cboMy_Grenzstelle.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ALLE WARENORTE", "ALLE_WO"))
cboMy_Grenzstelle.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("??? - Andere", "???"))
cboMy_Grenzstelle.changeItem("")
''''cboMy_Grenzstelle.changeItem("ALLE_BACK") 'greift nur wenn verfügbar..
@@ -927,12 +929,16 @@ Public Class frmHauptfenster
hSQL &= datumseinschr
If cboGrenzstelle._value = "ALLE_WO" Then
hSQL += " AND Grenzstelle IN (SELECT [grz_Grenzstelle] FROM [tblGrenzstelle] where (grz_Warenort=1 AND grz_Firma ='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR grz_Cluster='" & VERAG_PROG_ALLGEMEIN.cAllgemein.CLUSTER & "' ) ) "
' If SucheStandort <> "" Then hSQL += " AND Grenzstelle = '" & SucheStandort & "'"
If cboGrenzstelle._value <> "" Then hSQL += " AND Grenzstelle = '" & cboGrenzstelle._value & "'"
' Bestimmungs.ZST
If cboGrenzstelle._value = "???" And txtBestimmungszollstelle._value <> "" Then
hSQL += " AND Zollstelle = '" & txtBestimmungszollstelle._value & "'"
Else
' If SucheStandort <> "" Then hSQL += " AND Grenzstelle = '" & SucheStandort & "'"
If cboGrenzstelle._value <> "" Then hSQL += " AND Grenzstelle = '" & cboGrenzstelle._value & "'"
' Bestimmungs.ZST
If cboGrenzstelle._value = "???" And txtBestimmungszollstelle._value <> "" Then
hSQL += " AND Zollstelle = '" & txtBestimmungszollstelle._value & "'"
End If
End If
@@ -1236,26 +1242,33 @@ Public Class frmHauptfenster
" FROM Aviso " &
" WHERE ( Status IN (0, 3, 4, 5,6,7) OR ( Status = 1 AND [Abgeschlossen] = 0 )) " &
sqlStrFirma & " AND (LetzterMitarbeiterId=@maId) "
If cboMy_Grenzstelle._value.Replace("ALLE_BACK", "") <> "" Then sqlStr &= " AND Grenzstelle = '" & cboMy_Grenzstelle._value & "'"
'If cboMy_Grenzstelle._value.Replace("ALLE_BACK", "") <> "" Then sqlStr &= " AND Grenzstelle = '" & cboMy_Grenzstelle._value & "'"
If cboMy_Grenzstelle._value = "ALLE_WO" Then
sqlStr += " AND Grenzstelle IN (SELECT [grz_Grenzstelle] FROM [tblGrenzstelle] where (grz_Warenort=1 AND grz_Firma ='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR grz_Cluster='" & VERAG_PROG_ALLGEMEIN.cAllgemein.CLUSTER & "' ) ) "
ElseIf cboMy_Grenzstelle._value.Replace("ALLE_BACK", "") <> "" Then
sqlStr &= " AND Grenzstelle = '" & cboMy_Grenzstelle._value & "'"
End If
sqlStr &= " ORDER BY case " &
" when [Status] =3 then 0 " &
" when [Status] =6 then 0.5 " &
" when [Status] =7 then 0.5 " &
" when [Status] =0 then 1 " &
" when [Status] =99 then 2 " &
" when [Status] =4 then 3 " &
" when [Status] =1 then 4 " &
" when [Status] =5 then 4 " &
" when [Status] =0 then 5 " &
" END, Grenzstelle,Ankunft " & If(cbx_My_LKW.Checked, "", ",tblSnd_SendungID")
Else
" when [Status] =3 then 0 " &
" when [Status] =6 then 0.5 " &
" when [Status] =7 then 0.5 " &
" when [Status] =0 then 1 " &
" when [Status] =99 then 2 " &
" when [Status] =4 then 3 " &
" when [Status] =1 then 4 " &
" when [Status] =5 then 4 " &
" when [Status] =0 then 5 " &
" END, Grenzstelle,Ankunft " & If(cbx_My_LKW.Checked, "", ",tblSnd_SendungID")
Else
'----------------------------------------------------------------------------------------------------------------------------------
'--- Sendung ---
'----------------------------------------------------------------------------------------------------------------------------------
Dim inBearbeitungSQL = " tblSendungen.LetzterMitarbeiterId=@maId " ' 1<>1 " 'DEFAULT = "Benutzer"
'----------------------------------------------------------------------------------------------------------------------------------
'--- Sendung ---
'----------------------------------------------------------------------------------------------------------------------------------
Dim inBearbeitungSQL = " tblSendungen.LetzterMitarbeiterId=@maId " ' 1<>1 " 'DEFAULT = "Benutzer"
If cboMyAvisoAnzeige._value <> "" Then
If cboMyAvisoAnzeige._value = "ALLE" Then
' inBearbeitungSQL = " 1=1 " 'ALLE
@@ -1285,8 +1298,15 @@ Public Class frmHauptfenster
Case CheckState.Unchecked : sqlStr &= " AND tblSnd_Vorbereitet is null "
' Case CheckState.Indeterminate : sqlStr &= " AND tblSnd_Vorbereitet is not null "
End Select
If cboMy_Grenzstelle._value.Replace("ALLE_BACK", "") <> "" Then sqlStr &= " AND Grenzstelle = '" & cboMy_Grenzstelle._value & "'"
If cboMy_Grenzstelle._value = "ALLE_BACK" Then sqlStr &= " AND FilialenNr NOT IN ('7001','7002','7003') "
If cboMy_Grenzstelle._value = "ALLE_WO" Then
sqlStr += " AND Grenzstelle IN (SELECT [grz_Grenzstelle] FROM [tblGrenzstelle] where (grz_Warenort=1 AND grz_Firma ='" & VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & "' OR grz_Cluster='" & VERAG_PROG_ALLGEMEIN.cAllgemein.CLUSTER & "' ) ) "
Else
If cboMy_Grenzstelle._value.Replace("ALLE_BACK", "") <> "" Then sqlStr &= " AND Grenzstelle = '" & cboMy_Grenzstelle._value & "'"
If cboMy_Grenzstelle._value = "ALLE_BACK" Then sqlStr &= " AND FilialenNr NOT IN ('7001','7002','7003') "
End If
If cbx_My_Brexit.Visible AndAlso Not cbx_My_Brexit.Checked Then sqlStr &= " AND FilialenNr NOT IN ('7001','7002','7003') "
'Farbe