BH, nacherfassung leihgeld, etc.

This commit is contained in:
2025-11-04 15:26:49 +01:00
parent 18b089d9ab
commit 05edf96d95
12 changed files with 3380 additions and 143 deletions

View File

@@ -154,25 +154,27 @@ Public Class cUIDPruefung
Public Shared Function doUIDPruefungALL(Optional datum As Object = Nothing, Optional SaveErgInAdressen As Boolean = True, Optional Sciherheitsabfrage As Boolean = True, Optional MaxEintraege As Integer = -1, Optional showErr As Boolean = True, Optional finanzOnline As Boolean = True, Optional veroegerungMs As Integer = 1500) As DataTable
Dim dt As DataTable = Nothing
If datum = Nothing Then datum = CDate("15." & Now.ToString("MM.yyyy")).AddMonths(-1)
'If datum = Nothing Then datum = CDate("15." & Now.ToString("MM.yyyy")).AddMonths(-1)
Dim where = ""
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701)"
Case "IMEX" : where = " And Filialen.FilialenNr IN (5501)"
Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801)"
Case "UNISPED" : where = " AND Filialen.firma='UNISPED' "
Case Else : where = " AND Filialen.firma='VERAG' " '" And isnull(FilialenNr,'') Not IN (5501,5701)"
End Select
Dim Top = ""
If MaxEintraege > 0 Then
Top = " TOP " & MaxEintraege
End If
'Dim where = ""
'Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
' Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701)"
' Case "IMEX" : where = " And Filialen.FilialenNr IN (5501)"
' Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801)"
' Case "UNISPED" : where = " AND Filialen.firma='UNISPED' "
' Case Else : where = " AND Filialen.firma='VERAG' " '" And isnull(FilialenNr,'') Not IN (5501,5701)"
'End Select
'Dim Top = ""
'If MaxEintraege > 0 Then
' Top = " TOP " & MaxEintraege
'End If
dt = SQL.loadDgvBySql("SELECT " & Top & " [AdressenNr] as KdNr,[Ordnungsbegriff] as Firma,UstIdGeprüft as [letzte Prüfung],Adressen.UstIdKz,Adressen.UstIdnr " &
" From [Adressen] inner Join kunden On KundenNr=AdressenNr inner join Filialen on Filialen.FilialenNr=Kunden.FilialenNr " &
" where (UstIdGeprüft <= '" & datum.ToShortDateString & "' OR UstIdGeprüft is null) and (Adressen.UstIdKz is not null and Adressen.UstIdNr is not null) " &
" And Auswahl='A' " & where & " ORDER BY Ordnungsbegriff", "FMZOLL")
'dt = SQL.loadDgvBySql("SELECT " & Top & " [AdressenNr] as KdNr,[Ordnungsbegriff] as Firma,UstIdGeprüft as [letzte Prüfung],Adressen.UstIdKz,Adressen.UstIdnr " &
' " From [Adressen] inner Join kunden On KundenNr=AdressenNr inner join Filialen on Filialen.FilialenNr=Kunden.FilialenNr " &
' " where (UstIdGeprüft <= '" & datum.ToShortDateString & "' OR UstIdGeprüft is null) and (isnull(Adressen.UstIdKz,'') <> ''and isnull(Adressen.UstIdNr,'') <> '') " &
' " And Auswahl='A' " & where & " ORDER BY Ordnungsbegriff", "FMZOLL")
dt = get_zupruefendeKunden(MaxEintraege, datum)
If dt IsNot Nothing Then
If dt.Rows.Count = 0 Then Return Nothing
@@ -296,6 +298,41 @@ Public Class cUIDPruefung
Return dt
End Function
Public Shared Function get_zupruefendeKunden(MaxEintraege As Integer, Optional datum As Object = Nothing, Optional Firma As String = "") As DataTable
Dim dt As DataTable = Nothing
If datum = Nothing Then datum = CDate("15." & Now.ToString("MM.yyyy")).AddMonths(-1)
Dim where = ""
If Firma = "" Then
Firma = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
End If
Select Case Firma
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701)"
Case "IMEX" : where = " And Filialen.FilialenNr IN (5501)"
Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801)"
Case "UNISPED" : where = " AND Filialen.firma='UNISPED' "
Case Else : where = " AND Filialen.firma='VERAG' " '" And isnull(FilialenNr,'') Not IN (5501,5701)"
End Select
Dim Top = ""
If MaxEintraege > 0 Then
Top = " TOP " & MaxEintraege
End If
dt = SQL.loadDgvBySql("SELECT " & Top & " [AdressenNr] as KdNr,[Ordnungsbegriff] as Firma,UstIdGeprüft as [letzte Prüfung],Adressen.UstIdKz,Adressen.UstIdnr " &
" From [Adressen] inner Join kunden On KundenNr=AdressenNr inner join Filialen on Filialen.FilialenNr=Kunden.FilialenNr " &
" where (UstIdGeprüft <= '" & datum.ToShortDateString & "' OR UstIdGeprüft is null) and (isnull(Adressen.UstIdKz,'') <> ''and isnull(Adressen.UstIdNr,'') <> '') " &
" And Auswahl='A' " & where & " ORDER BY Ordnungsbegriff", "FMZOLL")
Return dt
End Function
Public Shared Function doUIDPruefung(ba_KundenNr, Optional AskIfDouble = False, Optional SaveErgInAdressen = True, Optional showErr = True, Optional Art = "") As cUIDPruefung