Kundenuebersicht etc.
This commit is contained in:
@@ -26,6 +26,7 @@ Public Class cKundenSicherheiten
|
||||
|
||||
Public Property sc_cbam_jahr As Integer? = Nothing
|
||||
Public Property sc_cbam_quartal As Integer? = Nothing
|
||||
Public Property sc_updated As DateTime? = Nothing
|
||||
|
||||
|
||||
Public hasEntry As Boolean = False
|
||||
|
||||
@@ -144,10 +144,10 @@ Public Class cUIDPruefung
|
||||
End Function
|
||||
|
||||
|
||||
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 = 3000) As DataTable
|
||||
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 = 3000, Optional olderThanCurrentMonth As Boolean = False) As DataTable
|
||||
Dim dt As DataTable = Nothing
|
||||
|
||||
dt = get_zupruefendeKunden(MaxEintraege, datum,, True)
|
||||
dt = get_zupruefendeKunden(MaxEintraege, datum,, True, olderThanCurrentMonth)
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
If dt.Rows.Count = 0 Then Return Nothing
|
||||
@@ -302,19 +302,29 @@ Public Class cUIDPruefung
|
||||
Return dt
|
||||
End Function
|
||||
|
||||
Public Shared Function get_zupruefendeKunden(MaxEintraege As Integer, Optional datum As Object = Nothing, Optional Firma As String = "", Optional Validierungspruefung As Boolean = False) As DataTable
|
||||
Public Shared Function get_zupruefendeKunden(MaxEintraege As Integer, Optional datum As Object = Nothing, Optional Firma As String = "", Optional Validierungspruefung As Boolean = False, Optional olderThanCurrentMonth As Boolean = False) As DataTable
|
||||
|
||||
Dim dt As DataTable = Nothing
|
||||
If datum = Nothing Then datum = CDate("15." & Now.ToString("MM.yyyy")).AddMonths(-1)
|
||||
|
||||
Dim where = ""
|
||||
|
||||
Dim WhereDateOrMonthCondition As String = "UstIdGeprüft <= '" & datum.ToShortDateString & "'"
|
||||
Dim WhereDateOrMonthConditionVeranlagung As String = "VAUID.UstIdGeprüft <= '" & datum.ToShortDateString & "'"
|
||||
|
||||
If olderThanCurrentMonth Then
|
||||
WhereDateOrMonthCondition = "Month(UstIdGeprüft) <" & Now().Month & " and Year(UstIdGeprüft) <=" & Now().Year
|
||||
WhereDateOrMonthConditionVeranlagung = "Month(VAUID.UstIdGeprüft) <" & Now().Month & " and Year(VAUID.UstIdGeprüft) <=" & Now().Year
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Firma = "" Then
|
||||
Firma = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
|
||||
End If
|
||||
|
||||
Select Case Firma
|
||||
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701) "
|
||||
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 "VERAG 360 GmbH" : where = " And Filialen.FilialenNr IN (8001) "
|
||||
@@ -343,7 +353,7 @@ Public Class cUIDPruefung
|
||||
ELSE 'Nein'
|
||||
END AS istEUVAT, 'UID' as typ " &
|
||||
" 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,'') <> '') " &
|
||||
" where ( " & WhereDateOrMonthCondition & " OR UstIdGeprüft is null) and (isnull(Adressen.UstIdKz,'') <> '' and isnull(Adressen.UstIdNr,'') <> '') " &
|
||||
" And Auswahl='A' " & where
|
||||
|
||||
Dim SQLUID_Veranlagungskunden As String = "SELECT VAUID.KdNr,[Ordnungsbegriff] as Firma, VAUID.UstIdGeprüft, VAUID.UstIdKz,VAUID.UstIdNr, CASE WHEN UPPER(VAUID.UstIdKz) IN (
|
||||
@@ -354,7 +364,7 @@ Public Class cUIDPruefung
|
||||
inner Join [Adressen] On AdressenNr=VAUID.KdNr
|
||||
inner Join kunden On KundenNr=VAUID.KdNr
|
||||
inner join Filialen on Filialen.FilialenNr=Kunden.FilialenNr
|
||||
where (VAUID.UstIdGeprüft <= '" & datum.ToShortDateString & "' OR VAUID.UstIdGeprüft is null) and (isnull(VAUID.UstIdKz,'') <> '' and isnull(VAUID.UstIdNr,'') <> '') AND Filialen.firma='VERAG' " & where.Replace("Adressen.", "VAUID.")
|
||||
where (" & WhereDateOrMonthConditionVeranlagung & " OR VAUID.UstIdGeprüft is null) and (isnull(VAUID.UstIdKz,'') <> '' and isnull(VAUID.UstIdNr,'') <> '') AND Filialen.firma='VERAG' " & where.Replace("Adressen.", "VAUID.")
|
||||
|
||||
dt = SQL.loadDgvBySql(SQLUID & " UNION ALL " & SQLUID_Veranlagungskunden & " ORDER BY Ordnungsbegriff", "FMZOLL")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user