Essensbestellungen, scanlist, etc.

This commit is contained in:
2025-02-26 14:35:25 +01:00
parent aecfcaffe0
commit b32a117a96
8 changed files with 709 additions and 636 deletions

View File

@@ -1279,6 +1279,22 @@ Public Class frmMDM_USTVAntrag
btnNachforderung.Visible = True btnNachforderung.Visible = True
Panel5.BackColor = Color.SteelBlue Panel5.BackColor = Color.SteelBlue
Panel5.ForeColor = Color.White Panel5.ForeColor = Color.White
If USTV_ANTRAG.UStVAn_AntragEingereichtAm Is Nothing OrElse Not IsDate(USTV_ANTRAG.UStVAn_AntragEingereichtAm) Then
Dim f As New frmDatumsabfrage("Bitte Einreichdatum eingeben", False)
f.ShowDialog()
If f.DialogResult = DialogResult.OK Then
Dim pruefdatum As Date = CDate(f.Datum)
USTV_ANTRAG = New VERAG_PROG_ALLGEMEIN.cUSTVAntrag(UStVAn_ID)
USTV_ANTRAG.UStVAn_AntragEingereichtAm = pruefdatum
USTV_ANTRAG.SAVE()
cboStatus.changeItem(cUSTVStatus.STAT_EINGEREICHT)
init()
End If
End If
Case cUSTVStatus.STAT_ABGELEHNT Case cUSTVStatus.STAT_ABGELEHNT
btnBearb.Visible = True btnBearb.Visible = True
btnEingereicht.Visible = True btnEingereicht.Visible = True
@@ -1336,16 +1352,21 @@ Public Class frmMDM_USTVAntrag
Private Sub btnEingereicht_Click(sender As Object, e As EventArgs) Handles btnEingereicht.Click Private Sub btnEingereicht_Click(sender As Object, e As EventArgs) Handles btnEingereicht.Click
Dim f As New frmDatumsabfrage("Bitte Einreichtdatum eingeben", False) If USTV_ANTRAG.UStVAn_AntragEingereichtAm Is Nothing OrElse Not IsDate(USTV_ANTRAG.UStVAn_AntragEingereichtAm) Then
f.ShowDialog()
If f.DialogResult = DialogResult.OK Then Dim f As New frmDatumsabfrage("Bitte Einreichdatum eingeben", False)
Dim pruefdatum As Date = CDate(f.Datum) f.ShowDialog()
USTV_ANTRAG = New VERAG_PROG_ALLGEMEIN.cUSTVAntrag(UStVAn_ID) If f.DialogResult = DialogResult.OK Then
USTV_ANTRAG.UStVAn_AntragEingereichtAm = pruefdatum Dim pruefdatum As Date = CDate(f.Datum)
USTV_ANTRAG.SAVE() USTV_ANTRAG = New VERAG_PROG_ALLGEMEIN.cUSTVAntrag(UStVAn_ID)
cboStatus.changeItem(cUSTVStatus.STAT_EINGEREICHT) USTV_ANTRAG.UStVAn_AntragEingereichtAm = pruefdatum
USTV_ANTRAG.SAVE()
cboStatus.changeItem(cUSTVStatus.STAT_EINGEREICHT)
init()
End If
End If End If
End Sub End Sub
Private Sub btnAbgelehnt_Click(sender As Object, e As EventArgs) Handles btnAbgelehnt.Click Private Sub btnAbgelehnt_Click(sender As Object, e As EventArgs) Handles btnAbgelehnt.Click
@@ -1927,9 +1948,6 @@ Public Class frmMDM_USTVAntrag
SQL.doSQL("UPDATE tblUStVPositionen SET UStVPo_ID = " & counter & " WHERE UStVAn_ID=" & UStVAn_ID & " AND UStVPo_ID=" & USTV_POS.UStVPo_ID, "FMZOLL") SQL.doSQL("UPDATE tblUStVPositionen SET UStVPo_ID = " & counter & " WHERE UStVAn_ID=" & UStVAn_ID & " AND UStVPo_ID=" & USTV_POS.UStVPo_ID, "FMZOLL")
End If End If
Next Next
End Sub End Sub
@@ -2070,8 +2088,8 @@ Public Class frmMDM_USTVAntrag
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
USTV_ANTRAG.SAVE() USTV_ANTRAG.SAVE()
If IsDBNull(USTV_ANTRAG.FilialenNr) Then MsgBox("Für das Speditionsbuch muss die Filiale eingegeben werden.") : Exit Sub If IsDBNull(USTV_ANTRAG.FilialenNr) OrElse USTV_ANTRAG.FilialenNr Is Nothing OrElse USTV_ANTRAG.FilialenNr = 0 Then MsgBox("Für das Speditionsbuch muss die Filiale eingegeben werden.") : Exit Sub
If IsDBNull(USTV_ANTRAG.AbfertigungsNr) Then MsgBox("Für das Speditionsbuch muss die Abfertigungs-Nr eingegeben werden.") : Exit Sub If IsDBNull(USTV_ANTRAG.AbfertigungsNr) OrElse USTV_ANTRAG.AbfertigungsNr Is Nothing OrElse USTV_ANTRAG.AbfertigungsNr <= 0 Then MsgBox("Für das Speditionsbuch muss die Abfertigungs-Nr eingegeben werden.") : Exit Sub
Dim spedBuch As New cSpeditionsbuch(USTV_ANTRAG.FilialenNr, USTV_ANTRAG.AbfertigungsNr) Dim spedBuch As New cSpeditionsbuch(USTV_ANTRAG.FilialenNr, USTV_ANTRAG.AbfertigungsNr)
@@ -2091,7 +2109,7 @@ Public Class frmMDM_USTVAntrag
If .SAVE() Then MsgBox("Sped-Eintrag wurde angelegt") If .SAVE() Then MsgBox("Sped-Eintrag wurde angelegt")
End With End With
End Sub End Sub
Private Sub initdgvErstattungen() Private Sub initdgvErstattungen()

