neu
This commit is contained in:
@@ -70,7 +70,7 @@ Public Class rptKontrolleLKW_NCTSTR
|
||||
|
||||
' If FIRMA = "ATILLA" Then operatorID = "'5','6'"
|
||||
|
||||
Dim sqlStr As String = " SELECT isnull(ncts_Befoerderungsmittel_KennzeichenAbgang,'') as Kennzeichen, cast(ncts_Eroeffnung as date) as AnmeldungsDatum,COUNT(*) ,isnull(SUM(nctsSA_AbgabenBetrag),0) as GarantieWert FROM tblNCTS_TR_Sicherheitsangaben inner join tblNCTS_TR on ncts_Id = nctsSA_NctsId "
|
||||
Dim sqlStr As String = " SELECT isnull(ncts_Befoerderungsmittel_KennzeichenAbgang,'') as Kennzeichen, cast(ncts_Eroeffnung as date) as AnmeldungsDatum,COUNT(*) ,isnull(SUM(nctsSA_AbgabenBetrag),0) as GarantieWert,isnull(SUM(ncts_VERAG_WeiterverrechungSatz),0) ncts_VERAG_WeiterverrechungSatz FROM tblNCTS_TR_Sicherheitsangaben inner join tblNCTS_TR on ncts_Id = nctsSA_NctsId "
|
||||
sqlStr &= " WHERE cast (ncts_Eroeffnung as date) BETWEEN '" & datVon.ToShortDateString & "' AND '" & datBis.ToShortDateString & "'"
|
||||
sqlStr &= " AND nctsSA_GRN IN ( '" & brg_AT & "' , '" & brg_DE & "' , '" & brg_DE_NEU & "' ) "
|
||||
sqlStr &= " AND ncts_status BETWEEN 50 AND 60 "
|
||||
@@ -82,7 +82,7 @@ Public Class rptKontrolleLKW_NCTSTR
|
||||
Me.DataSource = kundenSQL.loadDgvBySql(sqlStr, "FMZOLL", 1000)
|
||||
|
||||
|
||||
Dim sqlStrSUB As String = " SELECT *, isnull(nctsSA_AbgabenBetrag,0) as GarantieWert,isnull(ncts_Befoerderungsmittel_KennzeichenAbgang,'') as Kennzeichen,cast(ncts_Eroeffnung as date) as AnmeldungsDatum FROM tblNCTS_TR_Sicherheitsangaben inner join tblNCTS_TR on ncts_Id = nctsSA_NctsId "
|
||||
Dim sqlStrSUB As String = " SELECT *, isnull(nctsSA_AbgabenBetrag,0) as GarantieWert,isnull(ncts_Befoerderungsmittel_KennzeichenAbgang,'') as Kennzeichen,cast(ncts_Eroeffnung as date) as AnmeldungsDatum,ncts_VERAG_WeiterverrechungSatz FROM tblNCTS_TR_Sicherheitsangaben inner join tblNCTS_TR on ncts_Id = nctsSA_NctsId "
|
||||
sqlStrSUB &= " WHERE cast(ncts_Eroeffnung as date) BETWEEN '" & datVon.ToShortDateString & "' AND '" & datBis.ToShortDateString & "'"
|
||||
sqlStrSUB &= " AND nctsSA_GRN IN ( '" & brg_AT & "' , '" & brg_DE & "' , '" & brg_DE_NEU & "' ) "
|
||||
sqlStrSUB &= " AND ncts_status BETWEEN 50 AND 60 "
|
||||
@@ -144,17 +144,48 @@ Public Class rptKontrolleLKW_NCTSTR
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If LIST_NCTSABR IsNot Nothing Then
|
||||
|
||||
'per LKW
|
||||
For Each l In LIST_NCTSABR.LIST
|
||||
'Spezial
|
||||
Dim SpezialFound = False
|
||||
Dim AllSpezial = True
|
||||
If SUB_DATA IsNot Nothing Then
|
||||
For Each r In SUB_DATA.Rows
|
||||
If r("AnmeldungsDatum") = Fields.Item("AnmeldungsDatum").Value And r("Kennzeichen") = Fields.Item("Kennzeichen").Value Then
|
||||
If r("ncts_VERAG_WeiterverrechungSatz") IsNot DBNull.Value And r("ncts_VERAG_WeiterverrechungSatz") IsNot Nothing Then
|
||||
SpezialFound = True 'Kennzeichen, dass spezial
|
||||
|
||||
Dim GarantieWertLKW As Double = CDbl(Fields.Item("GarantieWert").Value)
|
||||
Select Case l.abrg_artAbrechnung
|
||||
Case "LKW"
|
||||
If GarantieWertLKW < l.abrg_GarantiewertBis Then
|
||||
l._ANZAHL += 1 : Exit For
|
||||
End If
|
||||
Dim VERAG_WeiterverrechungSatz As Double = CDbl(r("ncts_VERAG_WeiterverrechungSatz"))
|
||||
Dim L As New VERAG_PROG_ALLGEMEIN.cAbrechnung_NCTSBrg(-1)
|
||||
L.abrg_Partner = FIRMA
|
||||
L.abrg_artAbrechnung = "SPEZIAL"
|
||||
L.abrg_GarantiewertBis = CDbl(r("GarantieWert"))
|
||||
L.abrg_bertrag = VERAG_WeiterverrechungSatz
|
||||
L.abrg_prozent = Nothing
|
||||
L._ANZAHL = 1
|
||||
L._BETRAG = VERAG_WeiterverrechungSatz
|
||||
|
||||
LIST_NCTSABR.LIST.Add(L)
|
||||
Else
|
||||
AllSpezial = False ' Es sind nicht alle spezial
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not SpezialFound OrElse Not AllSpezial Then
|
||||
|
||||
'per LKW
|
||||
For Each l In LIST_NCTSABR.LIST
|
||||
|
||||
Dim GarantieWertLKW As Double = CDbl(Fields.Item("GarantieWert").Value)
|
||||
Select Case l.abrg_artAbrechnung
|
||||
Case "LKW"
|
||||
If GarantieWertLKW < l.abrg_GarantiewertBis Then
|
||||
l._ANZAHL += 1 : Exit For
|
||||
End If
|
||||
'Case "Versandschein"
|
||||
' If SUB_DATA IsNot Nothing Then
|
||||
' For Each r In SUB_DATA.Rows
|
||||
@@ -166,44 +197,49 @@ Public Class rptKontrolleLKW_NCTSTR
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
Case "%" 'LKW
|
||||
If GarantieWertLKW < l.abrg_GarantiewertBis Then
|
||||
l._ANZAHL += 1
|
||||
Dim prozent As Double = 0.001
|
||||
If l.abrg_prozent IsNot Nothing Then prozent = CDbl(l.abrg_prozent)
|
||||
l._BETRAG += (CDbl(Fields.Item("GarantieWert").Value)) * prozent
|
||||
Exit For
|
||||
End If
|
||||
End Select
|
||||
Case "%" 'LKW
|
||||
If GarantieWertLKW < l.abrg_GarantiewertBis Then
|
||||
l._ANZAHL += 1
|
||||
Dim prozent As Double = 0.001
|
||||
If l.abrg_prozent IsNot Nothing Then prozent = CDbl(l.abrg_prozent)
|
||||
l._BETRAG += (CDbl(Fields.Item("GarantieWert").Value)) * prozent
|
||||
Exit For
|
||||
End If
|
||||
End Select
|
||||
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
|
||||
'per VERSANDSCHEIN
|
||||
For Each r In SUB_DATA.Rows
|
||||
'Dim next_SND = False
|
||||
If SUB_DATA IsNot Nothing Then
|
||||
For Each l In LIST_NCTSABR.LIST
|
||||
'If Not next_SND Then
|
||||
Select Case l.abrg_artAbrechnung
|
||||
If SUB_DATA IsNot Nothing Then
|
||||
For Each r In SUB_DATA.Rows
|
||||
'Dim next_SND = False
|
||||
For Each l In LIST_NCTSABR.LIST
|
||||
'If Not next_SND Then
|
||||
Select Case l.abrg_artAbrechnung
|
||||
Case "Versandschein"
|
||||
Dim GarantieWertSND As Double = CDbl(r("GarantieWert"))
|
||||
If r("ncts_VERAG_WeiterverrechungSatz") Is DBNull.Value Or r("ncts_VERAG_WeiterverrechungSatz") Is Nothing Then 'Wenn nicht durch Speziel-Satz verrechnet
|
||||
If r("AnmeldungsDatum") = Fields.Item("AnmeldungsDatum").Value And r("Kennzeichen") = Fields.Item("Kennzeichen").Value Then
|
||||
If GarantieWertSND < l.abrg_GarantiewertBis Then
|
||||
l._ANZAHL += 1
|
||||
'next_SND = True
|
||||
Exit For
|
||||
'next_SND = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
' End If
|
||||
End If
|
||||
End Select
|
||||
' End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'Abwechselnd grauen und wei<65>en Hintergrund
|
||||
If (dummycount Mod 2) = 0 Then
|
||||
|
||||
|
||||
'Abwechselnd grauen und wei<65>en Hintergrund
|
||||
If (dummycount Mod 2) = 0 Then
|
||||
Detail.BackColor = Drawing.Color.White
|
||||
Else
|
||||
Detail.BackColor = Drawing.Color.WhiteSmoke
|
||||
|
||||
@@ -43,9 +43,14 @@ Public Class subrptKontrolleLKW_NCTSTR_Abrechnung
|
||||
lblGesamtpreis.Text = "<EFBFBD> " & CDbl(Fields.Item("GESAMTBETRAG").Value).ToString("N2", CultureInfo.InvariantCulture)
|
||||
lblAbrechnugnsart.Text = "per Versandschein"
|
||||
Case "%"
|
||||
lblEinzelpreis.Text = ""
|
||||
lblEinzelpreis.Text = "<EFBFBD> " & CDbl(Fields.Item("BETRAG").Value).ToString("N2", CultureInfo.InvariantCulture)
|
||||
lblGesamtpreis.Text = "<EFBFBD> " & CDbl(Fields.Item("BETRAG").Value).ToString("N2", CultureInfo.InvariantCulture)
|
||||
lblAbrechnugnsart.Text = "% vom Sicherheit"
|
||||
Case "SPEZIAL"
|
||||
lblGarantieBis.Text = "<EFBFBD> " & CDbl(Fields.Item("GARANTIEBIS").Value).ToString("N2", CultureInfo.InvariantCulture)
|
||||
lblEinzelpreis.Text = ""
|
||||
lblGesamtpreis.Text = "<EFBFBD> " & CDbl(Fields.Item("BETRAG").Value).ToString("N2", CultureInfo.InvariantCulture)
|
||||
lblAbrechnugnsart.Text = "Spezial"
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user