Merge branch 'newMaster2024' of https://dev.azure.com/VeragAG/_git/SDL into newMaster2024

This commit is contained in:
2025-01-29 21:39:46 +01:00
9 changed files with 519 additions and 183 deletions

View File

@@ -2978,7 +2978,7 @@ Public Class cFakturierung
End Function End Function
Public Shared Function doSAMMELRechnungsDruck_Abschnitt(ByRef RechnungsNr As Integer, Firma_ID As Integer, Buchungsjahr As Integer, DruckdatumUhrzeit As DateTime, PrinterName As String, Optional AnlageEinzelRg As Boolean = True, Optional Sammelrechnungsbericht As Boolean = True, Optional RechnungsdruckArt As Integer = -1, Optional ByRef pathPDF As String = "", Optional SRDruckWiederholen As Boolean = False, Optional SB As String = "", Optional AnlageExcelEvolog As Boolean = False, Optional ByRef SonstAnlagen As List(Of String) = Nothing, Optional VorschauID As String = "", Optional AnlageExcelTransferry360 As Boolean = False, Optional FakturierungsGruppe As String = "", Optional Abfertigungsart As String = "", Optional mergePDF As Boolean = False) As Boolean Public Shared Function doSAMMELRechnungsDruck_Abschnitt(ByRef RechnungsNr As Integer, Firma_ID As Integer, Buchungsjahr As Integer, DruckdatumUhrzeit As DateTime, PrinterName As String, Optional AnlageEinzelRg As Boolean = True, Optional Sammelrechnungsbericht As Boolean = True, Optional RechnungsdruckArt As Integer = -1, Optional ByRef pathPDF As String = "", Optional SRDruckWiederholen As Boolean = False, Optional SB As String = "", Optional AnlageExcelEvolog As Boolean = False, Optional ByRef SonstAnlagen As List(Of String) = Nothing, Optional VorschauID As String = "", Optional AnlageExcelTransferry360 As Boolean = False, Optional FakturierungsGruppe As String = "", Optional Abfertigungsart As String = "", Optional mergePDF As Boolean = False, Optional RechnungsmautanhangAsPDF As Boolean = False) As Boolean
'SB Nicht mehr benötigt, da RG-Nr und DruckdatumUhrzeit 'SB Nicht mehr benötigt, da RG-Nr und DruckdatumUhrzeit
Dim dt As DataTable Dim dt As DataTable
@@ -3007,6 +3007,31 @@ Public Class cFakturierung
doSAMMELRechnungsDruck_Abschnitt = doSAMMELRechnungDruck_Rechnungsdruck(dt, RechnungsNr, DruckdatumUhrzeit, 3, RechnungsdruckArt, pathPDF_SammelRg, PrinterName, SRDruckWiederholen, VorschauID) 'Sammelrechnung drucken doSAMMELRechnungsDruck_Abschnitt = doSAMMELRechnungDruck_Rechnungsdruck(dt, RechnungsNr, DruckdatumUhrzeit, 3, RechnungsdruckArt, pathPDF_SammelRg, PrinterName, SRDruckWiederholen, VorschauID) 'Sammelrechnung drucken
If Sammelrechnungsbericht Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Sammelrechnungsbericht(RechnungsNr, DruckdatumUhrzeit, RechnungsdruckArt, pathPDF_SammelBericht, PrinterName, VorschauID, dt) Then doSAMMELRechnungsDruck_Abschnitt = False 'Sammelrechnungsbericht drucken If Sammelrechnungsbericht Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Sammelrechnungsbericht(RechnungsNr, DruckdatumUhrzeit, RechnungsdruckArt, pathPDF_SammelBericht, PrinterName, VorschauID, dt) Then doSAMMELRechnungsDruck_Abschnitt = False 'Sammelrechnungsbericht drucken
If AnlageEinzelRg Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Anlagen(RechnungsNr, DruckdatumUhrzeit, PrinterName, pathPDF_Anlage, RechnungsdruckArt, VorschauID) Then doSAMMELRechnungsDruck_Abschnitt = False 'Anlagen drucken If AnlageEinzelRg Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Anlagen(RechnungsNr, DruckdatumUhrzeit, PrinterName, pathPDF_Anlage, RechnungsdruckArt, VorschauID) Then doSAMMELRechnungsDruck_Abschnitt = False 'Anlagen drucken
If RechnungsmautanhangAsPDF Then
Dim displayView = New DataView(dt, "", "RK_ID", DataViewRowState.CurrentRows)
Dim distinctDT_RK As DataTable = displayView.ToTable(True, "RK_ID")
For Each r In distinctDT_RK.Rows
Dim RG As New VERAG_PROG_ALLGEMEIN.cRechnungsausgang(r("RK_ID"))
If RG IsNot Nothing Then
RG.LOAD_ANHAENGE()
For Each RG_AH In RG.ANHAENGE
If RG_AH.Bezeichnung.ToUpper.Contains("MAUT") Or RG_AH.Bezeichnung.ToUpper.Contains("DIESEL") Or RG_AH.Bezeichnung.ToUpper.Contains("INVOICE") Then
Dim Path = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(RG_AH.dsId)
If Not pathPDF_Anlage.Contains(Path) Then
If Not (pathPDF_Anlage.Any(Function(f) f.Contains("COPY_INVOICE")) And Path.ToUpper.Contains("COPY_INVOICE")) Then 'damit diesel IDS-Rechnung nicht doppelt hinzugefügt wird.
pathPDF_Anlage.Add(Path)
End If
End If
End If
Next
End If
Next
End If
'SONSTIGE ANLAGEN: 'SONSTIGE ANLAGEN:
If AnlageExcelEvolog Then 'Sammelrechnungsbericht EVOLOG If AnlageExcelEvolog Then 'Sammelrechnungsbericht EVOLOG

View File

@@ -382,7 +382,7 @@ Public Class frmFaktEmail
End If End If
lastAktuelle_RgNr = RechnungsNr lastAktuelle_RgNr = RechnungsNr
listPDFs.Add(path) If path <> "" Then listPDFs.Add(path)
End If End If
If Not RechnungsNrisSet Then 'Abbruch bei fehlender RE-Nr If Not RechnungsNrisSet Then 'Abbruch bei fehlender RE-Nr
@@ -837,7 +837,7 @@ Public Class frmFaktEmail
If MergePDF And ATTACHMENTS.Count > 1 Then If MergePDF And ATTACHMENTS.Count > 1 Then
Dim extension = ".pdf" Dim extension = ".pdf"
Dim zielPfadZusammenfassung = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("Rechnungs_Anhänge_" & RgNr & extension, extension,, False, "Zusammenfassung") Dim zielPfadZusammenfassung = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(IIf(SammelrechungArt <> 6, "Rechnungs_Anhänge_", "Rechnung_") & RgNr & extension, extension,, False, "Zusammenfassung")
Dim myList As New List(Of String) Dim myList As New List(Of String)
For Each a In ATTACHMENTS : myList.Add(a.Pfad) : Next For Each a In ATTACHMENTS : myList.Add(a.Pfad) : Next

View File

@@ -603,7 +603,7 @@ Public Class usrCntlFaktAbrechnung
End Select End Select
cboFirma.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [tblFirma] WHERE Firma_ID NOT IN(3) " & whereFirma & " ORDER BY Firma_ID ", True, "FMZOLL", firstEmpty) cboFirma.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [tblFirma] WHERE Firma_ID NOT IN(3) " & whereFirma & " ORDER BY Firma_ID ", True, "FMZOLL", firstEmpty)
cboFirma.SelectedIndex = 0 cboFirma.SelectedIndex = 0
@@ -1890,7 +1890,7 @@ Public Class usrCntlFaktAbrechnung
initRg_Anhaenhe_Default(RECHNUNG, SPEDBUCH) initRg_Anhaenhe_Default(RECHNUNG, SPEDBUCH)
If Not cboFirma._value = 19 Then If cboFirma._value IsNot Nothing AndAlso cboFirma._value <> "" AndAlso Not cboFirma._value = 19 Then
If cboSammelrechnung.Items.Count > 7 Then If cboSammelrechnung.Items.Count > 7 Then

View File

