USTVA-Antrag, etc.

This commit is contained in:
2025-05-27 17:02:52 +02:00
parent 05fed2d357
commit 747835170f
2 changed files with 49 additions and 6 deletions

View File

@@ -3177,14 +3177,32 @@ Public Class frmMDM_USTVAntrag
Private Sub pb_Beleg_Click(sender As Object, e As EventArgs) Handles pb_Beleg.Click
Dim RK_ID As Integer = CInt(SQL.getValueTxtBySql("select top(1) RK_ID from Rechnungsausgang where FilialenNr = " & USTV_ANTRAG.FilialenNr & " and AbfertigungsNr = " & USTV_ANTRAG.AbfertigungsNr & " and DruckDatumZeit is not null and Firma_ID = 19", "FMZOLL", ,, "0"))
If RK_ID > 0 Then
Dim RG_PATH = ""
cFakturierung.doRechnungsDruck_SRorER(RK_ID,, False, 4, RG_PATH,,, True)
Process.Start(RG_PATH)
Dim dtRE As DataTable = (New SQL).loadDgvBySql("select RK_ID, RechnungsNr, FilialenNr from Rechnungsausgang where FilialenNr = " & USTV_ANTRAG.FilialenNr & " and AbfertigungsNr = " & USTV_ANTRAG.AbfertigungsNr & " and Firma_ID = 19", "FMZOLL")
ncs_Belege.Items.Clear()
If dtRE.Rows.Count > 0 Then
Dim RK_ID As String = ""
For Each r As DataRow In dtRE.Rows
Dim re = New ToolStripMenuItem() With {.Text = r.Item("FilialenNr") & " - " & r.Item("RechnungsNr"), .Name = r.Item("RK_ID"), .Font = New Font(Me.Font.FontFamily, Me.Font.Size)}
ncs_Belege.Items.Add(re)
AddHandler re.Click, AddressOf mnuItemBelegeOpenPDF_Clicked
Next
End If
ncs_Belege.Show(Cursor.Position)
End Sub
Private Sub cbxRGretour_CheckedChanged(sender As Object, e As EventArgs) Handles cbxRGretour.CheckedChanged
@@ -3320,8 +3338,30 @@ Public Class frmMDM_USTVAntrag
End If
End If
End Sub
Private Sub mnuItemBelegeOpenPDF_Clicked(sender As Object, e As EventArgs)
ncs_Belege.Hide()
Dim item As ToolStripMenuItem = TryCast(sender, ToolStripMenuItem)
If item IsNot Nothing Then
If item.Name <> "" Then
If IsNumeric(item.Name) Then
Dim RG_PATH = ""
cFakturierung.doRechnungsDruck_SRorER(item.Name,, False, 4, RG_PATH,,, True)
Process.Start(RG_PATH)
End If
End If
End If
End Sub

View File

@@ -1100,7 +1100,10 @@ Public Class cMDMFunctionsAllgemein
Else
For Each row In dtNew.Rows
row("Name of supplier") = row("Name of supplier").ToString.Replace(" " & row("VAT").ToString.Substring(0, 2), "")
If Not IsDBNull(row("VAT")) AndAlso row("VAT") <> "" AndAlso Not IsDBNull(row("Name of supplier")) AndAlso row("Name of supplier") <> "" Then
row("Name of supplier") = row("Name of supplier").ToString.Replace(" " & row("VAT").ToString.Substring(0, 2), "")
End If
Next
If dtNew.Columns.Contains("Number") Then