View File

@@ -70,9 +70,16 @@ Public Class ustCntlUSTV_AntragPosition
Case 4, 9 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblMSEInvoices] as inv inner join tblMSECustomers on inv.customer_number = customer_id where invoice_date='" & UStV_POS.UStVPo_ReDat & "' and country='" & Antrag_LandKz & "' AND partner_customer_number = " & kdnr & " AND daId is not null", "FMZOLL",,, -1) Case 4, 9 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblMSEInvoices] as inv inner join tblMSECustomers on inv.customer_number = customer_id where invoice_date='" & UStV_POS.UStVPo_ReDat & "' and country='" & Antrag_LandKz & "' AND partner_customer_number = " & kdnr & " AND daId is not null", "FMZOLL",,, -1)
Case 10 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblUTAImportNew] where Rechnungsdatum='" & UStV_POS.UStVPo_ReDat & "' and Abrechnungsnummer='" & UStV_POS.UStVPo_ReNr & "' and Lieferland_ISO2='" & Antrag_LandKz & "' AND daId is not null", "FMZOLL",,, -1) Case 10 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblUTAImportNew] where Rechnungsdatum='" & UStV_POS.UStVPo_ReDat & "' and Abrechnungsnummer='" & UStV_POS.UStVPo_ReNr & "' and Lieferland_ISO2='" & Antrag_LandKz & "' AND daId is not null", "FMZOLL",,, -1)
Case 8 : da_id = sql.getValueTxtBySql("SELECT TOP(1) tblIDSInvoicesNew.daId FROM [tblIDSTransactionsNew] INNER JOIN tbl_IDS_Länder ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode LEFT JOIN tblIDSInvoicesNew on tblIDSInvoicesNew.CustomerCode = tblIDSTransactionsNew.CustomerCode and tblIDSInvoicesNew.Invoicenumber = Paymentsummarynumber where tblIDSTransactionsNew.[YearMonthDay] ='" & UStV_POS.UStVPo_ReDat & "' and ISNULL(tblIDSTransactionsNew.[OBONumber], ISNULL(tblIDSTransactionsNew.[VRNumber], tblIDSTransactionsNew.[Paymentsummarynumber])) ='" & UStV_POS.UStVPo_ReNr & "' and tbl_IDS_Länder.Lieferland_ISO2='" & Antrag_LandKz & "' AND tblIDSInvoicesNew.daId is not null", "FMZOLL",,, -1) Case 8 : da_id = sql.getValueTxtBySql("SELECT TOP(1) tblIDSInvoicesNew.daId FROM [tblIDSTransactionsNew] INNER JOIN tbl_IDS_Länder ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode LEFT JOIN tblIDSInvoicesNew on tblIDSInvoicesNew.CustomerCode = tblIDSTransactionsNew.CustomerCode and tblIDSInvoicesNew.Invoicenumber = Paymentsummarynumber where tblIDSTransactionsNew.[YearMonthDay] ='" & UStV_POS.UStVPo_ReDat & "' and ISNULL(tblIDSTransactionsNew.[OBONumber], ISNULL(tblIDSTransactionsNew.[VRNumber], tblIDSTransactionsNew.[Paymentsummarynumber])) ='" & UStV_POS.UStVPo_ReNr & "' and tbl_IDS_Länder.Lieferland_ISO2='" & Antrag_LandKz & "' AND tblIDSInvoicesNew.daId is not null", "FMZOLL",,, -1)
Case 1 : da_id = 1 'VERAG-RECHNUGNEN werden immer direkt OHNE daid geöffnet!
Case -1 : IIf(UStV_POS.UStVPo_daId > 0, UStV_POS.UStVPo_daId, -1)
End Select End Select
scanSonstiges.INIT_daId(da_id)
If da_id > -1 Then
scanSonstiges.INIT_daId(da_id)
Else
scanSonstiges.INIT(kdnr, "MDM", "MDM_DATEN", "DIVERSE")
End If
scanUSTVFABest.INIT(kdnr, "KUNDENDATEN", "FA_Bestaetigungen") scanUSTVFABest.INIT(kdnr, "KUNDENDATEN", "FA_Bestaetigungen")
scanUSTVVollmachten.INIT(kdnr, "KUNDENDATEN", "USTV_Vollmachten") scanUSTVVollmachten.INIT(kdnr, "KUNDENDATEN", "USTV_Vollmachten")
@@ -427,4 +434,9 @@ Public Class ustCntlUSTV_AntragPosition
End Sub End Sub
Private Sub scanSonstiges_FileAdded(id As String, path As String, name As String) Handles scanSonstiges.FileAdded
getValues(UStV_POS, True)
UStV_POS.UStVPo_daId = id
UStV_POS.SAVE()
End Sub
End Class End Class