@@ -86,12 +86,13 @@ Partial Class frmMDM_USTVAntrag
Me.dgvUSTVPositionen = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.dgvUSTVPositionen = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.pnl = New System.Windows.Forms.Panel() Me.pnl = New System.Windows.Forms.Panel()
Me.Panel2 = New System.Windows.Forms.Panel() Me.Panel2 = New System.Windows.Forms.Panel()
Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition()
Me.Panel4 = New System.Windows.Forms.Panel() Me.Panel4 = New System.Windows.Forms.Panel()
Me.btnEintragloeschen = New System.Windows.Forms.Button() Me.btnEintragloeschen = New System.Windows.Forms.Button()
Me.btnNeuerEintrag = New System.Windows.Forms.Button() Me.btnNeuerEintrag = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition() Me.picPDF = New System.Windows.Forms.PictureBox()
Me.Panel3.SuspendLayout() Me.Panel3.SuspendLayout()
Me.Panel1.SuspendLayout() Me.Panel1.SuspendLayout()
Me.Panel9.SuspendLayout() Me.Panel9.SuspendLayout()
@@ -104,12 +105,14 @@ Partial Class frmMDM_USTVAntrag
Me.pnl.SuspendLayout() Me.pnl.SuspendLayout()
Me.Panel2.SuspendLayout() Me.Panel2.SuspendLayout()
Me.Panel4.SuspendLayout() Me.Panel4.SuspendLayout()
CType(Me.picPDF, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'Panel3 'Panel3
' '
Me.Panel3.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) Me.Panel3.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.Panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.Panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Panel3.Controls.Add(Me.picPDF)
Me.Panel3.Controls.Add(Me.btnMail) Me.Panel3.Controls.Add(Me.btnMail)
Me.Panel3.Controls.Add(Me.btnAntrageeinarbeiten) Me.Panel3.Controls.Add(Me.btnAntrageeinarbeiten)
Me.Panel3.Controls.Add(Me.cbxArchivierteEintracheNochmalsEinarbetien) Me.Panel3.Controls.Add(Me.cbxArchivierteEintracheNochmalsEinarbetien)
@@ -1033,6 +1036,14 @@ Partial Class frmMDM_USTVAntrag
Me.Panel2.Size = New System.Drawing.Size(1300, 269) Me.Panel2.Size = New System.Drawing.Size(1300, 269)
Me.Panel2.TabIndex = 1 Me.Panel2.TabIndex = 1
' '
'UstCntlUSTV_AntragPosition1
'
Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragPosition1.Location = New System.Drawing.Point(0, 0)
Me.UstCntlUSTV_AntragPosition1.Name = "UstCntlUSTV_AntragPosition1"
Me.UstCntlUSTV_AntragPosition1.Size = New System.Drawing.Size(1298, 267)
Me.UstCntlUSTV_AntragPosition1.TabIndex = 0
'
'Panel4 'Panel4
' '
Me.Panel4.BackColor = System.Drawing.Color.WhiteSmoke Me.Panel4.BackColor = System.Drawing.Color.WhiteSmoke
@@ -1083,13 +1094,15 @@ Partial Class frmMDM_USTVAntrag
Me.ContextMenuStrip2.Name = "ContextMenuStrip1" Me.ContextMenuStrip2.Name = "ContextMenuStrip1"
Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4) Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4)
' '
'UstCntlUSTV_AntragPosition1 'picPDF
' '
Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill Me.picPDF.Image = Global.SDL.My.Resources.Resources.pdf
Me.UstCntlUSTV_AntragPosition1.Location = New System.Drawing.Point(0, 0) Me.picPDF.Location = New System.Drawing.Point(972, 29)
Me.UstCntlUSTV_AntragPosition1.Name = "UstCntlUSTV_AntragPosition1" Me.picPDF.Name = "picPDF"
Me.UstCntlUSTV_AntragPosition1.Size = New System.Drawing.Size(1298, 267) Me.picPDF.Size = New System.Drawing.Size(50, 50)
Me.UstCntlUSTV_AntragPosition1.TabIndex = 0 Me.picPDF.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.picPDF.TabIndex = 27
Me.picPDF.TabStop = False
' '
'frmMDM_USTVAntrag 'frmMDM_USTVAntrag
' '
@@ -1123,6 +1136,7 @@ Partial Class frmMDM_USTVAntrag
Me.pnl.ResumeLayout(False) Me.pnl.ResumeLayout(False)
Me.Panel2.ResumeLayout(False) Me.Panel2.ResumeLayout(False)
Me.Panel4.ResumeLayout(False) Me.Panel4.ResumeLayout(False)
CType(Me.picPDF, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
@@ -1194,4 +1208,5 @@ Partial Class frmMDM_USTVAntrag
Friend WithEvents Label4 As Label Friend WithEvents Label4 As Label
Friend WithEvents Label2 As Label Friend WithEvents Label2 As Label
Friend WithEvents txtBezugsNr As VERAG_PROG_ALLGEMEIN.MyTextBox Friend WithEvents txtBezugsNr As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents picPDF As PictureBox
End Class End Class

View File

@@ -7,6 +7,7 @@ Imports com.sun.tools.internal.ws.wsdl.framework
Imports DocumentFormat.OpenXml.Office2010.Drawing.Charts Imports DocumentFormat.OpenXml.Office2010.Drawing.Charts
Imports itextsharp.text.pdf Imports itextsharp.text.pdf
Imports itextsharp.text.pdf.parser Imports itextsharp.text.pdf.parser
Imports java.awt.geom
Imports java.text.Normalizer Imports java.text.Normalizer
Imports jdk.nashorn.internal.objects.annotations Imports jdk.nashorn.internal.objects.annotations
'Imports DocumentFormat.OpenXml.Drawing.Charts 'Imports DocumentFormat.OpenXml.Drawing.Charts
@@ -470,7 +471,7 @@ Public Class frmMDM_USTVAntrag
AddHandler plose.Click, AddressOf mnuItemAuftrauege_Clicked AddHandler plose.Click, AddressOf mnuItemAuftrauege_Clicked
End If End If
If USTV_ANTRAG.UStVAn_ReDatVon.year >= 2025 Then 'wenn INFO von PLOSE WÄHRUNGSCODE IN INV_DATA, dann freischalten If USTV_ANTRAG.UStVAn_ReDatVon.year >= 2025 Then
If Not ContextMenuStrip2.Items.ContainsKey("ploseneu") Then If Not ContextMenuStrip2.Items.ContainsKey("ploseneu") Then
Dim plose = New ToolStripMenuItem() With {.Text = "Plose NEUE LOGIK", .Name = "ploseneu", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)} Dim plose = New ToolStripMenuItem() With {.Text = "Plose NEUE LOGIK", .Name = "ploseneu", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)}
ContextMenuStrip2.Items.Add(plose) ContextMenuStrip2.Items.Add(plose)
@@ -1490,99 +1491,109 @@ Public Class frmMDM_USTVAntrag
If e.RowIndex >= 0 AndAlso e.ColumnIndex >= 0 Then If e.RowIndex >= 0 AndAlso e.ColumnIndex >= 0 Then
Dim schnnittstellenNr = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_SchnittstellenNr").Value
Dim ReNr = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_ReNr").Value
Dim ReDat = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_ReDat").Value
Dim dsID
If Not IsDBNull(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value) AndAlso IsNumeric(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value) AndAlso dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value > 0 Then Dim pdf As String = ""
dsID = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value pdf = getPDF(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_SchnittstellenNr").Value, dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_ReNr").Value, dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_ReDat").Value, dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value)
Else
dsID = getDaID_OLD(schnnittstellenNr, ReDat, ReNr)
If IO.File.Exists(pdf) Then
Process.Start(pdf)
End If End If
Select Case schnnittstellenNr 'Dim schnnittstellenNr = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_SchnittstellenNr").Value
Case 1 'Dim ReNr = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_ReNr").Value
If dsID > 0 Then 'Dim ReDat = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_ReDat").Value
Me.Cursor = Cursors.WaitCursor
cFakturierung.doRechnungsDruck_SRorER(dsID,, False, 3)
End If
Case 8 'Dim dsID
Me.Cursor = Cursors.WaitCursor 'If Not IsDBNull(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value) AndAlso IsNumeric(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value) AndAlso dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value > 0 Then
Dim ds As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsID) ' dsID = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value
'Else
' dsID = getDaID_OLD(schnnittstellenNr, ReDat, ReNr)
'If Not IsDBNull(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value) Then 'End If
' ds.OPEN_SINGLE()
' Exit Sub
'End If
Dim path_src As String = ds.OPEN_SINGLE(False) 'Select Case schnnittstellenNr
If path_src = "" Then Exit Sub ' Case 1
' If dsID > 0 Then
' Me.Cursor = Cursors.WaitCursor
' cFakturierung.doRechnungsDruck_SRorER(dsID,, False, 3)
' End If
Try ' Case 8
Dim fi As New System.IO.DirectoryInfo(path_src) ' Me.Cursor = Cursors.WaitCursor
Dim pdfReader As itextsharp.text.pdf.PdfReader = New itextsharp.text.pdf.PdfReader(path_src) ' Dim ds As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsID)
Dim TMP_Path_New = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension,, True, "IDS-Rechnungen") ' 'If Not IsDBNull(dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_daId").Value) Then
Dim srcDoc As New itextsharp.text.Document() ' ' ds.OPEN_SINGLE()
Dim PdfCopyProvider As New itextsharp.text.pdf.PdfCopy(srcDoc, New FileStream(TMP_Path_New, System.IO.FileMode.Create)) ' ' Exit Sub
PdfCopyProvider.SetFullCompression() ' 'End If
srcDoc.Open()
PdfReader.unethicalreading = True
Dim pages As New List(Of Integer)()
For page As Integer = 1 To pdfReader.NumberOfPages ' Dim path_src As String = ds.OPEN_SINGLE(False)
' If path_src = "" Then Exit Sub
Dim strategy As ITextExtractionStrategy = New SimpleTextExtractionStrategy() ' Try
Dim currentpagetext As String = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy)
Dim searchtext As String = ReNr
Dim impPage As itextsharp.text.pdf.PdfImportedPage = Nothing
If (currentpagetext.Contains(searchtext)) Then ' Dim fi As New System.IO.DirectoryInfo(path_src)
' Dim pdfReader As itextsharp.text.pdf.PdfReader = New itextsharp.text.pdf.PdfReader(path_src)
If page > pdfReader.NumberOfPages Then ' Dim TMP_Path_New = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension,, True, "IDS-Rechnungen")
MsgBox("Seitenanzahl überschritten!") ' Dim srcDoc As New itextsharp.text.Document()
srcDoc.Close() : pdfReader.Close() ' Dim PdfCopyProvider As New itextsharp.text.pdf.PdfCopy(srcDoc, New FileStream(TMP_Path_New, System.IO.FileMode.Create))
Exit Sub ' PdfCopyProvider.SetFullCompression()
End If ' srcDoc.Open()
Try ' PdfReader.unethicalreading = True
' Dim pages As New List(Of Integer)()
impPage = PdfCopyProvider.GetImportedPage(pdfReader, page) ' For page As Integer = 1 To pdfReader.NumberOfPages
' ----- Ermitteln der Seitenauflösung und setzen für die neue Seite
PdfCopyProvider.SetPageSize(New itextsharp.text.Rectangle(0.0F, 0.0F, impPage.Width, impPage.Height, pdfReader.GetPageRotation(page))) ' Dim strategy As ITextExtractionStrategy = New SimpleTextExtractionStrategy()
' ----- PDF Seite in das neue Dokument einfügen ' Dim currentpagetext As String = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy)
If impPage IsNot Nothing Then PdfCopyProvider.AddPage(impPage) ' Dim searchtext As String = ReNr
Catch ex As Exception ' Dim impPage As itextsharp.text.pdf.PdfImportedPage = Nothing
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try ' If (currentpagetext.Contains(searchtext)) Then
' If page > pdfReader.NumberOfPages Then
' MsgBox("Seitenanzahl überschritten!")
' srcDoc.Close() : pdfReader.Close()
' Exit Sub
' End If
' Try
' impPage = PdfCopyProvider.GetImportedPage(pdfReader, page)
' ' ----- Ermitteln der Seitenauflösung und setzen für die neue Seite
' PdfCopyProvider.SetPageSize(New itextsharp.text.Rectangle(0.0F, 0.0F, impPage.Width, impPage.Height, pdfReader.GetPageRotation(page)))
' ' ----- PDF Seite in das neue Dokument einfügen
' If impPage IsNot Nothing Then PdfCopyProvider.AddPage(impPage)
' Catch ex As Exception
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
' End Try
End If ' End If
Next ' Next
srcDoc.Close() ' srcDoc.Close()
pdfReader.Close() ' pdfReader.Close()
If IO.File.Exists(TMP_Path_New) Then ' If IO.File.Exists(TMP_Path_New) Then
Process.Start(TMP_Path_New) ' Process.Start(TMP_Path_New)
End If ' End If
Catch ex As Exception ' Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) ' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try ' End Try
Case Else ' Case Else
If dsID > 0 Then ' If dsID > 0 Then
Me.Cursor = Cursors.WaitCursor ' Me.Cursor = Cursors.WaitCursor
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsID) ' Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsID)
DS.OPEN_SINGLE() ' DS.OPEN_SINGLE()
End If ' End If
End Select 'End Select
End If End If
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -1613,6 +1624,52 @@ Public Class frmMDM_USTVAntrag
lblLand.Text = IIf(cbxLand.SelectedItem IsNot Nothing, cbxLand.SelectedItem.Text, "") lblLand.Text = IIf(cbxLand.SelectedItem IsNot Nothing, cbxLand.SelectedItem.Text, "")
End Sub End Sub
Private Sub picPDF_Click(sender As Object, e As EventArgs) Handles picPDF.Click
If dgvUSTVPositionen.SelectedRows.Count = 0 Then Exit Sub
Try
Dim list As New List(Of String)
If dgvUSTVPositionen.SelectedRows.Count > 0 Then
For Each row As DataGridViewRow In dgvUSTVPositionen.SelectedRows
Dim pdf As String = ""
pdf = getPDF(row.Cells("UStVPo_SchnittstellenNr").Value, row.Cells("UStVPo_ReNr").Value, row.Cells("UStVPo_ReDat").Value, row.Cells("UStVPo_daId").Value)
If pdf <> "" Then list.Add(pdf)
Next
End If
If list.Count = 0 Then Exit Sub
If list.Count > 1 Then
Dim pathPDF = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("RG_" & Now.ToString("ddMMyyyyHHmmss") & ".pdf", ".pdf", False, False)
If FormularManagerNEU.MergePdfFiles(list, pathPDF) Then
Process.Start(pathPDF)
End If
Else
Dim PDFFile As String = ""
PDFFile = list(0)
Process.Start(PDFFile)
End If
Me.Cursor = Cursors.Default
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Me.Cursor = Cursors.Default
End Try
End Sub
Private Sub dgvUSTVPositionen_Sorted(sender As Object, e As EventArgs) Handles dgvUSTVPositionen.Sorted Private Sub dgvUSTVPositionen_Sorted(sender As Object, e As EventArgs) Handles dgvUSTVPositionen.Sorted
For Each r As DataGridViewRow In dgvUSTVPositionen.Rows For Each r As DataGridViewRow In dgvUSTVPositionen.Rows
@@ -1627,4 +1684,101 @@ Public Class frmMDM_USTVAntrag
Next Next
End Sub End Sub
Private Function getPDF(schnittstellenNr, ReNr, ReDat, daId) As String
Dim schnnittstellenNr = schnittstellenNr
Dim dsID
If Not IsDBNull(daId) AndAlso IsNumeric(daId) AndAlso daId > 0 Then
dsID = daId
Else
dsID = getDaID_OLD(schnnittstellenNr, ReDat, ReNr)
End If
If dsID < 0 Then Return ""
Select Case schnnittstellenNr
Case 1
If dsID > 0 Then
Me.Cursor = Cursors.WaitCursor
Dim path As String
cFakturierung.doRechnungsDruck_SRorER(dsID,, False, 3, path)
Return path
End If
Case 8
Me.Cursor = Cursors.WaitCursor
Dim ds As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsID)
Dim path_src As String = ds.OPEN_SINGLE(False)
If path_src = "" Then Return ""
Try
Dim fi As New System.IO.DirectoryInfo(path_src)
Dim pdfReader As itextsharp.text.pdf.PdfReader = New itextsharp.text.pdf.PdfReader(path_src)
Dim TMP_Path_New = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension,, False, "IDS-Rechnungen")
Dim srcDoc As New itextsharp.text.Document()
Dim PdfCopyProvider As New itextsharp.text.pdf.PdfCopy(srcDoc, New FileStream(TMP_Path_New, System.IO.FileMode.Create))
PdfCopyProvider.SetFullCompression()
srcDoc.Open()
PdfReader.unethicalreading = True
Dim pages As New List(Of Integer)()
For page As Integer = 1 To pdfReader.NumberOfPages
Dim strategy As ITextExtractionStrategy = New SimpleTextExtractionStrategy()
Dim currentpagetext As String = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy)
Dim searchtext As String = ReNr
Dim impPage As itextsharp.text.pdf.PdfImportedPage = Nothing
If (currentpagetext.Contains(searchtext)) Then
If page > pdfReader.NumberOfPages Then
MsgBox("Seitenanzahl überschritten!")
srcDoc.Close() : pdfReader.Close()
Return False
End If
Try
impPage = PdfCopyProvider.GetImportedPage(pdfReader, page)
' ----- Ermitteln der Seitenauflösung und setzen für die neue Seite
PdfCopyProvider.SetPageSize(New itextsharp.text.Rectangle(0.0F, 0.0F, impPage.Width, impPage.Height, pdfReader.GetPageRotation(page)))
' ----- PDF Seite in das neue Dokument einfügen
If impPage IsNot Nothing Then PdfCopyProvider.AddPage(impPage)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End If
Next
srcDoc.Close()
pdfReader.Close()
Return TMP_Path_New
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Case Else
If dsID > 0 Then
Me.Cursor = Cursors.WaitCursor
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsID)
Return DS.GET_TOP1_PATH
End If
End Select
End Function
End Class End Class

