diff --git a/SDL/Classes/cRKSV.vb b/SDL/Classes/cRKSV.vb index 72d7f39a..c2901f97 100644 --- a/SDL/Classes/cRKSV.vb +++ b/SDL/Classes/cRKSV.vb @@ -2700,21 +2700,21 @@ Public Class cRKSV zsZeilenNr += 1 Dim buchungsbetrag1 As Decimal = betrag UpdateDtKontenAmount(dtKonten, kassenkonto, "Soll", buchungsbetrag1) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag1, Double), "EUR", zsZeilenNr, "KO", kassenkonto, beleg.KundenNr, "S", BelegNrUID) ' 2) Debitor (Haben) zsZeilenNr += 1 Dim buchungsbetrag2 As Decimal = betrag UpdateDtKontenAmount(dtKonten, beleg.KundenNr, "Haben", buchungsbetrag2) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag2, Double), "EUR", zsZeilenNr, "DE", beleg.KundenNr, kassenkonto, "H", BelegNrUID) ' 3) Forderung (Haben) zsZeilenNr += 1 Dim buchungsbetrag3 As Decimal = betrag UpdateDtKontenAmount(dtKonten, forderungskonto, "Haben", buchungsbetrag3) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag3, Double), "EUR", zsZeilenNr, "DB", forderungskonto, kassenkonto, "H", BelegNrUID) End If ElseIf typ = "AUSZAHLUNG" Then @@ -2724,35 +2724,35 @@ Public Class cRKSV zsZeilenNr += 1 Dim buchungsbetrag1 As Decimal = betrag UpdateDtKontenAmount(dtKonten, bestandskonto, "Soll", buchungsbetrag1) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag1, Double), "EUR", zsZeilenNr, "KO", bestandskonto, 0, "S", BelegNrUID) ' 2) Kassa (Haben) = +betrag (cash out) zsZeilenNr += 1 Dim buchungsbetrag2 As Decimal = betrag UpdateDtKontenAmount(dtKonten, kassenkonto, "Haben", buchungsbetrag2) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag2, Double), "EUR", zsZeilenNr, "KO", kassenkonto, 0, "H", BelegNrUID) ' 3) Debitor (Soll) zsZeilenNr += 1 Dim buchungsbetrag3 As Decimal = betrag UpdateDtKontenAmount(dtKonten, beleg.KundenNr, "Soll", buchungsbetrag3) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag3, Double), "EUR", zsZeilenNr, "DE", beleg.KundenNr, 0, "S", BelegNrUID) ' 4) Forderung (Soll) zsZeilenNr += 1 Dim buchungsbetrag4 As Decimal = betrag UpdateDtKontenAmount(dtKonten, forderungskonto, "Soll", buchungsbetrag4) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag4, Double), "EUR", zsZeilenNr, "DB", forderungskonto, 0, "S", BelegNrUID) ' 5) Bestandskonto (Haben) zsZeilenNr += 1 Dim buchungsbetrag5 As Decimal = betrag UpdateDtKontenAmount(dtKonten, bestandskonto, "Haben", buchungsbetrag5) - InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(beleg.Belegart), + InsertBelegszeile_new(sql, mandant, jahr, periode, rel_periode, SafeIntToSql(i_beleg_refid), beleg.BelegDat.ToShortDateString, SafeString(beleg.BelegNr), SafeString(1), buchungstext, CType(buchungsbetrag5, Double), "EUR", zsZeilenNr, "KO", bestandskonto, 0, "H", BelegNrUID) End If End If diff --git a/SDL/Fakturierung/frmAbrechnungHandling.vb b/SDL/Fakturierung/frmAbrechnungHandling.vb index 10fdfa43..105f4383 100644 --- a/SDL/Fakturierung/frmAbrechnungHandling.vb +++ b/SDL/Fakturierung/frmAbrechnungHandling.vb @@ -31,15 +31,12 @@ Public Class frmAbrechnungHandling If HandlingList.LIST.Count > 0 Then Dim dt_temp As New DataTable() - Dim props = HandlingList.LIST(0).GetType().GetProperties() - ' Create columns automatically For Each p In props dt_temp.Columns.Add(p.Name, p.PropertyType) Next - ' Fill rows For Each item In HandlingList.LIST Dim row = dt_temp.NewRow() @@ -50,9 +47,7 @@ Public Class frmAbrechnungHandling dt_temp.Rows.Add(row) Next - dgvHandling.DataSource = dt_temp - - VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_temp) + VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_temp,,,,,,,, True) End If End Sub diff --git a/SDL/Fakturierung/frmAbrechnungsMaske.vb b/SDL/Fakturierung/frmAbrechnungsMaske.vb index 0e832ce1..a3123a69 100644 --- a/SDL/Fakturierung/frmAbrechnungsMaske.vb +++ b/SDL/Fakturierung/frmAbrechnungsMaske.vb @@ -1,6 +1,5 @@ Imports System.IO Imports Microsoft.Office.Interop -Imports VERAG_PROG_ALLGEMEIN Public Class frmAbrechnungsMaske Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL @@ -106,7 +105,7 @@ Public Class frmAbrechnungsMaske Case "ATILLA" cboFirma.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [tblFirma] WHERE Firma_ID=7", False, "FMZOLL") cboFirma.changeItem("7") - cboSachbearbeiter.fillWithSQL("SELECT [mit_username] FROM [tblMitarbeiter] where isnull(mit_firmaFMZoll,0)=7 and mit_gekuendigt=0 AND (mit_abteilung IN ('VRR','BH') OR (SELECT COUNT(*) FROM [tblBerechtigungsObjekteZuordnung] where [beroz_beroId]=199 AND [beroz_bergrId]=[mit_id] AND beroz_art='B')>0) order by mit_username", False, "ADMIN", True) + cboSachbearbeiter.fillWithSQL("SELECT [mit_username] FROM [tblMitarbeiter] where isnull(mit_firmaFMZoll,0)=7 and mit_gekuendigt=0 AND (mit_FakturierungsGruppe IN ('ATL') OR (SELECT COUNT(*) FROM [tblBerechtigungsObjekteZuordnung] where [beroz_beroId]=199 AND [beroz_bergrId]=[mit_id] AND beroz_art='B')>0) order by mit_username", False, "ADMIN", True) FilialNrRestriction = 4813 Case "VERAGIMEX" @@ -984,9 +983,9 @@ Public Class frmAbrechnungsMaske Dim ListOfRK_ID As New List(Of Integer) - Dim noRE_DATE = dgvRechnungen.SelectedRows.Cast(Of DataGridViewRow)().Any(Function(r) r.Cells("RENR").Value Is Nothing OrElse IsDBNull(r.Cells("RENR").Value) OrElse (r.Cells("RENR").Value) <> "-") + Dim noRE_NR = dgvRechnungen.SelectedRows.Cast(Of DataGridViewRow)().Any(Function(r) r.Cells("RENR").Value Is Nothing OrElse IsDBNull(r.Cells("RENR").Value) OrElse Not IsNumeric(r.Cells("RENR").Value)) - If noRE_DATE Then MsgBox("ACHTUNG, Rechnungsdatum wurde nicht gesetzt." & vbNewLine & "Vorgang wird abgebrochen!") : Exit Sub + If noRE_NR Then MsgBox("ACHTUNG, RechnungsNr wurde nicht gesetzt." & vbNewLine & "Vorgang wird abgebrochen!") : Exit Sub For Each row As DataGridViewRow In dgvRechnungen.SelectedRows diff --git a/SDL/Fakturierung/usrCntlFaktAbrechnung.vb b/SDL/Fakturierung/usrCntlFaktAbrechnung.vb index 0254ad05..511b484f 100644 --- a/SDL/Fakturierung/usrCntlFaktAbrechnung.vb +++ b/SDL/Fakturierung/usrCntlFaktAbrechnung.vb @@ -1061,9 +1061,9 @@ Public Class usrCntlFaktAbrechnung End Select initRgArt() - initKdAtrNr() initPkSt() + End Sub Sub setBGbColotTxt(p_cntl As Control) diff --git a/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb b/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb index 0a3435c2..8eaa86f5 100644 --- a/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb +++ b/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb @@ -419,7 +419,7 @@ Public Class usrcntlVorauskasse End Sub Private Sub MyComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboFirma.SelectedIndexChanged - cboSprache.Visible = False + 'cboSprache.Visible = False Label17.Visible = False Select Case cboFirma._value Case "1", "11" @@ -440,7 +440,7 @@ Public Class usrcntlVorauskasse txtEustProzent.changeItem("0,0") lblWaehrung.Text = "GBP" Case "24" - cboSprache.Visible = True + 'cboSprache.Visible = True Label17.Visible = True txtEustProzent.changeItem("0,0") Case Else diff --git a/SDL/Formulare/KDFormulare/frmFormulare.vb b/SDL/Formulare/KDFormulare/frmFormulare.vb index 96b9d2f7..96f302c2 100644 --- a/SDL/Formulare/KDFormulare/frmFormulare.vb +++ b/SDL/Formulare/KDFormulare/frmFormulare.vb @@ -4890,10 +4890,17 @@ Public Class FormularManagerNEU listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues(chWrg(usrCntl.txtGesamtsumme.Text, w), 170, top + 61, 30, 6, "bold", 10, , itextsharp.text.Element.ALIGN_RIGHT)) + Select Case usrCntl.cboSprache._value + Case "EN" + listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues("IMPORTANT NOTICE:", 12, 250, 70, 6, "bold", 14, , itextsharp.text.Element.ALIGN_LEFT, 2)) + Dim cbamTxt = "From 1 October 2023, a reporting requirement (CBAM) was introduced for the import of certain goods from third countries. As an importer, you are responsible for submitting this report. For further information, visit www.zoll.de or www.customs-consulting.at (search for ‘CBAM’)." + listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues(cbamTxt, 12, 258, 180, 30, "bold", 13, , itextsharp.text.Element.ALIGN_LEFT, 2)) + Case Else + listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues("WICHTIGER HINWEIS:", 12, 250, 70, 6, "bold", 14, , itextsharp.text.Element.ALIGN_LEFT, 2)) + Dim cbamTxt = "Ab 01.10.2023 wurde eine Meldepflicht (CBAM) beim Import bestimmter Waren aus Drittländern eingeführt. Sie als Importeur sind für diese Meldung eigenverantwortlich. Informationen unter www.zoll.de oder www.customs-consulting.at Stichwort CBAM" + listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues(cbamTxt, 12, 258, 180, 30, "bold", 13, , itextsharp.text.Element.ALIGN_LEFT, 2)) - listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues("WICHTIGER HINWEIS:", 12, 250, 70, 6, "bold", 14, , itextsharp.text.Element.ALIGN_LEFT, 2)) - Dim cbamTxt = "Ab 01.10.2023 wurde eine Meldepflicht (CBAM) beim Import bestimmter Waren aus Drittländern eingeführt. Sie als Importeur sind für diese Meldung eigenverantwortlich. Informationen unter www.zoll.de oder www.customs-consulting.at Stichwort CBAM" - listTowrite.Add(New VERAG_PROG_ALLGEMEIN.cPDFWriteValues(cbamTxt, 12, 258, 180, 30, "bold", 13, , itextsharp.text.Element.ALIGN_LEFT, 2)) + End Select @@ -4936,15 +4943,34 @@ Public Class FormularManagerNEU Case Else : destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_VK", listTowrite) End Select Case "UNISPED" - Select Case usrCntl.cboFirma._value Case "21", "23" : destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "VORAUSKASSE_AT", listTowrite) - Case Else : destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_VK", listTowrite) + Case Else + If usrCntl.cboSprache._value = "EN" Then + destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_VK_EN", listTowrite) + Else + destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_VK", listTowrite) + End If + End Select Case Else Select Case usrCntl.cboFirma._value - Case "11" : destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_CS_NEU2", listTowrite) - Case Else : destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_AG_NEU2", listTowrite) + + Case "11" + If usrCntl.cboSprache._value = "EN" Then + destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_VK_CS_EN", listTowrite) + Else + destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_CS_NEU2", listTowrite) + End If + + Case Else + If usrCntl.cboSprache._value = "EN" Then + destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_VK_EN", listTowrite) + Else + destPath = fm.fillPDF("DOKUMENTE", "VORLAGEN", "SONSTIGE", getUO2, "", "Importaviso_AG_NEU2", listTowrite) + End If + + End Select End Select diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index 9a0ee558..1ba15cbc 100644 --- a/SDL/My Project/AssemblyInfo.vb +++ b/SDL/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.Designer.vb b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.Designer.vb index 12e71232..d3de9fd2 100644 --- a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.Designer.vb +++ b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.Designer.vb @@ -23,12 +23,12 @@ Partial Class usrCntlSpeditionsBuchSuche Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(usrCntlSpeditionsBuchSuche)) Me.TabPage1 = New System.Windows.Forms.TabPage() Me.cntxtCntxtSpeditionsbuch = New System.Windows.Forms.ContextMenuStrip(Me.components) @@ -85,14 +85,17 @@ Partial Class usrCntlSpeditionsBuchSuche Me.Button21 = New System.Windows.Forms.Button() Me.btnSpedBuchEinnahmen = New System.Windows.Forms.Button() Me.pnlBerichte = New System.Windows.Forms.Panel() + Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel() + Me.btnHandling = New System.Windows.Forms.Button() + Me.cboHandlingssatz = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.btnHandling_AMBAR = New System.Windows.Forms.Button() + Me.cboHandlingssatz_AMBAR = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.cbxHandlingAbrechnen = New System.Windows.Forms.CheckBox() Me.CheckBox4 = New System.Windows.Forms.CheckBox() Me.cbxDetailbericht = New System.Windows.Forms.CheckBox() - Me.MyComboBox2 = New VERAG_PROG_ALLGEMEIN.MyComboBox() - Me.Button25 = New System.Windows.Forms.Button() Me.Button24 = New System.Windows.Forms.Button() Me.Button23 = New System.Windows.Forms.Button() Me.lblKdAusFortschritt = New System.Windows.Forms.Label() - Me.cboHandlingssatz = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.MenuStrip1 = New System.Windows.Forms.MenuStrip() Me.KundenauswertungenToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem() @@ -100,7 +103,6 @@ Partial Class usrCntlSpeditionsBuchSuche Me.ZFSteyrZeitraumAuswählenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ZFThyrnauZeitraumAuswählenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.AuswertungDiversZeitraumAuswählenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.Button20 = New System.Windows.Forms.Button() Me.Button19 = New System.Windows.Forms.Button() Me.Button18 = New System.Windows.Forms.Button() Me.Button16 = New System.Windows.Forms.Button() @@ -213,7 +215,6 @@ Partial Class usrCntlSpeditionsBuchSuche Me.Label45 = New System.Windows.Forms.Label() Me.cboFilialeHandling = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.SplitContainer = New System.Windows.Forms.SplitContainer() - Me.cbxHandlingAbrechnen = New System.Windows.Forms.CheckBox() Me.cntxtCntxtSpeditionsbuch.SuspendLayout() Me.pnlRechts.SuspendLayout() CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).BeginInit() @@ -223,6 +224,7 @@ Partial Class usrCntlSpeditionsBuchSuche Me.Panel3.SuspendLayout() Me.Panel1.SuspendLayout() Me.pnlBerichte.SuspendLayout() + Me.FlowLayoutPanel1.SuspendLayout() Me.MenuStrip1.SuspendLayout() Me.pnl.SuspendLayout() Me.MenuStrip2.SuspendLayout() @@ -681,35 +683,35 @@ Partial Class usrCntlSpeditionsBuchSuche Me.DataGridView.AllowUserToDeleteRows = False Me.DataGridView.AllowUserToOrderColumns = True Me.DataGridView.AllowUserToResizeRows = False - DataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.DataGridView.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle7 + DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.DataGridView.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1 Me.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.DataGridView.ContextMenuStrip = Me.cntxtCntxtSpeditionsbuch - DataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window - DataGridViewCellStyle8.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText - DataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.DataGridView.DefaultCellStyle = DataGridViewCellStyle8 + DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.DataGridView.DefaultCellStyle = DataGridViewCellStyle2 Me.DataGridView.Dock = System.Windows.Forms.DockStyle.Fill Me.DataGridView.Location = New System.Drawing.Point(450, 0) Me.DataGridView.Name = "DataGridView" - DataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle9.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.DataGridView.RowHeadersDefaultCellStyle = DataGridViewCellStyle9 + DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.DataGridView.RowHeadersDefaultCellStyle = DataGridViewCellStyle3 Me.DataGridView.Size = New System.Drawing.Size(789, 262) Me.DataGridView.TabIndex = 0 ' @@ -736,35 +738,35 @@ Partial Class usrCntlSpeditionsBuchSuche Me.dgvLKW.AllowUserToOrderColumns = True Me.dgvLKW.AllowUserToResizeRows = False Me.dgvLKW.BackgroundColor = System.Drawing.Color.WhiteSmoke - DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.dgvLKW.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1 + DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.dgvLKW.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle4 Me.dgvLKW.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvLKW.ContextMenuStrip = Me.cntxtCntxtSpeditionsbuch - DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window - DataGridViewCellStyle2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText - DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.dgvLKW.DefaultCellStyle = DataGridViewCellStyle2 + DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.dgvLKW.DefaultCellStyle = DataGridViewCellStyle5 Me.dgvLKW.Dock = System.Windows.Forms.DockStyle.Left Me.dgvLKW.Location = New System.Drawing.Point(0, 0) Me.dgvLKW.Name = "dgvLKW" - DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.dgvLKW.RowHeadersDefaultCellStyle = DataGridViewCellStyle3 + DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.dgvLKW.RowHeadersDefaultCellStyle = DataGridViewCellStyle6 Me.dgvLKW.Size = New System.Drawing.Size(450, 262) Me.dgvLKW.TabIndex = 35 Me.dgvLKW.Visible = False @@ -1069,17 +1071,14 @@ Partial Class usrCntlSpeditionsBuchSuche ' Me.pnlBerichte.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.pnlBerichte.Controls.Add(Me.FlowLayoutPanel1) Me.pnlBerichte.Controls.Add(Me.cbxHandlingAbrechnen) Me.pnlBerichte.Controls.Add(Me.CheckBox4) Me.pnlBerichte.Controls.Add(Me.cbxDetailbericht) - Me.pnlBerichte.Controls.Add(Me.MyComboBox2) - Me.pnlBerichte.Controls.Add(Me.Button25) Me.pnlBerichte.Controls.Add(Me.Button24) Me.pnlBerichte.Controls.Add(Me.Button23) Me.pnlBerichte.Controls.Add(Me.lblKdAusFortschritt) - Me.pnlBerichte.Controls.Add(Me.cboHandlingssatz) Me.pnlBerichte.Controls.Add(Me.MenuStrip1) - Me.pnlBerichte.Controls.Add(Me.Button20) Me.pnlBerichte.Controls.Add(Me.Button19) Me.pnlBerichte.Controls.Add(Me.Button18) Me.pnlBerichte.Controls.Add(Me.Button16) @@ -1099,6 +1098,82 @@ Partial Class usrCntlSpeditionsBuchSuche Me.pnlBerichte.TabIndex = 6 Me.pnlBerichte.Visible = False ' + 'FlowLayoutPanel1 + ' + Me.FlowLayoutPanel1.Controls.Add(Me.btnHandling) + Me.FlowLayoutPanel1.Controls.Add(Me.cboHandlingssatz) + Me.FlowLayoutPanel1.Controls.Add(Me.btnHandling_AMBAR) + Me.FlowLayoutPanel1.Controls.Add(Me.cboHandlingssatz_AMBAR) + Me.FlowLayoutPanel1.Location = New System.Drawing.Point(3, 123) + Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1" + Me.FlowLayoutPanel1.Size = New System.Drawing.Size(319, 60) + Me.FlowLayoutPanel1.TabIndex = 97 + ' + 'btnHandling + ' + Me.btnHandling.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnHandling.Image = Global.SDL.My.Resources.Resources.statistik_small + Me.btnHandling.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btnHandling.Location = New System.Drawing.Point(0, 0) + Me.btnHandling.Margin = New System.Windows.Forms.Padding(0) + Me.btnHandling.Name = "btnHandling" + Me.btnHandling.Size = New System.Drawing.Size(159, 28) + Me.btnHandling.TabIndex = 59 + Me.btnHandling.Text = "Handling an Außenstellen" + Me.btnHandling.TextAlign = System.Drawing.ContentAlignment.MiddleRight + Me.btnHandling.UseVisualStyleBackColor = True + ' + 'cboHandlingssatz + ' + Me.cboHandlingssatz._allowedValuesFreiText = Nothing + Me.cboHandlingssatz._allowFreiText = False + Me.cboHandlingssatz._value = "" + Me.cboHandlingssatz.DropDownWidth = 300 + Me.cboHandlingssatz.FormattingEnabled = True + Me.cboHandlingssatz.Location = New System.Drawing.Point(3, 31) + Me.cboHandlingssatz.Name = "cboHandlingssatz" + Me.cboHandlingssatz.Size = New System.Drawing.Size(159, 21) + Me.cboHandlingssatz.TabIndex = 60 + ' + 'btnHandling_AMBAR + ' + Me.btnHandling_AMBAR.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnHandling_AMBAR.Image = Global.SDL.My.Resources.Resources.statistik_small + Me.btnHandling_AMBAR.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btnHandling_AMBAR.Location = New System.Drawing.Point(165, 28) + Me.btnHandling_AMBAR.Margin = New System.Windows.Forms.Padding(0) + Me.btnHandling_AMBAR.Name = "btnHandling_AMBAR" + Me.btnHandling_AMBAR.Size = New System.Drawing.Size(128, 28) + Me.btnHandling_AMBAR.TabIndex = 94 + Me.btnHandling_AMBAR.Text = "Handling (AMBAR)" + Me.btnHandling_AMBAR.TextAlign = System.Drawing.ContentAlignment.MiddleRight + Me.btnHandling_AMBAR.UseVisualStyleBackColor = True + ' + 'cboHandlingssatz_AMBAR + ' + Me.cboHandlingssatz_AMBAR._allowedValuesFreiText = Nothing + Me.cboHandlingssatz_AMBAR._allowFreiText = False + Me.cboHandlingssatz_AMBAR._value = "" + Me.cboHandlingssatz_AMBAR.DropDownWidth = 250 + Me.cboHandlingssatz_AMBAR.Font = New System.Drawing.Font("Microsoft Tai Le", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.cboHandlingssatz_AMBAR.FormattingEnabled = True + Me.cboHandlingssatz_AMBAR.Location = New System.Drawing.Point(3, 59) + Me.cboHandlingssatz_AMBAR.Name = "cboHandlingssatz_AMBAR" + Me.cboHandlingssatz_AMBAR.Size = New System.Drawing.Size(128, 22) + Me.cboHandlingssatz_AMBAR.TabIndex = 53 + ' + 'cbxHandlingAbrechnen + ' + Me.cbxHandlingAbrechnen.AutoSize = True + Me.cbxHandlingAbrechnen.BackColor = System.Drawing.Color.WhiteSmoke + Me.cbxHandlingAbrechnen.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.cbxHandlingAbrechnen.Location = New System.Drawing.Point(4, 107) + Me.cbxHandlingAbrechnen.Name = "cbxHandlingAbrechnen" + Me.cbxHandlingAbrechnen.Size = New System.Drawing.Size(140, 17) + Me.cbxHandlingAbrechnen.TabIndex = 96 + Me.cbxHandlingAbrechnen.Text = "Handling abrechnen" + Me.cbxHandlingAbrechnen.UseVisualStyleBackColor = False + ' 'CheckBox4 ' Me.CheckBox4.AutoSize = True @@ -1121,33 +1196,6 @@ Partial Class usrCntlSpeditionsBuchSuche Me.cbxDetailbericht.Text = "Detailbericht" Me.cbxDetailbericht.UseVisualStyleBackColor = False ' - 'MyComboBox2 - ' - Me.MyComboBox2._allowedValuesFreiText = Nothing - Me.MyComboBox2._allowFreiText = False - Me.MyComboBox2._value = "" - Me.MyComboBox2.DropDownWidth = 250 - Me.MyComboBox2.Font = New System.Drawing.Font("Microsoft Tai Le", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.MyComboBox2.FormattingEnabled = True - Me.MyComboBox2.Location = New System.Drawing.Point(169, 162) - Me.MyComboBox2.Name = "MyComboBox2" - Me.MyComboBox2.Size = New System.Drawing.Size(128, 22) - Me.MyComboBox2.TabIndex = 53 - ' - 'Button25 - ' - Me.Button25.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.Button25.Image = Global.SDL.My.Resources.Resources.statistik_small - Me.Button25.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button25.Location = New System.Drawing.Point(169, 134) - Me.Button25.Margin = New System.Windows.Forms.Padding(0) - Me.Button25.Name = "Button25" - Me.Button25.Size = New System.Drawing.Size(128, 28) - Me.Button25.TabIndex = 94 - Me.Button25.Text = "Handling (AMBAR)" - Me.Button25.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.Button25.UseVisualStyleBackColor = True - ' 'Button24 ' Me.Button24.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) @@ -1182,18 +1230,6 @@ Partial Class usrCntlSpeditionsBuchSuche Me.lblKdAusFortschritt.TabIndex = 43 Me.lblKdAusFortschritt.TextAlign = System.Drawing.ContentAlignment.TopRight ' - 'cboHandlingssatz - ' - Me.cboHandlingssatz._allowedValuesFreiText = Nothing - Me.cboHandlingssatz._allowFreiText = False - Me.cboHandlingssatz._value = "" - Me.cboHandlingssatz.DropDownWidth = 300 - Me.cboHandlingssatz.FormattingEnabled = True - Me.cboHandlingssatz.Location = New System.Drawing.Point(7, 162) - Me.cboHandlingssatz.Name = "cboHandlingssatz" - Me.cboHandlingssatz.Size = New System.Drawing.Size(159, 21) - Me.cboHandlingssatz.TabIndex = 60 - ' 'MenuStrip1 ' Me.MenuStrip1.Dock = System.Windows.Forms.DockStyle.None @@ -1253,20 +1289,6 @@ Partial Class usrCntlSpeditionsBuchSuche Me.AuswertungDiversZeitraumAuswählenToolStripMenuItem.Text = "Flender Bocholt (Zeitraum auswählen)" Me.AuswertungDiversZeitraumAuswählenToolStripMenuItem.Visible = False ' - 'Button20 - ' - Me.Button20.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.Button20.Image = Global.SDL.My.Resources.Resources.statistik_small - Me.Button20.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button20.Location = New System.Drawing.Point(7, 134) - Me.Button20.Margin = New System.Windows.Forms.Padding(0) - Me.Button20.Name = "Button20" - Me.Button20.Size = New System.Drawing.Size(159, 28) - Me.Button20.TabIndex = 59 - Me.Button20.Text = "Handling an Außenstellen" - Me.Button20.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.Button20.UseVisualStyleBackColor = True - ' 'Button19 ' Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat @@ -2957,18 +2979,6 @@ Partial Class usrCntlSpeditionsBuchSuche Me.SplitContainer.SplitterWidth = 2 Me.SplitContainer.TabIndex = 3 ' - 'cbxHandlingAbrechnen - ' - Me.cbxHandlingAbrechnen.AutoSize = True - Me.cbxHandlingAbrechnen.BackColor = System.Drawing.Color.WhiteSmoke - Me.cbxHandlingAbrechnen.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.cbxHandlingAbrechnen.Location = New System.Drawing.Point(7, 115) - Me.cbxHandlingAbrechnen.Name = "cbxHandlingAbrechnen" - Me.cbxHandlingAbrechnen.Size = New System.Drawing.Size(140, 17) - Me.cbxHandlingAbrechnen.TabIndex = 96 - Me.cbxHandlingAbrechnen.Text = "Handling abrechnen" - Me.cbxHandlingAbrechnen.UseVisualStyleBackColor = False - ' 'usrCntlSpeditionsBuchSuche ' Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None @@ -2992,6 +3002,7 @@ Partial Class usrCntlSpeditionsBuchSuche Me.Panel1.PerformLayout() Me.pnlBerichte.ResumeLayout(False) Me.pnlBerichte.PerformLayout() + Me.FlowLayoutPanel1.ResumeLayout(False) Me.MenuStrip1.ResumeLayout(False) Me.MenuStrip1.PerformLayout() Me.pnl.ResumeLayout(False) @@ -3160,7 +3171,7 @@ Partial Class usrCntlSpeditionsBuchSuche Friend WithEvents Button19 As Button Friend WithEvents cboFilialeHandling As VERAG_PROG_ALLGEMEIN.MyComboBox Friend WithEvents Label45 As Label - Friend WithEvents Button20 As Button + Friend WithEvents btnHandling As Button Friend WithEvents Panel2 As Panel Friend WithEvents MyComboBox1 As VERAG_PROG_ALLGEMEIN.MyComboBox Friend WithEvents lstFilialeHandling As VERAG_PROG_ALLGEMEIN.MyListBox @@ -3183,8 +3194,8 @@ Partial Class usrCntlSpeditionsBuchSuche Friend WithEvents txtVermerk As VERAG_PROG_ALLGEMEIN.MyTextBox Friend WithEvents lblVermerke As Label Friend WithEvents Button24 As Button - Friend WithEvents Button25 As Button - Friend WithEvents MyComboBox2 As VERAG_PROG_ALLGEMEIN.MyComboBox + Friend WithEvents btnHandling_AMBAR As Button + Friend WithEvents cboHandlingssatz_AMBAR As VERAG_PROG_ALLGEMEIN.MyComboBox Friend WithEvents SendungsdetailsÖffnenToolStripMenuItem As ToolStripMenuItem Friend WithEvents ZFSteyrZeitraumAuswählenToolStripMenuItem As ToolStripMenuItem Friend WithEvents cbxRptDetailsZahlungsdetails As CheckBox @@ -3201,4 +3212,5 @@ Partial Class usrCntlSpeditionsBuchSuche Friend WithEvents cbxfehlZahlung_AVISOID As CheckBox Friend WithEvents cbxfehlZahlung_SENDUNG As CheckBox Friend WithEvents cbxHandlingAbrechnen As CheckBox + Friend WithEvents FlowLayoutPanel1 As FlowLayoutPanel End Class diff --git a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.resx b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.resx index e2a16688..34a80e24 100644 --- a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.resx +++ b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.resx @@ -126,9 +126,6 @@ 431, 17 - - 546, 17 - diff --git a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb index 0b884199..f345cf7f 100644 --- a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb +++ b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb @@ -501,11 +501,11 @@ Public Class usrCntlSpeditionsBuchSuche - MyComboBox2.Items.Clear() - MyComboBox2.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", "")) - MyComboBox2.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("VERAG", "VERAG")) - MyComboBox2.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("IMEX", "IMEX")) - MyComboBox2.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("UNISPED", "UNISPED")) + cboHandlingssatz_AMBAR.Items.Clear() + cboHandlingssatz_AMBAR.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", "")) + cboHandlingssatz_AMBAR.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("VERAG", "VERAG")) + cboHandlingssatz_AMBAR.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("IMEX", "IMEX")) + cboHandlingssatz_AMBAR.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("UNISPED", "UNISPED")) cboFilialeHandling.Items.Clear() @@ -579,8 +579,12 @@ Public Class usrCntlSpeditionsBuchSuche For Each p In pnlBerichte.Controls p.Visible = False Next - Button25.Visible = True - MyComboBox2.Visible = True + btnHandling_AMBAR.Visible = True + cboHandlingssatz_AMBAR.Visible = True + + btnHandling.Visible = False + cboHandlingssatz.Visible = False + End If @@ -1726,6 +1730,7 @@ Public Class usrCntlSpeditionsBuchSuche dt_summen.Columns.Add("HANDLING", GetType(Double)) dt_summen.Columns.Add("zu_kassieren_BAR", GetType(Double)) dt_summen.Columns.Add("Grenzstelle", GetType(String)) + dt_summen.Columns.Add("FilialNr", GetType(Integer)) @@ -1791,29 +1796,40 @@ Public Class usrCntlSpeditionsBuchSuche If Not IsDBNull(rpt.Fields.Item("Grenzstelle").Value) Then Dim grenzstelle As String = rpt.Fields.Item("Grenzstelle").Value.ToString() Dim existingRow = dt_summen.AsEnumerable().FirstOrDefault(Function(r) r.Field(Of String)("Grenzstelle") = grenzstelle) + Dim filialNr As Integer = -1 - If existingRow IsNot Nothing Then + If existingRow Is Nothing Then - existingRow("Anzahl") = CInt(existingRow("Anzahl")) + anz - existingRow("BAR") = CDbl(existingRow("BAR")) + bar - existingRow("HANDLING") = CDbl(existingRow("HANDLING")) + handling - existingRow("zu_kassieren_BAR") = CDbl(existingRow("zu_kassieren_BAR")) + zukassBAR - Else - - Dim R As DataRow = dt_summen.NewRow() - R("Anzahl") = anz - R("BAR") = bar - R("HANDLING") = handling - R("zu_kassieren_BAR") = zukassBAR - R("Grenzstelle") = grenzstelle - - dt_summen.Rows.Add(R) + Dim filialNrTemp = SQL.getValueTxtBySql("SELECT grz_filialNr from tblGrenzstelle where grz_BezeichnungCBO = '" & grenzstelle & "'", "AVISO") + If filialNrTemp <> "" AndAlso IsNumeric(filialNrTemp) Then + filialNr = CInt(filialNrTemp) + End If End If - End If + If existingRow IsNot Nothing Then - sumAnz += anz + existingRow("Anzahl") = CInt(existingRow("Anzahl")) + anz + existingRow("BAR") = CDbl(existingRow("BAR")) + bar + existingRow("HANDLING") = CDbl(existingRow("HANDLING")) + handling + existingRow("zu_kassieren_BAR") = CDbl(existingRow("zu_kassieren_BAR")) + zukassBAR + Else + + Dim R As DataRow = dt_summen.NewRow() + R("Anzahl") = anz + R("BAR") = bar + R("HANDLING") = handling + R("zu_kassieren_BAR") = zukassBAR + R("Grenzstelle") = grenzstelle + R("FilialNr") = filialNr + + dt_summen.Rows.Add(R) + End If + + + End If + + sumAnz += anz sumBar += bar sumhandling += handling sumzukassBAR += zukassBAR @@ -2141,7 +2157,7 @@ Public Class usrCntlSpeditionsBuchSuche End Sub - Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click + Private Sub Button20_Click(sender As Object, e As EventArgs) Handles btnHandling.Click If CDate(txtAbfertDat.Text).Year <> CDate(txtAbfertDatBis.Text).Year Then MsgBox("keine jahresüberschneidende Handlingsauswertung möglich!") Exit Sub @@ -2150,14 +2166,15 @@ Public Class usrCntlSpeditionsBuchSuche Dim HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST = Nothing Dim anhang = getrHandlingAussenstellen(CDate(txtAbfertDat.Text), dtAbrechnung, HandlingList, Not cbxHandlingAbrechnen.Checked, cboHandlingssatz.Text.Trim,,) + If anhang = "" Then Exit Sub + If cbxHandlingAbrechnen.Checked Then - If lstFiliale.SelectedItems.Count > 1 Then - MsgBox("Es darf nur eine Filiale ausgewählt werden!") - Exit Sub - End If + Select Case lstFiliale.SelectedItems.Count + Case 0 : MsgBox("Es muss mind. eine Filiale ausgewählt werden!") : Exit Sub + End Select - createHandlingAbrechnung(dtAbrechnung, cboHandlingssatz.Text.Trim, cboHandlingssatz._value, CInt(lstFiliale._value), CDate(txtAbfertDat.Text), CDate(txtAbfertDatBis.Text), anhang, HandlingList) + createHandlingAbrechnung(dtAbrechnung, cboHandlingssatz.Text.Trim, cboHandlingssatz._value, CDate(txtAbfertDat.Text), CDate(txtAbfertDatBis.Text), anhang, HandlingList) End If End Sub @@ -2871,7 +2888,7 @@ Public Class usrCntlSpeditionsBuchSuche End Function - Private Sub Button25_Click(sender As Object, e As EventArgs) Handles Button25.Click + Private Sub Button25_Click(sender As Object, e As EventArgs) Handles btnHandling_AMBAR.Click If CDate(txtAbfertDat.Text).Year <> CDate(txtAbfertDatBis.Text).Year Then MsgBox("keine jahresüberschneidende Handlingsauswertung möglich!") @@ -2879,7 +2896,7 @@ Public Class usrCntlSpeditionsBuchSuche End If Dim where = "" - Select Case MyComboBox2._value + Select Case cboHandlingssatz_AMBAR._value Case "VERAG" : where = " AND FilialenNr IN (SELECT Filialen.FilialenNr FROM Filialen WHERE Filialen.Firma='VERAG' AND Filialen.FilialenNr NOT IN (4801,4802)) " Case "IMEX" : where = " AND FilialenNr IN (5501) " Case "UNISPED" : where = " AND FilialenNr IN (5601) " @@ -2889,14 +2906,17 @@ Public Class usrCntlSpeditionsBuchSuche Dim dtAbrechnung As New DataTable Dim HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST = Nothing Dim anhang_path = getrHandlingAussenstellen(CDate(txtAbfertDat.Text), dtAbrechnung, HandlingList, Not cbxHandlingAbrechnen.Checked, "AMBAR an ALL", where, True) + + If anhang_path = "" Then Exit Sub + If cbxHandlingAbrechnen.Checked Then - If lstFiliale.SelectedItems.Count > 1 Then - MsgBox("Es darf nur eine Filiale ausgewählt werden!") - Exit Sub - End If + Select Case lstFiliale.SelectedItems.Count + Case 0 : MsgBox("Es muss mind. eine Filiale ausgewählt werden!") : Exit Sub - createHandlingAbrechnung(dtAbrechnung, MyComboBox2._value, MyComboBox2._value, lstFiliale._value, CDate(txtAbfertDat.Text), CDate(txtAbfertDatBis.Text), anhang_path, HandlingList) + End Select + + createHandlingAbrechnung(dtAbrechnung, cboHandlingssatz_AMBAR._value, cboHandlingssatz_AMBAR._value, CDate(txtAbfertDat.Text), CDate(txtAbfertDatBis.Text), anhang_path, HandlingList) End If End Sub @@ -2922,7 +2942,7 @@ Public Class usrCntlSpeditionsBuchSuche End Sub - Private Shared Function createHandlingAbrechnung(dt As DataTable, title As String, anFirma As String, filiale As Integer, von As Date, bis As Date, anhang_path As String, HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST) As Boolean + Private Shared Function createHandlingAbrechnung(dt As DataTable, title As String, anFirma As String, von As Date, bis As Date, anhang_path As String, HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST) As Boolean Try @@ -2959,7 +2979,8 @@ Public Class usrCntlSpeditionsBuchSuche For Each row As DataGridViewRow In frm.dgvHandling.SelectedRows - doRechnung(filiale, kdNr, row.Cells("Grenzstelle").Value, row.Cells("Anzahl").Value, von, bis, row.Cells("HANDLING").Value, row.Cells("zu_kassieren_BAR").Value, counter, DS, anFirma.Trim()) + + doRechnung(CInt(row.Cells("FilialNr").Value), kdNr, row.Cells("Grenzstelle").Value, row.Cells("Anzahl").Value, von, bis, row.Cells("HANDLING").Value, row.Cells("zu_kassieren_BAR").Value, counter, DS, anFirma.Trim()) Next @@ -3069,7 +3090,7 @@ Public Class usrCntlSpeditionsBuchSuche SPEDBUCH.Umrechnungskurs = Nothing SPEDBUCH.veoerz_basbtg = Nothing SPEDBUCH.Sicherheitsbetrag = Nothing - + SPEDBUCH.AnzahlZA = anzahl SPEDBUCH.Abfertigungsanzahl = anzahl SPEDBUCH.Bemerkungen = "Sammelrechnung " & von.ToShortDateString & " - " & bis.ToShortDateString & " / Abfertigungen: " & anzahl @@ -3288,7 +3309,7 @@ Public Class usrCntlSpeditionsBuchSuche Detailbericht = True End If - If kdnrsrch < 0 Then + If kdnrsrch <0 Then Dim inputKdNr = InputBox("Bitte KdNr eingeben", "Kundenauswertung generieren") If inputKdNr <> "" Then inputKdNr = inputKdNr.Trim() diff --git a/SDL/USTV/frmMDM_USTVAntrag.Designer.vb b/SDL/USTV/frmMDM_USTVAntrag.Designer.vb index 6a837465..833a3ff4 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.Designer.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.Designer.vb @@ -24,8 +24,8 @@ Partial Class frmMDM_USTVAntrag Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMDM_USTVAntrag)) - Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.pnlBottom = New System.Windows.Forms.Panel() Me.pbXMLExport = New System.Windows.Forms.PictureBox() Me.btnRMCQuartal = New System.Windows.Forms.Button() @@ -56,6 +56,8 @@ Partial Class frmMDM_USTVAntrag Me.cbxLand = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.lblLand = New System.Windows.Forms.Label() Me.Panel8 = New System.Windows.Forms.Panel() + Me.btnSortNachLeist = New System.Windows.Forms.Button() + Me.cbxInterneNr = New System.Windows.Forms.CheckBox() Me.cbxSicherheit = New System.Windows.Forms.CheckBox() Me.Label16 = New System.Windows.Forms.Label() Me.txtRZam = New VERAG_PROG_ALLGEMEIN.MyTextBox() @@ -144,7 +146,6 @@ Partial Class frmMDM_USTVAntrag Me.ToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem() Me.FakturiertToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.cbxInterneNr = New System.Windows.Forms.CheckBox() Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition() Me.UstCntlUSTV_AntragErstattungen1 = New SDL.ustCntlUSTV_ErstattungPosition() Me.pnlBottom.SuspendLayout() @@ -604,6 +605,7 @@ Partial Class frmMDM_USTVAntrag ' Me.Panel8.BackColor = System.Drawing.Color.WhiteSmoke Me.Panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.Panel8.Controls.Add(Me.btnSortNachLeist) Me.Panel8.Controls.Add(Me.cbxInterneNr) Me.Panel8.Controls.Add(Me.cbxSicherheit) Me.Panel8.Controls.Add(Me.Label16) @@ -642,6 +644,32 @@ Partial Class frmMDM_USTVAntrag Me.Panel8.Size = New System.Drawing.Size(963, 115) Me.Panel8.TabIndex = 19 ' + 'btnSortNachLeist + ' + Me.btnSortNachLeist.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnSortNachLeist.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.btnSortNachLeist.ForeColor = System.Drawing.Color.Black + Me.btnSortNachLeist.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btnSortNachLeist.Location = New System.Drawing.Point(210, 86) + Me.btnSortNachLeist.Name = "btnSortNachLeist" + Me.btnSortNachLeist.Size = New System.Drawing.Size(117, 25) + Me.btnSortNachLeist.TabIndex = 58 + Me.btnSortNachLeist.Text = "Sort. nach Leistendem" + Me.btnSortNachLeist.UseVisualStyleBackColor = True + ' + 'cbxInterneNr + ' + Me.cbxInterneNr.AutoSize = True + Me.cbxInterneNr.BackColor = System.Drawing.Color.Transparent + Me.cbxInterneNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.cbxInterneNr.ForeColor = System.Drawing.Color.Black + Me.cbxInterneNr.Location = New System.Drawing.Point(11, 88) + Me.cbxInterneNr.Name = "cbxInterneNr" + Me.cbxInterneNr.Size = New System.Drawing.Size(141, 20) + Me.cbxInterneNr.TabIndex = 57 + Me.cbxInterneNr.Text = "interne Nr anzeigen" + Me.cbxInterneNr.UseVisualStyleBackColor = False + ' 'cbxSicherheit ' Me.cbxSicherheit.AutoSize = True @@ -1562,8 +1590,8 @@ Partial Class frmMDM_USTVAntrag Me.dgvUSTVPositionen.AKTUALISIERUNGS_INTERVALL = 500 Me.dgvUSTVPositionen.AllowUserToAddRows = False Me.dgvUSTVPositionen.AllowUserToDeleteRows = False - DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.dgvUSTVPositionen.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3 + DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvUSTVPositionen.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1 Me.dgvUSTVPositionen.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -1716,8 +1744,8 @@ Partial Class frmMDM_USTVAntrag Me.dgvErstattungspositionen.AKTUALISIERUNGS_INTERVALL = 500 Me.dgvErstattungspositionen.AllowUserToAddRows = False Me.dgvErstattungspositionen.AllowUserToDeleteRows = False - DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.dgvErstattungspositionen.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4 + DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvErstattungspositionen.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2 Me.dgvErstattungspositionen.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -1862,19 +1890,6 @@ Partial Class frmMDM_USTVAntrag Me.FakturiertToolStripMenuItem.Text = "Fakturiert zurücksetzen" Me.FakturiertToolStripMenuItem.Visible = False ' - 'cbxInterneNr - ' - Me.cbxInterneNr.AutoSize = True - Me.cbxInterneNr.BackColor = System.Drawing.Color.Transparent - Me.cbxInterneNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.cbxInterneNr.ForeColor = System.Drawing.Color.Black - Me.cbxInterneNr.Location = New System.Drawing.Point(15, 91) - Me.cbxInterneNr.Name = "cbxInterneNr" - Me.cbxInterneNr.Size = New System.Drawing.Size(141, 20) - Me.cbxInterneNr.TabIndex = 57 - Me.cbxInterneNr.Text = "interne Nr anzeigen" - Me.cbxInterneNr.UseVisualStyleBackColor = False - ' 'UstCntlUSTV_AntragPosition1 ' Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill @@ -2062,4 +2077,5 @@ Partial Class frmMDM_USTVAntrag Friend WithEvents btnRMCQuartal As Button Friend WithEvents pbXMLExport As PictureBox Friend WithEvents cbxInterneNr As CheckBox + Friend WithEvents btnSortNachLeist As Button End Class diff --git a/SDL/USTV/frmMDM_USTVAntrag.vb b/SDL/USTV/frmMDM_USTVAntrag.vb index 98ccbf53..8cd6e33b 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.vb @@ -67,6 +67,7 @@ Public Class frmMDM_USTVAntrag UstCntlUSTV_AntragPosition1.Enabled = Not UStVAn_ID <= 0 cbxLand.Visible = UStVAn_ID <= 0 + With dgvUSTVPositionen .ClearSelection() @@ -198,6 +199,12 @@ Public Class frmMDM_USTVAntrag Next + If .Columns.Count > 1 Then + btnSortNachLeist.Visible = True + Else + btnSortNachLeist.Visible = False + End If + End If End With @@ -560,7 +567,7 @@ Public Class frmMDM_USTVAntrag Else - Dim sqlWhere As String = "" + Dim sqlWhere As String = "" 'neuer USTVA-Antrag KdSearchBox1.Visible = True cbxWahrung.Enabled = True @@ -3793,8 +3800,10 @@ Public Class frmMDM_USTVAntrag scanUSTVA.INIT(USTV_ANTRAG.UStVAn_KuNr, "MDM", "USTVA_KI_" & USTV_ANTRAG.UStVAn_ID) btnPDFauslesen.Enabled = scanUSTVA.getDS().da_id > 0 cbxKIUploaddelete.Enabled = btnPDFauslesen.Enabled + scanUSTVA.Enabled = Not btnPDFauslesen.Enabled Else cbxKIUploaddelete.Enabled = False + scanUSTVA.Enabled = False End If @@ -4299,7 +4308,7 @@ Public Class frmMDM_USTVAntrag - Dim goods As New GoodsDescription With {.GoodsItem = New List(Of GoodsItem)} + Dim goods As New GoodsDescription With {.GoodsItem = New List(Of GoodsItem)} If diesel Then goods.GoodsItem.Add(New GoodsItem With {.Code = 1, .SubCode = "1.1.2", .FreeText = ""}) @@ -4394,22 +4403,22 @@ Public Class frmMDM_USTVAntrag If list.Count > 0 Then If list.Count > 1 Then - Dim pathPDF = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("RG_" & Now.ToString("ddMMyyyyHHmmss") & ".pdf", ".pdf", False, False) - If FormularManagerNEU.MergePdfFiles(list, pathPDF) Then - pdfPathfinished = pathPDF + Dim pathPDF = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("RG_" & Now.ToString("ddMMyyyyHHmmss") & ".pdf", ".pdf", False, False) + If FormularManagerNEU.MergePdfFiles(list, pathPDF) Then + pdfPathfinished = pathPDF + End If + Else + + pdfPathfinished = list(0) + End If - Else - pdfPathfinished = list(0) + Dim fileNamePDFAttZIP As String = "RG_" & Antrag_LandKz & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Year & ".zip" - End If - - Dim fileNamePDFAttZIP As String = "RG_" & Antrag_LandKz & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Year & ".zip" - - fileNamePDFAttZIP = directoryPath & "\" & fileNamePDFAttZIP + fileNamePDFAttZIP = directoryPath & "\" & fileNamePDFAttZIP - Dim fileZipped As Boolean = True + Dim fileZipped As Boolean = True If pdfPathfinished <> "" Then ' Falls ZIP schon existiert → löschen @@ -4528,22 +4537,16 @@ Public Class frmMDM_USTVAntrag init() End Sub - Private Function setXMLExportVisible(ISOLand As String) + Private Sub Button6_Click(sender As Object, e As EventArgs) Handles btnSortNachLeist.Click - Dim valid As Boolean = True + If rearangePosNrByLeistender(UStVAn_ID) Then - If ISOLand = "" Then Return valid + If dgvUSTVPositionen.SelectedRows.Count > 0 Then + initPosition(dgvUSTVPositionen.SelectedRows(0).Cells("UStVPo_ID").Value) + End If + End If - Select Case ISOLand - Case "RO" : valid = True - Case Else : valid = False - - End Select - - Return valid - - - End Function + End Sub Private Function lookFields(look As Boolean) @@ -4557,4 +4560,46 @@ Public Class frmMDM_USTVAntrag End Function + + Public Shared Function rearangePosNrByLeistender(UStVAn_ID As Integer) + + If UStVAn_ID > 0 Then + + Dim SQLString = "WITH Ordered AS ( + SELECT + [UStVAn_ID], + [UStVPo_ID], + ROW_NUMBER() OVER ( + ORDER BY [UStVPo_Leistender], + [UStVPo_ReDat], + [UStVPo_ReNr] + ) AS NewPosNr + FROM [tblUStVPositionen] + WHERE [UStVAn_ID] = " & UStVAn_ID & " + ) + + -- Temporär verschieben + UPDATE t + SET [UStVPo_ID] = o.NewPosNr + 1000 + FROM [tblUStVPositionen] t + JOIN Ordered o + ON t.[UStVAn_ID] = o.[UStVAn_ID] + AND t.[UStVPo_ID] = o.[UStVPo_ID]; + + -- Endgültige Nummern + UPDATE [tblUStVPositionen] + SET [UStVPo_ID] = [UStVPo_ID] - 1000 + WHERE [UStVAn_ID] = " & UStVAn_ID & ";" + + If (New SQL).doSQL(SQLString, "FMZOLL") Then + Return True + Else + Return False + End If + Else + Return False + End If + + End Function + End Class \ No newline at end of file diff --git a/SDL/USTV/usrCntlUSTV.vb b/SDL/USTV/usrCntlUSTV.vb index 700b7a1c..558945ef 100644 --- a/SDL/USTV/usrCntlUSTV.vb +++ b/SDL/USTV/usrCntlUSTV.vb @@ -381,6 +381,7 @@ Public Class usrCntlUSTV Next cProgramFunctions.genExcelFromDT_NEW(dtNew, {"K1:K" & (dtNew.Rows.Count + 1), "O1:T" & (dtNew.Rows.Count + 1)},,,,, True) + End If diff --git a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.Designer.vb b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.Designer.vb index bfaf998d..32a88c05 100644 --- a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.Designer.vb +++ b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.Designer.vb @@ -45,6 +45,7 @@ Partial Class usrCntlATLAS_AnkunftsAnzeige Me.txtDyNiederlassung = New System.Windows.Forms.Label() Me.MenuStrip = New System.Windows.Forms.MenuStrip() Me.OptionenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.txtWO_ID = New VERAG_PROG_ALLGEMEIN.MyTextBox() CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainer.Panel1.SuspendLayout() Me.SplitContainer.Panel2.SuspendLayout() @@ -74,6 +75,7 @@ Partial Class usrCntlATLAS_AnkunftsAnzeige 'SplitContainer.Panel2 ' Me.SplitContainer.Panel2.BackColor = System.Drawing.Color.White + Me.SplitContainer.Panel2.Controls.Add(Me.txtWO_ID) Me.SplitContainer.Panel2.Controls.Add(Me.txtWarenort) Me.SplitContainer.Panel2.Controls.Add(Me.Label3) Me.SplitContainer.Panel2.Controls.Add(Me.txtMRN) @@ -343,6 +345,30 @@ Partial Class usrCntlATLAS_AnkunftsAnzeige Me.OptionenToolStripMenuItem.Size = New System.Drawing.Size(69, 20) Me.OptionenToolStripMenuItem.Text = "Optionen" ' + 'txtWO_ID + ' + Me.txtWO_ID._DateTimeOnly = False + Me.txtWO_ID._numbersOnly = False + Me.txtWO_ID._numbersOnlyKommastellen = "" + Me.txtWO_ID._numbersOnlyTrennzeichen = True + Me.txtWO_ID._Prozent = False + Me.txtWO_ID._ShortDateNew = False + Me.txtWO_ID._ShortDateOnly = False + Me.txtWO_ID._TimeOnly = False + Me.txtWO_ID._TimeOnly_Seconds = False + Me.txtWO_ID._value = "" + Me.txtWO_ID._Waehrung = False + Me.txtWO_ID._WaehrungZeichen = True + Me.txtWO_ID.Enabled = False + Me.txtWO_ID.ForeColor = System.Drawing.Color.Black + Me.txtWO_ID.Location = New System.Drawing.Point(447, 94) + Me.txtWO_ID.MaxLineLength = -1 + Me.txtWO_ID.MaxLines_Warning = "" + Me.txtWO_ID.MaxLines_Warning_Label = Nothing + Me.txtWO_ID.Name = "txtWO_ID" + Me.txtWO_ID.Size = New System.Drawing.Size(42, 20) + Me.txtWO_ID.TabIndex = 18 + ' 'usrCntlATLAS_AnkunftsAnzeige ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -389,4 +415,5 @@ Partial Class usrCntlATLAS_AnkunftsAnzeige Friend WithEvents Label2 As Label Friend WithEvents txtWarenort As VERAG_PROG_ALLGEMEIN.MyTextBox Friend WithEvents Label3 As Label + Friend WithEvents txtWO_ID As VERAG_PROG_ALLGEMEIN.MyTextBox End Class diff --git a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.vb b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.vb index f3bfda99..7a4cafb3 100644 --- a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.vb +++ b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/Verwahrung/usrCntlATLAS_AnkunftsAnzeige.vb @@ -261,19 +261,31 @@ Public Class usrCntlATLAS_AnkunftsAnzeige Dim firmaId As Integer = -1 Dim LKW_ID As String = "" + 'Select Case Standort + ' Case "Verag GmbH" + ' firmaId = 2 + ' Case "Verag AG" + ' firmaId = 1 + ' Case "Unisped GmbH" + ' firmaId = 21 + ' Case "AMBAR GmbH" + ' firmaId = 24 + ' Case "Verag CS" + ' firmaId = 11 + ' Case "IMEX" + ' firmaId = 20 + 'End Select + Select Case Standort - Case "Verag GmbH" - firmaId = 2 - Case "Verag AG" - firmaId = 1 - Case "Unisped GmbH" - firmaId = 21 - Case "AMBAR GmbH" - firmaId = 24 - Case "Verag CS" - firmaId = 11 - Case "IMEX" - firmaId = 20 + Case Sicherheiten_Standort.VERAG_GMBH : firmaId = 2 + Case Sicherheiten_Standort.AMBAR : firmaId = 24 + Case Sicherheiten_Standort.ATILLA : firmaId = 7 + Case Sicherheiten_Standort.VERAG_AG : firmaId = 1 + Case Sicherheiten_Standort.IMEX : firmaId = 20 + Case Sicherheiten_Standort.VERAG_CS : firmaId = 11 + Case Sicherheiten_Standort.UNISPED : firmaId = 21 + Case Sicherheiten_Standort.ZOLLERN : firmaId = 90 + Case Else End Select With OPEN_DUMMY @@ -378,6 +390,7 @@ Public Class usrCntlATLAS_AnkunftsAnzeige If valueREF <> "" Then Dim DAKOSY_REF As New cDakosy_Stammreferenzen(valueREF) If DAKOSY_REF IsNot Nothing Then + txtWO_ID.Text = DAKOSY_REF.dySr_WarenortID.ToString If DAKOSY_REF.dySr_WarenortID > 0 Then txtWarenort.Text = (New SQL).getValueTxtBySql("SELECT [wo_warenort] from [tblWarenorte] where [wo_id] = " & DAKOSY_REF.dySr_WarenortID, "AVISO") End If diff --git a/SDL/buchhaltung/usrCntlBH.Designer.vb b/SDL/buchhaltung/usrCntlBH.Designer.vb index 71fb0f66..03a2355e 100644 --- a/SDL/buchhaltung/usrCntlBH.Designer.vb +++ b/SDL/buchhaltung/usrCntlBH.Designer.vb @@ -76,6 +76,9 @@ Partial Class usrCntlBH Me.Label1 = New System.Windows.Forms.Label() Me.btnWord = New System.Windows.Forms.Button() Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.txtMonateSyskavergleich = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.Label61 = New System.Windows.Forms.Label() + Me.Button15 = New System.Windows.Forms.Button() Me.Label2 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Button1 = New System.Windows.Forms.Button() @@ -150,6 +153,18 @@ Partial Class usrCntlBH Me.Label29 = New System.Windows.Forms.Label() Me.Button7 = New System.Windows.Forms.Button() Me.TabPage2 = New System.Windows.Forms.TabPage() + Me.GroupBox14 = New System.Windows.Forms.GroupBox() + Me.Label63 = New System.Windows.Forms.Label() + Me.Label66 = New System.Windows.Forms.Label() + Me.txtLand = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.Label64 = New System.Windows.Forms.Label() + Me.txtKundeNrVon = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.txtKundeNrBis = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.Label65 = New System.Windows.Forms.Label() + Me.btn_ZV = New System.Windows.Forms.Button() + Me.btn_Laender = New System.Windows.Forms.Button() + Me.btn_Erloeskkonten = New System.Windows.Forms.Button() + Me.Label62 = New System.Windows.Forms.Label() Me.GroupBox11 = New System.Windows.Forms.GroupBox() Me.Label57 = New System.Windows.Forms.Label() Me.btnDel_ = New VERAG_PROG_ALLGEMEIN.FlatButton() @@ -174,6 +189,10 @@ Partial Class usrCntlBH Me.txtZRvon = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.txtZRbis = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.Label51 = New System.Windows.Forms.Label() + Me.txtJahr_FIBU = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.Button16 = New System.Windows.Forms.Button() + Me.Label67 = New System.Windows.Forms.Label() + Me.cboFirma_FIBUFilialen = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.pnl.SuspendLayout() Me.TabPage1.SuspendLayout() Me.GroupBox13.SuspendLayout() @@ -194,6 +213,7 @@ Partial Class usrCntlBH Me.GroupBox9.SuspendLayout() Me.GroupBox6.SuspendLayout() Me.TabPage2.SuspendLayout() + Me.GroupBox14.SuspendLayout() Me.GroupBox11.SuspendLayout() Me.SuspendLayout() ' @@ -670,7 +690,7 @@ Partial Class usrCntlBH ' Me.Label32.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label32.ForeColor = System.Drawing.SystemColors.ControlDarkDark - Me.Label32.Location = New System.Drawing.Point(7, 104) + Me.Label32.Location = New System.Drawing.Point(7, 124) Me.Label32.Name = "Label32" Me.Label32.Size = New System.Drawing.Size(298, 18) Me.Label32.TabIndex = 12 @@ -680,15 +700,15 @@ Partial Class usrCntlBH ' Me.GroupBox7.Controls.Add(Me.Label33) Me.GroupBox7.Controls.Add(Me.Button6) - Me.GroupBox7.Location = New System.Drawing.Point(6, 116) + Me.GroupBox7.Location = New System.Drawing.Point(6, 137) Me.GroupBox7.Name = "GroupBox7" - Me.GroupBox7.Size = New System.Drawing.Size(369, 69) + Me.GroupBox7.Size = New System.Drawing.Size(369, 48) Me.GroupBox7.TabIndex = 13 Me.GroupBox7.TabStop = False ' 'Label33 ' - Me.Label33.Location = New System.Drawing.Point(145, 30) + Me.Label33.Location = New System.Drawing.Point(150, 21) Me.Label33.Name = "Label33" Me.Label33.Size = New System.Drawing.Size(224, 17) Me.Label33.TabIndex = 3 @@ -700,7 +720,7 @@ Partial Class usrCntlBH Me.Button6.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) Me.Button6.Location = New System.Drawing.Point(6, 12) Me.Button6.Name = "Button6" - Me.Button6.Size = New System.Drawing.Size(121, 49) + Me.Button6.Size = New System.Drawing.Size(121, 31) Me.Button6.TabIndex = 1 Me.Button6.Text = "zum Mahnlauf" Me.Button6.UseVisualStyleBackColor = True @@ -871,19 +891,74 @@ Partial Class usrCntlBH ' 'GroupBox2 ' + Me.GroupBox2.Controls.Add(Me.cboFirma_FIBUFilialen) + Me.GroupBox2.Controls.Add(Me.Label67) + Me.GroupBox2.Controls.Add(Me.Button16) + Me.GroupBox2.Controls.Add(Me.txtMonateSyskavergleich) + Me.GroupBox2.Controls.Add(Me.Label61) + Me.GroupBox2.Controls.Add(Me.Button15) Me.GroupBox2.Controls.Add(Me.Label2) Me.GroupBox2.Controls.Add(Me.Label5) Me.GroupBox2.Controls.Add(Me.Button1) Me.GroupBox2.Location = New System.Drawing.Point(6, 15) Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(461, 86) + Me.GroupBox2.Size = New System.Drawing.Size(461, 107) Me.GroupBox2.TabIndex = 4 Me.GroupBox2.TabStop = False ' + 'txtMonateSyskavergleich + ' + Me.txtMonateSyskavergleich._DateTimeOnly = False + Me.txtMonateSyskavergleich._numbersOnly = True + Me.txtMonateSyskavergleich._numbersOnlyKommastellen = "" + Me.txtMonateSyskavergleich._numbersOnlyTrennzeichen = False + Me.txtMonateSyskavergleich._Prozent = False + Me.txtMonateSyskavergleich._ShortDateNew = False + Me.txtMonateSyskavergleich._ShortDateOnly = False + Me.txtMonateSyskavergleich._TimeOnly = False + Me.txtMonateSyskavergleich._TimeOnly_Seconds = False + Me.txtMonateSyskavergleich._value = "" + Me.txtMonateSyskavergleich._Waehrung = False + Me.txtMonateSyskavergleich._WaehrungZeichen = False + Me.txtMonateSyskavergleich.ForeColor = System.Drawing.Color.Black + Me.txtMonateSyskavergleich.Location = New System.Drawing.Point(377, 58) + Me.txtMonateSyskavergleich.MaxLength = 2 + Me.txtMonateSyskavergleich.MaxLineLength = -1 + Me.txtMonateSyskavergleich.MaxLines_Warning = "" + Me.txtMonateSyskavergleich.MaxLines_Warning_Label = Nothing + Me.txtMonateSyskavergleich.Name = "txtMonateSyskavergleich" + Me.txtMonateSyskavergleich.Size = New System.Drawing.Size(24, 20) + Me.txtMonateSyskavergleich.TabIndex = 43 + Me.txtMonateSyskavergleich.Text = "3" + Me.txtMonateSyskavergleich.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label61 + ' + Me.Label61.AutoSize = True + Me.Label61.Location = New System.Drawing.Point(133, 61) + Me.Label61.Name = "Label61" + Me.Label61.Size = New System.Drawing.Size(247, 13) + Me.Label61.TabIndex = 30 + Me.Label61.Text = "akt. Kunden ohne FIBU-Filiale der letzten x Monate" + ' + 'Button15 + ' + Me.Button15.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center + Me.Button15.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button15.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.Button15.Image = Global.SDL.My.Resources.Resources.Excel_logo + Me.Button15.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.Button15.Location = New System.Drawing.Point(6, 51) + Me.Button15.Name = "Button15" + Me.Button15.Size = New System.Drawing.Size(121, 27) + Me.Button15.TabIndex = 29 + Me.Button15.Text = " Excel" + Me.Button15.UseVisualStyleBackColor = True + ' 'Label2 ' Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(145, 30) + Me.Label2.Location = New System.Drawing.Point(145, 23) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(291, 26) Me.Label2.TabIndex = 2 @@ -904,9 +979,9 @@ Partial Class usrCntlBH ' Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) - Me.Button1.Location = New System.Drawing.Point(6, 19) + Me.Button1.Location = New System.Drawing.Point(6, 10) Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(121, 49) + Me.Button1.Size = New System.Drawing.Size(121, 37) Me.Button1.TabIndex = 1 Me.Button1.Text = "Abgleich starten" Me.Button1.UseVisualStyleBackColor = True @@ -1860,8 +1935,11 @@ Partial Class usrCntlBH ' 'TabPage2 ' + Me.TabPage2.Controls.Add(Me.GroupBox14) + Me.TabPage2.Controls.Add(Me.Label62) Me.TabPage2.Controls.Add(Me.GroupBox11) Me.TabPage2.Controls.Add(Me.Label51) + Me.TabPage2.Controls.Add(Me.txtJahr_FIBU) Me.TabPage2.Location = New System.Drawing.Point(4, 22) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Size = New System.Drawing.Size(956, 879) @@ -1869,6 +1947,180 @@ Partial Class usrCntlBH Me.TabPage2.Text = "MDM" Me.TabPage2.UseVisualStyleBackColor = True ' + 'GroupBox14 + ' + Me.GroupBox14.Controls.Add(Me.Label63) + Me.GroupBox14.Controls.Add(Me.Label66) + Me.GroupBox14.Controls.Add(Me.txtLand) + Me.GroupBox14.Controls.Add(Me.Label64) + Me.GroupBox14.Controls.Add(Me.txtKundeNrVon) + Me.GroupBox14.Controls.Add(Me.txtKundeNrBis) + Me.GroupBox14.Controls.Add(Me.Label65) + Me.GroupBox14.Controls.Add(Me.btn_ZV) + Me.GroupBox14.Controls.Add(Me.btn_Laender) + Me.GroupBox14.Controls.Add(Me.btn_Erloeskkonten) + Me.GroupBox14.Location = New System.Drawing.Point(20, 153) + Me.GroupBox14.Name = "GroupBox14" + Me.GroupBox14.Size = New System.Drawing.Size(841, 123) + Me.GroupBox14.TabIndex = 38 + Me.GroupBox14.TabStop = False + ' + 'Label63 + ' + Me.Label63.AutoSize = True + Me.Label63.Location = New System.Drawing.Point(725, 70) + Me.Label63.Name = "Label63" + Me.Label63.Size = New System.Drawing.Size(103, 13) + Me.Label63.TabIndex = 76 + Me.Label63.Text = "*wenn leer dann alle" + ' + 'Label66 + ' + Me.Label66.AutoSize = True + Me.Label66.Location = New System.Drawing.Point(153, 62) + Me.Label66.Name = "Label66" + Me.Label66.Size = New System.Drawing.Size(38, 13) + Me.Label66.TabIndex = 80 + Me.Label66.Text = "Land*:" + ' + 'txtLand + ' + Me.txtLand._DateTimeOnly = False + Me.txtLand._numbersOnly = False + Me.txtLand._numbersOnlyKommastellen = "" + Me.txtLand._numbersOnlyTrennzeichen = False + Me.txtLand._Prozent = False + Me.txtLand._ShortDateNew = False + Me.txtLand._ShortDateOnly = False + Me.txtLand._TimeOnly = False + Me.txtLand._TimeOnly_Seconds = False + Me.txtLand._value = "" + Me.txtLand._Waehrung = False + Me.txtLand._WaehrungZeichen = False + Me.txtLand.ForeColor = System.Drawing.Color.Black + Me.txtLand.Location = New System.Drawing.Point(238, 59) + Me.txtLand.MaxLength = 10 + Me.txtLand.MaxLineLength = -1 + Me.txtLand.MaxLines_Warning = "" + Me.txtLand.MaxLines_Warning_Label = Nothing + Me.txtLand.Name = "txtLand" + Me.txtLand.Size = New System.Drawing.Size(70, 20) + Me.txtLand.TabIndex = 76 + ' + 'Label64 + ' + Me.Label64.AutoSize = True + Me.Label64.Location = New System.Drawing.Point(154, 96) + Me.Label64.Name = "Label64" + Me.Label64.Size = New System.Drawing.Size(86, 13) + Me.Label64.TabIndex = 76 + Me.Label64.Text = "Kunden-Nr von*:" + ' + 'txtKundeNrVon + ' + Me.txtKundeNrVon._DateTimeOnly = False + Me.txtKundeNrVon._numbersOnly = False + Me.txtKundeNrVon._numbersOnlyKommastellen = "" + Me.txtKundeNrVon._numbersOnlyTrennzeichen = True + Me.txtKundeNrVon._Prozent = False + Me.txtKundeNrVon._ShortDateNew = False + Me.txtKundeNrVon._ShortDateOnly = False + Me.txtKundeNrVon._TimeOnly = False + Me.txtKundeNrVon._TimeOnly_Seconds = False + Me.txtKundeNrVon._value = Nothing + Me.txtKundeNrVon._Waehrung = False + Me.txtKundeNrVon._WaehrungZeichen = True + Me.txtKundeNrVon.ForeColor = System.Drawing.Color.Black + Me.txtKundeNrVon.Location = New System.Drawing.Point(239, 93) + Me.txtKundeNrVon.MaxLineLength = -1 + Me.txtKundeNrVon.MaxLines_Warning = "" + Me.txtKundeNrVon.MaxLines_Warning_Label = Nothing + Me.txtKundeNrVon.Name = "txtKundeNrVon" + Me.txtKundeNrVon.Size = New System.Drawing.Size(70, 20) + Me.txtKundeNrVon.TabIndex = 78 + ' + 'txtKundeNrBis + ' + Me.txtKundeNrBis._DateTimeOnly = False + Me.txtKundeNrBis._numbersOnly = False + Me.txtKundeNrBis._numbersOnlyKommastellen = "" + Me.txtKundeNrBis._numbersOnlyTrennzeichen = True + Me.txtKundeNrBis._Prozent = False + Me.txtKundeNrBis._ShortDateNew = False + Me.txtKundeNrBis._ShortDateOnly = False + Me.txtKundeNrBis._TimeOnly = False + Me.txtKundeNrBis._TimeOnly_Seconds = False + Me.txtKundeNrBis._value = Nothing + Me.txtKundeNrBis._Waehrung = False + Me.txtKundeNrBis._WaehrungZeichen = True + Me.txtKundeNrBis.ForeColor = System.Drawing.Color.Black + Me.txtKundeNrBis.Location = New System.Drawing.Point(347, 93) + Me.txtKundeNrBis.MaxLineLength = -1 + Me.txtKundeNrBis.MaxLines_Warning = "" + Me.txtKundeNrBis.MaxLines_Warning_Label = Nothing + Me.txtKundeNrBis.Name = "txtKundeNrBis" + Me.txtKundeNrBis.Size = New System.Drawing.Size(70, 20) + Me.txtKundeNrBis.TabIndex = 79 + ' + 'Label65 + ' + Me.Label65.AutoSize = True + Me.Label65.Location = New System.Drawing.Point(318, 96) + Me.Label65.Name = "Label65" + Me.Label65.Size = New System.Drawing.Size(23, 13) + Me.Label65.TabIndex = 77 + Me.Label65.Text = "bis:" + ' + 'btn_ZV + ' + Me.btn_ZV.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center + Me.btn_ZV.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btn_ZV.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.btn_ZV.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btn_ZV.Location = New System.Drawing.Point(23, 88) + Me.btn_ZV.Name = "btn_ZV" + Me.btn_ZV.Size = New System.Drawing.Size(105, 29) + Me.btn_ZV.TabIndex = 78 + Me.btn_ZV.Text = "Zahlungsverhalten" + Me.btn_ZV.UseVisualStyleBackColor = True + ' + 'btn_Laender + ' + Me.btn_Laender.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center + Me.btn_Laender.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btn_Laender.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.btn_Laender.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btn_Laender.Location = New System.Drawing.Point(23, 54) + Me.btn_Laender.Name = "btn_Laender" + Me.btn_Laender.Size = New System.Drawing.Size(105, 29) + Me.btn_Laender.TabIndex = 77 + Me.btn_Laender.Text = "nach Länder" + Me.btn_Laender.UseVisualStyleBackColor = True + ' + 'btn_Erloeskkonten + ' + Me.btn_Erloeskkonten.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center + Me.btn_Erloeskkonten.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btn_Erloeskkonten.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.btn_Erloeskkonten.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btn_Erloeskkonten.Location = New System.Drawing.Point(23, 19) + Me.btn_Erloeskkonten.Name = "btn_Erloeskkonten" + Me.btn_Erloeskkonten.Size = New System.Drawing.Size(105, 29) + Me.btn_Erloeskkonten.TabIndex = 76 + Me.btn_Erloeskkonten.Text = "Erlöskonten" + Me.btn_Erloeskkonten.UseVisualStyleBackColor = True + ' + 'Label62 + ' + Me.Label62.AutoSize = True + Me.Label62.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label62.ForeColor = System.Drawing.SystemColors.ControlDarkDark + Me.Label62.Location = New System.Drawing.Point(17, 133) + Me.Label62.Name = "Label62" + Me.Label62.Size = New System.Drawing.Size(145, 17) + Me.Label62.TabIndex = 37 + Me.Label62.Text = "FIBU-Auswerungen" + ' 'GroupBox11 ' Me.GroupBox11.Controls.Add(Me.Label57) @@ -2252,6 +2504,65 @@ Partial Class usrCntlBH Me.Label51.TabIndex = 36 Me.Label51.Text = "Zinsnachberechnung" ' + 'txtJahr_FIBU + ' + Me.txtJahr_FIBU._DateTimeOnly = False + Me.txtJahr_FIBU._numbersOnly = False + Me.txtJahr_FIBU._numbersOnlyKommastellen = "" + Me.txtJahr_FIBU._numbersOnlyTrennzeichen = True + Me.txtJahr_FIBU._Prozent = False + Me.txtJahr_FIBU._ShortDateNew = False + Me.txtJahr_FIBU._ShortDateOnly = False + Me.txtJahr_FIBU._TimeOnly = False + Me.txtJahr_FIBU._TimeOnly_Seconds = False + Me.txtJahr_FIBU._value = "0" + Me.txtJahr_FIBU._Waehrung = False + Me.txtJahr_FIBU._WaehrungZeichen = True + Me.txtJahr_FIBU.ForeColor = System.Drawing.Color.Black + Me.txtJahr_FIBU.Location = New System.Drawing.Point(175, 133) + Me.txtJahr_FIBU.MaxLineLength = -1 + Me.txtJahr_FIBU.MaxLines_Warning = "" + Me.txtJahr_FIBU.MaxLines_Warning_Label = Nothing + Me.txtJahr_FIBU.Name = "txtJahr_FIBU" + Me.txtJahr_FIBU.Size = New System.Drawing.Size(57, 20) + Me.txtJahr_FIBU.TabIndex = 76 + Me.txtJahr_FIBU.Text = "0" + ' + 'Button16 + ' + Me.Button16.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center + Me.Button16.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button16.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.Button16.Image = Global.SDL.My.Resources.Resources.Excel_logo + Me.Button16.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.Button16.Location = New System.Drawing.Point(6, 81) + Me.Button16.Name = "Button16" + Me.Button16.Size = New System.Drawing.Size(121, 23) + Me.Button16.TabIndex = 44 + Me.Button16.Text = " Excel" + Me.Button16.UseVisualStyleBackColor = True + ' + 'Label67 + ' + Me.Label67.AutoSize = True + Me.Label67.Location = New System.Drawing.Point(145, 87) + Me.Label67.Name = "Label67" + Me.Label67.Size = New System.Drawing.Size(105, 13) + Me.Label67.TabIndex = 45 + Me.Label67.Text = "Vergleich UID-Syska" + ' + 'cboFirma_FIBUFilialen + ' + Me.cboFirma_FIBUFilialen._allowedValuesFreiText = Nothing + Me.cboFirma_FIBUFilialen._allowFreiText = False + Me.cboFirma_FIBUFilialen._value = "" + Me.cboFirma_FIBUFilialen.DropDownWidth = 150 + Me.cboFirma_FIBUFilialen.FormattingEnabled = True + Me.cboFirma_FIBUFilialen.Location = New System.Drawing.Point(406, 57) + Me.cboFirma_FIBUFilialen.Name = "cboFirma_FIBUFilialen" + Me.cboFirma_FIBUFilialen.Size = New System.Drawing.Size(54, 21) + Me.cboFirma_FIBUFilialen.TabIndex = 43 + ' 'usrCntlBH ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -2299,6 +2610,8 @@ Partial Class usrCntlBH Me.GroupBox6.PerformLayout() Me.TabPage2.ResumeLayout(False) Me.TabPage2.PerformLayout() + Me.GroupBox14.ResumeLayout(False) + Me.GroupBox14.PerformLayout() Me.GroupBox11.ResumeLayout(False) Me.GroupBox11.PerformLayout() Me.ResumeLayout(False) @@ -2456,4 +2769,23 @@ Partial Class usrCntlBH Friend WithEvents Label60 As Label Friend WithEvents Label58 As Label Friend WithEvents btnfortlRENr As Button + Friend WithEvents txtMonateSyskavergleich As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents Label61 As Label + Friend WithEvents Button15 As Button + Friend WithEvents GroupBox14 As GroupBox + Friend WithEvents Label62 As Label + Friend WithEvents txtJahr_FIBU As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents btn_ZV As Button + Friend WithEvents btn_Laender As Button + Friend WithEvents btn_Erloeskkonten As Button + Friend WithEvents Label66 As Label + Friend WithEvents txtLand As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents Label64 As Label + Friend WithEvents txtKundeNrVon As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents txtKundeNrBis As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents Label65 As Label + Friend WithEvents Label63 As Label + Friend WithEvents cboFirma_FIBUFilialen As VERAG_PROG_ALLGEMEIN.MyComboBox + Friend WithEvents Label67 As Label + Friend WithEvents Button16 As Button End Class diff --git a/SDL/buchhaltung/usrCntlBH.vb b/SDL/buchhaltung/usrCntlBH.vb index 72714ebd..bdccd252 100644 --- a/SDL/buchhaltung/usrCntlBH.vb +++ b/SDL/buchhaltung/usrCntlBH.vb @@ -1,5 +1,6 @@ Imports System.Globalization Imports System.Text +Imports ClosedXML.Excel Imports VERAG_PROG_ALLGEMEIN Public Class usrCntlBH @@ -29,6 +30,9 @@ Public Class usrCntlBH cboAbfVerbFirma.fillWithSQL("SELECT distinct([Firma]) FROM [VERAG].[dbo].[Filialen] order by [Firma]", False, "FMZOLL", True) cboAbfVerbFirma.changeItem(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA) + cboFirma_FIBUFilialen.fillWithSQL("SELECT distinct([Firma]) FROM [VERAG].[dbo].[Filialen] order by [Firma]", False, "FMZOLL", True) + cboFirma_FIBUFilialen.changeItem(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA) + cbxFirma_RE.fillWithSQL("SELECT Firma_ID, Firma_Bez FROM [VERAG].[dbo].[tblFirma] where Firma_ID in (1,4,7,11,19,20,21,22,23,24,26)", False, "FMZOLL", True) txtRE_Jahr.Text = Now().Year @@ -44,6 +48,7 @@ Public Class usrCntlBH txtUID_Jahr.Text = Now().Year txtUID_Monat.Text = Now().Month + txtJahr_FIBU.Text = Now().Year MyComboBox1.fillWithSQL(" SELECT Währungstabelle.LandKz, [Länderverzeichnis für die Außenhandelsstatistik].LandKz + ' - ' + [Länderverzeichnis für die Außenhandelsstatistik].LandBez AS LandKzISO2 " & " FROM [Länderverzeichnis für die Außenhandelsstatistik] LEFT JOIN Währungstabelle ON [Länderverzeichnis für die Außenhandelsstatistik].LandNr = Währungstabelle.Währungsschlüssel " & @@ -71,9 +76,9 @@ Public Class usrCntlBH Else - End If + End If - MyListBox1.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [VERAG].[dbo].[tblFirma] where Firma_ID NOT IN (20) order by [Firma_ID] ", False, "FMZOLL") + MyListBox1.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [VERAG].[dbo].[tblFirma] where Firma_ID NOT IN (20) order by [Firma_ID] ", False, "FMZOLL") For i = 0 To MyListBox1.Items.Count - 1 If isMDM Then @@ -1469,7 +1474,7 @@ Public Class usrCntlBH If txtRE_Jahr.Text <> "" AndAlso IsNumeric(txtRE_Jahr.Text) AndAlso txtRE_Jahr.Text.Length = 4 Then - If txtRE_Monat.Text = "" OrElse txtRE_Monat.Text <> "" AndAlso IsNumeric(txtRE_Monat.Text) AndAlso CInt(txtRE_Monat.Text) > 0 AndAlso CInt(txtRE_Monat.Text) < 13 Then + If txtRE_Monat.Text = "" OrElse txtRE_Monat.Text <> "" AndAlso IsNumeric(txtRE_Monat.Text) AndAlso CInt(txtRE_Monat.Text) > 0 AndAlso CInt(txtRE_Monat.Text) < 13 Then Dim Bezeichnung As String = "" Dim SQL_RE As String = "" @@ -1576,15 +1581,17 @@ Public Class usrCntlBH If dt_RE.Rows.Count > 0 Then cProgramFunctions.genExcelFromDT_NEW(dt_RE,,, Bezeichnung,,, True) Me.Cursor = Cursors.Default - Else - MsgBox("keine Daten für den ausgewählten Zeitraum!") - Me.Cursor = Cursors.Default - End If - + Else + MsgBox("keine Daten für den ausgewählten Zeitraum!") + Me.Cursor = Cursors.Default End If End If + End If + + + Catch ex As Exception VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) @@ -1593,5 +1600,441 @@ Public Class usrCntlBH End Sub + Private Sub Button15_Click_1(sender As Object, e As EventArgs) Handles Button15.Click + If txtMonateSyskavergleich.Text <> "" AndAlso IsNumeric(txtMonateSyskavergleich.Text) Then + + Dim SQLString = "select RechnungsKundenNr, Adressen.[Name 1], Kunden.FilialenNr, MAX(cast(RechnungsDatum as Date)) as aktuellsteRE from Rechnungsausgang + inner join Kunden on Kunden.KundenNr = Rechnungsausgang.RechnungsKundenNr + inner join Adressen on Adressen.AdressenNr = Kunden.KundenNr + inner join Filialen On Filialen.FilialenNr=Kunden.FilialenNr + where cast(RechnungsDatum as date) >= DATEADD(MONTH,-" & txtMonateSyskavergleich.Text & ", GETDATE()) and Kunden.FiBuSchnittstelle = 0 and Kunden.FiBuSchnittstelleNr is null and Adressen.Auswahl = 'A'" & IIf(cboFirma_FIBUFilialen._value <> "", " And Filialen.Firma = '" & cboFirma_FIBUFilialen._value & "'", "") & + " group by RechnungsKundenNr, Adressen.[Name 1], Kunden.FilialenNr + order by MAX(cast(RechnungsDatum as Date)) " + + Me.Cursor = Cursors.WaitCursor + Dim dt_RE As DataTable = SQL.loadDgvBySql(SQLString, "FMZOLL") + + If dt_RE.Rows.Count > 0 Then + cProgramFunctions.genExcelFromDT_NEW(dt_RE,,, "Kunden ohne FIBU-Filiale mit Belegen der letzten " & txtMonateSyskavergleich.Text & " Monate",,, True) + Me.Cursor = Cursors.Default + Else + MsgBox("keine Daten für den ausgewählten Zeitraum!") + Me.Cursor = Cursors.Default + End If + + End If + + + + + End Sub + + Private Sub Button16_Click(sender As Object, e As EventArgs) Handles btn_Erloeskkonten.Click, btn_Laender.Click, btn_ZV.Click + + If txtJahr_FIBU.Text <> "" AndAlso IsNumeric(txtJahr_FIBU.Text) AndAlso txtJahr_FIBU.TextLength = 4 Then + + Dim SQLString = "" + Dim Bezeichnung As String = "" + + + Select Case sender.Name + Case "btn_Erloeskkonten" + + Bezeichnung = "Erlöskontenstatistik " & txtJahr_FIBU.Text + SQLString = "declare @Jahr as Integer = " & txtJahr_FIBU.Text & " declare @Vorjahr as Integer = @Jahr - 1;WITH Daten AS ( + SELECT + bz.i_konto, + k.c_name, + YEAR(bz.d_beleg) AS Jahr, + MONTH(bz.d_beleg) AS Monat, + + CASE + WHEN bz.c_sollhabenkz = 'S' + THEN bz.eur_betrag * -1 + ELSE bz.eur_betrag + END AS Betrag + + FROM FIBU2.dbo.fibu_belegzeile bz + INNER JOIN FIBU2.dbo.fibu_konto k + ON bz.i_konto = k.i_konto + + WHERE bz.i_firm_refid = 19 + AND k.i_firm_refid = 19 + AND bz.eur_betrag <> 0 + AND bz.c_kennung = 'KO' + AND bz.i_konto BETWEEN 4000 AND 4999 + AND YEAR(bz.d_beleg) IN (@Jahr, @Vorjahr) + ), + + Summen AS ( + SELECT + i_konto, + c_name, + Jahr, + Monat, + SUM(Betrag) AS Betrag + FROM Daten + GROUP BY + i_konto, + c_name, + Jahr, + Monat + ), + + PivotDaten AS ( + SELECT + i_konto, + c_name, + Jahr, + + ISNULL([1],0) AS Jan, + ISNULL([2],0) AS Feb, + ISNULL([3],0) AS Mär, + ISNULL([4],0) AS Apr, + ISNULL([5],0) AS Mai, + ISNULL([6],0) AS Jun, + ISNULL([7],0) AS Jul, + ISNULL([8],0) AS Aug, + ISNULL([9],0) AS Sep, + ISNULL([10],0) AS Okt, + ISNULL([11],0) AS Nov, + ISNULL([12],0) AS Dez + + FROM Summen + PIVOT ( + SUM(Betrag) + FOR Monat IN ( + [1],[2],[3],[4],[5],[6], + [7],[8],[9],[10],[11],[12] + ) + ) p + ), + + Jahreswerte AS ( + SELECT*, Jan + Feb + Mär + Apr + Mai + Jun + Jul + Aug + Sep + Okt + Nov + Dez AS Gesamtsumme + FROM PivotDaten + ) + + -- Aktuelles Jahr + Vorjahr + SELECT + Konto, Bezeichnung, CAST(Jahr AS VARCHAR(10)) AS Zeile,Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt, Nov,Dez,Gesamtsumme + + FROM ( + SELECT + i_konto AS Konto, c_name AS Bezeichnung, Jahr,Jan,Feb,Mär,Apr,Mai,Jun,Jul, Aug,Sep,Okt,Nov,Dez,Gesamtsumme + + FROM Jahreswerte + ) x + + UNION ALL + + -- Prozentuale Veränderung + SELECT + a.i_konto AS Konto, + a.c_name AS Bezeichnung, + '% Veränderung' AS Zeile, + + CASE WHEN v.Jan = 0 THEN 100 + ELSE ROUND((a.Jan - v.Jan) * 100.0 / v.Jan, 2) + END AS Jan, + + CASE WHEN v.Feb = 0 THEN 100 + ELSE ROUND((a.Feb - v.Feb) * 100.0 / v.Feb, 2) + END AS Feb, + + CASE WHEN v.Mär = 0 THEN 100 + ELSE ROUND((a.Mär - v.Mär) * 100.0 / v.Mär, 2) + END AS Mär, + + CASE WHEN v.Apr = 0 THEN 100 + ELSE ROUND((a.Apr - v.Apr) * 100.0 / v.Apr, 2) + END AS Apr, + + CASE WHEN v.Mai = 0 THEN 100 + ELSE ROUND((a.Mai - v.Mai) * 100.0 / v.Mai, 2) + END AS Mai, + + CASE WHEN v.Jun = 0 THEN 100 + ELSE ROUND((a.Jun - v.Jun) * 100.0 / v.Jun, 2) + END AS Jun, + + CASE WHEN v.Jul = 0 THEN 100 + ELSE ROUND((a.Jul - v.Jul) * 100.0 / v.Jul, 2) + END AS Jul, + + CASE WHEN v.Aug = 0 THEN 100 + ELSE ROUND((a.Aug - v.Aug) * 100.0 / v.Aug, 2) + END AS Aug, + + CASE WHEN v.Sep = 0 THEN 100 + ELSE ROUND((a.Sep - v.Sep) * 100.0 / v.Sep, 2) + END AS Sep, + + CASE WHEN v.Okt = 0 THEN 100 + ELSE ROUND((a.Okt - v.Okt) * 100.0 / v.Okt, 2) + END AS Okt, + + CASE WHEN v.Nov = 0 THEN 100 + ELSE ROUND((a.Nov - v.Nov) * 100.0 / v.Nov, 2) + END AS Nov, + + CASE WHEN v.Dez = 0 THEN 100 + ELSE ROUND((a.Dez - v.Dez) * 100.0 / v.Dez, 2) + END AS Dez, + + CASE WHEN v.Gesamtsumme = 0 THEN 100 + ELSE ROUND((a.Gesamtsumme - v.Gesamtsumme) * 100.0 / v.Gesamtsumme, 2) + END AS Gesamtsumme + + FROM Jahreswerte a + INNER JOIN Jahreswerte v + ON a.i_konto = v.i_konto + AND a.Jahr = @Jahr + AND v.Jahr = @Vorjahr + + ORDER BY + Konto, Zeile desc" + + Case "btn_Laender" + + Bezeichnung = "Länderstatistik " & txtJahr_FIBU.Text + SQLString = "declare @Jahr as Integer = " & txtJahr_FIBU.Text & " + declare @VJ_Jahr as Integer = @Jahr - 1 + declare @c_landid as NVARCHAR(50) = '" & txtLand.Text & "'; + WITH Base AS + ( + SELECT k.c_landid, o.eur_bruttobetrag, YEAR(o.d_rechnung) AS jahr, MONTH(o.d_rechnung) AS monat + FROM [FIBU2].dbo.op_debitor o INNER JOIN [FIBU2].dbo.fibu_konto k ON o.i_personenkonto = k.i_konto + + WHERE o.i_firm_refid = 19 AND k.i_firm_refid = 19 AND ISNULL(o.eur_bruttobetrag,0) <> 0 " & IIf(txtLand.Text <> "", "AND k.c_landid = @c_landid", "") & " AND YEAR(o.d_rechnung) IN (@Jahr, @VJ_Jahr)), + + Agg AS + ( + SELECT c_landid,jahr,monat,SUM(eur_bruttobetrag) AS betrag + FROM Base + GROUP BY c_landid, jahr, monat), + + PivotMonate AS + ( SELECT * FROM Agg PIVOT + ( + SUM(betrag) + FOR monat IN ( + [1],[2],[3],[4],[5],[6], + [7],[8],[9],[10],[11],[12] + ) + ) p + ), + + Final AS + ( + SELECT + c_landid, + -- aktuelles Jahr + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([1],0) ELSE 0 END) AS akt_Jan, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([2],0) ELSE 0 END) AS akt_Feb, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([3],0) ELSE 0 END) AS akt_Mär, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([4],0) ELSE 0 END) AS akt_Apr, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([5],0) ELSE 0 END) AS akt_Mai, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([6],0) ELSE 0 END) AS akt_Jun, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([7],0) ELSE 0 END) AS akt_Jul, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([8],0) ELSE 0 END) AS akt_Aug, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([9],0) ELSE 0 END) AS akt_Sep, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([10],0) ELSE 0 END) AS akt_Okt, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([11],0) ELSE 0 END) AS akt_Nov, + SUM(CASE WHEN jahr = @Jahr THEN ISNULL([12],0) ELSE 0 END) AS akt_Dez, + -- Vorjahr + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([1],0) ELSE 0 END) AS vj_Jan, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([2],0) ELSE 0 END) AS vj_Feb, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([3],0) ELSE 0 END) AS vj_Mär, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([4],0) ELSE 0 END) AS vj_Apr, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([5],0) ELSE 0 END) AS vj_Mai, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([6],0) ELSE 0 END) AS vj_Jun, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([7],0) ELSE 0 END) AS vj_Jul, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([8],0) ELSE 0 END) AS vj_Aug, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([9],0) ELSE 0 END) AS vj_Sep, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([10],0) ELSE 0 END) AS vj_Okt, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([11],0) ELSE 0 END) AS vj_Nov, + SUM(CASE WHEN jahr = @VJ_Jahr THEN ISNULL([12],0) ELSE 0 END) AS vj_Dez + + FROM PivotMonate + GROUP BY c_landid + ) + + -- ===================================== + -- AKTUELLES JAHR + -- ===================================== + SELECT + c_landid,CAST(@Jahr AS VARCHAR(10)) AS Kennzahl,akt_Jan AS Jan,akt_Feb AS Feb,akt_Mär AS Mär,akt_Apr AS Apr,akt_Mai AS Mai,akt_Jun AS Jun, akt_Jul AS Jul,akt_Aug AS Aug,akt_Sep AS Sep,akt_Okt AS Okt,akt_Nov AS Nov,akt_Dez AS Dez,akt_Jan + akt_Feb + akt_Mär + akt_Apr + akt_Mai + akt_Jun + akt_Jul + akt_Aug + akt_Sep + akt_Okt + akt_Nov + akt_Dez AS Gesamt + + FROM Final + + UNION ALL + + SELECT c_landid,CAST(@VJ_Jahr AS VARCHAR(10)), vj_Jan,vj_Feb,vj_Mär,vj_Apr,vj_Mai,vj_Jun,vj_Jul,vj_Aug,vj_Sep,vj_Okt,vj_Nov,vj_Dez,vj_Jan + vj_Feb + vj_Mär + vj_Apr +vj_Mai + vj_Jun + vj_Jul + vj_Aug +vj_Sep + vj_Okt + vj_Nov + vj_Dez + FROM Final + + UNION ALL + + SELECT + c_landid, + '% Veränderung', + + CASE WHEN vj_Jan = 0 THEN 100 ELSE akt_Jan * 100.0 / vj_Jan END, + CASE WHEN vj_Feb = 0 THEN 100 ELSE akt_Feb * 100.0 / vj_Feb END, + CASE WHEN vj_Mär = 0 THEN 100 ELSE akt_Mär * 100.0 / vj_Mär END, + CASE WHEN vj_Apr = 0 THEN 100 ELSE akt_Apr * 100.0 / vj_Apr END, + CASE WHEN vj_Mai = 0 THEN 100 ELSE akt_Mai * 100.0 / vj_Mai END, + CASE WHEN vj_Jun = 0 THEN 100 ELSE akt_Jun * 100.0 / vj_Jun END, + CASE WHEN vj_Jul = 0 THEN 100 ELSE akt_Jul * 100.0 / vj_Jul END, + CASE WHEN vj_Aug = 0 THEN 100 ELSE akt_Aug * 100.0 / vj_Aug END, + CASE WHEN vj_Sep = 0 THEN 100 ELSE akt_Sep * 100.0 / vj_Sep END, + CASE WHEN vj_Okt = 0 THEN 100 ELSE akt_Okt * 100.0 / vj_Okt END, + CASE WHEN vj_Nov = 0 THEN 100 ELSE akt_Nov * 100.0 / vj_Nov END, + CASE WHEN vj_Dez = 0 THEN 100 ELSE akt_Dez * 100.0 / vj_Dez END, + + CASE + WHEN ( + vj_Jan + vj_Feb + vj_Mär + vj_Apr + + vj_Mai + vj_Jun + vj_Jul + vj_Aug + + vj_Sep + vj_Okt + vj_Nov + vj_Dez + ) = 0 + THEN 100 + ELSE + ( + (akt_Jan + akt_Feb + akt_Mär + akt_Apr + + akt_Mai + akt_Jun + akt_Jul + akt_Aug + + akt_Sep + akt_Okt + akt_Nov + akt_Dez) + + * 100.0 / + + (vj_Jan + vj_Feb + vj_Mär + vj_Apr + + vj_Mai + vj_Jun + vj_Jul + vj_Aug + + vj_Sep + vj_Okt + vj_Nov + vj_Dez) + ) + END + + FROM Final ORDER BY c_landid, Kennzahl desc;" + + + + Case "btn_ZV" + Bezeichnung = "Zahlungsverhalten " & txtJahr_FIBU.Text & " von " & txtKundeNrVon.Text & " - " & txtKundeNrBis.Text & " " & IIf(txtLand.Text <> "", txtLand.Text, "") + SQLString = "declare @Jahr as Integer = " & txtJahr_FIBU.Text & "; WITH BaseData AS ( + SELECT o.i_personenkonto, o.d_rechnung, o.d_netto, o.d_zahlung,ISNULL(o.eur_zahlung, 0) AS eur_zahlung,DATEDIFF(DAY, o.d_rechnung, o.d_netto) AS ZZ_Tage,DATEDIFF(DAY, o.d_rechnung, o.d_zahlung) AS ZOP_Tage, MONTH(o.d_zahlung) AS Monat + FROM [FIBU2].dbo.op_debitor o + INNER JOIN [FIBU2].dbo.fibu_konto k ON o.i_personenkonto = k.i_konto + WHERE o.i_firm_refid = 19 AND k.i_firm_refid = 19 AND ISNULL(o.eur_zahlung, 0) <> 0 " & IIf(txtKundeNrVon.Text <> "" AndAlso IsNumeric(txtKundeNrVon.Text) AndAlso txtKundeNrBis.Text <> "" AndAlso IsNumeric(txtKundeNrBis.Text), " AND o.i_personenkonto BETWEEN " & txtKundeNrVon.Text & " AND " & txtKundeNrBis.Text, "") & " AND Year(o.d_zahlung) = @Jahr " & IIf(txtLand.Text <> "", " AND ISNULL(k.c_landid, '') = '" & txtLand.Text & "'", "") & "), Agg AS ( + SELECT Monat,i_personenkonto as Konto,COUNT(*) AS Anzahl,SUM(-eur_zahlung) AS Zahlung,SUM(ZZ_Tage) AS ZZ_Tage,SUM(ZOP_Tage) AS ZOP_Tage + FROM BaseData + GROUP BY Monat, i_personenkonto + ) SELECT Kennzahl,i_personenkonto as Konto,[1] AS Jan,[2] AS Feb,[3] AS Mär,[4] AS Apr,[5] AS Mai,[6] AS Jun,[7] AS Jul,[8] AS Aug,[9] AS Sep,[10] AS Okt,[11] AS Nov,[12] AS Dez, + Isnull([1],0) + isnull([2],0) + isnull([3],0) + isnull([4],0) + isnull([5],0) + isnull([6],0) + isnull([7],0) + isnull([8],0) + isnull([9],0) + isnull([10],0) + isnull([11],0) + isnull([12],0) AS Gesamtsumme + + FROM ( + + SELECT Monat, 'Zahlung' AS Kennzahl,i_personenkonto, SUM(-eur_zahlung) AS Wert + FROM BaseData GROUP BY Monat,i_personenkonto + + UNION ALL + + SELECT Monat, 'Anzahl',i_personenkonto, COUNT(*) + FROM BaseData GROUP BY Monat,i_personenkonto + + UNION ALL + SELECT Monat, 'Zahlungsziel',i_personenkonto, SUM(ZZ_Tage) / COUNT(*) + FROM BaseData GROUP BY Monat,i_personenkonto + + UNION ALL + + SELECT Monat, 'Zahlung nach Tagen',i_personenkonto, SUM(ZOP_Tage) / COUNT(*) + FROM BaseData GROUP BY Monat,i_personenkonto + + UNION ALL + + SELECT Monat, 'Zahlungsverspätung',i_personenkonto, (SUM(ZOP_Tage) / COUNT(*)) - (SUM(ZZ_Tage) / COUNT(*)) + FROM BaseData GROUP BY Monat,i_personenkonto + + ) x + PIVOT ( + SUM(Wert) FOR Monat IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]) + ) p order by p.i_personenkonto, p.Kennzahl;" + + + + End Select + + + If SQLString <> "" Then + Me.Cursor = Cursors.WaitCursor + Dim dt_RE As DataTable = SQL.loadDgvBySql(SQLString, "FIBU") + + Dim rangeAsBuchhaltung() As String + Dim lastRow = dt_RE.Rows.Count + 1 + + + Select Case sender.Name + Case "btn_Erloeskkonten" + rangeAsBuchhaltung = {"D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"} _ + .Select(Function(c) $"{c}2:{c}{lastRow}") _ + .ToArray() + Case "btn_Laender" + rangeAsBuchhaltung = {"C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O"} _ + .Select(Function(c) $"{c}2:{c}{lastRow}") _ + .ToArray() + Case "btn_ZV" + rangeAsBuchhaltung = {"C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O"} _ + .Select(Function(c) $"{c}2:{c}{lastRow}") _ + .ToArray() + End Select + + + + + If dt_RE.Rows.Count > 0 Then + cProgramFunctions.genExcelFromDT_NEW(dt_RE,,, Bezeichnung,,, True,,,,,, rangeAsBuchhaltung) + Me.Cursor = Cursors.Default + Else + MsgBox("keine Daten für den ausgewählten Zeitraum!") + Me.Cursor = Cursors.Default + End If + End If + + + End If + + + End Sub + + Private Sub Button16_Click_1(sender As Object, e As EventArgs) Handles Button16.Click + + Dim firmenlist As New List(Of MyListItem) + firmenlist.Add(New MyListItem("VERAG AG", 1)) + firmenlist.Add(New MyListItem("VERAG CS", 11)) + firmenlist.Add(New MyListItem("ATILLA", 7)) + + Dim dtList As New List(Of DataTable) + + For Each i In firmenlist + Dim sql As New SQL + Dim sqlstrKunden = " select * from ( SELECT [KundenNr] as KundenNr,[Name 1], Adressen.LandKz, (isnull(Adressen.UstIdKz,'') + isnull(Adressen.UstIdNr,'')) as UIDNrKunden, isnull(c_ustidnr,'') as UIDNrKundenDeb, [i_firm_refid] as MandantFIBU, FiBuSchnittstelleNr as MandantAVISO FROM [VERAG].[dbo].[Kunden] + inner join Adressen on Adressen.AdressenNr = Kunden.KundenNr + inner join Buchhaltung.[FIBU2].[dbo].[fibu_konto] on Kunden.KundenNrZentrale = i_konto + where isnull(KundenNrZentrale,0) <> 0 and Auswahl = 'A' And isnull(FiBuSchnittstelleNr,0) = " & i.Value & " ANd [i_firm_refid] = " & i.Value & " ) as temp where UIDNrKunden <> UIDNrKundenDeb" + + + Dim dtKunden As DataTable = sql.loadDgvBySql(sqlstrKunden, "FMZOLL") + If dtKunden.Rows.Count > 0 Then + dtKunden.TableName = i.Text + dtList.Add(dtKunden) + End If + + Next + + If dtList.Count > 0 Then + cProgramFunctions.genExcelFromMultibleDT_NEW(dtList,,,,,,,,,,,, True) + End If + + + End Sub End Class diff --git a/SDL/cProgramFunctions.vb b/SDL/cProgramFunctions.vb index aaae9947..cf69d2da 100644 --- a/SDL/cProgramFunctions.vb +++ b/SDL/cProgramFunctions.vb @@ -1277,7 +1277,7 @@ Public Class cProgramFunctions End Try End Function - Public Shared Function genExcelFromMultibleDT_NEW(datatables As IEnumerable(Of DataTable), Optional rangeAsWaehrung() As String = Nothing, Optional ShowAutoFilter As Boolean = True, Optional HeaderTxt As String = "", Optional HeaderTxt2 As String = "", Optional waehrungsZeichen As String = "€", Optional fitCellsToContent As Boolean = False, Optional mergeHeadersToCell As Char = "", Optional Landscape As Boolean = False, Optional fitToOnePage As Boolean = False, Optional openFile As Boolean = True, Optional fitWideToOnePage As Boolean = False) As String + Public Shared Function genExcelFromMultibleDT_NEW(datatables As IEnumerable(Of DataTable), Optional rangeAsWaehrung() As String = Nothing, Optional ShowAutoFilter As Boolean = True, Optional HeaderTxt As String = "", Optional HeaderTxt2 As String = "", Optional waehrungsZeichen As String = "€", Optional fitCellsToContent As Boolean = False, Optional mergeHeadersToCell As Char = "", Optional Landscape As Boolean = False, Optional fitToOnePage As Boolean = False, Optional openFile As Boolean = True, Optional fitWideToOnePage As Boolean = False, Optional useTableName As Boolean = False) As String Try Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\SDL\tmp\" ' My.Computer.FileSystem.GetTempFileName @@ -1288,7 +1288,7 @@ Public Class cProgramFunctions Dim wb As New XLWorkbook Dim counter = 0 For Each dt In datatables - wb.Worksheets.Add(dt, "DATEN" & IIf(counter > 0, "_" & counter, "")) + wb.Worksheets.Add(dt, IIf(useTableName, dt.TableName, "DATEN" & IIf(counter > 0, "_" & counter, ""))) wb.Worksheets(counter).Tables.FirstOrDefault().ShowAutoFilter = ShowAutoFilter diff --git a/SDL/kassenbuch/frmBelegNeu.vb b/SDL/kassenbuch/frmBelegNeu.vb index 8ca83b40..d4013fb7 100644 --- a/SDL/kassenbuch/frmBelegNeu.vb +++ b/SDL/kassenbuch/frmBelegNeu.vb @@ -1,7 +1,5 @@ Imports System.Drawing.Printing Imports System.Globalization -Imports java.awt.geom -Imports javax.print.attribute.standard Imports Microsoft.Win32 Imports SDL.RKSVServer Imports VERAG_PROG_ALLGEMEIN @@ -909,7 +907,7 @@ Public Class frmBelegNeu BELEG.FilialenNr = IIf(IsNumeric(cboFiliale._value), cboFiliale._value, -1) BELEG.AbfertigungsNr = IIf(IsNumeric(txtAbfertigungsNr.Text), txtAbfertigungsNr.Text, -1) Case Else - If Not PERSONAL.isLeihgeldkasse Then 'Wird berits anders geregelt + If Not PERSONAL.isLeihgeldkasse Then 'Wird bereits anders geregelt BELEG.LKW_Beleg = (Not cbxSplittung.Checked And AvisoID IsNot Nothing) If Not BELEG.LKW_Beleg Then diff --git a/SDL/kunden/frmKundenUebersichtZOLL.vb b/SDL/kunden/frmKundenUebersichtZOLL.vb index 96b85cd1..525df4e6 100644 --- a/SDL/kunden/frmKundenUebersichtZOLL.vb +++ b/SDL/kunden/frmKundenUebersichtZOLL.vb @@ -212,13 +212,10 @@ Public Class frmKundenUebersichtZOLL If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("KUNDEN_Fiskaldaten", Me) Then mnueFiskal.Visible = True mnueFiskaluebersicht.Visible = True - mnueFiskaluebersicht.Visible = True End If If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("CBAM", Me) Then mnueCBAM.Visible = True - mnueCBAM.Visible = True - mnueCBAM.Visible = True End If diff --git a/SDL/kunden/usrCntlOfferte.vb b/SDL/kunden/usrCntlOfferte.vb index 3946b3ef..eb57f5f4 100644 --- a/SDL/kunden/usrCntlOfferte.vb +++ b/SDL/kunden/usrCntlOfferte.vb @@ -731,7 +731,7 @@ Public Class usrCntlOfferte dgvOfferteNew.Enabled = False currentOffert = New VERAG_PROG_ALLGEMEIN.cOfferte(kdNr, dgvOfferteNew.SelectedRows(0).Cells("OffertenNr").Value, False) - Dim orgDataTable As DataTable = dgvOfferteDetails.DataSource + Dim orgDataTable As System.Data.DataTable = dgvOfferteDetails.DataSource tmpDataTable = orgDataTable.Copy Catch ex As Exception diff --git a/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb b/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb index c298e0d4..14d6a13f 100644 --- a/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb +++ b/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb @@ -2782,9 +2782,9 @@ Partial Class usrcntlKundeBearbeitenFull Me.Label56.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label56.Location = New System.Drawing.Point(4, 230) Me.Label56.Name = "Label56" - Me.Label56.Size = New System.Drawing.Size(87, 13) + Me.Label56.Size = New System.Drawing.Size(80, 13) Me.Label56.TabIndex = 28 - Me.Label56.Text = "Keditlimit in Euro:" + Me.Label56.Text = "Kreditlimit EUR:" ' 'Label54 ' diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index 92484eeb..69a843f6 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -1,6 +1,5 @@ Imports System.Data.OleDb Imports System.IO -Imports System.Runtime.InteropServices Imports itextsharp.text.pdf Imports MDM_Worker Imports VERAG_PROG_ALLGEMEIN @@ -94,7 +93,7 @@ Public Class frmMDMDatenverarbetiung btnDatenLaden.Text = "Daten laden" Case "IDS" : checkImport(LIEFERANT) : initDgv_IDS() btnDatenLaden.Text = "Daten laden" - Button1.Enabled = False + 'Button1.Enabled = False Case "MSE" : checkImport(LIEFERANT) : initDgv_MSE() btnDatenLaden.Text = "Daten laden" End Select @@ -2013,16 +2012,16 @@ Public Class frmMDMDatenverarbetiung Dim displayFilter = False Dim sqlstr As String = "" - sqlstr &= " SELECT 'PLOSE',AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plp_Land,isnull([tblPLOSE_Produktbeschreibung].plp_Description_EN,plose_Produktbeschreibung) as plose_Produktbeschreibung ,isnull(plose_NummerKarteGeraet,plose_Kontonummer) as plose_NummerKarteGeraet ,plose_BeschreibungEinfahrt,case when plose_BeschreibungAusfahrt is null and plose_BeschreibungMautTankstelle = 'Bregana' then 'Bregana' else isnull(plose_BeschreibungAusfahrt,'') end as plose_BeschreibungAusfahrt,plose_NettobetragWaehrungAbbuchung,(plose_BruttobetragWaehrungAbbuchung-plose_NettobetragWaehrungAbbuchung) as Steuer,plose_BruttobetragWaehrungAbbuchung " + sqlstr &= " SELECT 'PLOSE' as ,AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plp_Land,isnull([tblPLOSE_Produktbeschreibung].plp_Description_EN,plose_Produktbeschreibung) as plose_Produktbeschreibung ,isnull(plose_NummerKarteGeraet,plose_Kontonummer) as plose_NummerKarteGeraet ,plose_BeschreibungEinfahrt,case when plose_BeschreibungAusfahrt is null and plose_BeschreibungMautTankstelle = 'Bregana' then 'Bregana' else isnull(plose_BeschreibungAusfahrt,'') end as plose_BeschreibungAusfahrt,plose_NettobetragWaehrungAbbuchung,(plose_BruttobetragWaehrungAbbuchung-plose_NettobetragWaehrungAbbuchung) as Steuer,plose_BruttobetragWaehrungAbbuchung " sqlstr &= " FROM tblPLOSE_Details INNER JOIN [tblPLOSE_Produktbeschreibung] on plose_ProduktCode=plp_ProductCode INNER JOIN Adressen on plose_POLSEKundennummer=PLOSEKundenNr and plp_LeistungsNr is not null " sqlstr &= " WHERE 1=1 " sqlstr &= " AND plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') " + 'sqlstr &= " AND cast(plose_FakturiertDatum as date) = '06.05.2026' AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') " + sqlstr &= " AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' " sqlstr &= " order by plp_Land, plose_DatumTransaktion" - ' sqlstr &= " group by plose_ProduktCode" - ' MsgBox(sqlstr) Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL") Dim sqlstrAT As String = "" @@ -2030,13 +2029,13 @@ Public Class frmMDMDatenverarbetiung sqlstrAT &= " FROM tblPLOSE_Details INNER JOIN [tblPLOSE_Produktbeschreibung] on plose_ProduktCode=plp_ProductCode INNER JOIN Adressen on plose_POLSEKundennummer=PLOSEKundenNr and plp_LeistungsNr is not null " sqlstrAT &= " WHERE 1=1 " sqlstrAT &= " AND plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land IN ('AT','DE') " + + 'sqlstr &= " AND cast(plose_FakturiertDatum as date) = '06.05.2026' AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & " ) AND plp_Land NOT IN ('AT','DE') " + sqlstrAT &= " AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' " sqlstrAT &= " group by plp_Land, AdressenNr, plose_Kennzeichen,plose_DatumTransaktion,plose_NummerKarteGeraet" sqlstrAT &= " order by plp_Land" - - ' sqlstr &= " group by plose_ProduktCode" - ' MsgBox(sqlstr) Dim dtAT As DataTable = SQL.loadDgvBySql_Param(sqlstrAT, "FMZOLL") @@ -2051,21 +2050,6 @@ Public Class frmMDMDatenverarbetiung End If End If - 'Dim connectionString = "" - 'If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD_Test.accd" - 'Else - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD.accdb" - 'End If - - 'Dim con As New OleDbConnection(connectionString) - - Dim cmd As New OleDbCommand - Dim var1 As String - - Dim adapter As OleDbDataAdapter = New OleDbDataAdapter() - Dim reader As OleDbDataReader = Nothing - If dt IsNot Nothing Then @@ -2076,34 +2060,11 @@ Public Class frmMDMDatenverarbetiung SQL.doSQL("INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Net Amount],[VAT Amount],[Total Amount], [BillingDate]) VALUES ('" & r(0) & "'," & r(1) & ",'" & r(2) & "','" & r(3) & "','" & r(4) & "','" & r(5).ToString.Replace("'", " ") & "','" & r(6) & "','" & r(7).ToString.Replace("'", " ") & "','" & r(8).ToString.Replace("'", " ") & "'," & CDbl(r(9)).ToString.Replace(",", ".") & "," & CDbl(r(10)).ToString.Replace(",", ".") & "," & CDbl(r(11)).ToString.Replace(",", ".") & ",'" & datPloseAnhang.Text & "')", "FMZOLL") - 'Zeitstempel - 'Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12) " - '' "SELECT * FROM DBParent WHERE P_ID = " & UniqeID & ";" - 'Using Command As New OleDbCommand(SQLQuery, con) - - ' Command.Parameters.AddWithValue("@P1", r(0)) - ' Command.Parameters.AddWithValue("@P2", r(1)) - ' Command.Parameters.AddWithValue("@P3", r(2)) - ' Command.Parameters.AddWithValue("@P4", r(3)) - ' Command.Parameters.AddWithValue("@P5", r(4)) - ' Command.Parameters.AddWithValue("@P6", r(5)) - ' Command.Parameters.AddWithValue("@P7", r(6)) - ' Command.Parameters.AddWithValue("@P8", r(7)) - ' Command.Parameters.AddWithValue("@P9", r(8)) - ' Command.Parameters.AddWithValue("@P10", CDbl(r(9))) - ' Command.Parameters.AddWithValue("@P11", CDbl(r(10))) - ' Command.Parameters.AddWithValue("@P12", CDbl(r(11))) - - ' If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Command.ExecuteNonQuery() - ' Command.Dispose() - 'End Using - - Catch ex2 As System.Exception MsgBox("err: " & ex2.Message & ex2.StackTrace) Finally - If reader IsNot Nothing Then reader.Close() + End Try @@ -2121,6 +2082,109 @@ Public Class frmMDMDatenverarbetiung End Function + Function genPLOSEInsertMautD_NEW(von As Date, bis As Date) As Boolean + Try + + VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False + + pic.Visible = False + + Dim SQL_String_OHNE_DE_AT = "SELECT + 'PLOSE' AS Datenquelle, + AdressenNr AS [Customer No], + plose_Kennzeichen AS [Licence Plate Number], + plp_Land AS [Transaction Country], + cast(plose_DatumTransaktion as Date) AS [Transaction Date], + ISNULL(tblPLOSE_Produktbeschreibung.plp_Description_EN, plose_Produktbeschreibung) AS [Product description], + ISNULL(plose_NummerKarteGeraet, plose_Kontonummer) AS [Card number], + ISNULL(plose_BeschreibungEinfahrt, '') AS [Entry Terminal], + CASE + WHEN plose_BeschreibungAusfahrt IS NULL + AND plose_BeschreibungMautTankstelle = 'Bregana' + THEN 'Bregana' + ELSE ISNULL(plose_BeschreibungAusfahrt, '') + END AS [Exit Terminal], + plose_NettobetragWaehrungAbbuchung AS [Net Amount], + (plose_BruttobetragWaehrungAbbuchung - plose_NettobetragWaehrungAbbuchung) AS [VAT Amount], + plose_BruttobetragWaehrungAbbuchung AS [Total Amount] + + FROM tblPLOSE_Details INNER JOIN tblPLOSE_Produktbeschreibung ON plose_ProduktCode = plp_ProductCode + INNER JOIN Adressen ON plose_POLSEKundennummer = PLOSEKundenNr AND plp_LeistungsNr IS NOT NULL + WHERE + plose_Fakturiert=0 AND plose_ProduktCode NOT IN (" & ProduktCode_NOT_IN & ") AND plp_Land NOT IN ('AT','DE') AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' " + + + Dim SQL_String_MIT_DE_AT = " SELECT 'PLOSE' AS Datenquelle, + AdressenNr AS [Customer No], + plose_Kennzeichen AS [Licence Plate Number], + plp_Land AS [Transaction Country], + cast(plose_DatumTransaktion as Date) AS [Transaction Date], + '' AS [Product description], + plose_NummerKarteGeraet AS [Card number], + '' AS [Entry Terminal], + '' AS [Exit Terminal], + SUM(plose_NettobetragWaehrungAbbuchung) AS [Net Amount], + SUM(plose_BruttobetragWaehrungAbbuchung - plose_NettobetragWaehrungAbbuchung) AS [VAT Amount], + SUM(plose_BruttobetragWaehrungAbbuchung) AS [Total Amount] + + FROM tblPLOSE_Details + INNER JOIN tblPLOSE_Produktbeschreibung ON plose_ProduktCode = plp_ProductCode + INNER JOIN Adressen ON plose_POLSEKundennummer = PLOSEKundenNr AND plp_LeistungsNr IS NOT NULL + WHERE + plose_Fakturiert=0 AND plose_ProduktCode NOT IN ( " & ProduktCode_NOT_IN & ") AND plp_Land IN ('AT','DE') AND plose_DatumTransaktion between '" & von.ToShortDateString & "' and '" & bis.ToShortDateString & "' + GROUP BY plp_Land,AdressenNr,plose_Kennzeichen,plose_DatumTransaktion,plose_NummerKarteGeraet" + + + + Dim sqlstr As String = "SELECT *, cast( '" & datPloseAnhang.Text & "' as date) as Billingdate FROM ( " & SQL_String_OHNE_DE_AT & " UNION ALL " & SQL_String_MIT_DE_AT & " ) AS TEMP ORDER BY TEMP.[Licence Plate Number];" + Dim updated As Boolean = False + Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL") + + If dt.Rows.Count > 0 Then + + + Dim InsertSatement As String = " INSERT INTO tblMautbericht + ( + Datenquelle, + [Customer No], + [Licence Plate Number], + [Transaction Country], + [Transaction Date], + [Product description], + [Card Number], + [Entry Terminal], + [Exit Terminal], + [Net Amount], + [VAT Amount], + [Total Amount], + [Billingdate] + )" + + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + + updated = SQL.doSQL(InsertSatement & sqlstr, "FMZOLL",,,, 500) + + + End If + End If + + + pic.Visible = updated + + Return updated + + Catch ex As Exception + + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, Reflection.MethodInfo.GetCurrentMethod.Name) + + End Try + + Return False + + End Function + + + Function genASFINAGInsertMautAT(kdNr) As Boolean Try pic.Visible = False @@ -2134,112 +2198,60 @@ Public Class frmMDMDatenverarbetiung sqlstr = " select - 'AT' - ,Adressen.AdressenNr - ,licenceplate - ,turnoverdate - ,'AT' - ,contractPartner as ProductCode - ,[cardnumber] as CardNumber - ,[netAmount] as Netamount - ,[VATamount] as VATAmount - ,[totalAmount] as totalAmount + 'AT' as Datenquelle + ,Adressen.AdressenNr as [Customer No] + ,licenceplate as [Licence Plate Number] + ,'AT' as [Transaction Country] + ,turnoverdate as [Transaction Date] + ,contractPartner as [Product description] + ,[cardnumber] as [Card Number] + ,'' as [Entry Terminal] + ,'' as [Exit Terminal] + ,[netAmount] as [Net Amount] + ,[VATamount] as [VAT Amount] + ,[totalAmount] as [Total Amount] FROM [VERAG].[dbo].[tblAsfinagMaut] INNER JOIN [VERAG].[dbo].Kreditkarten ON cardnumber = Kreditkarten.KartenNr INNER JOIN [VERAG].[dbo].Adressen ON Adressen.AdressenNr = Kreditkarten.AdressenNr - WHERE 1 = 1 " & sqlWhere & " - order by Adressen.AdressenNr" + WHERE 1 = 1 " & sqlWhere Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL") - Dim sqlstrAT As String = "" - - sqlstrAT &= "select 'AT' - ,Adressen.AdressenNr - ,licenceplate - ,turnoverdate - ,'AT' as land - ,'' as ProductCode - ,[cardnumber] as CardNumber - ,sum([netAmount]) as Netamount - ,sum([VATamount]) as VATAmount - ,sum([totalAmount]) as totalAmount - FROM [VERAG].[dbo].[tblAsfinagMaut] - INNER JOIN [VERAG].[dbo].Kreditkarten ON cardnumber = Kreditkarten.KartenNr - INNER JOIN [VERAG].[dbo].Adressen ON Adressen.AdressenNr = Kreditkarten.AdressenNr - WHERE 1 = 1 " & sqlWhere & " - group by Adressen.AdressenNr, licenceplate,turnoverdate,CardNumber - order by Adressen.AdressenNr" - - Dim dtAT As DataTable = SQL.loadDgvBySql_Param(sqlstrAT, "FMZOLL") - 'AT ---> Gruppiert - 'If dtAT IsNot Nothing AndAlso dtAT.Rows.Count > 0 Then - ' If dt Is Nothing OrElse dt.Rows.Count = 0 Then - ' dt = dtAT - ' Else - ' For Each r In dtAT.Rows - ' dt.Rows.Add({r(0), r(1), r(2), r(3), r(4), r(5), r(6), r(7), r(8), r(9)}) - ' Next - ' End If - 'End If - - 'Dim connectionString = "" - 'If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD_Test.accdb" - 'Else - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD.accdb" - 'End If - - 'Dim con As New OleDbConnection(connectionString) - 'Dim cmd As New OleDbCommand - 'Dim var1 As String - - 'Dim adapter As OleDbDataAdapter = New OleDbDataAdapter() - 'Dim reader As OleDbDataReader = Nothing + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then - If dt IsNot Nothing Then - - For Each r In dt.Rows - Try - 'Zeitstempel - - SQL.doSQL("INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Net Amount],[VAT Amount],[Total Amount], [BillingDate]) VALUES ('" & - r(0) & "'," & r(1) & ",'" & r(2) & "','" & r(3) & "','" & r(4) & "','" & r(5).ToString.Replace("'", " ") & "','" & r(6) & "'," & CDbl(r(7)).ToString.Replace(",", ".") & "," & CDbl(r(8)).ToString.Replace(",", ".") & "," & CDbl(r(9)).ToString.Replace(",", ".") & ",'" & datPloseAnhang.Text & "')", "FMZOLL") + Dim sqlstrBULKIMPORT As String = "SELECT *, cast( '" & datPloseAnhang.Text & "' as date) as Billingdate FROM ( " & sqlstr & " ) AS TEMP ORDER BY TEMP.[Customer No];" + Dim updated As Boolean = False - 'Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10) " - '' "SELECT * FROM DBParent WHERE P_ID = " & UniqeID & ";" - 'Using Command As New OleDbCommand(SQLQuery, con) + Dim InsertSatement As String = " INSERT INTO tblMautbericht + ( + Datenquelle, + [Customer No], + [Licence Plate Number], + [Transaction Country], + [Transaction Date], + [Product description], + [Card Number], + [Entry Terminal], + [Exit Terminal], + [Net Amount], + [VAT Amount], + [Total Amount], + [Billingdate] + )" - ' Command.Parameters.AddWithValue("@P1", r(0)) - ' Command.Parameters.AddWithValue("@P2", r(1)) - ' Command.Parameters.AddWithValue("@P3", r(2)) - ' Command.Parameters.AddWithValue("@P4", r(3)) - ' Command.Parameters.AddWithValue("@P5", r(4)) - ' Command.Parameters.AddWithValue("@P6", r(5)) - ' Command.Parameters.AddWithValue("@P7", r(6)) - ' Command.Parameters.AddWithValue("@P8", CDbl(r(7))) - ' Command.Parameters.AddWithValue("@P9", CDbl(r(8))) - ' Command.Parameters.AddWithValue("@P10", CDbl(r(9))) + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then - ' If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Command.ExecuteNonQuery() - ' Command.Dispose() - 'End Using + updated = SQL.doSQL(InsertSatement & sqlstrBULKIMPORT, "FMZOLL",,,, 500) - Catch ex2 As System.Exception - ' MsgBox("err: " & ex2.Message & ex2.StackTrace) - - 'Finally - ' If reader IsNot Nothing Then reader.Close() - End Try + End If - Next End If pic.Visible = True @@ -2265,91 +2277,59 @@ Public Class frmMDMDatenverarbetiung End If - sqlstr = "SELECT 'UTA',qryUTA_Fakturierungspositionen.KundenNr AS [Customer No], - isnull([KFZ_Kennzeichen_komprimiert],isnull([KFZ_Kennzeichen],isnull([Prägetext_i_d_R_KFZ_Kennzeichen],''))) AS LicencePlateNumber, + sqlstr = "SELECT 'UTA' as Datenquelle, + qryUTA_Fakturierungspositionen.KundenNr AS [Customer No], + isnull([KFZ_Kennzeichen_komprimiert],isnull([KFZ_Kennzeichen],isnull([Prägetext_i_d_R_KFZ_Kennzeichen],''))) AS [Licence Plate Number], cast([Belegdatum] as datetime) AS [Transaction Date], qryUTA_Fakturierungspositionen.Lieferland AS [Transaction Country], qryUTA_Fakturierungspositionen.Warenart AS [Product description], - qryUTA_Fakturierungspositionen.Kartennummer AS [Card number], + qryUTA_Fakturierungspositionen.Kartennummer AS [Card Number], qryUTA_Fakturierungspositionen.Autobahnauffahrt AS [Entry Terminal], qryUTA_Fakturierungspositionen.Autobahnausfahrt AS [Exit Terminal], - qryUTA_Fakturierungspositionen.Gesamtbetrag_Netto_in_Darstellwährung AS [Nett Amount], + qryUTA_Fakturierungspositionen.Gesamtbetrag_Netto_in_Darstellwährung AS [Net Amount], qryUTA_Fakturierungspositionen.Gesamtbetrag_Umsatzsteuer_in_Darstellwährung AS [VAT Amount], qryUTA_Fakturierungspositionen.Gesamtbetrag_Brutto_in_Darstellwährung AS [Total Amount] FROM (SELECT Adressen.AdressenNr, Adressen.[Name 1], Adressen.LandKz, Adressen.Ort, Adressen.UTAExportCSV, Adressen.Rechnungsdruck, Offertenpositionen.KundenNr, Offertenpositionen.OffertenNr, Offertenpositionen.LeistungsNr, Offertenpositionen.LeistungsBez, tblUTAFakturierwarenarten.Warenart, tblUTAImportNew.* FROM tblUTAFakturierwarenarten INNER JOIN (((Adressen INNER JOIN tblUTAImportNew ON Adressen.UTAKundenNr = tblUTAImportNew.Kundennummer) INNER JOIN Offertenpositionen ON Adressen.AdressenNr = Offertenpositionen.KundenNr) INNER JOIN tblUTALeistungen ON (tblUTALeistungen.VERAG_LeistungsNr = Offertenpositionen.LeistungsNr) AND (tblUTALeistungen.VERAG_OffertenNr = Offertenpositionen.OffertenNr) AND (tblUTAImportNew.Lieferland = tblUTALeistungen.Lieferland) AND (tblUTAImportNew.Fakturierwarenart = tblUTALeistungen.Fakturierwarenart)) ON tblUTAFakturierwarenarten.Fakturierwarenart = tblUTALeistungen.Fakturierwarenart - WHERE cast(Rechnungsdatum as Date) = '" & DateTimePicker2.Text & "' and chargedDatetime is not null " & sqlWhere & " + WHERE cast(Rechnungsdatum as Date) = '" & datPloseAnhang.Text & "' and chargedDatetime is not null " & sqlWhere & " ) as qryUTA_Fakturierungspositionen - WHERE (((qryUTA_Fakturierungspositionen.Gesamtbetrag_Brutto_in_Darstellwährung)<>0)) - order by KundenNr, LicencePlateNumber, Belegdatum" + WHERE (((qryUTA_Fakturierungspositionen.Gesamtbetrag_Brutto_in_Darstellwährung)<>0))" Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL", 60) + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + + Dim sqlstrBULKIMPORT As String = "SELECT *, cast( '" & datPloseAnhang.Text & "' as date) as Billingdate FROM ( " & sqlstr & " ) AS TEMP ORDER BY TEMP.[Customer No];" + Dim updated As Boolean = False + Dim InsertSatement As String = " INSERT INTO tblMautbericht + ( + Datenquelle, + [Customer No], + [Licence Plate Number], + [Transaction Date], + [Transaction Country], + [Product description], + [Card Number], + [Entry Terminal], + [Exit Terminal], + [Net Amount], + [VAT Amount], + [Total Amount], + [Billingdate] + )" - 'Dim connectionString = "" - 'If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD_Test.accdb" - 'Else - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD.accdb" - 'End If + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then - 'Dim con As New OleDbConnection(connectionString) - 'Dim cmd As New OleDbCommand - 'Dim var1 As String + updated = SQL.doSQL(InsertSatement & sqlstrBULKIMPORT, "FMZOLL",,,, 500) - 'Dim adapter As OleDbDataAdapter = New OleDbDataAdapter() - 'Dim reader As OleDbDataReader = Nothing + End If - - - If dt IsNot Nothing Then - 'con.Open() - For Each r In dt.Rows - Try - 'Zeitstempel - - SQL.doSQL("INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Net Amount],[VAT Amount],[Total Amount], [BillingDate]) VALUES ('" & - r(0) & "'," & r(1) & ",'" & r(2) & "','" & r(3) & "','" & r(4) & "','" & r(5).ToString.Replace("'", " ") & "','" & r(6) & "','" & r(7).ToString.Replace("'", " ") & "','" & r(8).ToString.Replace("'", " ") & "'," & CDbl(r(9)).ToString.Replace(",", ".") & "," & CDbl(r(10)).ToString.Replace(",", ".") & "," & CDbl(r(11)).ToString.Replace(",", ".") & ",'" & datPloseAnhang.Text & "')", "FMZOLL") - - - 'Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12) " - '' "SELECT * FROM DBParent WHERE P_ID = " & UniqeID & ";" - 'Using Command As New OleDbCommand(SQLQuery, con) - - ' Command.Parameters.AddWithValue("@P1", r(0)) - ' Command.Parameters.AddWithValue("@P2", r(1)) - ' Command.Parameters.AddWithValue("@P3", r(2)) - ' Command.Parameters.AddWithValue("@P4", r(3)) - ' Command.Parameters.AddWithValue("@P5", r(4)) - ' Command.Parameters.AddWithValue("@P6", r(5)) - ' Command.Parameters.AddWithValue("@P7", r(6)) - ' Command.Parameters.AddWithValue("@P8", r(7)) - ' Command.Parameters.AddWithValue("@P9", r(8)) - ' Command.Parameters.AddWithValue("@P10", CDbl(r(9))) - ' Command.Parameters.AddWithValue("@P11", CDbl(r(10))) - ' Command.Parameters.AddWithValue("@P12", CDbl(r(11))) - - ' If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Command.ExecuteNonQuery() - - ' Command.Dispose() - 'End Using - - Catch ex2 As System.Exception - MsgBox("err: " & ex2.Message & ex2.StackTrace) - - 'Finally - ' If reader IsNot Nothing Then reader.Close() - End Try - - - Next - 'con.Close() End If pic.Visible = True Return True @@ -2374,14 +2354,16 @@ Public Class frmMDMDatenverarbetiung End If - sqlstr = " Select 'MSE',adressen.AdressenNr As [Customer No], + sqlstr = " Select 'MSE' as Datenquelle, + adressen.AdressenNr As [Customer No], trans.license_plate_number as [Licence Plate Number], cast(trans.[purchase_datetime] as Date) as [Transaction Date], - trans.transaction_country As [Transaction Country],trans.device_product_type As [Product description], + trans.transaction_country As [Transaction Country], + trans.device_product_type As [Product description], trans.device_product_number as [Card Number], trans.entry_point_name as [Entry Terminal], trans.exit_point_name as [Exit Terminal], - case when trans.device_product_type like '%System Fee' then (msts_fee_amount + transaction_gross_amount) - trans.USteuer_EUR else transaction_gross_amount - trans.USteuer_EUR End As [Nett Amount], + case when trans.device_product_type like '%System Fee' then (msts_fee_amount + transaction_gross_amount) - trans.USteuer_EUR else transaction_gross_amount - trans.USteuer_EUR End As [Net Amount], trans.USteuer_EUR As [VAT Amount], case when trans.device_product_type like '%System Fee' then msts_fee_amount + transaction_gross_amount else transaction_gross_amount End as [Total Amount] From [VERAG].[dbo].[tblMSESettlements] as bills @@ -2389,69 +2371,43 @@ Public Class frmMDMDatenverarbetiung left Join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id left Join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] And inv.customer_number = cust.[customer_id] And trans.transaction_country = inv.country Left Join adressen ON cust.[customer_id] = Adressen.MSEKundenNr - where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.chargedDatetime is not null " & sqlWhere & - "order by Adressen.AdressenNr " + where bills.invoice_date = '" & datPloseAnhang.Text & "' and trans.chargedDatetime is not null " & sqlWhere Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL") - 'Dim connectionString = "" - 'If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD_Test.accdb" - 'Else - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD.accdb" - 'End If - - 'Dim con As New OleDbConnection(connectionString) - 'Dim cmd As New OleDbCommand - 'Dim var1 As String - - 'Dim adapter As OleDbDataAdapter = New OleDbDataAdapter() - 'Dim reader As OleDbDataReader = Nothing - If dt IsNot Nothing Then - 'con.Open() - For Each r In dt.Rows - Try - 'Zeitstempel - SQL.doSQL("INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Net Amount],[VAT Amount],[Total Amount], [BillingDate]) VALUES ('" & - r(0) & "'," & r(1) & ",'" & r(2) & "','" & r(3) & "','" & r(4) & "','" & r(5).ToString.Replace("'", " ") & "','" & r(6) & "','" & r(7).ToString.Replace("'", " ") & "','" & r(8).ToString.Replace("'", " ") & "'," & CDbl(r(9)).ToString.Replace(",", ".") & "," & CDbl(r(10)).ToString.Replace(",", ".") & "," & CDbl(r(11)).ToString.Replace(",", ".") & ",'" & datPloseAnhang.Text & "')", "FMZOLL") + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + + Dim sqlstrBULKIMPORT As String = "SELECT *, cast( '" & datPloseAnhang.Text & "' as date) as Billingdate FROM ( " & sqlstr & " ) AS TEMP ORDER BY TEMP.[Customer No];" + Dim updated As Boolean = False + Dim InsertSatement As String = " INSERT INTO tblMautbericht + ( + Datenquelle, + [Customer No], + [Licence Plate Number], + [Transaction Date], + [Transaction Country], + [Product description], + [Card Number], + [Entry Terminal], + [Exit Terminal], + [Net Amount], + [VAT Amount], + [Total Amount], + [Billingdate] + ) " - ' Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12) " - ' ' "SELECT * FROM DBParent WHERE P_ID = " & UniqeID & ";" - ' Using Command As New OleDbCommand(SQLQuery, con) + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then - ' Command.Parameters.AddWithValue("@P1", r(0)) - ' Command.Parameters.AddWithValue("@P2", r(1)) - ' Command.Parameters.AddWithValue("@P3", r(2)) - ' Command.Parameters.AddWithValue("@P4", r(3)) - ' Command.Parameters.AddWithValue("@P5", r(4)) - ' Command.Parameters.AddWithValue("@P6", r(5)) - ' Command.Parameters.AddWithValue("@P7", r(6)) - ' Command.Parameters.AddWithValue("@P8", r(7)) - ' Command.Parameters.AddWithValue("@P9", r(8)) - ' Command.Parameters.AddWithValue("@P10", CDbl(r(9))) - ' Command.Parameters.AddWithValue("@P11", CDbl(r(10))) - ' Command.Parameters.AddWithValue("@P12", CDbl(r(11))) + updated = SQL.doSQL(InsertSatement & sqlstrBULKIMPORT, "FMZOLL",,,, 500) - ' If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Command.ExecuteNonQuery() - ' Command.Dispose() - ' End Using + End If - Catch ex2 As System.Exception - MsgBox("err: " & ex2.Message & ex2.StackTrace) - - 'Finally - ' If reader IsNot Nothing Then reader.Close() - End Try - - - Next - 'con.Close() End If pic.Visible = True Return True @@ -2463,44 +2419,176 @@ Public Class frmMDMDatenverarbetiung End Function + Function genIDSInsertMaut(kdNr) As Boolean + Try + pic.Visible = False + Dim displayFilter = False + Dim sqlstr As String = "" + + Dim sqlWhere As String = "" + If kdNr <> "" Then + sqlWhere &= " AND Adressen.AdressenNr=" & kdNr + End If + + + ' Dim SQL_IDS = "SELECT 'IDS' as Datenquelle, + ' trans.KdNrVERAG As [Customer No], + ' isnull(det.LicencePlateNumber,'-') as [Licence Plate Number], + 'land.Lieferland_ISO2 As [Transaction Country], + 'det.Transactiondate as [Transaction Date] , + ' '' AS [Product description], + 'det.CardNumber as [Card Number] , + ' '' as [Entry Terminal], + ' '' as [Exit Terminal], + ' sum(det.[TotalNetAmount]) AS [Net Amount], + ' sum(det.[VATAmount]) AS[VAT Amount], + ' sum(det.[AmminclVAT]) AS [Total Amount] + + + ' FROM [VERAG].[dbo].[tblIDSTransactionsNew_Details] as det + ' inner join [tblIDSTransactionsNew] as trans on det.[YearMonthDay] = trans.[YearMonthDay] and det.[CustomerCode] = trans.[CustomerCode] and det.[OutletCountryCode] = trans.[OutletCountryCode] and det.[OutletCode] = trans.[OutletCode] and det.[ProductTypeCode] = trans.[ProductTypeCode] + ' inner join [VERAG].[dbo].[tbl_IDS_Länder] as land on det.OutletCountryCode = land.OutletCountryCode + ' where cast(det.[YearMonthDay] as date) = '" & DateTimePicker2.Text & "' and trans.charged = 0 + ' group by trans.KdNrVERAG,det.CustomerCode, det.[YearMonthDay], det.CardNumber, land.Lieferland_ISO2, det.LicencePlateNumber,det.Transactiondate " + + Dim updated As Boolean = False + + + Dim InsertSatement As String = ";WITH detAgg AS +( + SELECT + CAST(det.YearMonthDay AS date) AS Datum, + det.CustomerCode, + det.OutletCountryCode, + det.OutletCode, + det.ProductTypeCode, + det.CardNumber, + det.LicencePlateNumber, + det.Transactiondate, + + SUM(det.TransactionVolume) AS TotalVolume, + SUM(det.TotalNetAmount) AS NetAmount, + SUM(det.VATAmount) AS VATAmount, + SUM(det.AmminclVAT) AS TotalAmount + + FROM VERAG.dbo.tblIDSTransactionsNew_Details det + + WHERE CAST(det.YearMonthDay AS date) = '" & datPloseAnhang.Text & "' + + + GROUP BY + CAST(det.YearMonthDay AS date), + det.CustomerCode, + det.OutletCountryCode, + det.OutletCode, + det.ProductTypeCode, + det.CardNumber, + det.LicencePlateNumber, + det.Transactiondate +), + +transAgg AS +( + SELECT + CAST(trans.YearMonthDay AS date) AS Datum, + trans.CustomerCode, + trans.OutletCountryCode, + trans.OutletCode, + trans.ProductTypeCode, + MAX(trans.KdNrVERAG) AS KdNrVERAG + + FROM VERAG.dbo.tblIDSTransactionsNew trans + + WHERE trans.chargedDatetime is not null and KdNrVERAG not in (756150, 711104) + + GROUP BY + CAST(trans.YearMonthDay AS date), + trans.CustomerCode, + trans.OutletCountryCode, + trans.OutletCode, + trans.ProductTypeCode +) INSERT INTO tblMautbericht +( + Datenquelle, + [Customer No], + [Licence Plate Number], + [Transaction Country], + [Transaction Date], + [Product description], + [Card Number], + [Entry Terminal], + [Exit Terminal], + [Net Amount], + [VAT Amount], + [Total Amount], + [Billingdate] +) + +SELECT + 'IDS' AS Datenquelle, + + transAgg.KdNrVERAG AS [Customer No], + + ISNULL(detAgg.LicencePlateNumber,'-') + AS [Licence Plate Number], + + land.Lieferland_ISO2 + AS [Transaction Country], + + detAgg.Transactiondate + AS [Transaction Date], + + '' AS [Product description], + + detAgg.CardNumber + AS [Card Number], + + '' AS [Entry Terminal], + + '' AS [Exit Terminal], + + detAgg.NetAmount + AS [Net Amount], + + detAgg.VATAmount + AS [VAT Amount], + + detAgg.TotalAmount + AS [Total Amount], + + CAST('" & datPloseAnhang.Text & "' as Date) AS [Billingdate] + +FROM detAgg + +INNER JOIN transAgg + ON detAgg.Datum = transAgg.Datum + AND detAgg.CustomerCode = transAgg.CustomerCode + AND detAgg.OutletCountryCode = transAgg.OutletCountryCode + AND detAgg.OutletCode = transAgg.OutletCode + AND detAgg.ProductTypeCode = transAgg.ProductTypeCode + +LEFT JOIN VERAG.dbo.tbl_IDS_Länder land + ON detAgg.OutletCountryCode = land.OutletCountryCode" + + + + updated = SQL.doSQL(InsertSatement, "FMZOLL",,,, 500) + + + + + pic.Visible = updated + Return updated + + Catch ex As System.Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + + End Function + Function deleteMautD(Datenquelle As String) As Boolean Try - 'Dim connectionString = "" - 'If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD_Test.accdb" - 'Else - ' connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD.accdb" - 'End If - - 'Dim con As New OleDbConnection(connectionString) - 'Dim cmd As New OleDbCommand - 'Dim var1 As String - - 'Dim adapter As OleDbDataAdapter = New OleDbDataAdapter() - 'Dim reader As OleDbDataReader = Nothing - - - 'FMZOLL-Tabelle - 'Try - ' con.Open() - - ' 'Zeitstempel - ' Dim SQLQuery = "DELETE FROM tblMautbericht WHERE Datenquelle='" & Datenquelle & "' " - ' Using Command As New OleDbCommand(SQLQuery, con) - - ' If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then Command.ExecuteNonQuery() - - ' Command.Dispose() - ' End Using - - 'Catch ex2 As System.Exception - ' MsgBox("err: " & ex2.Message & ex2.StackTrace) - - ' 'Finally - ' ' If reader IsNot Nothing Then reader.Close() - 'End Try - - 'con.Close() Return SQL.doSQL("DELETE FROM tblMautbericht WHERE Datenquelle='" & Datenquelle & "' AND cast(Billingdate as Date)= '" & datPloseAnhang.Text & "'", "FMZOLL") @@ -4760,10 +4848,12 @@ Public Class frmMDMDatenverarbetiung Function MautD_Befuellen(Optional kdNr = "", Optional _Lieferant = "") As Boolean Select Case LIEFERANT - Case "PLOSE" : deleteMautD("PLOSE") : Return genPLOSEInsertMautD(dat_Sum_Von.Value.ToShortDateString, dat_Sum_Bis.Value.ToShortDateString) + Case "PLOSE" : deleteMautD("PLOSE") : Return genPLOSEInsertMautD_NEW(dat_Sum_Von.Value.ToShortDateString, dat_Sum_Bis.Value.ToShortDateString) Case "ASFINAG" : deleteMautD("AT") : Return genASFINAGInsertMautAT(kdNr) Case "UTA" : deleteMautD("UTA") : Return genUTAInsertMaut(kdNr) Case "MSE" : deleteMautD("MSE") : Return genMSEInsertMaut(kdNr) + Case "IDS" : deleteMautD("IDS") : Return genIDSInsertMaut(kdNr) + End Select Return False End Function @@ -4804,7 +4894,7 @@ Public Class frmMDMDatenverarbetiung PictureBox1.Visible = True End If Case Else - MsgBox("Funktion setFaktiuriert für den Lieferant " & Lieferant & " nicht definiert!") + MsgBox("Funktion setFakturiert für den Lieferant " & Lieferant & " nicht definiert!") End Select End Sub @@ -5298,7 +5388,7 @@ RabattBerechnen: Dim idsParam As New cIDS() idsParam.initImportPfade("IDS") If genRGAtt_IDS(item.Name, idsParam) Then - If Not test Then + If Not test AndAlso MautD_Befuellen() Then setFakturiert(item.Name) End If End If diff --git a/SDL/mdm/usrCntlMDMAuswertungen.vb b/SDL/mdm/usrCntlMDMAuswertungen.vb index 38ef5566..4ec56745 100644 --- a/SDL/mdm/usrCntlMDMAuswertungen.vb +++ b/SDL/mdm/usrCntlMDMAuswertungen.vb @@ -1585,7 +1585,9 @@ Public Class usrCntlMDMAuswertungen AND weitereWölflKundenNr IS NOT NULL THEN ', ' ELSE '' END + - ISNULL(CAST(weitereWölflKundenNr AS nvarchar(50)), '') AS RMC_KundenNr + ISNULL(CAST(weitereWölflKundenNr AS nvarchar(50)), '') AS RMC_KundenNr, + isnull(kde_VZ,0) as VZ_Kunde, + isnull(kde_AnmerkungVZ,'') as VZ_Intervall FROM Adressen AD INNER JOIN Kunden KD ON KD.KundenNr = AD.AdressenNr diff --git a/SDL/mdm/usrcntlFremdrechnungen.vb b/SDL/mdm/usrcntlFremdrechnungen.vb index 3a7da0fe..7fd0f844 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.vb @@ -1,9 +1,6 @@ Imports System.IO Imports System.Reflection -Imports com.sun.tools.corba.se.idl Imports com.sun.xml.internal.rngom -Imports DocumentFormat.OpenXml.Drawing.Diagrams -Imports DocumentFormat.OpenXml.VariantTypes Imports MDM_Worker Imports Microsoft.Office.Interop Imports VERAG_PROG_ALLGEMEIN @@ -1511,22 +1508,25 @@ Public Class usrcntlFremdrechnungen End If - - Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value - If daId > 0 Then - Me.Cursor = Cursors.WaitCursor - Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId) - DS.OPEN_SINGLE() + If Not IsDBNull(dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value) AndAlso IsNumeric(dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value) Then + Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value + If daId > 0 Then + Me.Cursor = Cursors.WaitCursor + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId) + DS.OPEN_SINGLE() + End If End If + Case Else - - Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value - If daId > 0 Then - Me.Cursor = Cursors.WaitCursor - Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId) - DS.OPEN_SINGLE() + If Not IsDBNull(dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value) AndAlso IsNumeric(dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value) Then + Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value + If daId > 0 Then + Me.Cursor = Cursors.WaitCursor + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId) + DS.OPEN_SINGLE() + End If End If End Select @@ -1535,12 +1535,13 @@ Public Class usrcntlFremdrechnungen Select Case aktLieferant Case "RMC" - - Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("RE_Anhang_daid").Value - If daId > 0 Then - Me.Cursor = Cursors.WaitCursor - Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId) - DS.OPEN_SINGLE() + If Not IsDBNull(dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value) AndAlso IsNumeric(dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value) Then + Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("RE_Anhang_daid").Value + If daId > 0 Then + Me.Cursor = Cursors.WaitCursor + Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId) + DS.OPEN_SINGLE() + End If End If End Select @@ -1640,47 +1641,57 @@ Public Class usrcntlFremdrechnungen cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden,cast(isnull(InvToCustomer, 0) as bit) as OrigRE ,[Country] as Land FROM [VERAG].[dbo].[tblIDSInvoicesNewSplittedByCountry] WHERE [TotalInvoiceId] = " & rechnugnsID & setSQLDetailWhere(aktLieferant, "Country") + Dim dtRechnugnsdet As DataTable = (New SQL).loadDgvBySql(sql, "FMZOLL") + If setDatatable Then - - Dim dtRechnugnsdet As DataTable = (New SQL).loadDgvBySql(sql, "FMZOLL") Return dtRechnugnsdet - End If + Dim imgGray = My.Resources.pdf_gray + Dim imgRed = My.Resources.pdf + + If Not dtRechnugnsdet.Columns.Contains("PDF_Image") Then + dtRechnugnsdet.Columns.Add("PDF_Image", GetType(Image)) + End If + + For Each row As DataRow In dtRechnugnsdet.Rows + + If Convert.ToBoolean(row("PDFvorhanden")) Then + row("PDF_Image") = imgRed + Else + row("PDF_Image") = imgGray + End If + + + Next With dgvDetails + .Columns.Clear() + .AutoGenerateColumns = True + .DataSource = dtRechnugnsdet + + ' ImageColumn hinzufügen + Dim c As New DataGridViewImageColumn With { + .Name = "PDF", + .HeaderText = "PDF", + .DataPropertyName = "PDF_Image", + .ImageLayout = DataGridViewImageCellLayout.Zoom, + .Width = 40 + } + + .Columns.Add(c) + .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells - .SET_SQL(sql, "FMZOLL") - .LOAD() .ClearSelection() - Dim c As New DataGridViewImageColumn - c.Name = "PDF" : c.HeaderText = "PDF" - c.DefaultCellStyle.NullValue = Nothing - c.ImageLayout = DataGridViewImageCellLayout.Zoom - c.Width = 40 - c.DefaultCellStyle.Padding = New Padding(2) - c.DefaultCellStyle.BackColor = Color.White - c.Image = My.Resources.pdf_gray - - - If Not .Columns.Contains("PDF") Then .Columns.Add(c) - - If .Columns.Count > 0 Then - - For Each r As DataGridViewRow In .Rows - - If IsDBNull(r.Cells("daId").Value) OrElse r.Cells("daId").Value = 0 Then - DirectCast(r.Cells("PDF"), DataGridViewImageCell).Value = My.Resources.pdf_gray - End If - - If .Columns.Contains("daId") Then - If .Columns("daId") IsNot Nothing Then .Columns("daId").Visible = False - End If - - Next + ' daId ausblenden + If .Columns.Contains("daId") Then + .Columns("daId").Visible = False + End If + If .Columns.Contains("PDF_Image") Then + .Columns("PDF_Image").Visible = False End If End With diff --git a/SDL/seriendruck/usrCntlFakturierung.vb b/SDL/seriendruck/usrCntlFakturierung.vb index f87e225d..ef2e83ca 100644 --- a/SDL/seriendruck/usrCntlFakturierung.vb +++ b/SDL/seriendruck/usrCntlFakturierung.vb @@ -29,9 +29,9 @@ Public Class usrcntlFakturierung KdSearchBox3.initKdBox(Me.FindForm) cbxMautbericht.Items.Clear() - cbxMautbericht.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Mautsummenbericht", "Gesamtbericht_EXCEL")) - cbxMautbericht.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Mautbericht AT DE MSE UTA", "Lieferantenbericht_PDF")) - cbxMautbericht.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Mautsummenbericht als CSV-Datei", "Gesamtbericht_CSV")) + cbxMautbericht.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Mautsummenbericht (öffnen)", "Gesamtbericht_EXCEL")) + cbxMautbericht.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Mautbericht PDF (erzeugen)", "Lieferantenbericht_PDF")) + cbxMautbericht.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Mautsummenbericht CSV (erzeugen)", "Gesamtbericht_CSV")) cbxDateMautbericht.Items.Clear() cbxDateMautbericht.fillWithSQL("select distinct(cast(BillingDate as Date)) From tblMautbericht order by cast(BillingDate as Date) desc", False, "FMZOLL") @@ -1372,7 +1372,7 @@ Public Class usrcntlFakturierung Dim dtBerichtkunden_CSV As DataTable = (New SQL).loadDgvBySql("SELECT [Customer No], [Licence Plate Number], [Transaction Country], [Transaction date], tblMautbericht.[Product description], tblMautbericht.[Card number], tblMautbericht.[Entry Terminal], tblMautbericht.[Exit Terminal], tblMautbericht.[Net Amount], tblMautbericht.[VAT Amount], tblMautbericht.[Total Amount] FROM Adressen INNER JOIN tblMautbericht ON Adressen.AdressenNr = tblMautbericht.[Customer No] - WHERE Adressen.ExportMautberichtCSV=1 AND cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' + WHERE Adressen.ExportMautberichtCSV=1 AND cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' and Datenquelle <> 'IDS' ORDER BY tblMautbericht.[Customer No], tblMautbericht.[Licence Plate Number], tblMautbericht.[Transaction Country], tblMautbericht.[Transaction date], tblMautbericht.[Product description], tblMautbericht.[Card number], tblMautbericht.[Entry Terminal], tblMautbericht.[Exit Terminal]", "FMZOLL") If dtBerichtkunden_CSV.Rows.Count > 0 Then @@ -1436,11 +1436,11 @@ Public Class usrcntlFakturierung 'für Kunde an RE anhängen (Tool Report to Verag Invoice aus FMZOLL) Case "Lieferantenbericht_PDF" - Dim AnzahlPDF_Berichte As Integer = CInt((New SQL).getValueTxtBySql("SELECT count(distinct(tblMautbericht.[Customer No])) FROM tblMautbericht WHERE cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "'", "FMZOLL")) + Dim AnzahlPDF_Berichte As Integer = CInt((New SQL).getValueTxtBySql("SELECT count(distinct(tblMautbericht.[Customer No])) FROM tblMautbericht WHERE cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' and Datenquelle <> 'IDS' ", "FMZOLL")) Dim dtBerichtkunden_PDF As DataTable = (New SQL).loadDgvBySql("SELECT tblMautbericht.[Customer No], Adressen.Ordnungsbegriff AS [Customer name], tblMautbericht.[Licence Plate Number], tblMautbericht.[Transaction date], tblMautbericht.[Transaction Country], tblMautbericht.[Product description], tblMautbericht.[Card number], tblMautbericht.[Entry Terminal], tblMautbericht.[Exit Terminal], Sum(tblMautbericht.[Net Amount]) AS [Net Amount], Sum(tblMautbericht.[VAT Amount]) AS [VAT Amount], Sum(tblMautbericht.[Total Amount]) AS [Total Amount] FROM tblMautbericht INNER JOIN Adressen ON tblMautbericht.[Customer No] = Adressen.AdressenNr - WHERE cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' + WHERE cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' and Datenquelle <> 'IDS' GROUP BY tblMautbericht.[Customer No], Adressen.Ordnungsbegriff, tblMautbericht.[Licence Plate Number], tblMautbericht.[Transaction date], tblMautbericht.[Transaction Country], tblMautbericht.[Product description], tblMautbericht.[Card number], tblMautbericht.[Entry Terminal], tblMautbericht.[Exit Terminal] ORDER BY tblMautbericht.[Licence Plate Number] , tblMautbericht.[Transaction Country], tblMautbericht.[Transaction date] ", "FMZOLL") @@ -1471,7 +1471,7 @@ Public Class usrcntlFakturierung Dim dt_PDF_selected = dtBerichtkunden_PDF.Select("[Customer No] ='" & pdf.Item(0) & "'").CopyToDataTable Dim dtLaender As DataTable = (New SQL).loadDgvBySql("SELECT tblMautbericht.[Customer No], tblMautbericht.[Transaction Country], sum(tblMautbericht.[Net Amount]) as Netto, sum(tblMautbericht.[VAT Amount]) as MWST, sum(tblMautbericht.[Total Amount]) as Brutto - FROM tblMautbericht WHERE [Customer No] ='" & pdf.Item(0) & "' AND cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' + FROM tblMautbericht WHERE [Customer No] ='" & pdf.Item(0) & "' AND cast(BillingDate as Date) = '" & cbxDateMautbericht._value & "' and Datenquelle <> 'IDS' GROUP BY [Customer No], [Transaction Country] ORDER BY tblMautbericht.[Customer No], tblMautbericht.[Transaction Country]", "FMZOLL") diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb b/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb index 99b8b7f0..a9da1483 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb @@ -346,6 +346,7 @@ Public Class cIDS Dim savedTrans As Integer = 0 Dim MDMEinarb As New cMDMEinarbeitung("IDS", Now()) + Dim isTransactionDetail As Boolean = False Do While (objFileRead.Peek() > -1) Dim currentRow As String() @@ -354,140 +355,114 @@ Public Class cIDS lngRecordCount = lngRecordCount + 1 If lngRecordCount = 1 Then - If Not (isleernothing((currentRow(0))) = "Year Month Day" AndAlso isleernothing((currentRow(14))) = "OBO Number") Then + If Not (isleernothing((currentRow(0))) = "Year Month Day") Then Return False End If + If isleernothing((currentRow(14))) = "OBO Number" Then isTransactionDetail = False + + If isleernothing((currentRow(14))) = "Transaction Volume" Then isTransactionDetail = True + + Else Try - 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))) + If Not isTransactionDetail Then - Dim vr = isleernothing((currentRow(13))) - Dim obo = isleernothing((currentRow(14))) - - '.VRNumber = isleernothing((currentRow(13))) - '.OBONumber = isleernothing((currentRow(14))) - - - Dim zusParam = "" - Dim isOBO As Boolean = False - If vr IsNot Nothing AndAlso vr <> "" Then - zusParam = vr - ElseIf obo IsNot Nothing AndAlso obo <> "" Then - zusParam = obo - isOBO = True - End If - - Dim ids As New cIDS(ymd, pyn, cc, occ, oc, ptc, zusParam, isOBO) - - Dim avprive = isleernothing((currentRow(12))) - - - - - - With ids - .YearMonthDay = isleernothing((currentRow(0))) - .CustomerCode = isleernothing((currentRow(1))) - .Paymentsummarynumber = isleernothing((currentRow(2))) - .CustomerName = isleernothing((currentRow(3))) - .OutletCountry = isleernothing((currentRow(4))) - .OutletCountryCode = isleernothing((currentRow(5))) - .OutletCode = isleernothing((currentRow(6))) - .ProductTypeCode = isleernothing((currentRow(7))) + 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 vr = isleernothing((currentRow(13))) + Dim obo = isleernothing((currentRow(14))) If lngRecordCount = 2 Then - MDMEinarb.invoicedate = CDate(.YearMonthDay) + Dim MDMEinarb_check As New cMDMEinarbeitung("IDS", ymd) + If MDMEinarb_check.hasEntry AndAlso MDMEinarb_check.completed Then Return False End If - 'Dim transVol_old = .TransactionVolume - 'Dim transVol_new = isleernothing((currentRow(8))) - 'If transVol_old IsNot Nothing AndAlso IsNumeric(transVol_old) AndAlso transVol_new IsNot Nothing AndAlso IsNumeric(transVol_new) Then + Dim zusParam = "" + Dim isOBO As Boolean = False + If vr IsNot Nothing AndAlso vr <> "" Then + zusParam = vr + ElseIf obo IsNot Nothing AndAlso obo <> "" Then + zusParam = obo + isOBO = True + End If - ' Dim AmininclVat_old = CDbl(.AmminclVAT) - ' Dim AmininclVat_new = CDbl(isleernothing((currentRow(9)).Replace(".", ","))) + Dim ids As New cIDS(ymd, pyn, cc, occ, oc, ptc, zusParam, isOBO) - ' Dim TotalNetAmount_old = CDbl(.TotalNetAmount) - ' Dim TotalNetAmount_new = CDbl(isleernothing((currentRow(10)).Replace(".", ","))) - - ' Dim VATAmount_old = CDbl(.VATAmount) - ' Dim VATAmount_new = CDbl(isleernothing((currentRow(11)).Replace(".", ","))) + Dim avprive = isleernothing((currentRow(12))) - ' If (CDec(transVol_old) <> CDec(transVol_new)) AndAlso Math.Abs(CDbl(transVol_old)) = Math.Abs(CDbl(transVol_new.replace(".", ","))) Then 'case1: gleiche Transaktionshohe -> nicht abziehen, sondern nur Preis anpassen! + With ids + .YearMonthDay = isleernothing((currentRow(0))) + .CustomerCode = isleernothing((currentRow(1))) + .Paymentsummarynumber = isleernothing((currentRow(2))) + .CustomerName = isleernothing((currentRow(3))) + .OutletCountry = isleernothing((currentRow(4))) + .OutletCountryCode = isleernothing((currentRow(5))) + .OutletCode = isleernothing((currentRow(6))) + .ProductTypeCode = isleernothing((currentRow(7))) - ' If AmininclVat_old <> AmininclVat_new Then - - ' .TransactionVolume = transVol_old + transVol_new - ' .AmminclVAT = AmininclVat_old + AmininclVat_new - ' .TotalNetAmount = TotalNetAmount_old + TotalNetAmount_new - ' .VATAmount = VATAmount_old + VATAmount_new + If lngRecordCount = 2 Then + MDMEinarb.invoicedate = CDate(.YearMonthDay) + End If - ' End If + .TransactionVolume = isleernothing((currentRow(8))) + .AmminclVAT = isleernothing((currentRow(9))) + .TotalNetAmount = isleernothing((currentRow(10))) + .VATAmount = isleernothing((currentRow(11))) + .avpriceexclVAT = IIf(avprive <> "" AndAlso IsNumeric(avprive), avprive, 0) + Console.WriteLine("IDS: " & isleernothing((currentRow(1))) & " - " & lngRecordCount & " - " & isleernothing((currentRow(10)))) - ' ElseIf Math.Abs(CDbl(transVol_old)) > Math.Abs(CDbl(transVol_new.replace(".", ","))) AndAlso (CDec(transVol_old) <> CDec(transVol_new)) Then 'case2: alte Transaktionshohe höher als neue, abziehen! + If isOBO Then + If .SAVE_OBO() Then counTrans += 1 + Else + If .SAVE_VR() Then counTrans += 1 + End If + End With - ' If AmininclVat_old <> AmininclVat_new Then - ' .TransactionVolume = transVol_old + transVol_new - ' .AmminclVAT = AmininclVat_old + AmininclVat_new - ' .TotalNetAmount = TotalNetAmount_old + TotalNetAmount_new - ' .VATAmount = VATAmount_old + VATAmount_new - - ' 'If .TransactionVolume < 0 Then .TransactionVolume = .TransactionVolume * -1 - - ' End If - - ' ElseIf Math.Abs(CDbl(transVol_old)) < Math.Abs(CDbl(transVol_new.replace(".", ","))) AndAlso (CDec(transVol_old) <> CDec(transVol_new)) Then 'case3: alte Transaktionshohe niedriger als neue, dazuzählen (weil die "Stornierung" vor der eig. Transk. importiert werden kann)! - - - ' If AmininclVat_old <> AmininclVat_new Then - - ' .TransactionVolume = transVol_old + transVol_new - ' .AmminclVAT = AmininclVat_old + AmininclVat_new - ' .TotalNetAmount = TotalNetAmount_old + TotalNetAmount_new - ' .VATAmount = VATAmount_old + VATAmount_new - - ' 'If .TransactionVolume < 0 Then .TransactionVolume = .TransactionVolume * -1 - - ' End If - - ' End If - - 'Else - .TransactionVolume = isleernothing((currentRow(8))) - .AmminclVAT = isleernothing((currentRow(9))) - .TotalNetAmount = isleernothing((currentRow(10))) - .VATAmount = isleernothing((currentRow(11))) - .avpriceexclVAT = IIf(avprive <> "" AndAlso IsNumeric(avprive), avprive, 0) - - ' End If - - - '.VRNumber = isleernothing((currentRow(13))) - '.OBONumber = isleernothing((currentRow(14))) - - Console.WriteLine("IDS: " & isleernothing((currentRow(1))) & " - " & lngRecordCount & " - " & isleernothing((currentRow(10)))) - - If isOBO Then - If .SAVE_OBO() Then counTrans += 1 Else - If .SAVE_VR() Then counTrans += 1 + + Dim ymd = isleernothing((currentRow(0))) + Dim cc = isleernothing((currentRow(1))) + Dim cn = isleernothing((currentRow(2))) + Dim occ = isleernothing((currentRow(8))) + Dim oc = isleernothing((currentRow(9))) + Dim ptc = isleernothing((currentRow(11))) + Dim tv = isleernothing((currentRow(14))) + Dim t_time = isleernothing((currentRow(13))) + Dim t_date = isleernothing((currentRow(12))) + Dim tna = isleernothing((currentRow(16))) + + If lngRecordCount = 2 Then + Dim MDMEinarb_check As New cMDMEinarbeitung("IDS_Details", ymd) + If MDMEinarb_check.hasEntry AndAlso MDMEinarb_check.completed Then Return False End If - '.SAVE() - End With + Dim ids_detail As New cIDSDetails(ymd, cc, cn, occ, oc, ptc, t_time, t_date, tv, tna) + ids_detail.AmminclVAT = isleernothing((currentRow(15))) + ids_detail.VATAmount = isleernothing((currentRow(17))) + ids_detail.avpriceexclVAT = isleernothing((currentRow(18))) + ids_detail.Paymentsummarynumber = "" + If ids_detail.SAVE() Then counTrans += 1 + + If lngRecordCount = 2 Then + MDMEinarb.invoicedate = CDate(ids_detail.YearMonthDay) + End If + + + End If + Catch ex As Exception VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) @@ -496,20 +471,47 @@ Public Class cIDS End If Loop - cnt = CInt(lngRecordCount) - MDMEinarb.ds_total += cnt - 1 - MDMEinarb.ds_count += counTrans - MDMEinarb.import_date = Now() - MDMEinarb.importfilename = fi.Name + If Not isTransactionDetail Then + MDMEinarb.supplier = "IDS" + cnt = CInt(lngRecordCount) + MDMEinarb.ds_total += cnt - 1 + MDMEinarb.ds_count += counTrans + MDMEinarb.import_date = Now() + MDMEinarb.importfilename = fi.Name + + If MDMEinarb.ds_total = MDMEinarb.ds_count Then + MDMEinarb.completed = True + MDMEinarb.completed_date = Now() + End If + + MDMEinarb.SAVE() + Else + 'LKW-Kennzeichen aktualisieren! + SQL.doSQL("UPDATE det SET det.LicencePlateNumber = s.KfzKennzeichen FROM tblIDSTransactionsNew_Details det INNER JOIN SDL.dbo.SDL s + ON s.KartenNr = + CAST(det.CustomerCode AS varchar(50)) + CAST(det.CardNumber AS varchar(50)) + WHERE s.SDLNr = 100 AND ISNULL(s.Gesperrt,0) = 0 AND det.LicencePlateNumber is null", "FMZOLL") + + MDMEinarb.supplier = "IDS_Details" + cnt = CInt(lngRecordCount) + MDMEinarb.ds_total += cnt - 1 + MDMEinarb.ds_count += counTrans + MDMEinarb.import_date = Now() + MDMEinarb.importfilename = fi.Name - If MDMEinarb.ds_total = MDMEinarb.ds_count Then MDMEinarb.completed = True - MDMEinarb.completed_date = Now() + MDMEinarb.completed_date = Now() + + + MDMEinarb.SAVE() End If - MDMEinarb.SAVE() + + objFileRead.Close() - Return True + Return True + + @@ -1319,6 +1321,160 @@ Public Class cIDSDieselpreisRW End Class +Public Class cIDSDetails + + Property YearMonthDay As Object = Nothing + Property CustomerCode As Object = Nothing + Property CardNumber As Object = Nothing + Property Paymentsummarynumber As Object = Nothing + Property OutletCountryCode As Object = Nothing + Property OutletCode As Object = Nothing + Property ProductTypeCode As Object = Nothing + Property TransactionVolume As Object = Nothing + Property AmminclVAT As Object = Nothing + Property TotalNetAmount As Object = Nothing + Property VATAmount As Object = Nothing + Property avpriceexclVAT As Object = Nothing + Property Transactiondate As Object = Nothing + Property Transactiontime As Object = Nothing + + Public hasEntry = False + + Dim SQL As New SQL + + Sub New() + + End Sub + + + + Sub New(YearMonthDay, CustomerCode, cardNumber, OutletCountryCode, OutletCode, ProductTypeCode, Transactiontime, Transactiondate, TransactionVolume, TotalNetAmount) + Me.YearMonthDay = YearMonthDay + Me.CardNumber = cardNumber + Me.CustomerCode = CustomerCode + Me.OutletCountryCode = OutletCountryCode + Me.OutletCode = OutletCode + Me.ProductTypeCode = ProductTypeCode + Me.Transactiontime = Transactiontime + Me.TransactionVolume = TransactionVolume + Me.TotalNetAmount = TotalNetAmount + Me.Transactiondate = Transactiondate + 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("YearMonthDay", YearMonthDay)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CustomerCode", CustomerCode)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OutletCountryCode", OutletCountryCode)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OutletCode", OutletCode)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ProductTypeCode", ProductTypeCode)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("TransactionVolume", TransactionVolume)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("AmminclVAT", AmminclVAT)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("TotalNetAmount", TotalNetAmount)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VATAmount", VATAmount)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("avpriceexclVAT", avpriceexclVAT)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CardNumber", CardNumber)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Transactiondate", Transactiondate)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Transactiontime", Transactiontime)) + Return list + End Function + + Public Sub LOAD() + Try + + hasEntry = False + Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL() + Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew_Details WHERE YearMonthDay=@YearMonthDay AND cardNumber=@cardNumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND Transactiontime=@Transactiontime AND TransactionVolume=@TransactionVolume AND Transactiondate=@Transactiondate ", conn) + cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay) + cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode) + cmd.Parameters.AddWithValue("@OutletCountryCode", OutletCountryCode) + cmd.Parameters.AddWithValue("@OutletCode", OutletCode) + cmd.Parameters.AddWithValue("@ProductTypeCode", ProductTypeCode) + cmd.Parameters.AddWithValue("@cardNumber", CardNumber) + cmd.Parameters.AddWithValue("@Transactiontime", Transactiontime) + cmd.Parameters.AddWithValue("@TransactionVolume", TransactionVolume) + cmd.Parameters.AddWithValue("@TotalNetAmount", TotalNetAmount) + cmd.Parameters.AddWithValue("@Transactiondate", Transactiondate) + 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 SAVE() As Boolean + Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() + + Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactionsNew_Details WHERE YearMonthDay=@YearMonthDay AND cardNumber=@cardNumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND Transactiontime=@Transactiontime AND TransactionVolume=@TransactionVolume AND Transactiondate=@Transactiondate) " & + " BEGIN " & getUpdateCmd() & " END " & + " Else " & + " BEGIN " & getInsertCmd() & " END " & + " commit tran " + + Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list) + End Function + + Public Function getUpdateCmd(Optional PARAM As String = "", Optional VALUE As String = "") 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 [tblIDSTransactionsNew_Details] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND cardNumber=@cardNumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND Transactiontime=@Transactiontime AND TransactionVolume=@TransactionVolume AND Transactiondate=@Transactiondate ") + + 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 tblIDSTransactionsNew_Details (" & 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 + +End Class + diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb b/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb index 9301f2ec..bfe72f90 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb @@ -297,36 +297,6 @@ Public Class cMitarbeiter End Function - - 'Public Sub LOAD(Optional topMax As String = "") - ' Try - ' Using conn As SqlConnection = SQL.GetNewOpenConnectionADMIN() - ' Using cmd As New SqlCommand("Select * FROM tblMitarbeiter WHERE mit_id=@mit_id ", conn) - ' cmd.Parameters.AddWithValue("@mit_id", mit_id) - ' Dim dr = cmd.ExecuteReader() - ' If dr.Read Then - ' For Each l In getParameterList() - ' Dim propInfo As PropertyInfo = Me.GetType.GetProperty(l.Scalarvariable) - - ' If dr.Item(l.Text) Is DBNull.Value Then - ' propInfo.SetValue(Me, Nothing) - ' Else - ' propInfo.SetValue(Me, dr.Item(l.Text)) - ' End If - - ' Next - ' Me.LOAD_MEMBERS() - ' Me.LOAD_MESSAGES(topMax) - ' End If - ' dr.Close() - ' End Using - ' End Using - ' Catch ex As Exception - ' MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace) - ' End Try - 'End Sub - - Public Function LOAD(ByVal id As Integer, Optional isTimas As Boolean = False) As Boolean Dim sqlstr As String = "SELECT * FROM tblMitarbeiter WHERE " & IIf(isTimas, "mit_timasId = " & id & "", "mit_id = " & id & "") ' adasdas() @@ -367,11 +337,8 @@ Public Class cMitarbeiter If Not dr.Item("mit_DpUserStandardDP") Is DBNull.Value Then Me.mit_DpUserStandardDP = dr.Item("mit_DpUserStandardDP") If Not dr.Item("mit_DpUserStandardFirma") Is DBNull.Value Then Me.mit_DpUserStandardFirma = dr.Item("mit_DpUserStandardFirma") If Not dr.Item("mit_DpUserStandardFirma2") Is DBNull.Value Then Me.mit_DpUserStandardFirma2 = dr.Item("mit_DpUserStandardFirma2") - - If Not dr.Item("mit_standartFiliale") Is DBNull.Value Then Me.mit_standartFiliale = dr.Item("mit_standartFiliale") If Not dr.Item("mit_standardPreisliste") Is DBNull.Value Then Me.mit_standardPreisliste = dr.Item("mit_standardPreisliste") - Me.mit_info = dr.Item("mit_info") If Not dr.Item("mit_einstiegsdatum") Is DBNull.Value Then Me.mit_einstiegsdatum = dr.Item("mit_einstiegsdatum") Me.mit_gekuendigt = dr.Item("mit_gekuendigt") @@ -387,7 +354,6 @@ Public Class cMitarbeiter If Not dr.Item("mit_DAKOSY_SBFull") Is DBNull.Value Then Me.mit_DAKOSY_SBFull = dr.Item("mit_DAKOSY_SBFull") If Not dr.Item("mit_TESTonly") Is DBNull.Value Then Me.mit_TESTonly = dr.Item("mit_TESTonly") If Not dr.Item("mit_PasswortChanged") Is DBNull.Value Then Me.mit_PasswortChanged = dr.Item("mit_PasswortChanged") - If Not dr.Item("mit_FirmenDatenAnzeige") Is DBNull.Value Then Me.mit_FirmenDatenAnzeige = dr.Item("mit_FirmenDatenAnzeige") If Not dr.Item("mit_TELOTEC_SB") Is DBNull.Value Then Me.mit_TELOTEC_SB = dr.Item("mit_TELOTEC_SB") If Not dr.Item("mit_AliasAD_Domain") Is DBNull.Value Then Me.mit_AliasAD_Domain = dr.Item("mit_AliasAD_Domain") @@ -395,20 +361,16 @@ Public Class cMitarbeiter If Not dr.Item("mit_AliasAD_Domain2") Is DBNull.Value Then Me.mit_AliasAD_Domain2 = dr.Item("mit_AliasAD_Domain2") If Not dr.Item("mit_AliasAD_Username2") Is DBNull.Value Then Me.mit_AliasAD_Username2 = dr.Item("mit_AliasAD_Username2") If Not dr.Item("mit_teamId") Is DBNull.Value Then Me.mit_teamId = dr.Item("mit_teamId") - Me.mit_ChatBenutzer = dr.Item("mit_ChatBenutzer") Me.mit_ChatEasteregg = dr.Item("mit_ChatEasteregg") Me.mit_ChatEasteregg2 = dr.Item("mit_ChatEasteregg2") - If Not dr.Item("mit_FirmaHaupt") Is DBNull.Value Then Me.mit_FirmaHaupt = dr.Item("mit_FirmaHaupt") - If Not dr.Item("mit_MAVerzeichnis_SettingsTstmp") Is DBNull.Value Then Me.mit_MAVerzeichnis_SettingsTstmp = dr.Item("mit_MAVerzeichnis_SettingsTstmp") Me.mit_MAVerzeichnis_allowGebDat = dr.Item("mit_MAVerzeichnis_allowGebDat") Me.mit_MAVerzeichnis_allowGebDatOhneJahr = dr.Item("mit_MAVerzeichnis_allowGebDatOhneJahr") Me.mit_MAVerzeichnis_allowWohnadresse = dr.Item("mit_MAVerzeichnis_allowWohnadresse") Me.mit_MAVerzeichnis_allowHandynummer = dr.Item("mit_MAVerzeichnis_allowHandynummer") Me.mit_MAVerzeichnis_allowFoto = dr.Item("mit_MAVerzeichnis_allowFoto") - If Not dr.Item("mit_foto_DocId") Is DBNull.Value Then Me.mit_foto_DocId = dr.Item("mit_foto_DocId") If Not dr.Item("mit_fotoHover1_DocId") Is DBNull.Value Then Me.mit_fotoHover1_DocId = dr.Item("mit_fotoHover1_DocId") If Not dr.Item("mit_fotoHover2_DocId") Is DBNull.Value Then Me.mit_fotoHover2_DocId = dr.Item("mit_fotoHover2_DocId") @@ -429,7 +391,6 @@ Public Class cMitarbeiter Me.mit_ausstempelnBeiBeenden = dr.Item("mit_ausstempelnBeiBeenden") If Not dr.Item("mit_timasFirmen") Is DBNull.Value Then Me.mit_timasFirmen = dr.Item("mit_timasFirmen") Me.mit_timasMehrereFirmen = dr.Item("mit_timasMehrereFirmen") - If Not dr.Item("mit_Notfall_Handy") Is DBNull.Value Then Me.mit_Notfall_Handy = dr.Item("mit_Notfall_Handy") If Not dr.Item("mit_Notfall_Name") Is DBNull.Value Then Me.mit_Notfall_Name = dr.Item("mit_Notfall_Name") If Not dr.Item("mit_Notfall_Mail") Is DBNull.Value Then Me.mit_Notfall_Mail = dr.Item("mit_Notfall_Mail") diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cOfferte.vb b/VERAG_PROG_ALLGEMEIN/Classes/cOfferte.vb index 02643509..d42abc61 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cOfferte.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cOfferte.vb @@ -1,7 +1,6 @@  Imports System.Data.SqlClient Imports System.Reflection -Imports jdk.nashorn.internal.ir Public Class cOfferteList Property KundenNr As Object = Nothing diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cSendungen.vb b/VERAG_PROG_ALLGEMEIN/Classes/cSendungen.vb index 3dd38f8e..3f497c8d 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cSendungen.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cSendungen.vb @@ -1,5 +1,4 @@ Imports System.Data.SqlClient -Imports javax.xml.bind.annotation Public Class cSendungen Implements ICloneable diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cSpeditionsbuch.vb b/VERAG_PROG_ALLGEMEIN/Classes/cSpeditionsbuch.vb index 8c57f91a..7eb22ead 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cSpeditionsbuch.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cSpeditionsbuch.vb @@ -133,6 +133,7 @@ Public Class cSpeditionsbuch Property AbfertigungsanzahlPos As Object = Nothing Property Barzahlungsbetrag As Double = 0 ' Property Sachbearbeiter As String = "" + Public Sachbearbeiter As String = "" Property Personalnummer As Object = Nothing 'int=-1 Property PersonalnummerQS As Object = Nothing 'int=-1 @@ -517,7 +518,6 @@ Public Class cSpeditionsbuch list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Zollsystem_Land", Zollsystem_Land)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("SB_CMRNr", SB_CMRNr)) - Return list End Function diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb b/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb index 76accc02..8993d28a 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb @@ -1,6 +1,7 @@ Imports System.Data.SqlClient Imports System.IO Imports System.Reflection +Imports com.sun.xml.internal.rngom.digested Public Class cUTA @@ -1055,8 +1056,9 @@ Public Class cUTA Dim counTrans As Integer = 0 Dim savedTrans As Integer = 0 - Dim MDMEinarb As New cMDMEinarbeitung("UTA", Now()) - MDMEinarb.setInvoicingDate(Now(), MDMEinarb) + Dim Einarbeitung_Lief = "UTA" + Dim MDMEinarb As New cMDMEinarbeitung(Einarbeitung_Lief, Now()) + 'MDMEinarb.setInvoicingDate(Now(), MDMEinarb) Dim lngRecordCount As Long Try @@ -1116,18 +1118,6 @@ Public Class cUTA Dim lngPKLine As Long = 0 lngRecordCount = 0 - 'gleicher PKFileName wird nun aus CLFHeader gelöscht. CASCADE löscht dann zugehörige CLFBody und CLFTrailer. - 'If Not SQL.doSQL("DELETE tblUTAHeaderNew.ErstellDatumUhrzeit, tblUTAHeaderNew.Übertragungsnummer FROM tblUTAHeaderNew WHERE (((tblUTAHeaderNew.ErstellDatumUhrzeit)=" & Format$(dtmErstellDatumUhrzeit, "\#mm\/dd\/yyyy hh\:nn\:ss AM/PM\#") & ") AND ((tblUTAHeaderNew.Übertragungsnummer)=" & lngÜbertragungsnummer, "FMZOLL") Then - ' MsgBox("Fehler beim Löschen des CLF-Headers") - ' objFileRead.Close() - ' Return False - 'End If - - 'If Not SQL.doSQL("UPDATE CLF SET PKFileName = '" & fi.Name.ToString & "'", "FMZOLL") Then - ' MsgBox("Fehler beim Update der CLF-Nr") - ' objFileRead.Close() - ' Return False - 'End If objFileRead.DiscardBufferedData() objFileRead.BaseStream.Seek(0, System.IO.SeekOrigin.Begin) @@ -1268,8 +1258,20 @@ Public Class cUTA .[Gesamtbetrag_in_Lieferlandwährung_Umsatzsteuer_informativ] = 0 - .[Gesamtbetrag_in_Lieferlandwährung_Umsatzsteuer_informativ] End Select + If lngRecordCount = 2 Then + MDMEinarb.invoicedate = .[Rechnungsdatum] + Dim KdNr = .[Kundennummer] + + If KdNr = 170582 Then + Einarbeitung_Lief = "UTA_VERAG" + End If + + Dim MDMEinarb_check As New cMDMEinarbeitung(Einarbeitung_Lief, .[Rechnungsdatum]) + If MDMEinarb_check.hasEntry AndAlso MDMEinarb_check.completed Then Return False + End If + + If onlyTestkunedn Then - 'nur KundenNr 100964 und 825040 speichern: If .[Kundennummer] = 100964 Or .[Kundennummer] = 825040 Then .SAVE() End If @@ -1277,97 +1279,6 @@ Public Class cUTA If .SAVE() Then savedTrans += 1 End If - - - 'Dim clfArchiv As New cUTA.UTAArchiv(.Belegdatum, .UTA_Beleg_ID) - 'clfArchiv.Übertragungsnummer = .Übertragungsnummer - 'clfArchiv.ErstellDatumUhrzeit = .ErstellDatumUhrzeit - 'clfArchiv.Übertragungsposition = .Übertragungsposition - 'clfArchiv.Abrechnungsnummer = .Abrechnungsnummer - 'clfArchiv.Datum_für_Lieferungen_und_Leistungen_bis = .Datum_für_Lieferungen_und_Leistungen_bis - 'clfArchiv.Rechnungsempfänger_Kundennummer = .Rechnungsempfänger_Kundennummer - 'clfArchiv.Abrechnungsdatum = .Abrechnungsdatum - 'clfArchiv.Kundennummer = .Kundennummer - 'clfArchiv.Kartennummer = .Kartennummer - 'clfArchiv.Akzeptanzstellennummer = .Akzeptanzstellennummer - 'clfArchiv.Standort_der_Akzeptanzstelle = .Standort_der_Akzeptanzstelle - 'clfArchiv.Lieferland = .Lieferland - 'clfArchiv.Belegnummer_des_Lieferanten = .Belegnummer_des_Lieferanten - 'clfArchiv.Kilometerstand = .Kilometerstand - 'clfArchiv.Fakturierwarenart = .Fakturierwarenart - 'clfArchiv.Vorzeichen_Statusfeld_für_alle_Beträge_und_Mengen = .Vorzeichen_Statusfeld_für_alle_Beträge_und_Mengen - 'clfArchiv.Menge = .Menge - 'clfArchiv.SB_BT = .SB_BT - 'clfArchiv.Umsatzsteuerprozentsatz = .Umsatzsteuerprozentsatz - 'clfArchiv.Lieferlandwährung_ISO = .Lieferlandwährung_ISO - 'clfArchiv.Einzelpreis_Netto_in_Lieferlandwährung = .Einzelpreis_Netto_in_Lieferlandwährung - 'clfArchiv.Einzelpreis_Brutto_in_Lieferlandwährung = .Einzelpreis_Brutto_in_Lieferlandwährung - 'clfArchiv.Einzelpreis_Netto_in_Lieferlandwährung = .Einzelpreis_Netto_in_Lieferlandwährung - 'clfArchiv.Betrag_Service_in_Lieferlandwährung = .Betrag_Service_in_Lieferlandwährung - 'clfArchiv.Betrag_Nachlass_in_Lieferlandwährung = .Betrag_Nachlass_in_Lieferlandwährung - 'clfArchiv.Gesamtbetrag_Netto_in_Lieferlandwährung = .Gesamtbetrag_Netto_in_Lieferlandwährung - 'clfArchiv.Gesamtbetrag_Brutto_in_Lieferlandwährung = .Gesamtbetrag_Brutto_in_Lieferlandwährung - 'clfArchiv.Darstellwährung_ISO = .Darstellwährung_ISO - 'clfArchiv.Betrag_Service_in_Darstellwährung = .Betrag_Service_in_Darstellwährung - 'clfArchiv.Betrag_Nachlass_in_Darstellwährung = .Betrag_Nachlass_in_Darstellwährung - 'clfArchiv.Gesamtbetrag_Netto_in_Darstellwährung = .Gesamtbetrag_Netto_in_Darstellwährung - 'clfArchiv.Gesamtbetrag_Umsatzsteuer_in_Darstellwährung = .Gesamtbetrag_Umsatzsteuer_in_Darstellwährung - 'clfArchiv.Gesamtbetrag_Brutto_in_Darstellwährung = .Gesamtbetrag_Brutto_in_Darstellwährung - 'clfArchiv.Prägetext_i_d_R_KFZ_Kennzeichen = .Prägetext_i_d_R_KFZ_Kennzeichen - 'clfArchiv.Kunden_Kostenstelle_1 = .Kunden_Kostenstelle_1 - 'clfArchiv.Kartentyp = .Kartentyp - 'clfArchiv.Filler_Feld_35 = .Filler_Feld_35 - 'clfArchiv.Filler_Feld_36 = .Filler_Feld_36 - 'clfArchiv.KZ_Autobahn = .KZ_Autobahn - 'clfArchiv.INFO_Feld = .INFO_Feld - 'clfArchiv.KFZ_Kennzeichen = .KFZ_Kennzeichen - 'clfArchiv.Filler_Feld_40 = .Filler_Feld_40 - 'clfArchiv.Buchungsart = .Buchungsart - 'clfArchiv.Buchungsgrund = .Buchungsgrund - 'clfArchiv.Filler_Feld_43 = .Filler_Feld_43 - 'clfArchiv.Informationsbeleg = .Informationsbeleg - 'clfArchiv.Belegherkunft = .Belegherkunft - 'clfArchiv.Filler_Feld_46 = .Filler_Feld_46 - 'clfArchiv.Einzelpreis_Brutto_in_Lieferlandwährung_mit_4_Nachkommastellen = .Einzelpreis_Brutto_in_Lieferlandwährung_mit_4_Nachkommastellen - 'clfArchiv.Einzelpreis_Netto_in_Lieferlandwährung_mit_4_Nachkommastellen = .Einzelpreis_Netto_in_Lieferlandwährung_mit_4_Nachkommastellen - 'clfArchiv.Rechnungsdatum = .Rechnungsdatum - 'clfArchiv.Umsatzsteuerprozentsatz_informativ = .Umsatzsteuerprozentsatz_informativ - 'clfArchiv.Betrag_Nachlass_in_Lieferlandwährung = .Betrag_Nachlass_in_Lieferlandwährung - 'clfArchiv.Betrag_Service_in_Lieferlandwährung_Umsatzsteuer_informativ = .Betrag_Service_in_Lieferlandwährung_Umsatzsteuer_informativ - 'clfArchiv.Gesamtbetrag_in_Lieferlandwährung_Umsatzsteuer_informativ = .Gesamtbetrag_in_Lieferlandwährung_Umsatzsteuer_informativ - 'clfArchiv.Fälligkeitsdatum = .Fälligkeitsdatum - 'clfArchiv.Zahlungsziel_in_Tagen = .Zahlungsziel_in_Tagen - 'clfArchiv.Zahlungsart = .Zahlungsart - 'clfArchiv.TC_Rechnungsnummer_gegenüber_dem_Nutzer = .TC_Rechnungsnummer_gegenüber_dem_Nutzer - 'clfArchiv.TC_Rechnungsdatum = .TC_Rechnungsdatum - 'clfArchiv.Zahlungszielgruppe = .Zahlungszielgruppe - 'clfArchiv.Kunden_Kostenstelle_2 = .Kunden_Kostenstelle_2 - 'clfArchiv.Lieferzeit = .Lieferzeit - 'clfArchiv.Fremdkartennummer = .Fremdkartennummer - 'clfArchiv.OnBoardUnitID = .OnBoardUnitID - 'clfArchiv.KFZ_Kennzeichen_komprimiert = .KFZ_Kennzeichen_komprimiert - 'clfArchiv.Kartenkategorie = .Kartenkategorie - 'clfArchiv.Rechnungsnummer_pro_Lieferland = .Rechnungsnummer_pro_Lieferland - 'clfArchiv.Autobahnauffahrt = .Autobahnauffahrt - 'clfArchiv.Autobahnausfahrt = .Autobahnausfahrt - 'clfArchiv.Rabattschlüssel_der_französischen_Autobahngesellschaften = .Rabattschlüssel_der_französischen_Autobahngesellschaften - 'clfArchiv.Nummer_Belastungsanzeige = .Nummer_Belastungsanzeige - 'clfArchiv.Betreuungsstelle = .Betreuungsstelle - 'clfArchiv.Filler_Feld_72 = .Filler_Feld_72 - 'clfArchiv.Akzeptanz_Medium = .Akzeptanz_Medium - 'clfArchiv.Steuerkategorie = .Steuerkategorie - 'clfArchiv.UTA_Normalbeleg_ID = .UTA_Normalbeleg_ID - 'clfArchiv.Gebühren_Bescheinigung_von = .Gebühren_Bescheinigung_von - 'clfArchiv.Gebühren_Bescheinigung_bis = .Gebühren_Bescheinigung_bis - 'clfArchiv.Herausgeber_Nutzer_Nummer = .Herausgeber_Nutzer_Nummer - 'clfArchiv.Maßeinheit = .Maßeinheit - 'clfArchiv.Land_der_Akzeptanzstelle = .Land_der_Akzeptanzstelle - 'clfArchiv.Postleitzahl_der_Akzeptanzstelle = .Postleitzahl_der_Akzeptanzstelle - 'clfArchiv.Steuerliches_Lieferland = .Steuerliches_Lieferland - 'clfArchiv.Steuerliche_Produktgruppe = .Steuerliche_Produktgruppe - 'clfArchiv.Leistungsort_verlagerbar = .Leistungsort_verlagerbar - 'clfArchiv.SAVE() - End With Case "90" @@ -1400,6 +1311,12 @@ Public Class cUTA Loop + If Einarbeitung_Lief <> "UTA" Then + Dim ts_total = MDMEinarb.ds_total + MDMEinarb = New cMDMEinarbeitung(Einarbeitung_Lief, MDMEinarb.invoicedate) + MDMEinarb.ds_total = ts_total + End If + MDMEinarb.ds_count += savedTrans MDMEinarb.import_date = Now() MDMEinarb.importfilename = fi.Name diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb index 1dfaac8e..7607e76b 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb @@ -51,7 +51,7 @@ Public Class frmMitarbeitersuche End If - sbMitarbeiter.initSearchBox(Me.FindForm, " [mit_id] ,[mit_username] ,(mit_vname + ' ' + mit_nname ) AS Name , CASE WHEN mit_firma='ALL' THEN mit_firmaHaupt ELSE mit_firma END as Firma, mit_niederlassung as Niederlassung FROM tblMitarbeiter", {"mit_vname", "mit_nname"}, " 1=1 AND mit_gekuendigt=0 AND [mit_TESTonly]=0 AND [mit_pseudoUser]=0 ", "mit_id", "mit_id", "Name", "ADMIN", , 400, 200, {"mit_id", "mit_username"}) + sbMitarbeiter.initSearchBox(Me.FindForm, " [mit_id] ,[mit_username] ,(mit_vname + ' ' + mit_nname ) AS Name , CASE WHEN mit_firma='ALL' THEN mit_firmaHaupt ELSE mit_firma END as Firma, mit_niederlassung as Niederlassung FROM tblMitarbeiter", {"mit_vname", "mit_nname"}, " 1=1 AND mit_gekuendigt=0 AND [mit_TESTonly]=0 AND [mit_pseudoUser]=0 AND isnull([mit_kundenportal], 0) <> 1 ", "mit_id", "mit_id", "Name", "ADMIN", , 400, 200, {"mit_id", "mit_username"}) initMA() End Sub diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb index 5f810dce..31118020 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb @@ -237,7 +237,7 @@ Public Class cMSEAPI Return "FEHLER im TransaktionArray" End If - If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"), onlyBilledTransactions, savedTrans) + If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"), savedTrans,, onlyBilledTransactions) Catch ex As WebException @@ -1214,6 +1214,7 @@ Public Class cMSEAPI If lngRecordCount = 2 Then MDMEinarb.invoicedate = invoiceDate + If MDMEinarb.hasEntry AndAlso MDMEinarb.completed Then Return False End If inv.total_amount_euro = total_amount_euro