View File

@@ -85,13 +85,13 @@ Public Class ustCntlUSTV_ErstattungPosition
If txtBelegNr.Text <> "" Then If txtBelegNr.Text <> "" Then
UStV_ERS.Belegnummer = txtBelegNr.Text UStV_ERS.Belegnummer = txtBelegNr.Text
Else Else
save = False 'save = False
End If End If
If txtBelegDatum.Text <> "" AndAlso IsDate(txtBelegDatum.Text) Then If txtBelegDatum.Text <> "" AndAlso IsDate(txtBelegDatum.Text) Then
UStV_ERS.Belegdatum = txtBelegDatum._value UStV_ERS.Belegdatum = txtBelegDatum._value
Else Else
save = False 'save = False
End If End If
If txtUSTBetrag.Text <> "" Then If txtUSTBetrag.Text <> "" Then

View File

@@ -1100,7 +1100,7 @@ Public Class frmEssensbestellungenAdministration
dt_nichtBezahlteEB = dt_nichtBezahlteEB.Select("eb_abgerechnet = 0", "eb_mitid").CopyToDataTable dt_nichtBezahlteEB = dt_nichtBezahlteEB.Select("eb_abgerechnet = 0", "eb_mitid").CopyToDataTable
If vbYes = MsgBox("Möchten Sie einen Reminder für die noch nicht bezahlten Essensbestellungen verschicken?" & vbNewLine & IIf(cboAbteilung._value Is "", " alle Abteilungen", "Abteilung " & cboAbteilung._value) & " im Gebäude: " & cboGebaeude._value, vbYesNoCancel) Then If vbYes = MsgBox("Möchten Sie einen Reminder für die noch nicht bezahlten Essensbestellungen verschicken?" & vbNewLine & IIf(cboAbteilung._value Is "", "Alle Abteilungen", "Abteilung " & cboAbteilung._value) & " im Gebäude: " & cboGebaeude._value, vbYesNoCancel) Then
Dim displayView = New DataView(dt_nichtBezahlteEB, "", "eb_mitid", DataViewRowState.CurrentRows) Dim displayView = New DataView(dt_nichtBezahlteEB, "", "eb_mitid", DataViewRowState.CurrentRows)
Dim distinctDT As DataTable = displayView.ToTable(True, "eb_mitid") Dim distinctDT As DataTable = displayView.ToTable(True, "eb_mitid")
@@ -1132,8 +1132,8 @@ Public Class frmEssensbestellungenAdministration
If result IsNot Nothing AndAlso IsNumeric(result) Then If result IsNot Nothing AndAlso IsNumeric(result) Then
result = CDbl(result) result = CDbl(result)
Select Case mit.mit_abteilung Select Case mit.mit_abteilung
Case "MDM" ' -> per Mail weil SDL keine Benachrichtigungen: Case "MDM", "EDV" ' -> per Mail weil SDL keine Benachrichtigungen hat und EDV nicht ins AVISO schaut:
If mit.mit_email <> "" Then If mit.mit_email <> "" AndAlso Not emailEmpf.Contains(mit.mit_email) Then
emailEmpf &= mit.mit_email & ";" emailEmpf &= mit.mit_email & ";"
End If End If