View File

@@ -295,7 +295,7 @@ Partial Public Class rptPLOSE_Anhang
'ReportHeader1 'ReportHeader1
' '
Me.ReportHeader1.Controls.AddRange(New GrapeCity.ActiveReports.SectionReportModel.ARControl() {Me.lblRgDatum, Me.txtKunde, Me.Label16, Me.Picture1, Me.picVERAG, Me.lblUeberschriftRG_GS, Me.Line3, Me.lblFirmaOrt, Me.lblFirmaStrasse, Me.lblFirmaTel, Me.lblFirmaFax, Me.lblFirmaEmail, Me.lblFirmaWeb, Me.Label18, Me.Label1, Me.TextBox1, Me.Label2, Me.Label3, Me.Label4}) Me.ReportHeader1.Controls.AddRange(New GrapeCity.ActiveReports.SectionReportModel.ARControl() {Me.lblRgDatum, Me.txtKunde, Me.Label16, Me.Picture1, Me.picVERAG, Me.lblUeberschriftRG_GS, Me.Line3, Me.lblFirmaOrt, Me.lblFirmaStrasse, Me.lblFirmaTel, Me.lblFirmaFax, Me.lblFirmaEmail, Me.lblFirmaWeb, Me.Label18, Me.Label1, Me.TextBox1, Me.Label2, Me.Label3, Me.Label4})
Me.ReportHeader1.Height = 1.185761! Me.ReportHeader1.Height = 1.301575!
Me.ReportHeader1.Name = "ReportHeader1" Me.ReportHeader1.Name = "ReportHeader1"
' '
'lblRgDatum 'lblRgDatum
@@ -314,12 +314,12 @@ Partial Public Class rptPLOSE_Anhang
' '
Me.txtKunde.Height = 0.1574802! Me.txtKunde.Height = 0.1574802!
Me.txtKunde.HyperLink = Nothing Me.txtKunde.HyperLink = Nothing
Me.txtKunde.Left = 5.115748! Me.txtKunde.Left = 5.111811!
Me.txtKunde.Name = "txtKunde" Me.txtKunde.Name = "txtKunde"
Me.txtKunde.Style = "font-size: 8pt; font-weight: bold; text-align: right; vertical-align: middle; ddo" & Me.txtKunde.Style = "font-size: 8pt; font-weight: bold; text-align: left; vertical-align: middle; ddo-" &
"-char-set: 1" "char-set: 1"
Me.txtKunde.Text = "1000000 TEST" Me.txtKunde.Text = "1000000 TEST"
Me.txtKunde.Top = 0.9866142! Me.txtKunde.Top = 0.8291339!
Me.txtKunde.Width = 2.354331! Me.txtKunde.Width = 2.354331!
' '
'Label16 'Label16
@@ -330,8 +330,8 @@ Partial Public Class rptPLOSE_Anhang
Me.Label16.Name = "Label16" Me.Label16.Name = "Label16"
Me.Label16.Style = "font-size: 8pt; font-weight: normal; text-align: left; vertical-align: middle; dd" & Me.Label16.Style = "font-size: 8pt; font-weight: normal; text-align: left; vertical-align: middle; dd" &
"o-char-set: 1" "o-char-set: 1"
Me.Label16.Text = "VERAG-Kunde:" Me.Label16.Text = "Kunde:"
Me.Label16.Top = 0.9866142! Me.Label16.Top = 0.8291339!
Me.Label16.Width = 0.8114175! Me.Label16.Width = 0.8114175!
' '
'Picture1 'Picture1
@@ -439,19 +439,19 @@ Partial Public Class rptPLOSE_Anhang
Me.lblFirmaEmail.Style = "font-size: 7pt; font-weight: normal; text-align: right; vertical-align: middle; d" & Me.lblFirmaEmail.Style = "font-size: 7pt; font-weight: normal; text-align: right; vertical-align: middle; d" &
"do-char-set: 1" "do-char-set: 1"
Me.lblFirmaEmail.Text = "s.kriegner@verag.ag" Me.lblFirmaEmail.Text = "s.kriegner@verag.ag"
Me.lblFirmaEmail.Top = 0.7503937! Me.lblFirmaEmail.Top = 0.868504!
Me.lblFirmaEmail.Width = 1.436614! Me.lblFirmaEmail.Width = 1.436614!
' '
'lblFirmaWeb 'lblFirmaWeb
' '
Me.lblFirmaWeb.Height = 0.1181103! Me.lblFirmaWeb.Height = 0.1181102!
Me.lblFirmaWeb.HyperLink = Nothing Me.lblFirmaWeb.HyperLink = Nothing
Me.lblFirmaWeb.Left = 2.492913! Me.lblFirmaWeb.Left = 2.492913!
Me.lblFirmaWeb.Name = "lblFirmaWeb" Me.lblFirmaWeb.Name = "lblFirmaWeb"
Me.lblFirmaWeb.Style = "font-size: 7pt; font-weight: normal; text-align: right; vertical-align: middle; d" & Me.lblFirmaWeb.Style = "font-size: 7pt; font-weight: normal; text-align: right; vertical-align: middle; d" &
"do-char-set: 1" "do-char-set: 1"
Me.lblFirmaWeb.Text = "www.verag.ag" Me.lblFirmaWeb.Text = "www.verag.ag"
Me.lblFirmaWeb.Top = 0.8685042! Me.lblFirmaWeb.Top = 0.7503937!
Me.lblFirmaWeb.Width = 1.436614! Me.lblFirmaWeb.Width = 1.436614!
' '
'Label18 'Label18
@@ -485,7 +485,7 @@ Partial Public Class rptPLOSE_Anhang
Me.TextBox1.Style = "font-size: 8pt; font-weight: bold; text-align: right; vertical-align: middle; ddo" & Me.TextBox1.Style = "font-size: 8pt; font-weight: bold; text-align: right; vertical-align: middle; ddo" &
"-char-set: 1" "-char-set: 1"
Me.TextBox1.Text = "1000000" Me.TextBox1.Text = "1000000"
Me.TextBox1.Top = 0.8291339! Me.TextBox1.Top = 0.9866142!
Me.TextBox1.Width = 0.8688979! Me.TextBox1.Width = 0.8688979!
' '
'Label2 'Label2
@@ -497,7 +497,7 @@ Partial Public Class rptPLOSE_Anhang
Me.Label2.Style = "font-size: 8pt; font-weight: normal; text-align: left; vertical-align: middle; dd" & Me.Label2.Style = "font-size: 8pt; font-weight: normal; text-align: left; vertical-align: middle; dd" &
"o-char-set: 1" "o-char-set: 1"
Me.Label2.Text = "Partner-Kunden-Nr:" Me.Label2.Text = "Partner-Kunden-Nr:"
Me.Label2.Top = 0.8291339! Me.Label2.Top = 0.9866142!
Me.Label2.Width = 1.020079! Me.Label2.Width = 1.020079!
' '
'Label3 'Label3
@@ -509,25 +509,25 @@ Partial Public Class rptPLOSE_Anhang
Me.Label3.Style = "font-size: 8pt; font-weight: normal; text-align: left; vertical-align: middle; dd" & Me.Label3.Style = "font-size: 8pt; font-weight: normal; text-align: left; vertical-align: middle; dd" &
"o-char-set: 1" "o-char-set: 1"
Me.Label3.Text = "Zeitraum bis:" Me.Label3.Text = "Zeitraum bis:"
Me.Label3.Top = 0.8291339! Me.Label3.Top = 0.9866142!
Me.Label3.Width = 0.6905512! Me.Label3.Width = 0.6905512!
' '
'Label4 'Label4
' '
Me.Label4.Height = 0.1574803! Me.Label4.Height = 0.1574803!
Me.Label4.HyperLink = Nothing Me.Label4.HyperLink = Nothing
Me.Label4.Left = 6.674016! Me.Label4.Left = 6.670079!
Me.Label4.Name = "Label4" Me.Label4.Name = "Label4"
Me.Label4.Style = "font-size: 8pt; font-weight: bold; text-align: right; vertical-align: middle; ddo" & Me.Label4.Style = "font-size: 8pt; font-weight: bold; text-align: right; vertical-align: middle; ddo" &
"-char-set: 1" "-char-set: 1"
Me.Label4.Text = "01.01.2019" Me.Label4.Text = "01.01.2019"
Me.Label4.Top = 0.8291339! Me.Label4.Top = 0.9866142!
Me.Label4.Width = 0.7960634! Me.Label4.Width = 0.7960634!
' '
'ReportFooter1 'ReportFooter1
' '
Me.ReportFooter1.Controls.AddRange(New GrapeCity.ActiveReports.SectionReportModel.ARControl() {Me.txtBruttoGesSum, Me.txtNettoGesSum, Me.txtMWSTGEsSum, Me.lblGessumme, Me.Line7, Me.Line8}) Me.ReportFooter1.Controls.AddRange(New GrapeCity.ActiveReports.SectionReportModel.ARControl() {Me.txtBruttoGesSum, Me.txtNettoGesSum, Me.txtMWSTGEsSum, Me.lblGessumme, Me.Line7, Me.Line8})
Me.ReportFooter1.Height = 0.2515748! Me.ReportFooter1.Height = 0.6578248!
Me.ReportFooter1.KeepTogether = True Me.ReportFooter1.KeepTogether = True
Me.ReportFooter1.Name = "ReportFooter1" Me.ReportFooter1.Name = "ReportFooter1"
' '
@@ -1032,6 +1032,6 @@ Partial Public Class rptPLOSE_Anhang
Public WithEvents Label1 As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents Label1 As GrapeCity.ActiveReports.SectionReportModel.Label
Public WithEvents TextBox1 As GrapeCity.ActiveReports.SectionReportModel.TextBox Public WithEvents TextBox1 As GrapeCity.ActiveReports.SectionReportModel.TextBox
Public WithEvents Label2 As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents Label2 As GrapeCity.ActiveReports.SectionReportModel.Label
Private WithEvents Label3 As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents Label3 As GrapeCity.ActiveReports.SectionReportModel.Label
Public WithEvents Label4 As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents Label4 As GrapeCity.ActiveReports.SectionReportModel.Label
End Class End Class

