From 53e595541151a64bc17b9467fc0e5c39f9b84aee Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Tue, 12 Nov 2024 21:41:17 +0100 Subject: [PATCH 1/5] ZE, MDM, IDS --- SDL/mdm/frmMDMDatenverarbetiung.Designer.vb | 26 + SDL/mdm/frmMDMDatenverarbetiung.vb | 509 +++++++++++++++++- ...MDMDatenverarbeitungAuswertungen_divers.vb | 8 + VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb | 382 ++++++++++++- .../frmMitarbeitersuche.vb | 12 +- .../Mitarbeiterverzeichnis/frmZEButtons.vb | 31 +- 6 files changed, 931 insertions(+), 37 deletions(-) diff --git a/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb b/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb index 0ec317c1..c77a39ab 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb @@ -78,6 +78,8 @@ Partial Class frmMDMDatenverarbetiung Me.txtPruefsummeBrutto = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.txtPruefsummeNetto = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.txtAnzahl = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.pnlIDS = New System.Windows.Forms.Panel() + Me.btnRechenwertesetzen = New System.Windows.Forms.Button() Me.pnl.SuspendLayout() Me.Panel5.SuspendLayout() CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit() @@ -90,6 +92,7 @@ Partial Class frmMDMDatenverarbetiung Me.Panel3.SuspendLayout() Me.Panel2.SuspendLayout() CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.pnlIDS.SuspendLayout() Me.SuspendLayout() ' 'pnl @@ -333,6 +336,7 @@ Partial Class frmMDMDatenverarbetiung ' 'Panel1 ' + Me.Panel1.Controls.Add(Me.pnlIDS) Me.Panel1.Controls.Add(Me.lblTTRSum) Me.Panel1.Controls.Add(Me.txtTTRSum) Me.Panel1.Controls.Add(Me.lblProzPruef) @@ -739,6 +743,25 @@ Partial Class frmMDMDatenverarbetiung Me.txtAnzahl.TabIndex = 35 Me.txtAnzahl.TextAlign = System.Windows.Forms.HorizontalAlignment.Right ' + 'pnlIDS + ' + Me.pnlIDS.Controls.Add(Me.btnRechenwertesetzen) + Me.pnlIDS.Location = New System.Drawing.Point(616, 38) + Me.pnlIDS.Name = "pnlIDS" + Me.pnlIDS.Size = New System.Drawing.Size(311, 32) + Me.pnlIDS.TabIndex = 50 + Me.pnlIDS.Visible = False + ' + 'btnRechenwertesetzen + ' + Me.btnRechenwertesetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnRechenwertesetzen.Location = New System.Drawing.Point(10, 3) + Me.btnRechenwertesetzen.Name = "btnRechenwertesetzen" + Me.btnRechenwertesetzen.Size = New System.Drawing.Size(129, 23) + Me.btnRechenwertesetzen.TabIndex = 48 + Me.btnRechenwertesetzen.Text = "Rechenwerte setzen" + Me.btnRechenwertesetzen.UseVisualStyleBackColor = True + ' 'frmMDMDatenverarbetiung ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -769,6 +792,7 @@ Partial Class frmMDMDatenverarbetiung Me.Panel2.ResumeLayout(False) Me.Panel2.PerformLayout() CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit() + Me.pnlIDS.ResumeLayout(False) Me.ResumeLayout(False) End Sub @@ -827,4 +851,6 @@ Partial Class frmMDMDatenverarbetiung Friend WithEvents Panel5 As Panel Friend WithEvents Label5 As Label Friend WithEvents DateTimePicker2 As DateTimePicker + Friend WithEvents pnlIDS As Panel + Friend WithEvents btnRechenwertesetzen As Button End Class diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index 4706c6f4..64ca2971 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -1,6 +1,7 @@ Imports System.Data.OleDb Imports System.DirectoryServices.ActiveDirectory Imports System.IO +Imports Microsoft.Office.Interop.Outlook Public Class frmMDMDatenverarbetiung @@ -44,7 +45,7 @@ Public Class frmMDMDatenverarbetiung Case "PLOSE" : pruef = pruefData_PLOSE() Case "ASFINAG" : pruef = pruefData_ASFINAG() Case "UTA" : pruef = pruefData_UTA() - Case "IDS" : MsgBox("Nicht verfügbar!") : Exit Sub + Case "IDS" : pruef = pruefData_IDS() Case "MSE" : pruef = pruefData_MSE() Case Else : MsgBox("Nicht verfügbar!") : Exit Sub End Select @@ -76,7 +77,7 @@ Public Class frmMDMDatenverarbetiung btnDatenLaden.Text = "Daten laden" Case "ASFINAG" : initDgv_ASFINAG(cbxASFINAGAbgerechnet.Checked, cbxBelegeerstellt.Checked) btnDatenLaden.Text = "Daten laden" - Case "IDS" 'MsgBox("Nicht verfügbar!") + Case "IDS" : initDgv_IDS() btnDatenLaden.Text = "Daten laden" Case "MSE" : initDgv_MSE() btnDatenLaden.Text = "Daten laden" @@ -739,8 +740,6 @@ Public Class frmMDMDatenverarbetiung Sub initDgv_MSE() With MyDatagridview1 .Columns.Clear() - 'Exit Sub - 'MsgBox(.sql) .SET_SQL(" SELECT Adressen.AdressenNr as KundenNr, Adressen.[Name 1] as Name, trans.transaction_country AS Country,trans.device_product_type AS CardType, Sum(trans.transaction_gross_amount) As [Transaktionsbetrag], @@ -756,15 +755,87 @@ Public Class frmMDMDatenverarbetiung .LOAD() + If .Columns.Count > 0 Then + + .Columns("Name").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill + .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells + + End If + + Dim sumGes As Double = 0 + Dim sumFee As Double = 0 + Dim sumTr As Double = 0 + For Each r As DataGridViewRow In .Rows + sumGes += If(IsNumeric(r.Cells("Gesamtbetrag").Value), CDbl(r.Cells("Gesamtbetrag").Value), 0) + sumTr += If(IsNumeric(r.Cells("Transaktionsbetrag").Value), CDbl(r.Cells("Transaktionsbetrag").Value), 0) + sumFee += If(IsNumeric(r.Cells("Transaktionskosten").Value), CDbl(r.Cells("Transaktionskosten").Value), 0) + Next + + txtAnzahl.Text = .Rows.Count + txtPruefsummeNetto.Text = CDbl(sumTr).ToString("C2") + txtPruefsummeBrutto.Text = CDbl(sumGes).ToString("C2") + txtTTRSum.Text = CDbl(sumFee).ToString("C2") + + lblTTRSum.Visible = True + txtTTRSum.Visible = True + + lblTTRSum.Text = "Tr-Kosten" + + + .ClearSelection() + + End With + + End Sub + + Sub initDgv_IDS() + With MyDatagridview1 + .Columns.Clear() + 'Exit Sub + 'MsgBox(.sql) + + .SET_SQL("SELECT [transaction_id] + ,[YearMonthDay] as Datum + ,[Paymentsummarynumber] as ZahlungsNr + ,[CustomerCode] + ,[CustomerName] + ,[OutletCountryCode] + ,[OutletCountry] + ,[OutletCode] + ,[OutletName] + ,[ProductTypeCode] + ,[TransactionVolume] as Transaktionsbetrag + ,[AmminclVAT] as Gesamtbetrag + ,[TotalNetAmount] as Net + ,[VATAmount] as UST + ,[avpriceexclVAT] + ,[Rechenwert] + ,[Kz] + ,[Rabattbetrag] + ,[RabattbetragProLiter] + ,[Zeitstempel] + ,[Sachbearbeiter] + ,[KdNrVERAG] + ,[CardNumber] + ,[EmissionNumber] + ,[CardComments] + ,[CalendarDate] + ,[TransactionHHMM] + ,[UStVAn_ID] + ,[VRNumber] + ,[OBONumber] from tblIDSTransactionsNew where cast(YearMonthDay as Date) = '" & DateTimePicker2.Text & "' and UStVAn_ID is null", "FMZOLL") + + .LOAD() + If .Columns.Count > 0 Then '.Columns("AdressenNr").HeaderText = "KdNr" '.Columns("Name 1").HeaderText = "Kunde" '.Columns("LandKz").HeaderText = "Land" - .Columns("Name").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill + .Columns("CustomerName").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill '.Columns("VERAGLeistungsNr").ReadOnly = False - '.Columns("VERAGKdNr").ReadOnly = False + .Columns("transaction_id").Visible = False 'For Each r As DataGridViewColumn In .Columns ' If r.Name = "VERAGLeistungsNr" Or r.Name = "VERAGKdNr" Then @@ -811,7 +882,7 @@ Public Class frmMDMDatenverarbetiung For Each r As DataGridViewRow In .Rows sumGes += If(IsNumeric(r.Cells("Gesamtbetrag").Value), CDbl(r.Cells("Gesamtbetrag").Value), 0) sumTr += If(IsNumeric(r.Cells("Transaktionsbetrag").Value), CDbl(r.Cells("Transaktionsbetrag").Value), 0) - sumFee += If(IsNumeric(r.Cells("Transaktionskosten").Value), CDbl(r.Cells("Transaktionskosten").Value), 0) + sumFee += If(IsNumeric(r.Cells("Net").Value), CDbl(r.Cells("Net").Value), 0) Next txtAnzahl.Text = .Rows.Count @@ -903,6 +974,7 @@ Public Class frmMDMDatenverarbetiung cbxBelegeerstellt.Visible = False cbxTestdaten.Visible = VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMIN", Me.FindForm) pnlAsfinag.Visible = False + pnlIDS.Visible = False Panel4.Visible = False Panel5.Visible = False @@ -920,12 +992,13 @@ Public Class frmMDMDatenverarbetiung Case "ASFINAG" cbxASFINAGAbgerechnet.Visible = True cbxBelegeerstellt.Visible = True - If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMIN", Me.FindForm) Then - End If pnlAsfinag.Visible = True Exit Sub Case "IDS" - MsgBox("Noch nicht verfürbar!") + Dim c As New usrCntlMDMDatenverarbeitungAuswertungen_divers(Me, Me.LIEFERANT) + Panel3.Controls.Add(c) + c.Dock = DockStyle.Fill + pnlIDS.Visible = True Case "MSE" Panel5.Visible = True @@ -1144,8 +1217,7 @@ Public Class frmMDMDatenverarbetiung If Directory.Exists(dir) Then dir &= "_" & Now.ToShortTimeString.Replace(":", "") End If - - Directory.CreateDirectory(dir) +Directory.CreateDirectory(dir) @@ -2644,6 +2716,8 @@ Public Class frmMDMDatenverarbetiung Case "ASFINAG" : OffertenNr = 11 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4814 Case "UTA" : OffertenNr = 30 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4823 Case "MSE" : OffertenNr = 23 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4821 + Case "IDS" : OffertenNr = 17 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4868 + Case "IDS AUT" : OffertenNr = 21 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4868 End Select SPEDBUCH.AbfertigungsNr = VERAG_PROG_ALLGEMEIN.cAllgemein.getMaxPosNrIncrement(SPEDBUCH.FilialenNr, Now.Year) @@ -2847,6 +2921,8 @@ Public Class frmMDMDatenverarbetiung Case "ASFINAG" : OffertenNr = 11 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang" Case "UTA" : OffertenNr = 30 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang" Case "MSE" : OffertenNr = 23 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang" + Case "IDS" : OffertenNr = 17 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang" + Case "IDS AUT" : OffertenNr = 21 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang" End Select @@ -3104,6 +3180,84 @@ Public Class frmMDMDatenverarbetiung Next + + Case "IDS" + + ' Case 17 'Diesel IDS + '5970 Set qryOffPos = dbs.QueryDefs("qryIDSDieselofferte17") + '5980 qryOffPos.Parameters("[Bitte Kundennummer eingeben:]") = rstRK![RechnungsKundenNr] + '5990 Set rstOffPos = qryOffPos.OpenRecordset(dbOpenSnapshot) + '6000 Do Until rstOffPos.EOF + '6010 Set qryRPPKey = dbs.QueryDefs("qryReErfSchRPPKey") ' + '6020 qryRPPKey.Parameters("[prmRK_ID]") = rstRK!RK_ID + '6030 qryRPPKey.Parameters("[prmLeistungsNr]") = rstOffPos!LeistungsNr + '6040 qryRPPKey.Parameters("[prmSteuerpflichtig]") = False + '6050 qryRPPKey.Parameters("[prmLeistungsBez]") = rstOffPos!LeistungsBez + '6060 qryRPPKey.Parameters("[prmIndexZkteing]") = 0 + '6070 Set rstRPPKey = qryRPPKey.OpenRecordset(dbOpenDynaset, dbSeeChanges) ' + '6080 With rstRPPKey + '6090 If .EOF Then + '6100 .AddNew + '6110 !RK_ID = rstRK!RK_ID + '6120 !LeistungsNr = rstOffPos!LeistungsNr + '6130 !steuerpflichtig = False + '6140 !LeistungsBez = rstOffPos!LeistungsBez + '6150 !BerechnungsartNr = rstOffPos!BerechnungsartNr + '6160 Else + '6170 .Edit + '6180 End If + '6190 !Preis = rstOffPos!Bruttobetrag - rstOffPos![Summe von Rabattbetrag] + '6200 !Anzahl = 1 + '6210 .Update + '6220 .Close + '6230 End With + '6240 Set rstRPPKey = Nothing + '6250 rstOffPos.MoveNext + '6260 Loop + '6270 rstOffPos.Close + '6280 Set rstOffPos = Nothing + '6290 qryOffPos.Close + '6300 Set qryOffPos = Nothing + + Case "IDS AUT" + + ' Case 21 'Diesel IDS AT + '6320 Set qryOffPos = dbs.QueryDefs("qryIDSDieselofferte21") + '6330 qryOffPos.Parameters("[Bitte Kundennummer eingeben:]") = rstRK![RechnungsKundenNr] + '6340 Set rstOffPos = qryOffPos.OpenRecordset(dbOpenSnapshot) + '6350 Do Until rstOffPos.EOF + '6360 Set qryRPPKey = dbs.QueryDefs("qryReErfSchRPPKey") 'Test + '6370 qryRPPKey.Parameters("[prmRK_ID]") = rstRK!RK_ID + '6380 qryRPPKey.Parameters("[prmLeistungsNr]") = rstOffPos!LeistungsNr + '6390 qryRPPKey.Parameters("[prmSteuerpflichtig]") = False + '6400 qryRPPKey.Parameters("[prmLeistungsBez]") = rstOffPos!LeistungsBez + '6410 qryRPPKey.Parameters("[prmIndexZkteing]") = 0 + '6420 Set rstRPPKey = qryRPPKey.OpenRecordset(dbOpenDynaset, dbSeeChanges) 'Test + '6430 With rstRPPKey + '6440 If .EOF Then + '6450 .AddNew + '6460 !RK_ID = rstRK!RK_ID + '6470 !LeistungsNr = rstOffPos!LeistungsNr + '6480 !steuerpflichtig = False + '6490 !LeistungsBez = rstOffPos!LeistungsBez + '6500 !BerechnungsartNr = rstOffPos!BerechnungsartNr + '6510 Else + '6520 .Edit + '6530 End If + '6540 !Preis = rstOffPos!Bruttobetrag - rstOffPos![Summe von Rabattbetrag] + '6550 !Anzahl = 1 + '6560 .Update + '6570 .Close + '6580 End With + '6590 Set rstRPPKey = Nothing + '6600 rstOffPos.MoveNext + '6610 Loop + '6620 rstOffPos.Close + '6630 Set rstOffPos = Nothing + '6640 qryOffPos.Close + '6650 Set qryOffPos = Nothing + + End Select @@ -3546,6 +3700,77 @@ Public Class frmMDMDatenverarbetiung End Try End Function + + Function pruefData_IDS() As Boolean + pruefData_IDS = True + Try + + Dim RechnenWertNichtEingetragen As Integer = CInt((New SQL).getValueTxtBySql("select count(*) from [tblIDSTransactionsNew] + WHERE where cast(YearMonthDay as Date) = '" & DateTimePicker2.Text & "' AND [UStVAn_ID] is null AND [Rechenwert] is null ", "FMZOLL")) + + If RechnenWertNichtEingetragen > 0 Then + pruefData_IDS = False + MsgBox("Es wurden bei " & RechnenWertNichtEingetragen & " Transaktionen die Rechenwerte nicht eingetragen!" & vbNewLine & "Diese müssen nacherfasst werden (von Rechnung " & DateTimePicker2.Text & "). (bitte an Administrator wenden).") + Return False + End If + + Dim sqlStringfalscheLeistungsNr = "" + + Dim falscheLeistungsnummern As Integer = CInt((New SQL).getValueTxtBySql(sqlStringfalscheLeistungsNr, "FMZOLL")) + + + If falscheLeistungsnummern > 0 Then + If Not SQL.doSQL("update [VERAG].[dbo].[tblMSETransactions] set device_product_type = 'HUGO SIM renewal cost' where transaction_product_id = 453 and transaction_product_name like 'HUGO SIM renewal cost%'", "FMZOLL") Then + MsgBox("Fehler beim Setzen der HUGO SIM renewal cost") + Return False + End If + + falscheLeistungsnummern = CInt((New SQL).getValueTxtBySql(sqlStringfalscheLeistungsNr, "FMZOLL")) + If falscheLeistungsnummern > 0 Then + pruefData_IDS = False + MsgBox("Es fehlen " & falscheLeistungsnummern & " Leistungsnummern!" & vbNewLine & "Diese Leistungssnummern (von Rechnung " & DateTimePicker2.Text & ") müssen nachgetragen werden. (bitte an Administrator wenden, tblMSELeistungen).") + Return False + End If + + + End If + + Dim nichtAufAbgerechnetGesetzteTransactionen As Integer = 0 + + nichtAufAbgerechnetGesetzteTransactionen = CInt((New SQL).getValueTxtBySql("select count (*) FROM [VERAG].[dbo].[tblMSESettlements] as bills inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id] where trans.[transaction_status] <> 'Billed' and [invoice_date] = '" & DateTimePicker2.Text & "'", "FMZOLL")) + + If nichtAufAbgerechnetGesetzteTransactionen > 0 Then + Dim hint As String = "" + pruefData_IDS = False + If nichtAufAbgerechnetGesetzteTransactionen > 500 Then + hint = "Batch-Nr: " + hint &= SQL.getValueTxtBySql("select distinct(trans.batch_seq_nr) FROM [VERAG].[dbo].[tblMSESettlements] as bills inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id] where trans.[transaction_status] <> 'Billed' and [invoice_date] = '" & DateTimePicker2.Text & "'", "FMZOLL") + End If + MsgBox("Es sind " & nichtAufAbgerechnetGesetzteTransactionen & " Transaktionen in der Datenbank, die noch nicht auf VERRECHNET gesetzt sind!" & vbNewLine & "Diese Transaktionen (von Rechnung " & DateTimePicker2.Text & ") müssen aktualisiert werden. (bitte an Administrator wenden)." & IIf(hint <> "", vbNewLine & hint, "")) + End If + + + 'das muss die letzte Prüfung sein, da uU eine Transaktion fehlen kann! + Dim fehlendeTransactionen As Integer = 0 + + fehlendeTransactionen = CInt((New SQL).getValueTxtBySql("select count(*) FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & DateTimePicker2.Text & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "FMZOLL")) + + If fehlendeTransactionen > 0 Then + pruefData_IDS = False + Dim hint As String = "" + If fehlendeTransactionen > 500 Then + hint = "Batch-Nr: " + hint &= SQL.getValueTxtBySql("select distinct(trans.batch_seq_nr) FROM [VERAG].[dbo].[tblMSESettlements] as settle INNER JOIN [VERAG].[dbo].[tblMSETransactions] as trans on trans.transaction_id = settle.transaction_id where [invoice_date] = '" & DateTimePicker2.Text & "' AND trans.[transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "FMZOLL") + End If + MsgBox("Es fehlen " & fehlendeTransactionen & " Transaktionen in der Datenbank!" & vbNewLine & "Diese Transaktionen (von Rechnung " & DateTimePicker2.Text & ") müssen nachgeladen werden (bitte an Administrator wenden)." & IIf(hint <> "", vbNewLine & hint, "")) + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + pruefData_IDS = False + End Try + End Function + Function pruefData_PLOSE_old() As Boolean pruefData_PLOSE_old = True Try @@ -3833,6 +4058,260 @@ Public Class frmMDMDatenverarbetiung + cbxASFINAGAbgerechnet.Checked = True + 'initDgv_ASFINAG(Not cbxASFINAGNichtAbgerechnet.Checked) + End If + + + End Function + + Private Function setRechenwerteIDS() As Boolean +'Abrechnungsdatum setzen + + If Not LIEFERANT = "IDS" Then Return false + + If MyDatagridview1.Rows.Count = 0 Then + MsgBox("Keine Daten zum Setzen vorhanden!") + Return False +End If + + For each row In MyDatagridview1.Rows + + Dim Rechenwert = 0 + Dim mKZ = "R" + + Dim trans As New VERAG.PROG.ALLGEMEIN.cIDS(row.Cells("transaction_id").Value ) + + If row.Cells("TransactionVolume").Value <> 0 + row.Cells("avpriceexclVAT").Value = row.Cells("TotalNetAmount").Value / row.Cells("TransactionVolume").Value + End If + + +Next + + + ' Literpreis errechnen +1340 If ![Transaction Volume] <> 0 Then +1350 ![av price excl VAT] = ![Total Net Amount] / ![Transaction Volume] +1360 End If + + ' Über den IDS-CustomerCode die VERAG-Kundennummer ermitteln und eintragen. +1370 ![KdNrVERAG] = DLookup("KdNrVERAG", "tbl_IDS_Kunden", "CustomerCode=" & ![Customer Code]) + +1380 If Not IsNull(![KdNrVERAG]) Then + + ' Kunde ohne Rabatt +1390 strSQL = "SELECT *" & _ + " FROM tbl_IDS_Kunden_ohne_Rabatt" & _ + " WHERE (((tbl_IDS_Kunden_ohne_Rabatt.CustomerCode)=" & ![KdNrVERAG] & "));" +1400 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) +1410 If Not rstIDSRechenwert.EOF Then +1420 GoTo Rabatt_errechnen +1430 End If +1440 rstIDSRechenwert.Close + + ' Rechenwert für Land/Station/Kunde/Produkt ermitteln +1450 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ + " FROM tbl_IDS_Rechenwerte" & _ + " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + " AND ((OutletCode)=" & ![Outlet Code] & ")" & _ + " AND ((CustomerCode)=" & ![KdNrVERAG] & ")" & _ + " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + " ORDER BY Zeitstempel DESC;" +1460 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) +1470 If Not rstIDSRechenwert.EOF Then +1480 GoTo Rechenwert_eintragen +1490 End If +1500 rstIDSRechenwert.Close + + ' Rechenwert für Land/Kunde/Produkt ermittteln +1510 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ + " FROM tbl_IDS_Rechenwerte" & _ + " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + " AND ((OutletCode) Is Null)" & _ + " AND ((CustomerCode)=" & ![KdNrVERAG] & ")" & _ + " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + " ORDER BY Zeitstempel DESC;" +1520 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) +1530 If Not rstIDSRechenwert.EOF Then +1540 GoTo Rechenwert_eintragen +1550 End If +1560 rstIDSRechenwert.Close + +1570 End If + + ' Rechenwert für Land/Station/Produkt ermitteln +1580 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ + " FROM tbl_IDS_Rechenwerte" & _ + " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + " AND ((OutletCode)=" & ![Outlet Code] & ")" & _ + " AND ((CustomerCode) Is Null)" & _ + " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + " ORDER BY Zeitstempel DESC;" +1590 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) +1600 If Not rstIDSRechenwert.EOF Then +1610 GoTo Rechenwert_eintragen +1620 End If +1630 rstIDSRechenwert.Close + + ' Rechenwert für Land/Produkt ermitteln +1640 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ + " FROM tbl_IDS_Rechenwerte" & _ + " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + " AND ((OutletCode) Is Null)" & _ + " AND ((CustomerCode) Is Null)" & _ + " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + " ORDER BY Zeitstempel DESC;" +1650 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) +1660 If Not rstIDSRechenwert.EOF Then +1670 GoTo Rechenwert_eintragen +1680 End If +1690 rstIDSRechenwert.Close + +1700 GoTo Rabatt_errechnen + +Rechenwert_eintragen: +1710 !Rechenwert = rstIDSRechenwert!Rechenwert +1720 !Kz = rstIDSRechenwert!Kz +1730 If Not IsNull(rstIDSRechenwert!KategorieNr) Then +1740 Set qry = dbs.QueryDefs("qry_IDS_KategorieNr_ProductTypeCode_Rechenwert") +1750 qry.Parameters("[prmKategorieNr]") = rstIDSRechenwert!KategorieNr +1760 qry.Parameters("[prmProductTypeCode]") = ![Product Type Code] +1770 Set rst = qry.OpenRecordset(dbOpenSnapshot) +1780 If Not rst.EOF Then +1790 !Rechenwert = !Rechenwert + rst!Rechenwert +1800 If !Rechenwert < 0 Then +1810 !Rechenwert = 0 +1820 End If +1830 End If +1840 rst.Close +1850 qry.Close +1860 End If +1870 rstIDSRechenwert.Close + + ' Ab 24.03.2010 ist die Kategorie neu hinzugekommen. + ' Lt. Hr. Siener wird der Kategorierabatt nur dann berücksichtigt, + ' wenn [Outlet Country Code] <> 740543 (Österreich) + ' und [Rechenwert] > 0 (aus Land/Produkt oder Land/Station/Produkt) + ' und [Kz = R] (Rabatt) ist. + ' Der Kategorierabatt kann auch ein Minusbetrag sein. + ' Der Rechenwert darf aber nicht negativ werden. + ' Dieser Teil entfällt ab 31.01.2019 + ' If Not IsNull(![KdNrVERAG]) Then + ' If ![Outlet Country Code] <> 740543 And _ + ' ![Rechenwert] > 0 And _ + ' ![Kz] = "R" Then + ' Set qry = dbs.QueryDefs("qry_IDS_Kunde_Kategorie_Produkt_Rechenwert") + ' qry.Parameters("[parCustomerCode]") = ![KdNrVERAG] + ' qry.Parameters("[parProductTypeCode]") = ![Product Type Code] + ' Set rst = qry.OpenRecordset(dbOpenSnapshot) + ' If Not rst.EOF Then + ' !Rechenwert = !Rechenwert + rst!Rechenwert + ' If !Rechenwert < 0 Then + ' !Rechenwert = 0 + ' End If + ' End If + ' rst.Close + ' qry.Close + ' End If + ' End If + +Rabatt_errechnen: +1880 Select Case !Kz + Case "P" 'Rechenwert ist Preis pro Liter +1890 !Rabattbetrag = ![Total Net Amount] - Int(!Rechenwert * ![Transaction Volume] * 100 + 0.5) / 100 +1900 Case "R" 'Rechenwert ist Rabatt pro Liter +1910 !Rabattbetrag = Int(!Rechenwert * ![Transaction Volume] * 100 + 0.5) / 100 +1920 End Select +1930 If ![Transaction Volume] <> 0 Then +1940 !RabattbetragProLiter = !Rabattbetrag / ![Transaction Volume] +1950 End If + + ' Zeitstempel und Sachbearbeiter in tblDiesel eintragen +1960 !Zeitstempel = Now +1970 !Sachbearbeiter = CurrentUser() +1980 .Update + + ' Daten in das Archiv schreiben. +1990 Set qryIDSDieselArchiv = dbs.QueryDefs("qryDieselArchivPKey") +2000 qryIDSDieselArchiv.Parameters("[prmYearMonthDay]") = ![Year Month Day] +2010 qryIDSDieselArchiv.Parameters("[prmPaymentSummaryNumber]") = ![Payment summary number] +2020 qryIDSDieselArchiv.Parameters("[prmCustomerCode]") = ![Customer Code] +2030 qryIDSDieselArchiv.Parameters("[prmOutletCountryCode]") = ![Outlet Country Code] +2040 qryIDSDieselArchiv.Parameters("[prmOutletCode]") = ![Outlet Code] +2050 qryIDSDieselArchiv.Parameters("[prmProductTypeCode]") = ![Product Type Code] +2060 Set rstIDSDieselArchiv = qryIDSDieselArchiv.OpenRecordset(dbOpenDynaset) +2070 If rstIDSDieselArchiv.EOF Then +2080 rstIDSDieselArchiv.AddNew +2090 lngDatensätzeAngefügt = lngDatensätzeAngefügt + 1 +2100 Call SysCmd(acSysCmdSetStatus, "IDS-Diesel-Archiv Neuzugang: " & ![Year Month Day] & "-" & ![Payment summary number] & "-" & ![Customer Code] & "-" & ![Outlet Country Code] & "-" & ![Outlet Code] & "-" & ![Product Type Code]) +2110 Else +2120 rstIDSDieselArchiv.Edit +2130 lngDatensätzeAktualisiert = lngDatensätzeAktualisiert + 1 +2140 Call SysCmd(acSysCmdSetStatus, "IDS-Diesel-Archiv Änderung: " & ![Year Month Day] & "-" & ![Payment summary number] & "-" & ![Customer Code] & "-" & ![Outlet Country Code] & "-" & ![Outlet Code] & "-" & ![Product Type Code]) +2150 End If +2160 For Each fld In .Fields +2170 rstIDSDieselArchiv(fld.Name) = fld.Value +2180 Next +2190 rstIDSDieselArchiv.Update +2200 rstIDSDieselArchiv.Close +2210 qryIDSDieselArchiv.Close + +2220 DoEvents +2230 .MoveNext +2240 Loop + + + + + datum = f.Datum + SQL.doSQL("DELETE FROM tblAsfinagMaut", "FMZOLL") + If SQL.doSQL("Update Abrechnungsdatum SET Abrechnungsdatum = '" & f.Datum.ToShortDateString & "'", "ASFINAG") Then + If SQL.doSQL("UPDATE dbo.TTRBody SET Abrechnungsdatum = '" & f.Datum.ToShortDateString & "' WHERE (PKHistory = 0) AND (PKFileName LIKE N'" & checkifTestfiles() & ".%') AND (FileCreationDate <= '" & f.Datum.ToShortDateString & "') AND abrechnungsdatum IS NULL AND belegerstellungsdatum IS NULL", "ASFINAG") Then + + Dim dt As DataTable = SQL.loadDgvBySql("Select dbo.TTRBody.OBUID, dbo.TTRBody.CardNumber, dbo.TTRBody.receiptNumber, dbo.TTRBody.VATAmount, dbo.TTRBody.amountInclVAT, dbo.TTRBody.DeliveryDate,dbo.TTRBody.abrechnungsdatum,dbo.TTRBody.belegerstellungsdatum, dbo.tblWarenarten.WarenartDE, dbo.CLFArchiv.vehicleLicensePlate, dbo.TTRBody.InfoField, dbo.TTRBody.ProductCode, dbo.TTRBody.Town, dbo.TTRBody.PKFileName + From dbo.CLFArchiv + RIGHT OUTER Join dbo.TTRBody ON dbo.CLFArchiv.OBUID = dbo.TTRBody.OBUID + LEFT OUTER Join dbo.tblWarenarten ON dbo.TTRBody.ProductCode = dbo.tblWarenarten.ProductCode + Where (dbo.TTRBody.PKHistory = 0) And (dbo.TTRBody.PKFileName Like N'" & checkifTestfiles() & ".%') AND TTRBody.abrechnungsdatum = '" & f.Datum.ToShortDateString & "' + Order By dbo.TTRBody.CardNumber, dbo.TTRBody.FileCreationDate, dbo.TTRBody.PKHistory, dbo.TTRBody.PKFileName, dbo.TTRBody.PKLine", "ASFINAG") + If dt.Rows.Count = 0 Then + MsgBox("Es wurden keine Daten in tblAsfinagMaut geschrieben!") + Return False + End If + For Each row As DataRow In dt.Rows + Dim maut As New VERAG_PROG_ALLGEMEIN.cAsfinagMaut() + maut.cardnumber = row.Item("CardNumber") + maut.licenceplate = IIf(Not IsDBNull(row.Item("vehicleLicensePlate")), row.Item("vehicleLicensePlate"), row.Item("InfoField")) + maut.turnoverdate = row.Item("DeliveryDate") + maut.contractPartner = "ASFINAG " & IIf(Not IsDBNull(row.Item("WarenartDE")), row.Item("WarenartDE"), "Product Code " & row.Item("ProductCode")) + maut.netAmount = CDbl(row.Item("amountInclVAT")) - CDbl(row.Item("VATAmount")) + maut.VATamount = CDbl(row.Item("VATAmount")) + maut.totalAmount = CDbl(row.Item("amountInclVAT")) + maut.additionalData = row.Item("Town") 'wird nicht mehr verwendet???? + maut.receiptnumber = row.Item("receiptNumber") + maut.receiptCreated = IIf(IsDBNull(row.Item("belegerstellungsdatum")), False, True) + maut.SAVE() + Next + + Dim pruefSumTTR = SQL.getValueTxtBySql("select sum(checksumAmounntInclVAT) from [ASFINAG].[dbo].[TTRTrailer] where PKHistory = 0 and [TTRTrailer].PKFileName in (select distinct([TTRBody].PKFileName) as Test from [ASFINAG].[dbo].[TTRBody] where (TTRBody.PKHistory = 0) And (TTRBody.PKFileName Like N'" & checkifTestfiles() & ".%') AND TTRBody.abrechnungsdatum = '" & f.Datum.ToShortDateString & "')", "ASFINAG") + If pruefSumTTR IsNot Nothing AndAlso IsNumeric(pruefSumTTR) Then + txtTTRSum.Text = CDbl(pruefSumTTR).ToString("C2") + lblTTRSum.Visible = True + txtTTRSum.Visible = True + lblTTRSum.Text = "Prüfsumme TTR:" + Else + lblTTRSum.Visible = False + txtTTRSum.Visible = False + End If + + + MsgBox("Abrechnungsdatum gesetzt!") + End If + End If + + + cbxASFINAGAbgerechnet.Checked = True 'initDgv_ASFINAG(Not cbxASFINAGNichtAbgerechnet.Checked) End If @@ -3887,7 +4366,9 @@ Public Class frmMDMDatenverarbetiung End Sub Private Sub bntDatumsetzen_Click(sender As Object, e As EventArgs) Handles bntDatumsetzen.Click + setFakturiert_ASFINAG() + End Sub Private Sub cbxBelegeerstellt_CheckedChanged(sender As Object, e As EventArgs) Handles cbxBelegeerstellt.CheckedChanged @@ -3915,4 +4396,8 @@ Public Class frmMDMDatenverarbetiung Private Sub cbxTestdaten_CheckedChanged(sender As Object, e As EventArgs) Handles cbxTestdaten.CheckedChanged test = cbxTestdaten.Checked End Sub + + Private Sub btnRechenwertesetzen_Click(sender As Object, e As EventArgs) Handles btnRechenwertesetzen.Click + If vbYes = MsgBox("Haben Sie die Rechenwerte in den IDS-Tabellen aktualisiert?" & vbNewLine & "(Diese werden beim Importieren in die Abrechnungsdaten übernommen)", vbYesNoCancel) Then setRechenwerteIDS() + End Sub End Class diff --git a/SDL/mdm/usrCntlMDMDatenverarbeitungAuswertungen_divers.vb b/SDL/mdm/usrCntlMDMDatenverarbeitungAuswertungen_divers.vb index b68320d1..2862679f 100644 --- a/SDL/mdm/usrCntlMDMDatenverarbeitungAuswertungen_divers.vb +++ b/SDL/mdm/usrCntlMDMDatenverarbeitungAuswertungen_divers.vb @@ -51,6 +51,14 @@ Public Class usrCntlMDMDatenverarbeitungAuswertungen_divers Button3.Text = "fehlende Transakt." Button3.Visible = True + Case "IDS" + + Button6.Text = "Nach Spezifikation" + Button2.Text = "Leistungsnummern" + Button1.Text = "Kunden" + Button3.Text = "fehlende Transakt." + Button3.Visible = True + Case Else diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb b/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb index 90d5a0a0..bc52dadb 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb @@ -1,9 +1,16 @@  Imports System.Data.SqlClient +Imports System.IO +Imports System.Net Imports System.Reflection +Imports System.Windows.Forms +Imports com.sun.xml.internal.ws.api.pipe +Imports javax.print.attribute.standard +Imports Microsoft.Office.Interop Public Class cIDS + Property transaction_id As Integer Property YearMonthDay As Object = Nothing Property Paymentsummarynumber As Object = Nothing @@ -40,10 +47,27 @@ Public Class cIDS Dim SQL As New SQL + Sub New() + + End Sub + Sub New(transaction_id) Me.transaction_id = transaction_id - LOAD() + LOADID() End Sub + + Sub New(YearMonthDay, Paymentsummarynumber, CustomerCode, OutletCountryCode, OutletCode, ProductTypeCode) + Me.YearMonthDay = YearMonthDay + Me.Paymentsummarynumber = Paymentsummarynumber + Me.CustomerCode = CustomerCode + Me.OutletCountryCode = OutletCountryCode + Me.OutletCode = OutletCode + Me.ProductTypeCode = ProductTypeCode + LOAD() + + End Sub + + Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_id", transaction_id,, True)) @@ -76,30 +100,30 @@ Public Class cIDS list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("UStVAn_ID", UStVAn_ID)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VRNumber", VRNumber)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OBONumber", OBONumber)) - - Return list End Function + + Public Function SAVE() As Boolean Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() - Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactions WHERE transaction_id=@transaction_id) " & - " BEGIN " & getUpdateCmd() & " END " & - " Else " & - " BEGIN " & getInsertCmd() & " END " & - " commit tran " + Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode) " & + " BEGIN " & getUpdateCmd() & " END " & + " Else " & + " BEGIN " & getInsertCmd() & " END " & + " commit tran " Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list) End Function - Public Sub LOAD() + Public Sub LOADID() Try hasEntry = False Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL() - Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactions WHERE transaction_id=@transaction_id ", conn) + Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew WHERE transaction_id=@transaction_id ", conn) cmd.Parameters.AddWithValue("@transaction_id", transaction_id) Dim dr = cmd.ExecuteReader() If dr.Read Then @@ -111,7 +135,39 @@ Public Class cIDS Else propInfo.SetValue(Me, dr.Item(li.Text)) End If + Next + hasEntry = True + End If + dr.Close() + End Using + End Using + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End Sub + + Public Sub LOAD() + Try + hasEntry = False + Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL() + Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode ", conn) + cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay) + cmd.Parameters.AddWithValue("@Paymentsummarynumber", Paymentsummarynumber) + cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode) + cmd.Parameters.AddWithValue("@OutletCountryCode", OutletCountryCode) + cmd.Parameters.AddWithValue("@OutletCode", OutletCode) + cmd.Parameters.AddWithValue("@ProductTypeCode", ProductTypeCode) + Dim dr = cmd.ExecuteReader() + If dr.Read Then + For Each li In getParameterList() + Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable) + + If dr.Item(li.Text) Is DBNull.Value Then + propInfo.SetValue(Me, Nothing) + Else + propInfo.SetValue(Me, dr.Item(li.Text)) + End If Next hasEntry = True End If @@ -136,7 +192,7 @@ Public Class cIDS End If Next str = str.Substring(0, str.Length - 1) 'wg. ',' - Return (" UPDATE [tblIDSTransactions] SET " & str & " WHERE transaction_id=@transaction_id ") + Return (" UPDATE [tblIDSTransactionsNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode ") Catch ex As Exception VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) @@ -158,13 +214,82 @@ Public Class cIDS Next str = str.Substring(0, str.Length - 1) 'wg. ',' values = values.Substring(0, values.Length - 1) 'wg. ',' - Return (" INSERT INTO tblIDSTransactions (" & str & ") VALUES(" & values & ") ") + Return (" INSERT INTO tblIDSTransactionsNew (" & str & ") VALUES(" & values & ") ") Catch ex As Exception VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) End Try Return "" End Function + Public Function readAndSaveIDS(objFileRead As StreamReader, fi As FileInfo, cnt As Integer) As Boolean + + + Dim lngRecordCount As Long = 0 + + objFileRead.DiscardBufferedData() + objFileRead.BaseStream.Seek(0, System.IO.SeekOrigin.Begin) + + + Do While (objFileRead.Peek() > -1) 'header ignoríeren + Dim currentRow As String() + currentRow = objFileRead.ReadLine().Split(",") + + lngRecordCount = lngRecordCount + 1 + + If lngRecordCount = 1 Then + If Not isleernothing((currentRow(0))) = "Year Month Day" Then + Return False + End If + + + Else + + Dim ymd = isleernothing((currentRow(0))) + Dim cc = isleernothing((currentRow(1))) + Dim pyn = isleernothing((currentRow(2))) + Dim occ = isleernothing((currentRow(5))) + Dim oc = isleernothing((currentRow(6))) + Dim ptc = isleernothing((currentRow(7))) + + Dim ids As New cIDS(ymd, pyn, cc, occ, oc, ptc) + + With ids + .YearMonthDay = isleernothing((currentRow(0))) + .CustomerCode = isleernothing((currentRow(1))) + .Paymentsummarynumber = isleernothing((currentRow(2))) + .CustomerName = isleernothing((currentRow(4))) + .OutletCountry = isleernothing((currentRow(5))) + .OutletCountryCode = isleernothing((currentRow(6))) + .OutletCode = isleernothing((currentRow(7))) + .TransactionVolume = isleernothing((currentRow(8))) + .AmminclVAT = isleernothing((currentRow(9))) + .TotalNetAmount = isleernothing((currentRow(10))) + .VATAmount = isleernothing((currentRow(11))) + .avpriceexclVAT = isleernothing((currentRow(12))) + .VRNumber = isleernothing((currentRow(13))) + .OBONumber = isleernothing((currentRow(14))) + .SAVE() + End With + End If + + Loop + cnt = CInt(lngRecordCount) + objFileRead.Close() + Return True + + + + End Function + + Function isleernothing(s) As Object + If s Is DBNull.Value Then Return Nothing + If s.ToString.Trim = "" Then Return Nothing + Return s.trim + End Function + + + + Public VERARBEITUNG_PFAD Public ARCHIV_PFAD Public ERROR_PFAD @@ -189,7 +314,7 @@ Public Class cIDS MsgBox("Verabreitungspfad nicht gesetzt!") End If - Return Paramter.getFTPConenction(API_STRING, API, programName) + Return True End Function @@ -198,9 +323,8 @@ Public Class cIDS Shared apiSettingsloaded As Boolean = False Shared SQL As New VERAG_PROG_ALLGEMEIN.SQL - Shared Function GET_PARAM_ByName(tcParam_name, TESTSYSTEM) As String - Return SQL.getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='UTA' AND [Param_name]='" & tcParam_name & "'", , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(TESTSYSTEM)) + Return SQL.getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='IDS' AND [Param_name]='" & tcParam_name & "'", , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(TESTSYSTEM)) End Function Shared Function getFTPConenction(ByRef API_String As String, ByRef API As DataTable, ByRef program As String) As Boolean @@ -222,3 +346,231 @@ Public Class cIDS End Class + +Public Class cIDSInvoice + + Property invoice_id As Integer + Property YearMonthDay As Object = Nothing + Property CustomerCode As Object = Nothing + Property Invoicenumber As Object = Nothing + Property DocumentName As Object = Nothing + Property Zeitstempel As Object = Nothing + Property daid As Object = Nothing + Property archiv As Boolean + Property archiviertDatum As Object = Nothing + + + + Public hasEntry = False + + Dim SQL As New SQL + + Sub New() + + End Sub + + Sub New(invoice_id) + Me.invoice_id = invoice_id + LOADID() + End Sub + + Sub New(YearMonthDay, CustomerCode, Invoicenumber) + Me.YearMonthDay = YearMonthDay + Me.Invoicenumber = Invoicenumber + Me.CustomerCode = CustomerCode + LOAD() + + End Sub + + + Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) + Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_id", invoice_id,, True)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("YearMonthDay", YearMonthDay)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CustomerCode", CustomerCode)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Invoicenumber", Invoicenumber)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DocumentName", DocumentName)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Zeitstempel", Zeitstempel)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("daid", daid)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("archiv", archiv)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("archiviertDatum", archiviertDatum)) + Return list + End Function + Public Function SAVE() As Boolean + Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() + + Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSInvoicesNew WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber) " & + " BEGIN " & getUpdateCmd() & " END " & + " Else " & + " BEGIN " & getInsertCmd() & " END " & + " commit tran " + + Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list) + End Function + Public Sub LOADID() + Try + hasEntry = False + Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL() + Using cmd As New SqlCommand("SELECT * FROM tblIDSInvoicesNew WHERE invoice_id=@invoice_id ", conn) + cmd.Parameters.AddWithValue("@invoice_id", invoice_id) + Dim dr = cmd.ExecuteReader() + If dr.Read Then + For Each li In getParameterList() + Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable) + + If dr.Item(li.Text) Is DBNull.Value Then + propInfo.SetValue(Me, Nothing) + Else + propInfo.SetValue(Me, dr.Item(li.Text)) + End If + Next + hasEntry = True + End If + dr.Close() + End Using + End Using + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End Sub + + + Public Sub LOAD() + Try + hasEntry = False + Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL() + Using cmd As New SqlCommand("SELECT * FROM tblIDSInvoicesNew WHEREYearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber ", conn) + cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay) + cmd.Parameters.AddWithValue("@Invoicenumber", Invoicenumber) + cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode) + + Dim dr = cmd.ExecuteReader() + If dr.Read Then + For Each li In getParameterList() + Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable) + + If dr.Item(li.Text) Is DBNull.Value Then + propInfo.SetValue(Me, Nothing) + Else + propInfo.SetValue(Me, dr.Item(li.Text)) + End If + Next + hasEntry = True + End If + dr.Close() + End Using + End Using + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + End Sub + Public Function getUpdateCmd() As String + Try + Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() + Dim str As String = "" + For Each i In list + If Not i.isPrimaryParam Then + str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & "," + End If + Next + str = str.Substring(0, str.Length - 1) 'wg. ',' + Return (" UPDATE [tblIDSInvoicesNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber") + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return "" + End Function + Public Function getInsertCmd() As String + Try + Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() + Dim str As String = "" + Dim values As String = "" + For Each i In list + If Not i.isPrimaryParam Then + str &= "[" & i.Text & "]," + values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & "," + End If + Next + str = str.Substring(0, str.Length - 1) 'wg. ',' + values = values.Substring(0, values.Length - 1) 'wg. ',' + Return (" INSERT INTO tblIDSInvoicesNew (" & str & ") VALUES(" & values & ") ") + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return "" + End Function + + + + + + Shared Function isMail_IDS(mailItem As Outlook.MailItem) As Boolean + Try + If mailItem IsNot Nothing Then + Dim srch As String = "https://admin.unifiedpost.com/umadmin/viewDoc?doc=" + Return mailItem.HTMLBody.ToString.Contains(srch) + End If + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + + + Shared Function getPDF_IDS(ByRef mailItem As Outlook.MailItem, ByRef filename As String, ByRef targetpath As String) As Boolean + + Try + + If mailItem Is Nothing Then Return False + + Dim html = mailItem.HTMLBody + + Dim srch As String = "https://admin.unifiedpost.com/" + If html.ToString.Contains(srch) Then + + Dim myDelims As String() = New String() {srch} + Dim sp = html.Split(myDelims, StringSplitOptions.None) + + Dim cnt = 0 + + For Each txtHTML In sp + If cnt > 0 AndAlso txtHTML.Contains(""">") Then + + System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12 + + Dim pdfNameWithCounter As String = "" + Dim counter As Integer = 1 + Dim lastPdfName As String = "" + Dim linkinHTML = "umadmin/viewDoc?doc=" + + Dim lastIndexLink = txtHTML.ToString.IndexOf(linkinHTML) + linkinHTML.Length + Dim link = ("https://admin.unifiedpost.com/umadmin/viewDoc?doc=" & txtHTML.ToString.Substring(lastIndexLink, txtHTML.ToString.IndexOf(("Open document")) - lastIndexLink - 2)) + Dim pdf = VERAG_PROG_ALLGEMEIN.cFormularManager.getPDFViaSpirePDF_FromURLStream(link, , targetpath, False) + If pdf <> "" Then + Dim fi As New FileInfo(pdf) + filename = fi.Name + Return True + End If + + End If + cnt += 1 + Next + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + +End Class + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb index d7ad3e90..d6952875 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb @@ -414,7 +414,17 @@ Public Class frmMitarbeitersuche If MA.mit_nname.ToLower = "celan" Then 'aktuell Hardcoded, wenn Zeit ist dynamisch (per SQL-tbl) - Dim f As New frmZEButtons(art) + Dim f As New frmZEButtons(art, {"IMEX", "ATILLA", "VERAG", "FO"}) + f.ShowDialog() + + If f.DialogResult = DialogResult.OK AndAlso f.resultCode >= 0 Then + resultCode = f.resultCode + Else + Exit Sub + End If + ElseIf VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_nname.ToLower = "arslan" AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_vname.ToLower = "cihan" Then + + Dim f As New frmZEButtons(art, {"IMEX", "ATILLA"}) f.ShowDialog() If f.DialogResult = DialogResult.OK AndAlso f.resultCode >= 0 Then diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmZEButtons.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmZEButtons.vb index add42f37..734f9d1b 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmZEButtons.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmZEButtons.vb @@ -3,10 +3,12 @@ Public Class frmZEButtons Dim art As String + Dim firma As String() Public resultCode As Integer = -1 - Sub New(art As String) + Sub New(art As String, Firma As String()) Me.art = art + Me.firma = Firma InitializeComponent() End Sub @@ -28,15 +30,26 @@ Public Class frmZEButtons Select Case art Case "in" - btnIMEXKommen.Enabled = True - btnATTKommen.Enabled = True - btnFOKommen.Enabled = True - btnVergKommen.Enabled = True + If firma IsNot Nothing AndAlso firma.Length > 0 Then + + If firma.Contains("ATILLA") Then btnATTKommen.Enabled = True + If firma.Contains("IMEX") Then btnIMEXKommen.Enabled = True + If firma.Contains("FO") Then btnFOKommen.Enabled = True + If firma.Contains("VERAG") Then btnVergKommen.Enabled = True + + End If + Case "out" - btnIMEXGehen.Enabled = True - btnATTGehen.Enabled = True - btnFOGehen.Enabled = True - btnVergGehen.Enabled = True + + If firma IsNot Nothing AndAlso firma.Length > 0 Then + + If firma.Contains("ATILLA") Then btnATTGehen.Enabled = True + If firma.Contains("IMEX") Then btnIMEXGehen.Enabled = True + If firma.Contains("FO") Then btnFOGehen.Enabled = True + If firma.Contains("VERAG") Then btnVergGehen.Enabled = True + + End If + Case Else End Select From 5d56b0a245d9b595c7abf33beef17d5032804bd4 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Wed, 13 Nov 2024 08:37:49 +0100 Subject: [PATCH 2/5] MDM --- SDL/mdm/frmMDMDatenverarbetiung.vb | 429 ++++++++++++----------------- 1 file changed, 173 insertions(+), 256 deletions(-) diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index 64ca2971..c13eec19 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -1,6 +1,7 @@ Imports System.Data.OleDb Imports System.DirectoryServices.ActiveDirectory Imports System.IO +Imports GrapeCity.ActiveReports.Design.DdrDesigner.ReportViewerWinForms.UI.Controls Imports Microsoft.Office.Interop.Outlook Public Class frmMDMDatenverarbetiung @@ -794,36 +795,42 @@ Public Class frmMDMDatenverarbetiung 'Exit Sub 'MsgBox(.sql) - .SET_SQL("SELECT [transaction_id] - ,[YearMonthDay] as Datum - ,[Paymentsummarynumber] as ZahlungsNr - ,[CustomerCode] - ,[CustomerName] - ,[OutletCountryCode] - ,[OutletCountry] - ,[OutletCode] - ,[OutletName] - ,[ProductTypeCode] - ,[TransactionVolume] as Transaktionsbetrag - ,[AmminclVAT] as Gesamtbetrag - ,[TotalNetAmount] as Net - ,[VATAmount] as UST - ,[avpriceexclVAT] - ,[Rechenwert] - ,[Kz] - ,[Rabattbetrag] - ,[RabattbetragProLiter] - ,[Zeitstempel] - ,[Sachbearbeiter] - ,[KdNrVERAG] - ,[CardNumber] - ,[EmissionNumber] - ,[CardComments] - ,[CalendarDate] - ,[TransactionHHMM] - ,[UStVAn_ID] - ,[VRNumber] - ,[OBONumber] from tblIDSTransactionsNew where cast(YearMonthDay as Date) = '" & DateTimePicker2.Text & "' and UStVAn_ID is null", "FMZOLL") + .SET_SQL("SELECT trans.[transaction_id] + ,trans.[YearMonthDay] as Datum + ,trans.[Paymentsummarynumber] as ZahlungsNr + ,trans.[CustomerCode] + ,trans.[CustomerName] + ,trans.[OutletCountryCode] + ,trans.[OutletCountry] + ,trans.[OutletCode] + ,trans.[OutletName] + ,trans.[ProductTypeCode] + ,trans.[TransactionVolume] as Transaktionsbetrag + ,trans.[AmminclVAT] as Gesamtbetrag + ,trans.[TotalNetAmount] as Net + ,trans.[VATAmount] as UST + ,trans.[avpriceexclVAT] + ,trans.[Rechenwert] + ,trans.[Kz] + ,trans.[Rabattbetrag] + ,trans.[RabattbetragProLiter] + ,trans.[Zeitstempel] + ,trans.[Sachbearbeiter] + ,trans.[KdNrVERAG] + ,trans.[CardNumber] + ,trans.[EmissionNumber] + ,trans.[CardComments] + ,trans.[CalendarDate] + ,trans.[TransactionHHMM] + ,trans.[UStVAn_ID] + ,trans.[VRNumber] + ,trans.[OBONumber] + ,Kunde.CustomerCode + ,isnull(KundeOhneR.CustomerCode,0) as KundeOhneRabatt + from tblIDSTransactionsNew as trans + left join tbl_IDS_Kunden as Kunde on Kunde.CustomerCode = trans.CustomerCode + left join tbl_IDS_Kunden_ohne_Rabatt as KundeOhneR on KundeOhneR.CustomerCode = trans.CustomerCode + where cast(trans.YearMonthDay as Date) = '" & DateTimePicker2.Text & "' and trans.UStVAn_ID is null", "FMZOLL") .LOAD() @@ -836,6 +843,7 @@ Public Class frmMDMDatenverarbetiung '.Columns("VERAGLeistungsNr").ReadOnly = False .Columns("transaction_id").Visible = False + .Columns("Kunde.CustomerCode").Visible = False 'For Each r As DataGridViewColumn In .Columns ' If r.Name = "VERAGLeistungsNr" Or r.Name = "VERAGKdNr" Then @@ -1217,12 +1225,12 @@ Public Class frmMDMDatenverarbetiung If Directory.Exists(dir) Then dir &= "_" & Now.ToShortTimeString.Replace(":", "") End If -Directory.CreateDirectory(dir) + Directory.CreateDirectory(dir) - Dim displayView = New DataView(dt_Main, "MSEExportCSV = 1", "Customer ID", DataViewRowState.CurrentRows) + Dim displayView = New DataView(dt_Main, "MSEExportCSV = 1", "Customer ID", DataViewRowState.CurrentRows) Dim distinctDT_CSV As DataTable = displayView.ToTable(True, "Customer ID", "Customer Nr") @@ -4073,248 +4081,157 @@ Directory.CreateDirectory(dir) If MyDatagridview1.Rows.Count = 0 Then MsgBox("Keine Daten zum Setzen vorhanden!") Return False -End If + End If For each row In MyDatagridview1.Rows - Dim Rechenwert = 0 - Dim mKZ = "R" + Dim kundeOhneRabatt = True - Dim trans As New VERAG.PROG.ALLGEMEIN.cIDS(row.Cells("transaction_id").Value ) + Dim trans As New VERAG_PROG_ALLGEMEIN.cIDS(row.Cells("transaction_id").Value) + trans.Rechenwert = 0 + trans.Kz = "R" - If row.Cells("TransactionVolume").Value <> 0 - row.Cells("avpriceexclVAT").Value = row.Cells("TotalNetAmount").Value / row.Cells("TransactionVolume").Value + If trans.TransactionVolume <> 0 Then + trans.avpriceexclVAT = trans.TotalNetAmount / trans.TransactionVolume End If + If Not IsDBNull(row.Cells("Kunde.CustomerCode").Value) AndAlso CInt(row.Cells("Kunde.CustomerCode").Value) > 0 Then -Next + kundeOhneRabatt = row.Cells("KundeOhneRabatt").Value + + If Not kundeOhneRabatt Then 'kundeOhneRabatt -> gleich zu Rabattberechnen! + + 'Rechenwert für Land/Station/Kunde/Produkt ermitteln + Dim sqlStringLandStationKundeProdukt = "select Case Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") & AND ((OutletCode)=" & row.Cells("OutletCode").Value & ") & And ((CustomerCode)=" & row.Cells("Kunde.CustomerCode").Value & ") AND ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) & ORDER BY Zeitstempel DESC" + 'Rechenwert für Land/Kunde/Produkt ermittteln + Dim sqlStringLandKundeProdukt = "Select Case Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") And ((OutletCode) Is Null) AND ((CustomerCode)=" & row.Cells("Kunde.CustomerCode").Value & ") & And ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) ORDER BY Zeitstempel DESC" - ' Literpreis errechnen -1340 If ![Transaction Volume] <> 0 Then -1350 ![av price excl VAT] = ![Total Net Amount] / ![Transaction Volume] -1360 End If - - ' Über den IDS-CustomerCode die VERAG-Kundennummer ermitteln und eintragen. -1370 ![KdNrVERAG] = DLookup("KdNrVERAG", "tbl_IDS_Kunden", "CustomerCode=" & ![Customer Code]) - -1380 If Not IsNull(![KdNrVERAG]) Then - - ' Kunde ohne Rabatt -1390 strSQL = "SELECT *" & _ - " FROM tbl_IDS_Kunden_ohne_Rabatt" & _ - " WHERE (((tbl_IDS_Kunden_ohne_Rabatt.CustomerCode)=" & ![KdNrVERAG] & "));" -1400 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) -1410 If Not rstIDSRechenwert.EOF Then -1420 GoTo Rabatt_errechnen -1430 End If -1440 rstIDSRechenwert.Close - - ' Rechenwert für Land/Station/Kunde/Produkt ermitteln -1450 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ - " FROM tbl_IDS_Rechenwerte" & _ - " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ - " AND ((OutletCode)=" & ![Outlet Code] & ")" & _ - " AND ((CustomerCode)=" & ![KdNrVERAG] & ")" & _ - " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ - " ORDER BY Zeitstempel DESC;" -1460 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) -1470 If Not rstIDSRechenwert.EOF Then -1480 GoTo Rechenwert_eintragen -1490 End If -1500 rstIDSRechenwert.Close - - ' Rechenwert für Land/Kunde/Produkt ermittteln -1510 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ - " FROM tbl_IDS_Rechenwerte" & _ - " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ - " AND ((OutletCode) Is Null)" & _ - " AND ((CustomerCode)=" & ![KdNrVERAG] & ")" & _ - " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ - " ORDER BY Zeitstempel DESC;" -1520 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) -1530 If Not rstIDSRechenwert.EOF Then -1540 GoTo Rechenwert_eintragen -1550 End If -1560 rstIDSRechenwert.Close - -1570 End If - - ' Rechenwert für Land/Station/Produkt ermitteln -1580 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ - " FROM tbl_IDS_Rechenwerte" & _ - " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ - " AND ((OutletCode)=" & ![Outlet Code] & ")" & _ - " AND ((CustomerCode) Is Null)" & _ - " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ - " ORDER BY Zeitstempel DESC;" -1590 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) -1600 If Not rstIDSRechenwert.EOF Then -1610 GoTo Rechenwert_eintragen -1620 End If -1630 rstIDSRechenwert.Close - - ' Rechenwert für Land/Produkt ermitteln -1640 strSQL = "SELECT Rechenwert, Kz, KategorieNr" & _ - " FROM tbl_IDS_Rechenwerte" & _ - " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ - " AND ((OutletCode) Is Null)" & _ - " AND ((CustomerCode) Is Null)" & _ - " AND ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ - " ORDER BY Zeitstempel DESC;" -1650 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) -1660 If Not rstIDSRechenwert.EOF Then -1670 GoTo Rechenwert_eintragen -1680 End If -1690 rstIDSRechenwert.Close - -1700 GoTo Rabatt_errechnen - -Rechenwert_eintragen: -1710 !Rechenwert = rstIDSRechenwert!Rechenwert -1720 !Kz = rstIDSRechenwert!Kz -1730 If Not IsNull(rstIDSRechenwert!KategorieNr) Then -1740 Set qry = dbs.QueryDefs("qry_IDS_KategorieNr_ProductTypeCode_Rechenwert") -1750 qry.Parameters("[prmKategorieNr]") = rstIDSRechenwert!KategorieNr -1760 qry.Parameters("[prmProductTypeCode]") = ![Product Type Code] -1770 Set rst = qry.OpenRecordset(dbOpenSnapshot) -1780 If Not rst.EOF Then -1790 !Rechenwert = !Rechenwert + rst!Rechenwert -1800 If !Rechenwert < 0 Then -1810 !Rechenwert = 0 -1820 End If -1830 End If -1840 rst.Close -1850 qry.Close -1860 End If -1870 rstIDSRechenwert.Close - - ' Ab 24.03.2010 ist die Kategorie neu hinzugekommen. - ' Lt. Hr. Siener wird der Kategorierabatt nur dann berücksichtigt, - ' wenn [Outlet Country Code] <> 740543 (Österreich) - ' und [Rechenwert] > 0 (aus Land/Produkt oder Land/Station/Produkt) - ' und [Kz = R] (Rabatt) ist. - ' Der Kategorierabatt kann auch ein Minusbetrag sein. - ' Der Rechenwert darf aber nicht negativ werden. - ' Dieser Teil entfällt ab 31.01.2019 - ' If Not IsNull(![KdNrVERAG]) Then - ' If ![Outlet Country Code] <> 740543 And _ - ' ![Rechenwert] > 0 And _ - ' ![Kz] = "R" Then - ' Set qry = dbs.QueryDefs("qry_IDS_Kunde_Kategorie_Produkt_Rechenwert") - ' qry.Parameters("[parCustomerCode]") = ![KdNrVERAG] - ' qry.Parameters("[parProductTypeCode]") = ![Product Type Code] - ' Set rst = qry.OpenRecordset(dbOpenSnapshot) - ' If Not rst.EOF Then - ' !Rechenwert = !Rechenwert + rst!Rechenwert - ' If !Rechenwert < 0 Then - ' !Rechenwert = 0 - ' End If - ' End If - ' rst.Close - ' qry.Close - ' End If - ' End If - -Rabatt_errechnen: -1880 Select Case !Kz - Case "P" 'Rechenwert ist Preis pro Liter -1890 !Rabattbetrag = ![Total Net Amount] - Int(!Rechenwert * ![Transaction Volume] * 100 + 0.5) / 100 -1900 Case "R" 'Rechenwert ist Rabatt pro Liter -1910 !Rabattbetrag = Int(!Rechenwert * ![Transaction Volume] * 100 + 0.5) / 100 -1920 End Select -1930 If ![Transaction Volume] <> 0 Then -1940 !RabattbetragProLiter = !Rabattbetrag / ![Transaction Volume] -1950 End If - - ' Zeitstempel und Sachbearbeiter in tblDiesel eintragen -1960 !Zeitstempel = Now -1970 !Sachbearbeiter = CurrentUser() -1980 .Update - - ' Daten in das Archiv schreiben. -1990 Set qryIDSDieselArchiv = dbs.QueryDefs("qryDieselArchivPKey") -2000 qryIDSDieselArchiv.Parameters("[prmYearMonthDay]") = ![Year Month Day] -2010 qryIDSDieselArchiv.Parameters("[prmPaymentSummaryNumber]") = ![Payment summary number] -2020 qryIDSDieselArchiv.Parameters("[prmCustomerCode]") = ![Customer Code] -2030 qryIDSDieselArchiv.Parameters("[prmOutletCountryCode]") = ![Outlet Country Code] -2040 qryIDSDieselArchiv.Parameters("[prmOutletCode]") = ![Outlet Code] -2050 qryIDSDieselArchiv.Parameters("[prmProductTypeCode]") = ![Product Type Code] -2060 Set rstIDSDieselArchiv = qryIDSDieselArchiv.OpenRecordset(dbOpenDynaset) -2070 If rstIDSDieselArchiv.EOF Then -2080 rstIDSDieselArchiv.AddNew -2090 lngDatensätzeAngefügt = lngDatensätzeAngefügt + 1 -2100 Call SysCmd(acSysCmdSetStatus, "IDS-Diesel-Archiv Neuzugang: " & ![Year Month Day] & "-" & ![Payment summary number] & "-" & ![Customer Code] & "-" & ![Outlet Country Code] & "-" & ![Outlet Code] & "-" & ![Product Type Code]) -2110 Else -2120 rstIDSDieselArchiv.Edit -2130 lngDatensätzeAktualisiert = lngDatensätzeAktualisiert + 1 -2140 Call SysCmd(acSysCmdSetStatus, "IDS-Diesel-Archiv Änderung: " & ![Year Month Day] & "-" & ![Payment summary number] & "-" & ![Customer Code] & "-" & ![Outlet Country Code] & "-" & ![Outlet Code] & "-" & ![Product Type Code]) -2150 End If -2160 For Each fld In .Fields -2170 rstIDSDieselArchiv(fld.Name) = fld.Value -2180 Next -2190 rstIDSDieselArchiv.Update -2200 rstIDSDieselArchiv.Close -2210 qryIDSDieselArchiv.Close - -2220 DoEvents -2230 .MoveNext -2240 Loop - - - - - datum = f.Datum - SQL.doSQL("DELETE FROM tblAsfinagMaut", "FMZOLL") - If SQL.doSQL("Update Abrechnungsdatum SET Abrechnungsdatum = '" & f.Datum.ToShortDateString & "'", "ASFINAG") Then - If SQL.doSQL("UPDATE dbo.TTRBody SET Abrechnungsdatum = '" & f.Datum.ToShortDateString & "' WHERE (PKHistory = 0) AND (PKFileName LIKE N'" & checkifTestfiles() & ".%') AND (FileCreationDate <= '" & f.Datum.ToShortDateString & "') AND abrechnungsdatum IS NULL AND belegerstellungsdatum IS NULL", "ASFINAG") Then - - Dim dt As DataTable = SQL.loadDgvBySql("Select dbo.TTRBody.OBUID, dbo.TTRBody.CardNumber, dbo.TTRBody.receiptNumber, dbo.TTRBody.VATAmount, dbo.TTRBody.amountInclVAT, dbo.TTRBody.DeliveryDate,dbo.TTRBody.abrechnungsdatum,dbo.TTRBody.belegerstellungsdatum, dbo.tblWarenarten.WarenartDE, dbo.CLFArchiv.vehicleLicensePlate, dbo.TTRBody.InfoField, dbo.TTRBody.ProductCode, dbo.TTRBody.Town, dbo.TTRBody.PKFileName - From dbo.CLFArchiv - RIGHT OUTER Join dbo.TTRBody ON dbo.CLFArchiv.OBUID = dbo.TTRBody.OBUID - LEFT OUTER Join dbo.tblWarenarten ON dbo.TTRBody.ProductCode = dbo.tblWarenarten.ProductCode - Where (dbo.TTRBody.PKHistory = 0) And (dbo.TTRBody.PKFileName Like N'" & checkifTestfiles() & ".%') AND TTRBody.abrechnungsdatum = '" & f.Datum.ToShortDateString & "' - Order By dbo.TTRBody.CardNumber, dbo.TTRBody.FileCreationDate, dbo.TTRBody.PKHistory, dbo.TTRBody.PKFileName, dbo.TTRBody.PKLine", "ASFINAG") - If dt.Rows.Count = 0 Then - MsgBox("Es wurden keine Daten in tblAsfinagMaut geschrieben!") - Return False - End If - For Each row As DataRow In dt.Rows - Dim maut As New VERAG_PROG_ALLGEMEIN.cAsfinagMaut() - maut.cardnumber = row.Item("CardNumber") - maut.licenceplate = IIf(Not IsDBNull(row.Item("vehicleLicensePlate")), row.Item("vehicleLicensePlate"), row.Item("InfoField")) - maut.turnoverdate = row.Item("DeliveryDate") - maut.contractPartner = "ASFINAG " & IIf(Not IsDBNull(row.Item("WarenartDE")), row.Item("WarenartDE"), "Product Code " & row.Item("ProductCode")) - maut.netAmount = CDbl(row.Item("amountInclVAT")) - CDbl(row.Item("VATAmount")) - maut.VATamount = CDbl(row.Item("VATAmount")) - maut.totalAmount = CDbl(row.Item("amountInclVAT")) - maut.additionalData = row.Item("Town") 'wird nicht mehr verwendet???? - maut.receiptnumber = row.Item("receiptNumber") - maut.receiptCreated = IIf(IsDBNull(row.Item("belegerstellungsdatum")), False, True) - maut.SAVE() - Next - - Dim pruefSumTTR = SQL.getValueTxtBySql("select sum(checksumAmounntInclVAT) from [ASFINAG].[dbo].[TTRTrailer] where PKHistory = 0 and [TTRTrailer].PKFileName in (select distinct([TTRBody].PKFileName) as Test from [ASFINAG].[dbo].[TTRBody] where (TTRBody.PKHistory = 0) And (TTRBody.PKFileName Like N'" & checkifTestfiles() & ".%') AND TTRBody.abrechnungsdatum = '" & f.Datum.ToShortDateString & "')", "ASFINAG") - If pruefSumTTR IsNot Nothing AndAlso IsNumeric(pruefSumTTR) Then - txtTTRSum.Text = CDbl(pruefSumTTR).ToString("C2") - lblTTRSum.Visible = True - txtTTRSum.Visible = True - lblTTRSum.Text = "Prüfsumme TTR:" - Else - lblTTRSum.Visible = False - txtTTRSum.Visible = False + Dim sum As Double = 0 + If Not IsDBNull(row.Cells("Kunde.CustomerCode").Value) AndAlso CInt(row.Cells("Kunde.CustomerCode").Value) > 0 Then + sum = +row.Cells("transaction_id").Value End If - MsgBox("Abrechnungsdatum gesetzt!") + End If + + End If - cbxASFINAGAbgerechnet.Checked = True - 'initDgv_ASFINAG(Not cbxASFINAGNichtAbgerechnet.Checked) - End If + 'Rabatt_errechnen: + Select Case trans.Kz + + Case "P" 'Rechenwert ist Preis pro Liter + trans.Rabattbetrag = row.Cells("TotalNetAmount").Value - (row.Cells("Rechenwert").Value * row.Cells("TransactionVolume").Value * 100 + 0.5) / 100 + + Case "R" 'Rechenwert ist Rabatt pro Liter + trans.Rabattbetrag = (row.Cells("Rechenwert").Value * row.Cells("TransactionVolume").Value * 100 + 0.5) / 100 + + End Select + + If trans.TransactionVolume <> 0 Then + trans.RabattbetragProLiter = row.Cells("Rabattbetrag").Value / row.Cells("TransactionVolume").Value + End If + + trans.Zeitstempel = Now() + trans.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME + + Next + + ' Kunde ohne Rabatt + '1390 strSQL = "Select *" & _ + ' " FROM tbl_IDS_Kunden_ohne_Rabatt" & _ + ' " WHERE (((tbl_IDS_Kunden_ohne_Rabatt.CustomerCode)=" & ![KdNrVERAG] & "));" + '1400 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) + '1410 If Not rstIDSRechenwert.EOF Then + '1420 GoTo Rabatt_errechnen + '1430 End If + '1440 rstIDSRechenwert.Close + + ' ' Rechenwert für Land/Station/Kunde/Produkt ermitteln + '1450 strSQL = "Select Rechenwert, Kz, KategorieNr" & _ + ' " FROM tbl_IDS_Rechenwerte" & _ + ' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + ' " And ((OutletCode)=" & ![Outlet Code] & ")" & _ + ' " And ((CustomerCode)=" & ![KdNrVERAG] & ")" & _ + ' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + ' " ORDER BY Zeitstempel DESC;" + '1460 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) + '1470 If Not rstIDSRechenwert.EOF Then + '1480 GoTo Rechenwert_eintragen + '1490 End If + '1500 rstIDSRechenwert.Close + + ' ' Rechenwert für Land/Kunde/Produkt ermittteln + '1510 strSQL = "Select Rechenwert, Kz, KategorieNr" & _ + ' " FROM tbl_IDS_Rechenwerte" & _ + ' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + ' " And ((OutletCode) Is Null)" & _ + ' " And ((CustomerCode)=" & ![KdNrVERAG] & ")" & _ + ' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + ' " ORDER BY Zeitstempel DESC;" + '1520 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) + '1530 If Not rstIDSRechenwert.EOF Then + '1540 GoTo Rechenwert_eintragen + '1550 End If + '1560 rstIDSRechenwert.Close + + '1570 End If + + ' ' Rechenwert für Land/Station/Produkt ermitteln + '1580 strSQL = "Select Rechenwert, Kz, KategorieNr" & _ + ' " FROM tbl_IDS_Rechenwerte" & _ + ' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + ' " And ((OutletCode)=" & ![Outlet Code] & ")" & _ + ' " And ((CustomerCode) Is Null)" & _ + ' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + ' " ORDER BY Zeitstempel DESC;" + '1590 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) + '1600 If Not rstIDSRechenwert.EOF Then + '1610 GoTo Rechenwert_eintragen + '1620 End If + '1630 rstIDSRechenwert.Close + + ' ' Rechenwert für Land/Produkt ermitteln + '1640 strSQL = "Select Rechenwert, Kz, KategorieNr" & _ + ' " FROM tbl_IDS_Rechenwerte" & _ + ' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _ + ' " And ((OutletCode) Is Null)" & _ + ' " And ((CustomerCode) Is Null)" & _ + ' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _ + ' " ORDER BY Zeitstempel DESC;" + '1650 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot) + '1660 If Not rstIDSRechenwert.EOF Then + '1670 GoTo Rechenwert_eintragen + '1680 End If + '1690 rstIDSRechenwert.Close + + '1700 GoTo Rabatt_errechnen + + 'Rechenwert_eintragen: + '1710 !Rechenwert = rstIDSRechenwert!Rechenwert + '1720 !Kz = rstIDSRechenwert!Kz + '1730 If Not IsNull(rstIDSRechenwert!KategorieNr) Then + '1740 Set qry = dbs.QueryDefs("qry_IDS_KategorieNr_ProductTypeCode_Rechenwert") + '1750 qry.Parameters("[prmKategorieNr]") = rstIDSRechenwert!KategorieNr + '1760 qry.Parameters("[prmProductTypeCode]") = ![Product Type Code] + '1770 Set rst = qry.OpenRecordset(dbOpenSnapshot) + '1780 If Not rst.EOF Then + '1790 !Rechenwert = !Rechenwert + rst!Rechenwert + '1800 If !Rechenwert < 0 Then + '1810 !Rechenwert = 0 + '1820 End If + '1830 End If + '1840 rst.Close + '1850 qry.Close + '1860 End If + '1870 rstIDSRechenwert.Close + + + End Function From 03e06bbb63e7d36fc9d97e840ca6d54dd8bcfa8e Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Wed, 13 Nov 2024 08:39:21 +0100 Subject: [PATCH 3/5] MDM --- SDL/mdm/frmMDMDatenverarbetiung.vb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index c13eec19..4815b900 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -1,8 +1,6 @@ Imports System.Data.OleDb -Imports System.DirectoryServices.ActiveDirectory Imports System.IO -Imports GrapeCity.ActiveReports.Design.DdrDesigner.ReportViewerWinForms.UI.Controls -Imports Microsoft.Office.Interop.Outlook + Public Class frmMDMDatenverarbetiung From 33263dcc6d73c9d8c9ccc0d4542c4b317de99572 Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Wed, 13 Nov 2024 08:41:56 +0100 Subject: [PATCH 4/5] benachrichtigung --- SDL/mdm/frmMDMDatenverarbetiung.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index 4815b900..5be21a7e 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -4072,16 +4072,16 @@ Public Class frmMDMDatenverarbetiung End Function Private Function setRechenwerteIDS() As Boolean -'Abrechnungsdatum setzen + 'Abrechnungsdatum setzen - If Not LIEFERANT = "IDS" Then Return false + If Not LIEFERANT = "IDS" Then Return False If MyDatagridview1.Rows.Count = 0 Then MsgBox("Keine Daten zum Setzen vorhanden!") Return False End If - For each row In MyDatagridview1.Rows + For Each row In MyDatagridview1.Rows Dim kundeOhneRabatt = True @@ -4090,7 +4090,7 @@ Public Class frmMDMDatenverarbetiung trans.Kz = "R" If trans.TransactionVolume <> 0 Then - trans.avpriceexclVAT = trans.TotalNetAmount / trans.TransactionVolume + trans.avpriceexclVAT = trans.TotalNetAmount / trans.TransactionVolume End If If Not IsDBNull(row.Cells("Kunde.CustomerCode").Value) AndAlso CInt(row.Cells("Kunde.CustomerCode").Value) > 0 Then From f9b042944405009ee9c51c8095c01aa5d6cb8d09 Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Wed, 13 Nov 2024 08:43:41 +0100 Subject: [PATCH 5/5] Verwahrung_Foto --- .../Classes/cAvisoBenachrichtigungen.vb | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cAvisoBenachrichtigungen.vb b/VERAG_PROG_ALLGEMEIN/Classes/cAvisoBenachrichtigungen.vb index 7a2451c5..89bec9cd 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cAvisoBenachrichtigungen.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cAvisoBenachrichtigungen.vb @@ -237,6 +237,63 @@ Public Class cAvisoBenachrichtigungen End Function + + Public Shared Function send_BENACHRICHTIGUNG_AKTIV_AVISOUSER(AvisoId As Integer, SendungsId As Integer, TXT_Titel As String, TXT_Mitteilung As String, code As Integer, Optional firma As String = "") + + 'Benachrichtigung + Try + Dim SQL As New SQL + Dim sendToID As String = SQL.DLookup("tblSnd_VG_MA", "tblSendungen", "tblSnd_SendungID='" & SendungsId & "'", "AVISO", -1) + Dim art = "B" + + 'Wenn Benutzer vorschreiben nicht online, dann Benutzer der Sendung... + If sendToID <= 0 OrElse (Not VERAG_PROG_ALLGEMEIN.cSession.IS_ONLINE(sendToID, True)) Then + sendToID = SQL.DLookup("LetzterMitarbeiterId", "tblSendungen", "tblSnd_SendungID='" & SendungsId & "'", "AVISO", -1) + art = "B" + End If + + 'Wenn Benutzer der Sendung nicht online, dann Benutzer des LKW .. + If sendToID <= 0 OrElse (Not VERAG_PROG_ALLGEMEIN.cSession.IS_ONLINE(sendToID, True)) Then + sendToID = SQL.DLookup("LetzterMitarbeiterId", "Aviso", "AvisoId='" & AvisoId & "'", "AVISO", -1) + art = "B" + End If + + 'Wenn Benutzer des LKWs nicht online, Team... + If sendToID <= 0 OrElse (Not VERAG_PROG_ALLGEMEIN.cSession.IS_ONLINE(sendToID, True)) Then + sendToID = SQL.DLookup("tblSnd_TeamId", "tblSendungen", "tblSnd_SendungID='" & SendungsId & "'", "AVISO", -1) + art = "T" + End If + + 'Wenn TEAM nicht gefunden, Firma... + If sendToID <= 0 Then + If firma IsNot Nothing AndAlso firma <> "" Then + sendToID = firma + art = "F" + End If + End If + + 'Wenn gefunden + If (art = "F" AndAlso If(sendToID, "") <> "") OrElse sendToID >= 0 Then + Dim statusAVISO = SQL.DLookup("Status", "Aviso", "AvisoID='" & AvisoId & "'", "AVISO") + ' Dim GrenzstelleAVISO = SQL.DLookup("Grenzstelle", "Aviso", "AvisoID='" & DY_TMP.dy_AvisoId & "'", "AVISO") + ' If GrenzstelleAVISO = "???" Then 'lt. ML 27.03.-> für alle freigeben + Select Case statusAVISO + Case VERAG_PROG_ALLGEMEIN.cGlobal.Status_NichtEingetroffen, VERAG_PROG_ALLGEMEIN.cGlobal.Status_Freigegeben + 'Nicht + Case Else + VERAG_PROG_ALLGEMEIN.cAvisoBenachrichtigungen.INSERT_BENACHRICHTIGUNG(AvisoId, SendungsId, code, art, sendToID, TXT_Titel, 1, , (TXT_Mitteilung).Trim,,, firma <> "") + Return True + End Select + ' End If + End If + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine, System.Reflection.MethodInfo.GetCurrentMethod.Name) + + End Try + Return False + + End Function + End Class Public Class cAvisoBenachrichtigungenCodes @@ -251,5 +308,6 @@ Public Class cAvisoBenachrichtigungenCodes Public Shared ZOLL_Rueckweisung As Integer = 8 Public Shared ZOLL_Mitteilung As Integer = 9 Public Shared AAE_Benachrichtigung As Integer = 10 + Public Shared Verwahrung_Foto As Integer = 20 End Class