File diff suppressed because it is too large Load Diff

View File

@@ -361,9 +361,9 @@ Partial Class usrcntlFremdrechnungen
Me.cbxMax1000Eintrage.CheckState = System.Windows.Forms.CheckState.Checked Me.cbxMax1000Eintrage.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxMax1000Eintrage.Location = New System.Drawing.Point(8, 130) Me.cbxMax1000Eintrage.Location = New System.Drawing.Point(8, 130)
Me.cbxMax1000Eintrage.Name = "cbxMax1000Eintrage" Me.cbxMax1000Eintrage.Name = "cbxMax1000Eintrage"
Me.cbxMax1000Eintrage.Size = New System.Drawing.Size(111, 17) Me.cbxMax1000Eintrage.Size = New System.Drawing.Size(117, 17)
Me.cbxMax1000Eintrage.TabIndex = 41 Me.cbxMax1000Eintrage.TabIndex = 41
Me.cbxMax1000Eintrage.Text = "max. 200 Einträge" Me.cbxMax1000Eintrage.Text = "max. 1000 Einträge"
Me.cbxMax1000Eintrage.UseVisualStyleBackColor = True Me.cbxMax1000Eintrage.UseVisualStyleBackColor = True
' '
'lblEinträge 'lblEinträge

View File

@@ -119,7 +119,7 @@ Partial Class usrcntlPDFScanList
Me.cntxt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.cntxt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.cntxt.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.UmbenennenToolStripMenuItem, Me.LöschenToolStripMenuItem, Me.ToolStripSeparator1, Me.KopierenZwischenablageToolStripMenuItem, Me.AlsEmailSendenToolStripMenuItem}) Me.cntxt.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.UmbenennenToolStripMenuItem, Me.LöschenToolStripMenuItem, Me.ToolStripSeparator1, Me.KopierenZwischenablageToolStripMenuItem, Me.AlsEmailSendenToolStripMenuItem})
Me.cntxt.Name = "cntxt" Me.cntxt.Name = "cntxt"
Me.cntxt.Size = New System.Drawing.Size(218, 120) Me.cntxt.Size = New System.Drawing.Size(218, 98)
' '
'usrcntlPDFScanList 'usrcntlPDFScanList
' '

View File

