ustva, Kundenblatt, ncts, etc.
This commit is contained in:
@@ -119,7 +119,7 @@ Public Class usrCntlMDMAuswertungen
|
||||
Dim sqlstr = " SELECT CASE [BelegartenNr] WHEN 71 THEN 'GS' " &
|
||||
" WHEN 70 THEN 'RG' " &
|
||||
" END AS [BelegArt] " &
|
||||
" ,[RechnungsNr] " &
|
||||
" ,Rechnungsausgang.[RK_ID] ,[RechnungsNr] " &
|
||||
" ,CONVERT(VARCHAR(10), [RechnungsDatum], 104) as [RechnungsDatum] " &
|
||||
" ,[FilialenNr],[AbfertigungsNr],[UnterNr] " &
|
||||
" ,CONVERT(VARCHAR(10), [Abfertigungsdatum], 104) as [Abfertigungsdatum] " &
|
||||
@@ -156,40 +156,72 @@ Public Class usrCntlMDMAuswertungen
|
||||
|
||||
Dim antragsID As Integer = CInt(SQL.getValueTxtBySql("SELECT UStVAn_ID FROM tblUStVAntrag WHERE FilialenNr = " & r.Item("FilialenNr").ToString & " AND AbfertigungsNr = " & r.Item("AbfertigungsNr").ToString, "FMZOLL"))
|
||||
|
||||
Dim listVZMonth As New List(Of Integer)
|
||||
|
||||
If antragsID > 0 Then
|
||||
Dim MWSTAntrag As New cUSTVAntrag(antragsID)
|
||||
|
||||
Dim MonthStart As String = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & CDate(MWSTAntrag.UStVAn_ReDatVon).Month
|
||||
Dim MonthEnd As String = IIf(CDate(MWSTAntrag.UStVAn_ReDatBis).Month < 10, "0", "") & CDate(MWSTAntrag.UStVAn_ReDatBis).Month
|
||||
|
||||
Dim LeistungsBez As String = ""
|
||||
LeistungsBez = r.Item("LeistungsBez").ToString()
|
||||
If MonthStart = MonthEnd Then MonthEnd = ""
|
||||
|
||||
If r.Item("RK_ID") > 0 Then
|
||||
For Each pos As cUStVPositionen In MWSTAntrag.POSITIONEN.OrderBy(Function(x) If(IsDate(x.UStVPo_ReDat), CDate(x.UStVPo_ReDat), Nothing))
|
||||
|
||||
If Not IsDBNull(pos.UStVPo_VZ) AndAlso pos.UStVPo_VZ AndAlso pos.UStVPo_VZ_RKID = r.Item("RK_ID") AndAlso IsDate(pos.UStVPo_ReDat) Then
|
||||
If Not listVZMonth.Contains(CDate(pos.UStVPo_ReDat).Month) Then listVZMonth.Add(CDate(pos.UStVPo_ReDat).Month)
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
If listVZMonth.Count > 0 Then
|
||||
|
||||
If listVZMonth.Count = 1 Then
|
||||
MonthStart = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & listVZMonth(0).ToString
|
||||
MonthEnd = ""
|
||||
Else
|
||||
MonthStart = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & listVZMonth(0).ToString
|
||||
MonthEnd = IIf(CDate(MWSTAntrag.UStVAn_ReDatBis).Month < 10, "0", "") & listVZMonth(listVZMonth.Count - 1).ToString
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim LeistungsBez As String = ""
|
||||
LeistungsBez = r.Item("LeistungsBez").ToString()
|
||||
|
||||
If LeistungsBez.Contains("00-00/23") Then
|
||||
LeistungsBez = LeistungsBez.Replace("00/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
|
||||
ElseIf LeistungsBez.Contains("DL/23") Then
|
||||
LeistungsBez = LeistungsBez.Replace("DL/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
|
||||
Else
|
||||
LeistungsBez = LeistungsBez.Replace("/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
|
||||
End If
|
||||
|
||||
If LeistungsBez.Contains("-00") Then
|
||||
LeistungsBez = LeistungsBez.Replace("-00", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
|
||||
ElseIf LeistungsBez.Contains("00-") Then
|
||||
LeistungsBez = LeistungsBez.Replace("00-", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
|
||||
ElseIf LeistungsBez.Contains("00") Then
|
||||
LeistungsBez = LeistungsBez.Replace("00", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
|
||||
End If
|
||||
If LeistungsBez.Length > 30 Then
|
||||
r.Item("LeistungsBez") = LeistungsBez.Substring(0, 30)
|
||||
Else
|
||||
r.Item("LeistungsBez") = LeistungsBez
|
||||
End If
|
||||
|
||||
|
||||
If LeistungsBez.Contains("00-00/23") Then
|
||||
LeistungsBez = LeistungsBez.Replace("00/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
|
||||
ElseIf LeistungsBez.Contains("DL/23") Then
|
||||
LeistungsBez = LeistungsBez.Replace("DL/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
|
||||
Else
|
||||
LeistungsBez = LeistungsBez.Replace("/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
|
||||
End If
|
||||
|
||||
If LeistungsBez.Contains("-00") Then
|
||||
LeistungsBez = LeistungsBez.Replace("-00", MonthStart & "-" & MonthEnd)
|
||||
ElseIf LeistungsBez.Contains("00-") Then
|
||||
LeistungsBez = LeistungsBez.Replace("00-", MonthStart & "-" & MonthEnd)
|
||||
ElseIf LeistungsBez.Contains("00") Then
|
||||
LeistungsBez = LeistungsBez.Replace("00", MonthStart & "-" & MonthEnd)
|
||||
End If
|
||||
|
||||
r.Item("LeistungsBez") = LeistungsBez
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If dt.Columns.Contains("RK_ID") Then dt.Columns.Remove("RK_ID")
|
||||
|
||||
For i = 0 To dt.Columns.Count - 1
|
||||
clmns &= dt.Columns(i).ColumnName.ToString().Replace(";", ",") & ";"
|
||||
|
||||
Reference in New Issue
Block a user