View File

@@ -480,7 +480,7 @@ Partial Public Class rptPLOSE_LaenderGesamt
Public WithEvents lblSumBrutto As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents lblSumBrutto As GrapeCity.ActiveReports.SectionReportModel.Label
Public WithEvents lblSumMwst As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents lblSumMwst As GrapeCity.ActiveReports.SectionReportModel.Label
Public WithEvents lblSumNetto As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents lblSumNetto As GrapeCity.ActiveReports.SectionReportModel.Label
Private WithEvents Label7 As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents Label7 As GrapeCity.ActiveReports.SectionReportModel.Label
Public WithEvents lblEU As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents lblEU As GrapeCity.ActiveReports.SectionReportModel.Label
Public WithEvents lblLand As GrapeCity.ActiveReports.SectionReportModel.Label Public WithEvents lblLand As GrapeCity.ActiveReports.SectionReportModel.Label
End Class End Class

View File

@@ -45,6 +45,7 @@ Partial Class usrcntlFakturierung
Me.Button18 = New System.Windows.Forms.Button() Me.Button18 = New System.Windows.Forms.Button()
Me.Label44 = New System.Windows.Forms.Label() Me.Label44 = New System.Windows.Forms.Label()
Me.GBSammelrechnung = New System.Windows.Forms.GroupBox() Me.GBSammelrechnung = New System.Windows.Forms.GroupBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.PictureBox6 = New System.Windows.Forms.PictureBox() Me.PictureBox6 = New System.Windows.Forms.PictureBox()
Me.PictureBox5 = New System.Windows.Forms.PictureBox() Me.PictureBox5 = New System.Windows.Forms.PictureBox()
Me.PictureBox4 = New System.Windows.Forms.PictureBox() Me.PictureBox4 = New System.Windows.Forms.PictureBox()
@@ -75,7 +76,7 @@ Partial Class usrcntlFakturierung
Me.Label63 = New System.Windows.Forms.Label() Me.Label63 = New System.Windows.Forms.Label()
Me.Label45 = New System.Windows.Forms.Label() Me.Label45 = New System.Windows.Forms.Label()
Me.Button14 = New System.Windows.Forms.Button() Me.Button14 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button() Me.cbxMautanh = New System.Windows.Forms.CheckBox()
Me.GroupBox1.SuspendLayout() Me.GroupBox1.SuspendLayout()
Me.GBMautberichte.SuspendLayout() Me.GBMautberichte.SuspendLayout()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -303,6 +304,7 @@ Partial Class usrcntlFakturierung
' '
'GBSammelrechnung 'GBSammelrechnung
' '
Me.GBSammelrechnung.Controls.Add(Me.cbxMautanh)
Me.GBSammelrechnung.Controls.Add(Me.Button1) Me.GBSammelrechnung.Controls.Add(Me.Button1)
Me.GBSammelrechnung.Controls.Add(Me.PictureBox6) Me.GBSammelrechnung.Controls.Add(Me.PictureBox6)
Me.GBSammelrechnung.Controls.Add(Me.PictureBox5) Me.GBSammelrechnung.Controls.Add(Me.PictureBox5)
@@ -341,11 +343,22 @@ Partial Class usrcntlFakturierung
Me.GBSammelrechnung.TabIndex = 14 Me.GBSammelrechnung.TabIndex = 14
Me.GBSammelrechnung.TabStop = False Me.GBSammelrechnung.TabStop = False
' '
'Button1
'
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button1.Location = New System.Drawing.Point(10, 12)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(121, 49)
Me.Button1.TabIndex = 106
Me.Button1.Text = "Mautanh. prüfen"
Me.Button1.UseVisualStyleBackColor = True
'
'PictureBox6 'PictureBox6
' '
Me.PictureBox6.BackgroundImage = CType(resources.GetObject("PictureBox6.BackgroundImage"), System.Drawing.Image) Me.PictureBox6.BackgroundImage = CType(resources.GetObject("PictureBox6.BackgroundImage"), System.Drawing.Image)
Me.PictureBox6.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.PictureBox6.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox6.Location = New System.Drawing.Point(232, 151) Me.PictureBox6.Location = New System.Drawing.Point(151, 172)
Me.PictureBox6.Name = "PictureBox6" Me.PictureBox6.Name = "PictureBox6"
Me.PictureBox6.Size = New System.Drawing.Size(14, 14) Me.PictureBox6.Size = New System.Drawing.Size(14, 14)
Me.PictureBox6.TabIndex = 105 Me.PictureBox6.TabIndex = 105
@@ -356,7 +369,7 @@ Partial Class usrcntlFakturierung
' '
Me.PictureBox5.BackgroundImage = CType(resources.GetObject("PictureBox5.BackgroundImage"), System.Drawing.Image) Me.PictureBox5.BackgroundImage = CType(resources.GetObject("PictureBox5.BackgroundImage"), System.Drawing.Image)
Me.PictureBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.PictureBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox5.Location = New System.Drawing.Point(232, 134) Me.PictureBox5.Location = New System.Drawing.Point(151, 155)
Me.PictureBox5.Name = "PictureBox5" Me.PictureBox5.Name = "PictureBox5"
Me.PictureBox5.Size = New System.Drawing.Size(14, 14) Me.PictureBox5.Size = New System.Drawing.Size(14, 14)
Me.PictureBox5.TabIndex = 104 Me.PictureBox5.TabIndex = 104
@@ -367,7 +380,7 @@ Partial Class usrcntlFakturierung
' '
Me.PictureBox4.BackgroundImage = CType(resources.GetObject("PictureBox4.BackgroundImage"), System.Drawing.Image) Me.PictureBox4.BackgroundImage = CType(resources.GetObject("PictureBox4.BackgroundImage"), System.Drawing.Image)
Me.PictureBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.PictureBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox4.Location = New System.Drawing.Point(232, 117) Me.PictureBox4.Location = New System.Drawing.Point(151, 138)
Me.PictureBox4.Name = "PictureBox4" Me.PictureBox4.Name = "PictureBox4"
Me.PictureBox4.Size = New System.Drawing.Size(14, 14) Me.PictureBox4.Size = New System.Drawing.Size(14, 14)
Me.PictureBox4.TabIndex = 103 Me.PictureBox4.TabIndex = 103
@@ -378,7 +391,7 @@ Partial Class usrcntlFakturierung
' '
Me.PictureBox3.BackgroundImage = CType(resources.GetObject("PictureBox3.BackgroundImage"), System.Drawing.Image) Me.PictureBox3.BackgroundImage = CType(resources.GetObject("PictureBox3.BackgroundImage"), System.Drawing.Image)
Me.PictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.PictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox3.Location = New System.Drawing.Point(232, 100) Me.PictureBox3.Location = New System.Drawing.Point(151, 121)
Me.PictureBox3.Name = "PictureBox3" Me.PictureBox3.Name = "PictureBox3"
Me.PictureBox3.Size = New System.Drawing.Size(14, 14) Me.PictureBox3.Size = New System.Drawing.Size(14, 14)
Me.PictureBox3.TabIndex = 102 Me.PictureBox3.TabIndex = 102
@@ -389,7 +402,7 @@ Partial Class usrcntlFakturierung
' '
Me.PictureBox2.BackgroundImage = CType(resources.GetObject("PictureBox2.BackgroundImage"), System.Drawing.Image) Me.PictureBox2.BackgroundImage = CType(resources.GetObject("PictureBox2.BackgroundImage"), System.Drawing.Image)
Me.PictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.PictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox2.Location = New System.Drawing.Point(232, 83) Me.PictureBox2.Location = New System.Drawing.Point(151, 104)
Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Name = "PictureBox2"
Me.PictureBox2.Size = New System.Drawing.Size(14, 14) Me.PictureBox2.Size = New System.Drawing.Size(14, 14)
Me.PictureBox2.TabIndex = 101 Me.PictureBox2.TabIndex = 101
@@ -400,7 +413,7 @@ Partial Class usrcntlFakturierung
' '
Me.PictureBox1.BackgroundImage = Global.SDL.My.Resources.Resources.ok Me.PictureBox1.BackgroundImage = Global.SDL.My.Resources.Resources.ok
Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBox1.Location = New System.Drawing.Point(232, 69) Me.PictureBox1.Location = New System.Drawing.Point(151, 90)
Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(14, 14) Me.PictureBox1.Size = New System.Drawing.Size(14, 14)
Me.PictureBox1.TabIndex = 95 Me.PictureBox1.TabIndex = 95
@@ -409,7 +422,7 @@ Partial Class usrcntlFakturierung
' '
'Label4 'Label4
' '
Me.Label4.Location = New System.Drawing.Point(252, 134) Me.Label4.Location = New System.Drawing.Point(171, 155)
Me.Label4.Name = "Label4" Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(440, 17) Me.Label4.Size = New System.Drawing.Size(440, 17)
Me.Label4.TabIndex = 100 Me.Label4.TabIndex = 100
@@ -420,7 +433,7 @@ Partial Class usrcntlFakturierung
Me.cbxVorschau.AutoSize = True Me.cbxVorschau.AutoSize = True
Me.cbxVorschau.Checked = True Me.cbxVorschau.Checked = True
Me.cbxVorschau.CheckState = System.Windows.Forms.CheckState.Checked Me.cbxVorschau.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxVorschau.Location = New System.Drawing.Point(329, 256) Me.cbxVorschau.Location = New System.Drawing.Point(329, 262)
Me.cbxVorschau.Name = "cbxVorschau" Me.cbxVorschau.Name = "cbxVorschau"
Me.cbxVorschau.Size = New System.Drawing.Size(109, 17) Me.cbxVorschau.Size = New System.Drawing.Size(109, 17)
Me.cbxVorschau.TabIndex = 48 Me.cbxVorschau.TabIndex = 48
@@ -432,7 +445,7 @@ Partial Class usrcntlFakturierung
Me.cbxAbfVerbotdrucken.AutoSize = True Me.cbxAbfVerbotdrucken.AutoSize = True
Me.cbxAbfVerbotdrucken.Checked = True Me.cbxAbfVerbotdrucken.Checked = True
Me.cbxAbfVerbotdrucken.CheckState = System.Windows.Forms.CheckState.Checked Me.cbxAbfVerbotdrucken.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxAbfVerbotdrucken.Location = New System.Drawing.Point(166, 256) Me.cbxAbfVerbotdrucken.Location = New System.Drawing.Point(166, 262)
Me.cbxAbfVerbotdrucken.Name = "cbxAbfVerbotdrucken" Me.cbxAbfVerbotdrucken.Name = "cbxAbfVerbotdrucken"
Me.cbxAbfVerbotdrucken.Size = New System.Drawing.Size(157, 17) Me.cbxAbfVerbotdrucken.Size = New System.Drawing.Size(157, 17)
Me.cbxAbfVerbotdrucken.TabIndex = 47 Me.cbxAbfVerbotdrucken.TabIndex = 47
@@ -444,7 +457,7 @@ Partial Class usrcntlFakturierung
Me.cbxRechnungsjournaldrucken.AutoSize = True Me.cbxRechnungsjournaldrucken.AutoSize = True
Me.cbxRechnungsjournaldrucken.Checked = True Me.cbxRechnungsjournaldrucken.Checked = True
Me.cbxRechnungsjournaldrucken.CheckState = System.Windows.Forms.CheckState.Checked Me.cbxRechnungsjournaldrucken.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxRechnungsjournaldrucken.Location = New System.Drawing.Point(6, 256) Me.cbxRechnungsjournaldrucken.Location = New System.Drawing.Point(6, 262)
Me.cbxRechnungsjournaldrucken.Name = "cbxRechnungsjournaldrucken" Me.cbxRechnungsjournaldrucken.Name = "cbxRechnungsjournaldrucken"
Me.cbxRechnungsjournaldrucken.Size = New System.Drawing.Size(154, 17) Me.cbxRechnungsjournaldrucken.Size = New System.Drawing.Size(154, 17)
Me.cbxRechnungsjournaldrucken.TabIndex = 46 Me.cbxRechnungsjournaldrucken.TabIndex = 46
@@ -464,7 +477,7 @@ Partial Class usrcntlFakturierung
' '
'Label72 'Label72
' '
Me.Label72.Location = New System.Drawing.Point(96, 280) Me.Label72.Location = New System.Drawing.Point(96, 286)
Me.Label72.Name = "Label72" Me.Label72.Name = "Label72"
Me.Label72.Size = New System.Drawing.Size(589, 19) Me.Label72.Size = New System.Drawing.Size(589, 19)
Me.Label72.TabIndex = 42 Me.Label72.TabIndex = 42
@@ -490,7 +503,7 @@ Partial Class usrcntlFakturierung
Me.KdSearchBox3.KdNr = "-1" Me.KdSearchBox3.KdNr = "-1"
Me.KdSearchBox3.kdNrField = Nothing Me.KdSearchBox3.kdNrField = Nothing
Me.KdSearchBox3.KdNrNullInt = Nothing Me.KdSearchBox3.KdNrNullInt = Nothing
Me.KdSearchBox3.Location = New System.Drawing.Point(87, 302) Me.KdSearchBox3.Location = New System.Drawing.Point(87, 308)
Me.KdSearchBox3.Name = "KdSearchBox3" Me.KdSearchBox3.Name = "KdSearchBox3"
Me.KdSearchBox3.nurAktive = True Me.KdSearchBox3.nurAktive = True
Me.KdSearchBox3.searchActive = True Me.KdSearchBox3.searchActive = True
@@ -502,7 +515,7 @@ Partial Class usrcntlFakturierung
'rbkunde 'rbkunde
' '
Me.rbkunde.AutoSize = True Me.rbkunde.AutoSize = True
Me.rbkunde.Location = New System.Drawing.Point(9, 303) Me.rbkunde.Location = New System.Drawing.Point(9, 309)
Me.rbkunde.Name = "rbkunde" Me.rbkunde.Name = "rbkunde"
Me.rbkunde.Size = New System.Drawing.Size(59, 17) Me.rbkunde.Size = New System.Drawing.Size(59, 17)
Me.rbkunde.TabIndex = 40 Me.rbkunde.TabIndex = 40
@@ -513,7 +526,7 @@ Partial Class usrcntlFakturierung
' '
Me.rbAlleKunden.AutoSize = True Me.rbAlleKunden.AutoSize = True
Me.rbAlleKunden.Checked = True Me.rbAlleKunden.Checked = True
Me.rbAlleKunden.Location = New System.Drawing.Point(9, 280) Me.rbAlleKunden.Location = New System.Drawing.Point(9, 286)
Me.rbAlleKunden.Name = "rbAlleKunden" Me.rbAlleKunden.Name = "rbAlleKunden"
Me.rbAlleKunden.Size = New System.Drawing.Size(81, 17) Me.rbAlleKunden.Size = New System.Drawing.Size(81, 17)
Me.rbAlleKunden.TabIndex = 39 Me.rbAlleKunden.TabIndex = 39
@@ -525,7 +538,7 @@ Partial Class usrcntlFakturierung
' '
Me.txtPloseAnh_Einarbeitung.BackColor = System.Drawing.Color.White Me.txtPloseAnh_Einarbeitung.BackColor = System.Drawing.Color.White
Me.txtPloseAnh_Einarbeitung.BorderStyle = System.Windows.Forms.BorderStyle.None Me.txtPloseAnh_Einarbeitung.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.txtPloseAnh_Einarbeitung.Location = New System.Drawing.Point(209, 212) Me.txtPloseAnh_Einarbeitung.Location = New System.Drawing.Point(209, 218)
Me.txtPloseAnh_Einarbeitung.Name = "txtPloseAnh_Einarbeitung" Me.txtPloseAnh_Einarbeitung.Name = "txtPloseAnh_Einarbeitung"
Me.txtPloseAnh_Einarbeitung.Size = New System.Drawing.Size(106, 13) Me.txtPloseAnh_Einarbeitung.Size = New System.Drawing.Size(106, 13)
Me.txtPloseAnh_Einarbeitung.TabIndex = 38 Me.txtPloseAnh_Einarbeitung.TabIndex = 38
@@ -533,7 +546,7 @@ Partial Class usrcntlFakturierung
'Label71 'Label71
' '
Me.Label71.AutoSize = True Me.Label71.AutoSize = True
Me.Label71.Location = New System.Drawing.Point(144, 212) Me.Label71.Location = New System.Drawing.Point(144, 218)
Me.Label71.Name = "Label71" Me.Label71.Name = "Label71"
Me.Label71.Size = New System.Drawing.Size(56, 13) Me.Label71.Size = New System.Drawing.Size(56, 13)
Me.Label71.TabIndex = 35 Me.Label71.TabIndex = 35
@@ -541,14 +554,14 @@ Partial Class usrcntlFakturierung
' '
'pbPloseAnh_Proz 'pbPloseAnh_Proz
' '
Me.pbPloseAnh_Proz.Location = New System.Drawing.Point(147, 183) Me.pbPloseAnh_Proz.Location = New System.Drawing.Point(147, 189)
Me.pbPloseAnh_Proz.Name = "pbPloseAnh_Proz" Me.pbPloseAnh_Proz.Name = "pbPloseAnh_Proz"
Me.pbPloseAnh_Proz.Size = New System.Drawing.Size(283, 23) Me.pbPloseAnh_Proz.Size = New System.Drawing.Size(283, 23)
Me.pbPloseAnh_Proz.TabIndex = 36 Me.pbPloseAnh_Proz.TabIndex = 36
' '
'lblPloseAnh_Proz 'lblPloseAnh_Proz
' '
Me.lblPloseAnh_Proz.Location = New System.Drawing.Point(361, 212) Me.lblPloseAnh_Proz.Location = New System.Drawing.Point(361, 218)
Me.lblPloseAnh_Proz.Name = "lblPloseAnh_Proz" Me.lblPloseAnh_Proz.Name = "lblPloseAnh_Proz"
Me.lblPloseAnh_Proz.Size = New System.Drawing.Size(69, 13) Me.lblPloseAnh_Proz.Size = New System.Drawing.Size(69, 13)
Me.lblPloseAnh_Proz.TabIndex = 37 Me.lblPloseAnh_Proz.TabIndex = 37
@@ -559,7 +572,7 @@ Partial Class usrcntlFakturierung
' '
Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button19.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) Me.Button19.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button19.Location = New System.Drawing.Point(10, 183) Me.Button19.Location = New System.Drawing.Point(10, 163)
Me.Button19.Name = "Button19" Me.Button19.Name = "Button19"
Me.Button19.Size = New System.Drawing.Size(121, 49) Me.Button19.Size = New System.Drawing.Size(121, 49)
Me.Button19.TabIndex = 32 Me.Button19.TabIndex = 32
@@ -568,7 +581,7 @@ Partial Class usrcntlFakturierung
' '
'Label70 'Label70
' '
Me.Label70.Location = New System.Drawing.Point(252, 151) Me.Label70.Location = New System.Drawing.Point(171, 172)
Me.Label70.Name = "Label70" Me.Label70.Name = "Label70"
Me.Label70.Size = New System.Drawing.Size(429, 14) Me.Label70.Size = New System.Drawing.Size(429, 14)
Me.Label70.TabIndex = 30 Me.Label70.TabIndex = 30
@@ -613,7 +626,7 @@ Partial Class usrcntlFakturierung
' '
'Label65 'Label65
' '
Me.Label65.Location = New System.Drawing.Point(252, 117) Me.Label65.Location = New System.Drawing.Point(171, 138)
Me.Label65.Name = "Label65" Me.Label65.Name = "Label65"
Me.Label65.Size = New System.Drawing.Size(440, 17) Me.Label65.Size = New System.Drawing.Size(440, 17)
Me.Label65.TabIndex = 8 Me.Label65.TabIndex = 8
@@ -621,7 +634,7 @@ Partial Class usrcntlFakturierung
' '
'Label64 'Label64
' '
Me.Label64.Location = New System.Drawing.Point(252, 100) Me.Label64.Location = New System.Drawing.Point(171, 121)
Me.Label64.Name = "Label64" Me.Label64.Name = "Label64"
Me.Label64.Size = New System.Drawing.Size(440, 17) Me.Label64.Size = New System.Drawing.Size(440, 17)
Me.Label64.TabIndex = 7 Me.Label64.TabIndex = 7
@@ -629,7 +642,7 @@ Partial Class usrcntlFakturierung
' '
'Label63 'Label63
' '
Me.Label63.Location = New System.Drawing.Point(252, 83) Me.Label63.Location = New System.Drawing.Point(171, 104)
Me.Label63.Name = "Label63" Me.Label63.Name = "Label63"
Me.Label63.Size = New System.Drawing.Size(440, 17) Me.Label63.Size = New System.Drawing.Size(440, 17)
Me.Label63.TabIndex = 6 Me.Label63.TabIndex = 6
@@ -638,7 +651,7 @@ Partial Class usrcntlFakturierung
' '
'Label45 'Label45
' '
Me.Label45.Location = New System.Drawing.Point(252, 66) Me.Label45.Location = New System.Drawing.Point(171, 87)
Me.Label45.Name = "Label45" Me.Label45.Name = "Label45"
Me.Label45.Size = New System.Drawing.Size(224, 17) Me.Label45.Size = New System.Drawing.Size(224, 17)
Me.Label45.TabIndex = 5 Me.Label45.TabIndex = 5
@@ -648,23 +661,24 @@ Partial Class usrcntlFakturierung
' '
Me.Button14.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button14.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button14.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) Me.Button14.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button14.Location = New System.Drawing.Point(10, 85) Me.Button14.Location = New System.Drawing.Point(10, 90)
Me.Button14.Name = "Button14" Me.Button14.Name = "Button14"
Me.Button14.Size = New System.Drawing.Size(121, 49) Me.Button14.Size = New System.Drawing.Size(121, 49)
Me.Button14.TabIndex = 4 Me.Button14.TabIndex = 4
Me.Button14.Text = "Rechnungspos. berechnen" Me.Button14.Text = "Rechnungspos. berechnen"
Me.Button14.UseVisualStyleBackColor = True Me.Button14.UseVisualStyleBackColor = True
' '
'Button1 'cbxMautanh
' '
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.cbxMautanh.AutoSize = True
Me.Button1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) Me.cbxMautanh.Checked = True
Me.Button1.Location = New System.Drawing.Point(10, 12) Me.cbxMautanh.CheckState = System.Windows.Forms.CheckState.Checked
Me.Button1.Name = "Button1" Me.cbxMautanh.Location = New System.Drawing.Point(450, 262)
Me.Button1.Size = New System.Drawing.Size(121, 49) Me.cbxMautanh.Name = "cbxMautanh"
Me.Button1.TabIndex = 106 Me.cbxMautanh.Size = New System.Drawing.Size(184, 17)
Me.Button1.Text = "Mautanh. prüfen" Me.cbxMautanh.TabIndex = 107
Me.Button1.UseVisualStyleBackColor = True Me.cbxMautanh.Text = "Mautanhänge im PDF hinzufügen"
Me.cbxMautanh.UseVisualStyleBackColor = True
' '
'usrcntlFakturierung 'usrcntlFakturierung
' '
@@ -747,4 +761,5 @@ Partial Class usrcntlFakturierung
Friend WithEvents PictureBox3 As PictureBox Friend WithEvents PictureBox3 As PictureBox
Friend WithEvents PictureBox2 As PictureBox Friend WithEvents PictureBox2 As PictureBox
Friend WithEvents Button1 As Button Friend WithEvents Button1 As Button
Friend WithEvents cbxMautanh As CheckBox
End Class End Class