@@ -25,6 +25,7 @@ Public Class usrcntlPDFScanList
Public Event FileAdded(id As String, path As String, name As String) Public Event FileAdded(id As String, path As String, name As String)
Public Event FileDeleted()
Private Sub usrcntlPDFScan_Layout(sender As Object, e As LayoutEventArgs) Handles Me.Layout Private Sub usrcntlPDFScan_Layout(sender As Object, e As LayoutEventArgs) Handles Me.Layout
' Me.txt.Text = _TEXT_PDF ' Me.txt.Text = _TEXT_PDF
@@ -187,6 +188,7 @@ Public Class usrcntlPDFScanList
DS.DELETE_COMPLETE() DS.DELETE_COMPLETE()
End If End If
initPdf() initPdf()
RaiseEvent FileDeleted()
End If End If
Catch ex As Exception Catch ex As Exception
MsgBox(ex.Message) MsgBox(ex.Message)
@@ -332,35 +334,76 @@ Public Class usrcntlPDFScanList
e.Effect = DragDropEffects.All e.Effect = DragDropEffects.All
End Sub End Sub
Private Sub txt_Click(sender As Object, e As DragEventArgs) Handles Me.DragDrop ', txt.DragDrop, Me.DragDrop, picPDF.DragDrop Private Sub txt_Click(sender As Object, e As DragEventArgs) Handles Me.DragDrop ', txt.DragDrop, Me.DragDrop, picPDF.DragDrop
If e.Data.GetDataPresent("FileDrop", True) = True Then 'If e.Data.GetDataPresent("FileDrop", True) = True Then
Dim FileList As String() = CType(e.Data.GetData("FileDrop"), Object) 'Hier wird der Variable "Wert" das übergeben, was wir auf die Form gezogen haben. Bei einer Datei wäre es dann der Pfad der Datei. ' Dim FileList As String() = CType(e.Data.GetData("FileDrop"), Object) 'Hier wird der Variable "Wert" das übergeben, was wir auf die Form gezogen haben. Bei einer Datei wäre es dann der Pfad der Datei.
If FileList.Count > 0 Then ' If FileList.Count > 0 Then
If Not _MULTI_FILES And FileList.Count > 1 Then ' If Not _MULTI_FILES And FileList.Count > 1 Then
MsgBox("Es können nicht mehrere Dateien hochgeladen werden!") ' MsgBox("Es können nicht mehrere Dateien hochgeladen werden!")
Exit Sub ' Exit Sub
End If ' End If
For Each W In FileList ' For Each W In FileList
If W.ToUpper.EndsWith(".PDF") Then ' If W.ToUpper.EndsWith(".PDF") Then
Try ' Try
Dim bezeichnung = System.IO.Path.GetFileName(W).ToString ' Dim bezeichnung = System.IO.Path.GetFileName(W).ToString
DS.uploadDataToDATENSERVER(W, bezeichnung, ".pdf") ' DS.uploadDataToDATENSERVER(W, bezeichnung, ".pdf")
'Dim l As VERAG_PROG_ALLGEMEIN.cDatenarchiv_Collection = DS.DATA_LIST.LIST(DS.DATA_LIST.LIST.Count - 1) ' 'Dim l As VERAG_PROG_ALLGEMEIN.cDatenarchiv_Collection = DS.DATA_LIST.LIST(DS.DATA_LIST.LIST.Count - 1)
'RaiseEvent FileAdded(l.coll_id, l.coll_pfad, l.coll_bezeichnung) ' 'RaiseEvent FileAdded(l.coll_id, l.coll_pfad, l.coll_bezeichnung)
'If DS.DATA_LIST.LIST.Count > 0 Then ' 'If DS.DATA_LIST.LIST.Count > 0 Then
' Dim l As VERAG_PROG_ALLGEMEIN.cDatenarchiv_Collection = DS.DATA_LIST.LIST(DS.DATA_LIST.LIST.Count - 1) ' ' Dim l As VERAG_PROG_ALLGEMEIN.cDatenarchiv_Collection = DS.DATA_LIST.LIST(DS.DATA_LIST.LIST.Count - 1)
' RaiseEvent FileAdded(l.coll_id, l.coll_pfad, l.coll_bezeichnung) ' ' RaiseEvent FileAdded(l.coll_id, l.coll_pfad, l.coll_bezeichnung)
'End If ' 'End If
Catch ex As Exception ' Catch ex As Exception
MsgBox("FEHLER: UserControl möglicherweise nicht initialisiert!" & ex.Message & ex.StackTrace) ' MsgBox("FEHLER: UserControl möglicherweise nicht initialisiert!" & ex.Message & ex.StackTrace)
End Try ' End Try
' End If
' Next
' initPdf()
' End If
'End If
Try
Dim added = False
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim files() As String = e.Data.GetData(DataFormats.FileDrop)
If files.Count > 1 Then
MsgBox("Nur eine Datei möglich!")
ElseIf files.Count > 0 Then
If files(0) <> "" Then
Dim fio As New System.IO.FileInfo(files(0))
If DS.uploadDataToDATENSERVER(files(0), fio.Name, ".pdf") Then
RaiseEvent FileAdded(DS.da_id, DS.GET_TOP1_PATH, DS.da_name)
MsgBox("Dokument wurde hochgeladen.")
End If
End If End If
Next End If
initPdf()
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
Dim FilePath = VERAG_PROG_ALLGEMEIN.cProgramFunctions.EmAilAttach(e)
If FilePath <> "" Then
Dim fio As New System.IO.FileInfo(FilePath)
If DS.uploadDataToDATENSERVER(FilePath, fio.Name, ".pdf") Then
RaiseEvent FileAdded(DS.da_id, DS.GET_TOP1_PATH, DS.da_name)
MsgBox("Dokument wurde hochgeladen.")
End If
End If
End If End If
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub End Sub
Private Sub cntxt_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles cntxt.Opening Private Sub cntxt_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles cntxt.Opening
UmbenennenToolStripMenuItem.Visible = (MyListBox1.SelectedItems.Count = 1) UmbenennenToolStripMenuItem.Visible = (MyListBox1.SelectedItems.Count = 1)
End Sub End Sub
End Class End Class