View File

@@ -37,6 +37,8 @@ Public Class usrcntlFakturierung
PathMautberichte = (New SQL).getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='GESAMTMAUT' AND [Param_name]='ANLAGE_PFAD' AND Param_testsystem = " & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, 1, 0), "FMZOLL") PathMautberichte = (New SQL).getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='GESAMTMAUT' AND [Param_name]='ANLAGE_PFAD' AND Param_testsystem = " & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, 1, 0), "FMZOLL")
'PathMautberichte = "C:\Users\d.breimaier\Desktop\MDM\Mautgesamtberichte\"
Dim countCSV = 0 Dim countCSV = 0
Dim countPDF = 0 Dim countPDF = 0
If Directory.Exists(PathMautberichte) Then If Directory.Exists(PathMautberichte) Then
@@ -221,7 +223,7 @@ Public Class usrcntlFakturierung
'410 Set qdf = dbs.CreateQueryDef("") '410 Set qdf = dbs.CreateQueryDef("")
ok = SQL.doSQL("update [Rechnungsausgang] set Sachbearbeiter='" & Sachbearbeiter & "' where Sammelrechnung=6 and Firma_ID=19 and UPPER([Sachbearbeiter])<>'" & Sachbearbeiter & "' and Abfertigungsdatum = '" & dtRechnungsdatum.Value & "'", "FMZOLL") ok = SQL.doSQL("update [Rechnungsausgang] set Sachbearbeiter='" & Sachbearbeiter & "' where Sammelrechnung=6 and Firma_ID=19 and [Status] = 0 and UPPER([Sachbearbeiter])<>'" & Sachbearbeiter & "' and Abfertigungsdatum = '" & dtRechnungsdatum.Value & "'", "FMZOLL")
showPic(ok, PictureBox1) showPic(ok, PictureBox1)
'If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Exit Sub 'If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Exit Sub
@@ -959,10 +961,10 @@ Public Class usrcntlFakturierung
Dim SQLStringGruppierteSammelrechnung = "SELECT [Firma_ID], RechnungsNr,Buchungsjahr,DruckDatumZeit,[Status] Dim SQLStringGruppierteSammelrechnung = "SELECT [Firma_ID], RechnungsNr,Buchungsjahr,DruckDatumZeit,[Status], RechnungsKundenNr, Adressen.LandKz
FROM Rechnungsausgang FROM Rechnungsausgang INNER JOIN Adressen on AdressenNr = RechnungsKundenNr
WHERE [Status] = 2 AND [Sammelrechnung] = 6 AND UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' and RechnungsNr is not null " & IIf(kdnr > 0, " AND RechnungsKundenNr = " & kdnr, "") & " WHERE [Status] = 2 AND [Sammelrechnung] = 6 AND UPPER(Rechnungsausgang.Sachbearbeiter) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' and RechnungsNr is not null " & IIf(kdnr > 0, " AND RechnungsKundenNr = " & kdnr, "") & "
group by [Firma_ID], RechnungsNr,Buchungsjahr,DruckDatumZeit,[Status] group by [Firma_ID], RechnungsNr,Buchungsjahr,DruckDatumZeit,[Status], RechnungsKundenNr, Adressen.LandKz
ORDER BY [Firma_ID], [Status], RechnungsNr" ORDER BY [Firma_ID], [Status], RechnungsNr"
Dim dtSelectedSammelrechnungen As DataTable = (New SQL).loadDgvBySql(SQLStringGruppierteSammelrechnung, "FMZOLL") Dim dtSelectedSammelrechnungen As DataTable = (New SQL).loadDgvBySql(SQLStringGruppierteSammelrechnung, "FMZOLL")
@@ -972,26 +974,33 @@ Public Class usrcntlFakturierung
If cbxVorschau.Checked Then If cbxVorschau.Checked Then
Dim nurNICHTEUKunden As Boolean = False Dim nurNICHTEUKunden As Boolean = False
If rbAlleKunden.Checked Then If rbAlleKunden.Checked Then
If vbYes = MsgBox("Sollen nur die Rechnungen der NICHT-EU Kunden gedruckt werden?", vbYesNoCancel) Then nurNICHTEUKunden = True nurNICHTEUKunden = MsgBox("Sollen nur die Rechnungen der NICHT-EU Kunden gedruckt werden?", vbYesNo)
End If End If
For Each rowRE In dtSelectedSammelrechnungen.Rows Dim dTLANDEU As DataTable = (New SQL).loadDgvBySql("select LandKz, MitgliedslandEU from Währungstabelle where LandKz is not null", "FMZOLL")
Dim path = "" Dim R As DataRow = dTLANDEU.NewRow
R("LandKz") = "MK"
R("MitgliedslandEU") = False
dTLANDEU.Rows.Add(R)
For Each rowRE In dtSelectedSammelrechnungen.Rows
cFakturierung.doSAMMELRechnungsDruck_Abschnitt(rowRE("RechnungsNr"), rowRE("Firma_ID"), rowRE("Buchungsjahr"), rowRE("DruckDatumZeit"), "", True, True, 7, path,, , , , , , , ) Dim path = ""
If path <> "" Then If nurNICHTEUKunden Then
If nurNICHTEUKunden Then
'TODO-> nur nicht EU-Kunden zu Path Dim isEU As Boolean = dTLANDEU.AsEnumerable().Where(Function(res) res.Field(Of String)("LandKz") = rowRE("LandKZ")).Select(Function(res) res.Field(Of Boolean)("MitgliedslandEU")).FirstOrDefault()
listPDFs.Add(path) If Not isEU Then cFakturierung.doSAMMELRechnungsDruck_Abschnitt(rowRE("RechnungsNr"), rowRE("Firma_ID"), rowRE("Buchungsjahr"), rowRE("DruckDatumZeit"), "", True, True, 7, path,, , , , , , ,,, cbxMautanh.Checked)
Else If path <> "" Then listPDFs.Add(path)
listPDFs.Add(path) Else
End If
cFakturierung.doSAMMELRechnungsDruck_Abschnitt(rowRE("RechnungsNr"), rowRE("Firma_ID"), rowRE("Buchungsjahr"), rowRE("DruckDatumZeit"), "", True, True, 7, path,, , , , , , , ,, cbxMautanh.Checked)
If path <> "" Then listPDFs.Add(path)
End If End If
If True Then 'cnt Mod 10 = 0 Then If True Then 'cnt Mod 10 = 0 Then
txtPloseAnh_Einarbeitung.Text = cnt & " / " & dtSelectedSammelrechnungen.Rows.Count txtPloseAnh_Einarbeitung.Text = cnt & " / " & dtSelectedSammelrechnungen.Rows.Count
Dim proz As Double = (cnt / dtSelectedSammelrechnungen.Rows.Count) * 100 Dim proz As Double = (cnt / dtSelectedSammelrechnungen.Rows.Count) * 100
@@ -1000,29 +1009,37 @@ Public Class usrcntlFakturierung
'GroupBox12.Refresh() 'GroupBox12.Refresh()
My.Application.DoEvents() My.Application.DoEvents()
End If End If
cnt += 1 cnt += 1
Next 'Exit For
Next
If listPDFs.Count > 0 Then If listPDFs.Count > 0 Then
Dim pathPDF = listPDFs(0).ToString Dim pathPDF = listPDFs(0).ToString
If listPDFs.Count > 1 Then If listPDFs.Count > 1 Then
Dim pathPDFMerge = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("MDM_Sammelrechnung.pdf", ".pdf", False, False) Dim pathPDFMerge = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("MDM_Sammelrechnung.pdf", ".pdf", False, False)
If Not FormularManagerNEU.MergePdfFiles(listPDFs, pathPDFMerge) Then If Not FormularManagerNEU.MergePdfFiles(listPDFs, pathPDFMerge) Then
Exit Sub Exit Sub
MsgBox("Fehler beim Zusammenführen der PDFs.") MsgBox("Fehler beim Zusammenführen der PDFs.")
End If Else
Process.Start(pathPDFMerge)
End If End If
Else
Process.Start(pathPDF)
End If
pbPloseAnh_Proz.Value = 100 pbPloseAnh_Proz.Value = 100
txtPloseAnh_Einarbeitung.Text = dtSelectedSammelrechnungen.Rows.Count & " / " & dtSelectedSammelrechnungen.Rows.Count txtPloseAnh_Einarbeitung.Text = dtSelectedSammelrechnungen.Rows.Count & " / " & dtSelectedSammelrechnungen.Rows.Count
lblPloseAnh_Proz.Text = "100.00 %" lblPloseAnh_Proz.Text = "100.00 %"
Process.Start(pathPDF)
Else
Else
MsgBox("Datei von " & rechnungsdatum.ToShortDateString & " konnte nicht erstellt werden!") MsgBox("Datei von " & rechnungsdatum.ToShortDateString & " konnte nicht erstellt werden!")
End If End If
@@ -1246,7 +1263,15 @@ Public Class usrcntlFakturierung
Dim dt_PDF_selected = dtBerichtkunden_PDF.Select("[Customer No] ='" & pdf.Item(0) & "'").CopyToDataTable Dim dt_PDF_selected = dtBerichtkunden_PDF.Select("[Customer No] ='" & pdf.Item(0) & "'").CopyToDataTable
createPDFMautbericht(pdf.Item(0), dt_PDF_selected, cbxDateMautbericht._value, PathMautberichte) Dim dtLaender As DataTable = (New SQL).loadDgvBySql("SELECT tblMautbericht.[Customer No], tblMautbericht.[Transaction Country], sum(tblMautbericht.[Net Amount]) as Netto, sum(tblMautbericht.[VAT Amount]) as MWST, sum(tblMautbericht.[Total Amount]) as Brutto
FROM tblMautbericht WHERE [Customer No] ='" & pdf.Item(0) & "'
GROUP BY [Customer No], [Transaction Country]
ORDER BY tblMautbericht.[Customer No], tblMautbericht.[Transaction Country]", "FMZOLL")
createPDFMautbericht(pdf.Item(0), dt_PDF_selected, cbxDateMautbericht._value, PathMautberichte, dtLaender)
@@ -1295,7 +1320,7 @@ Public Class usrcntlFakturierung
End Try End Try
End Sub End Sub
Private Function createPDFMautbericht(kdnr As Integer, dt As DataTable, anhangsdatum As Date, path As String) As String Private Function createPDFMautbericht(kdnr As Integer, dt As DataTable, anhangsdatum As Date, path As String, dtLaender As DataTable) As String
Dim rpt As New rptPLOSE_Anhang Dim rpt As New rptPLOSE_Anhang
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
@@ -1308,17 +1333,17 @@ Public Class usrcntlFakturierung
rpt.GroupHeaderKz.DataField = "Licence Plate Number" rpt.GroupHeaderKz.DataField = "Licence Plate Number"
rpt.txtNettoKzSum.Visible = False 'rpt.txtNettoKzSum.Visible = False
rpt.txtNettoGesSum.Visible = False 'rpt.txtNettoGesSum.Visible = False
rpt.txtNetto.Visible = False 'rpt.txtNetto.Visible = False
rpt.txtNettoKatSum.Visible = False 'rpt.txtNettoKatSum.Visible = False
rpt.lblNetto.Visible = False 'rpt.lblNetto.Visible = False
rpt.txtMWSTKzSum.Visible = False 'rpt.txtMWSTKzSum.Visible = False
rpt.txtMWSTGEsSum.Visible = False 'rpt.txtMWSTGEsSum.Visible = False
rpt.txtMWST.Visible = False 'rpt.txtMWST.Visible = False
rpt.txtMWSTKatSum.Visible = False 'rpt.txtMWSTKatSum.Visible = False
rpt.lblMWST.Visible = False 'rpt.lblMWST.Visible = False
'rpt.lblBrutto.Text = "Total Amount ( EUR )" 'rpt.lblBrutto.Text = "Total Amount ( EUR )"
'rpt.Label4.Text = bis.ToShortDateString 'rpt.Label4.Text = bis.ToShortDateString
@@ -1329,6 +1354,15 @@ Public Class usrcntlFakturierung
rpt.lblSummeKennzeichen.Visible = False rpt.lblSummeKennzeichen.Visible = False
rpt.lblService.Visible = False rpt.lblService.Visible = False
rpt.Label2.Visible = False
rpt.TextBox1.Visible = False
rpt.Label3.Visible = False
rpt.Label4.Visible = False
rpt.lblFirmaFax.Visible = False
rpt.lblFirmaEmail.Visible = False
rpt.Label16.Visible = False
'rpt.lblSummeKennzeichen.Location = New PointF(rpt.lblSummeKennzeichen.Location.X + 4.5, rpt.lblSummeKennzeichen.Location.Y) 'rpt.lblSummeKennzeichen.Location = New PointF(rpt.lblSummeKennzeichen.Location.X + 4.5, rpt.lblSummeKennzeichen.Location.Y)
'rpt.lblSumKategorie.Location = New PointF(rpt.lblSumKategorie.Location.X + 4.5, rpt.lblSumKategorie.Location.Y) 'rpt.lblSumKategorie.Location = New PointF(rpt.lblSumKategorie.Location.X + 4.5, rpt.lblSumKategorie.Location.Y)
'rpt.lblGessumme.Location = New PointF(rpt.lblGessumme.Location.X + 4.5, rpt.lblGessumme.Location.Y) 'rpt.lblGessumme.Location = New PointF(rpt.lblGessumme.Location.X + 4.5, rpt.lblGessumme.Location.Y)
@@ -1367,8 +1401,8 @@ Public Class usrcntlFakturierung
rpt.txtMWST.Text = sql.isDbnullEmptyDbl(rpt.Fields.Item("VAT Amount").Value, 2, "") rpt.txtMWST.Text = sql.isDbnullEmptyDbl(rpt.Fields.Item("VAT Amount").Value, 2, "")
rpt.txtBrutto.Text = sql.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 2, "") rpt.txtBrutto.Text = sql.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 2, "")
sumNetto += 0 'SQL.isDbnullEmptyDbl(rpt.Fields.Item("plose_NettobetragWaehrungAbbuchung").Value, 4, 0) sumNetto += sql.isDbnullEmptyDbl(rpt.Fields.Item("Net Amount").Value, 4, 0)
sumMWST += 0 'SQL.isDbnullEmptyDbl(rpt.Fields.Item("plose_MWSTBetragWaehrungAbbuchung").Value, 4, 0) sumMWST += sql.isDbnullEmptyDbl(rpt.Fields.Item("VAT Amount").Value, 4, 0)
sumBrutto += sql.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 4, 0) sumBrutto += sql.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 4, 0)
cnt += 1 cnt += 1
End Sub End Sub
@@ -1410,6 +1444,7 @@ Public Class usrcntlFakturierung
rpt.txtMWSTKatSum.Text = sumMWSTKat.ToString("N2") rpt.txtMWSTKatSum.Text = sumMWSTKat.ToString("N2")
rpt.txtBruttoKatSum.Text = sumBruttoKat.ToString("N2") rpt.txtBruttoKatSum.Text = sumBruttoKat.ToString("N2")
cntKat += 1 cntKat += 1
rpt.lblSumKategorie.Text = rpt.lblSumKategorie.Text.Replace("Kunde", sql.isDbnullEmpty(rpt.Fields.Item("Customer No").Value, ""))
End Sub End Sub
AddHandler rpt.ReportFooter1.Format, Sub() AddHandler rpt.ReportFooter1.Format, Sub()
'sumNettoGes += sumNettoKat 'sumNettoGes += sumNettoKat
@@ -1443,6 +1478,63 @@ Public Class usrcntlFakturierung
Dim tmpPath = path & "\" & kdnr & "_Maut.pdf" Dim tmpPath = path & "\" & kdnr & "_Maut.pdf"
Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
rpt.Run(False) rpt.Run(False)
Dim rpt2 As New rptPLOSE_LaenderGesamt
rpt2.DataSource = dtLaender
rpt2.Label7.Visible = False
rpt2.lblEU.Visible = False
rpt2.lblUeberschrift.Text = "Länder Gesamt"
Dim sum = 0
' rpt.lblUeberschrift.Text = "PLOSE Summenbericht " & dat_Sum_Von.Text & " bis " & dat_Sum_Bis.Text
rpt2.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung
'Dim cnt As Integer = 0
rpt2.lblDat.Text = Now.ToLongDateString
Dim sumPreis As Double = 0
Dim sumNettoLaender As Double = 0
Dim sumMWSTLaender As Double = 0
Dim sumBruttoLaender As Double = 0
Dim sumBruttoAlleLeistungen As Double = 0
Dim sumMenge As Double = 0
AddHandler rpt2.Detail.Format, Sub()
rpt2.lblLand.Text = sql.isDbnullEmpty(rpt2.Fields.Item("Transaction Country").Value, "")
rpt2.lblEU.Text = "" 'sql.isDbnullEmpty(rpt.Fields.Item("EU").Value, "")
rpt2.lblNetto.Text = sql.isDbnullEmptyDbl(rpt2.Fields.Item("Netto").Value, 2, "")
rpt2.lblMWST.Text = sql.isDbnullEmptyDbl(rpt2.Fields.Item("MWST").Value, 2, "")
rpt2.lblBrutto.Text = sql.isDbnullEmptyDbl(rpt2.Fields.Item("Brutto").Value, 2, "")
sumNetto += sql.isDbnullEmptyDbl(rpt2.Fields.Item("Netto").Value, 4, 0)
sumMWST += sql.isDbnullEmptyDbl(rpt2.Fields.Item("MWST").Value, 4, 0)
sumBrutto += sql.isDbnullEmptyDbl(rpt2.Fields.Item("Brutto").Value, 4, 0)
End Sub
AddHandler rpt2.ReportFooter1.Format, Sub()
rpt2.lblSumNetto.Text = sumNetto.ToString("N2")
rpt2.lblSumMwst.Text = sumMWST.ToString("N2")
rpt2.lblSumBrutto.Text = sumBrutto.ToString("N2")
End Sub
rpt2.Run()
For i = 0 To rpt2.Document.Pages.Count - 1
rpt.Document.Pages.Add(rpt2.Document.Pages(i))
Next
p.NeverEmbedFonts = "" p.NeverEmbedFonts = ""
p.Export(rpt.Document, tmpPath) p.Export(rpt.Document, tmpPath)
@@ -1513,18 +1605,53 @@ Public Class usrcntlFakturierung
Dim rechnungenMitGesamtmautanhantCSV As String = (New SQL).getValueTxtBySqlVarList("SELECT COUNT(*) FROM Rechnungsausgang Dim rechnungenMitGesamtmautanhantCSV As String = (New SQL).getValueTxtBySqlVarList("SELECT COUNT(*) FROM Rechnungsausgang
inner join RechnungsausgangAnhaenge on Rechnungsausgang.RK_ID = RechnungsausgangAnhaenge.RK_ID inner join RechnungsausgangAnhaenge on Rechnungsausgang.RK_ID = RechnungsausgangAnhaenge.RK_ID
WHERE [Status] = 0 AND [Sammelrechnung] = 6 AND UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' WHERE ([Status] = 0 or [Status] = 2 or [Status] = 4) AND [Sammelrechnung] = 6 AND UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "'
and (RechnungsausgangAnhaenge.Bezeichnung like '%Maut.csv') and (RechnungsausgangAnhaenge.Bezeichnung like '%Maut.csv')", "FMZOLL",, 0)
group by [Firma_ID], RechnungsNr,Buchungsjahr,DruckDatumZeit,[Status], RechnungsausgangAnhaenge.Bezeichnung ", "FMZOLL",, 0)
Dim rechnungenMitGesamtmautanhantPDF As String = (New SQL).getValueTxtBySqlVarList("SELECT COUNT(*) FROM Rechnungsausgang Dim rechnungenMitGesamtmautanhantPDF As String = (New SQL).getValueTxtBySqlVarList("SELECT COUNT(*) FROM Rechnungsausgang
inner join RechnungsausgangAnhaenge on Rechnungsausgang.RK_ID = RechnungsausgangAnhaenge.RK_ID inner join RechnungsausgangAnhaenge on Rechnungsausgang.RK_ID = RechnungsausgangAnhaenge.RK_ID
WHERE [Status] = 0 AND [Sammelrechnung] = 6 AND UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' WHERE ([Status] = 0 or [Status] = 2 or [Status] = 4) AND [Sammelrechnung] = 6 AND UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "'
and (RechnungsausgangAnhaenge.Bezeichnung like '%Maut.pdf') and (RechnungsausgangAnhaenge.Bezeichnung like '%Maut.pdf')", "FMZOLL",, 0)
group by [Firma_ID], RechnungsNr,Buchungsjahr,DruckDatumZeit,[Status], RechnungsausgangAnhaenge.Bezeichnung ", "FMZOLL",, 0)
MsgBox("Anzahl CSV-Anhänge: " & rechnungenMitGesamtmautanhantCSV & vbNewLine & "Anzahl PDF-Anhänge: " & rechnungenMitGesamtmautanhantPDF) MsgBox("Anzahl CSV-Anhänge: " & rechnungenMitGesamtmautanhantCSV & vbNewLine & "Anzahl PDF-Anhänge: " & rechnungenMitGesamtmautanhantPDF)
End Sub End Sub
Private Sub dtRechnungsdatum_ValueChanged(sender As Object, e As EventArgs) Handles dtRechnungsdatum.ValueChanged
Dim sammelrechnung0vorhanden As Boolean = True
sammelrechnung0vorhanden = checkIfStatus0Sammelrechnugnenvorhanden(cboSachbearbeiter._value, CDate(dtRechnungsdatum.Text))
Button14.Enabled = sammelrechnung0vorhanden
'Button19.Enabled = sammelrechnung0vorhanden wenn RE bereits Status 2 wird sie nur gedruckt!!!!
Button20.Enabled = sammelrechnung0vorhanden
End Sub
Private Function checkIfStatus0Sammelrechnugnenvorhanden(Sachbearbeiter As String, rechnungsdatum As Date) As Boolean
If Sachbearbeiter = "" Then Return False
If rechnungsdatum > Today() Then Return False
Dim rechnungenMitStatus0 As Integer = CInt((New SQL).getValueTxtBySqlVarList("SELECT COUNT(*) From Rechnungsausgang
Where [Status] = 0 And [Sammelrechnung] = 6 And UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "'", "FMZOLL",, 0))
Return rechnungenMitStatus0 > 0
End Function
Private Sub cboSachbearbeiter_RightToLeftChanged(sender As Object, e As EventArgs) Handles cboSachbearbeiter.RightToLeftChanged
Dim sammelrechnung0vorhanden As Boolean = True
sammelrechnung0vorhanden = checkIfStatus0Sammelrechnugnenvorhanden(cboSachbearbeiter._value, CDate(dtRechnungsdatum.Text))
'Button19.Enabled = sammelrechnung0vorhanden wenn RE bereits Status 2 wird sie nur gedruckt!!!!
Button14.Enabled = sammelrechnung0vorhanden
Button20.Enabled = sammelrechnung0vorhanden
End Sub
End Class End Class