From ca55452c6c002a8fa50b0672263eafd3c48ab72f Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Fri, 20 Dec 2024 16:02:58 +0100 Subject: [PATCH] MDM. Zugferd, LeistungenFIBUKonten, USTVA, MSE --- SDL/Fakturierung/cFakturierung.vb | 66 +-- SDL/My Project/AssemblyInfo.vb | 4 +- SDL/USTV/frmMDM_USTVAntrag.Designer.vb | 412 +++++++++--------- SDL/USTV/frmMDM_USTVAntrag.vb | 43 +- SDL/USTV/frmUSTVoffeneAntraege.vb | 32 +- SDL/USTV/usrCntlUSTV.vb | 2 +- .../ustCntlUSTV_AntragPosition.Designer.vb | 4 +- SDL/USTV/ustCntlUSTV_AntragPosition.vb | 42 +- SDL/buchhaltung/frmLeistundenFIBUKonten.vb | 18 +- SDL/frmLogin.vb | 5 + SDL/mdm/frmMDMDatenverarbetiung.vb | 88 +--- .../Classes/cLeistungenBUKonten.vb | 1 - .../Schnittstellen/MSE/cMSEAPI.vb | 7 +- 13 files changed, 330 insertions(+), 394 deletions(-) diff --git a/SDL/Fakturierung/cFakturierung.vb b/SDL/Fakturierung/cFakturierung.vb index 95761de0..9ec8e9a9 100644 --- a/SDL/Fakturierung/cFakturierung.vb +++ b/SDL/Fakturierung/cFakturierung.vb @@ -1,15 +1,8 @@  Imports System.Globalization Imports System.Net -Imports System.Runtime.Serialization -Imports System.Xml -Imports DocumentFormat.OpenXml.Office.CustomUI -Imports GrapeCity.ActiveReports.ReportsCore.Tools -Imports itextsharp.text.pdf Imports Microsoft.Office.Interop Imports VERAG_PROG_ALLGEMEIN -Imports VERAG_PROG_ALLGEMEIN.Spire.Pdf -Imports VERAG_PROG_ALLGEMEIN.Spire.Pdf.Attachments Imports s2industries.ZUGFeRD Imports System.IO @@ -1796,39 +1789,56 @@ Public Class cFakturierung Dim steuerProzent As Double = SQL.DLookup(" isnull([Steuersatz %],0)", "[Steuertabelle] ", "[Steuerschlüssel]='" & checkNull(RECHNUNG.Steuerschlüssel) & "'", "FMZOLL", 0) + Dim steuerProzenFaktor As Double = 0 + If steuerProzent > 0 AndAlso steuerProzent < 1 Then + steuerProzenFaktor = steuerProzent * 100 + End If - desc.SetTotals( - lineTotalAmount:=Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag), 'Summe aller Rechnungspositions-Nettobeträge der Rechnung - chargeTotalAmount:=0, 'Summe aller in der Rechnung enthaltenen Zuschläge der Dokumentenebene - allowanceTotalAmount:=0, 'Summe aller in der Rechnung enthaltenen Abschläge der Dokumenteneben - taxBasisAmount:=Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag + 0 - 0), ' Die Gesamtsumme der Rechnung ohne Umsatzsteuer - taxTotalAmount:=Convert.ToDecimal(RECHNUNG.SteuerpflichtigerGesamtbetrag) * steuerProzent, 'Der Gesamtbetrag der Umsatzsteuer für die Rechnung - grandTotalAmount:=Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag * steuerProzent), 'Der Gesamtbetrag der Rechnung mit Umsatzsteuer - totalPrepaidAmount:=0, 'Die Summe der im Voraus gezahlten Beträge - duePayableAmount:=Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag * steuerProzent), 'Der ausstehende Betrag, um dessen Zahlung gebeten wird. Dieser Betrag ist der Rechnungsgesamtbetrag einschließlich Umsatzsteuer abzüglich des im Voraus gezahlten Betrages.Im Falle einer vollständig beglichenen Rechnung ist dieser Betrag gleich null. Der Betrag kann negativ sein; In diesem Fall schuldet der Verkäufer dem Käufer den Betrag - roundingAmount:=0 'Der Betrag, der dem Rechnungsgesamtbetrag hinzuzufügen ist, um den zu zahlenden Betrag zu runden -) - - Dim lineTotalAmont = RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag - - desc.AddTradePaymentTerms(RECHNUNG.TextZZ, zahlungszieldatum) - + Dim sumNetto = 0 For Each p In RECHNUNG.POSITIONEN Dim tradeLineItemNew As TradeLineItem = desc.AddTradeLineItem( name:=p.LeistungsBez, billedQuantity:=Convert.ToDecimal(p.Anzahl), - unitCode:=QuantityCodes.C62, ' Stück + unitCode:=QuantityCodes.C62, ' immer in Stück netUnitPrice:=Convert.ToDecimal(p.Preis), - grossUnitPrice:=IIf(p.Steuerpflichtig, Convert.ToDecimal(p.Preis * RECHNUNG.Steuersatz_Proz), Convert.ToDecimal(p.Preis)), + grossUnitPrice:=Convert.ToDecimal(p.Preis), categoryCode:=IIf(p.Steuerpflichtig, TaxCategoryCodes.S, TaxCategoryCodes.Z), - taxPercent:=IIf(p.Steuerpflichtig, Convert.ToDecimal(RECHNUNG.Steuersatz_Proz), 0), + taxPercent:=IIf(p.Steuerpflichtig, Convert.ToDecimal(RECHNUNG.Steuersatz_Proz * 100), 0), taxType:=IIf(p.Steuerpflichtig, TaxTypes.VAT, TaxTypes.VAT) ) - + Dim netUnitPrice = Convert.ToDecimal(p.Preis) + Dim grossUnitPrice = IIf(p.Steuerpflichtig, Convert.ToDecimal(p.Preis * (1 + RECHNUNG.Steuersatz_Proz)), Convert.ToDecimal(p.Preis)) + Dim netPricePos = netUnitPrice * Convert.ToDecimal(p.Anzahl) + sumNetto += netPricePos Next + 'Summe aller Rechnungspositions-Nettobeträge der Rechnung + Dim lineTotalAmont = sumNetto + 'Der Gesamtbetrag der Umsatzsteuer für die Rechnung, + Dim taxTotalAmount = IIf(RECHNUNG.SteuerpflichtigerGesamtbetrag <> 0, Math.Round(Convert.ToDecimal(RECHNUNG.SteuerpflichtigerGesamtbetrag) / (100 + steuerProzenFaktor) * steuerProzenFaktor, 2), 0) + ' Die Gesamtsumme der Rechnung ohne Umsatzsteuer ' RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag + 0 - 0 + Dim taxBasisAmount = Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag + 0 - 0 - taxTotalAmount) + 'Der Gesamtbetrag der Rechnung mit Umsatzsteuer + Dim grandTotalAmount = Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag) + 'Der ausstehende Betrag, um dessen Zahlung gebeten wird. Dieser Betrag ist der Rechnungsgesamtbetrag einschließlich Umsatzsteuer abzüglich des im Voraus gezahlten Betrages.Im Falle einer vollständig beglichenen Rechnung ist dieser Betrag gleich null. Der Betrag kann negativ sein; In diesem Fall schuldet der Verkäufer dem Käufer den Betrag + Dim duePayableAmount = Convert.ToDecimal(RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag) + + desc.SetTotals( + lineTotalAmount:=Convert.ToDecimal(lineTotalAmont), + chargeTotalAmount:=0, 'Summe aller in der Rechnung enthaltenen Zuschläge der Dokumentenebene + allowanceTotalAmount:=0, 'Summe aller in der Rechnung enthaltenen Abschläge der Dokumenteneben + taxBasisAmount:=Convert.ToDecimal(taxBasisAmount), + taxTotalAmount:=Convert.ToDecimal(taxTotalAmount), + grandTotalAmount:=Convert.ToDecimal(grandTotalAmount), + totalPrepaidAmount:=0, 'Die Summe der im Voraus gezahlten Beträge + duePayableAmount:=Convert.ToDecimal(duePayableAmount), + roundingAmount:=0 'Der Betrag, der dem Rechnungsgesamtbetrag hinzuzufügen ist, um den zu zahlenden Betrag zu runden +) + + + desc.AddTradePaymentTerms(RECHNUNG.TextZZ, zahlungszieldatum) Dim isReverseCharge = isReverseChargeSumme(FIRMA, RECHNUNG) @@ -1837,7 +1847,7 @@ Public Class cFakturierung End If If RECHNUNG.SteuerpflichtigerGesamtbetrag > 0 Then - desc.AddApplicableTradeTax(Convert.ToDecimal(RECHNUNG.SteuerpflichtigerGesamtbetrag), Convert.ToDecimal(RECHNUNG.Steuersatz_Proz), Convert.ToDecimal(RECHNUNG.SteuerpflichtigerGesamtbetrag * RECHNUNG.Steuersatz_Proz), TaxTypes.VAT, IIf(isReverseCharge, TaxCategoryCodes.AE, TaxCategoryCodes.S)) + desc.AddApplicableTradeTax(Convert.ToDecimal(taxBasisAmount), Convert.ToDecimal(steuerProzenFaktor), Convert.ToDecimal(taxTotalAmount), TaxTypes.VAT, IIf(isReverseCharge, TaxCategoryCodes.AE, TaxCategoryCodes.S)) End If diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index d56af7a4..bc57a485 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/USTV/frmMDM_USTVAntrag.Designer.vb b/SDL/USTV/frmMDM_USTVAntrag.Designer.vb index b1f822f4..7de7a32b 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.Designer.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.Designer.vb @@ -32,6 +32,7 @@ Partial Class frmMDM_USTVAntrag Me.Button1 = New System.Windows.Forms.Button() Me.lbl_EintrageVerarbetiet = New System.Windows.Forms.Label() Me.Panel1 = New System.Windows.Forms.Panel() + Me.lblWarnung = New System.Windows.Forms.Label() Me.KdSearchBox1 = New VERAG_PROG_ALLGEMEIN.KdSearchBox() Me.cboAntragArt = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.lblKdNr = New System.Windows.Forms.Label() @@ -39,6 +40,16 @@ 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.Label11 = New System.Windows.Forms.Label() + Me.txtStNr = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.Label9 = New System.Windows.Forms.Label() + Me.txtVZ = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.txtAbfNr = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.Label8 = New System.Windows.Forms.Label() + Me.cbxFiliale = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.txtBezugsNr = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.cbxWahrung = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.lblWahrung = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() @@ -80,17 +91,6 @@ Partial Class frmMDM_USTVAntrag Me.btnNeuerEintrag = New System.Windows.Forms.Button() Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.lblWarnung = New System.Windows.Forms.Label() - Me.Label2 = New System.Windows.Forms.Label() - Me.txtBezugsNr = New VERAG_PROG_ALLGEMEIN.MyTextBox() - Me.cbxFiliale = New VERAG_PROG_ALLGEMEIN.MyComboBox() - Me.Label4 = New System.Windows.Forms.Label() - Me.Label8 = New System.Windows.Forms.Label() - Me.txtAbfNr = New VERAG_PROG_ALLGEMEIN.MyTextBox() - Me.Label9 = New System.Windows.Forms.Label() - Me.txtVZ = New VERAG_PROG_ALLGEMEIN.MyTextBox() - Me.Label11 = New System.Windows.Forms.Label() - Me.txtStNr = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition() Me.Panel3.SuspendLayout() Me.Panel1.SuspendLayout() @@ -207,6 +207,19 @@ Partial Class frmMDM_USTVAntrag Me.Panel1.Size = New System.Drawing.Size(1454, 177) Me.Panel1.TabIndex = 0 ' + 'lblWarnung + ' + Me.lblWarnung.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.lblWarnung.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.lblWarnung.Cursor = System.Windows.Forms.Cursors.Default + Me.lblWarnung.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold) + Me.lblWarnung.ForeColor = System.Drawing.Color.Red + Me.lblWarnung.Location = New System.Drawing.Point(475, 10) + Me.lblWarnung.Name = "lblWarnung" + Me.lblWarnung.Size = New System.Drawing.Size(183, 18) + Me.lblWarnung.TabIndex = 23 + ' 'KdSearchBox1 ' Me.KdSearchBox1._AlleFirmenCLUSTER = False @@ -330,6 +343,184 @@ Partial Class frmMDM_USTVAntrag Me.Panel8.Size = New System.Drawing.Size(973, 87) Me.Panel8.TabIndex = 19 ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.BackColor = System.Drawing.Color.Transparent + Me.Label11.Cursor = System.Windows.Forms.Cursors.Hand + Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label11.ForeColor = System.Drawing.Color.Black + Me.Label11.Location = New System.Drawing.Point(10, 47) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(74, 17) + Me.Label11.TabIndex = 21 + Me.Label11.Text = "Steuer-Nr:" + ' + 'txtStNr + ' + Me.txtStNr._DateTimeOnly = False + Me.txtStNr._numbersOnly = False + Me.txtStNr._numbersOnlyKommastellen = "" + Me.txtStNr._numbersOnlyTrennzeichen = False + Me.txtStNr._Prozent = False + Me.txtStNr._ShortDateNew = False + Me.txtStNr._ShortDateOnly = False + Me.txtStNr._TimeOnly = False + Me.txtStNr._TimeOnly_Seconds = False + Me.txtStNr._value = "" + Me.txtStNr._Waehrung = False + Me.txtStNr._WaehrungZeichen = False + Me.txtStNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) + Me.txtStNr.ForeColor = System.Drawing.Color.Black + Me.txtStNr.Location = New System.Drawing.Point(101, 44) + Me.txtStNr.MaxLength = 10 + Me.txtStNr.MaxLineLength = -1 + Me.txtStNr.MaxLines_Warning = "" + Me.txtStNr.MaxLines_Warning_Label = Nothing + Me.txtStNr.Name = "txtStNr" + Me.txtStNr.Size = New System.Drawing.Size(100, 23) + Me.txtStNr.TabIndex = 22 + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.BackColor = System.Drawing.Color.Transparent + Me.Label9.Cursor = System.Windows.Forms.Cursors.Hand + Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label9.ForeColor = System.Drawing.Color.Black + Me.Label9.Location = New System.Drawing.Point(815, 44) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(30, 17) + Me.Label9.TabIndex = 19 + Me.Label9.Text = "VZ:" + ' + 'txtVZ + ' + Me.txtVZ._DateTimeOnly = False + Me.txtVZ._numbersOnly = True + Me.txtVZ._numbersOnlyKommastellen = "" + Me.txtVZ._numbersOnlyTrennzeichen = True + Me.txtVZ._Prozent = False + Me.txtVZ._ShortDateNew = False + Me.txtVZ._ShortDateOnly = False + Me.txtVZ._TimeOnly = False + Me.txtVZ._TimeOnly_Seconds = False + Me.txtVZ._value = "" + Me.txtVZ._Waehrung = True + Me.txtVZ._WaehrungZeichen = True + Me.txtVZ.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) + Me.txtVZ.ForeColor = System.Drawing.Color.Black + Me.txtVZ.Location = New System.Drawing.Point(865, 38) + Me.txtVZ.MaxLength = 10 + Me.txtVZ.MaxLineLength = -1 + Me.txtVZ.MaxLines_Warning = "" + Me.txtVZ.MaxLines_Warning_Label = Nothing + Me.txtVZ.Name = "txtVZ" + Me.txtVZ.Size = New System.Drawing.Size(100, 23) + Me.txtVZ.TabIndex = 20 + ' + 'txtAbfNr + ' + Me.txtAbfNr._DateTimeOnly = False + Me.txtAbfNr._numbersOnly = True + Me.txtAbfNr._numbersOnlyKommastellen = "" + Me.txtAbfNr._numbersOnlyTrennzeichen = False + Me.txtAbfNr._Prozent = False + Me.txtAbfNr._ShortDateNew = False + Me.txtAbfNr._ShortDateOnly = False + Me.txtAbfNr._TimeOnly = False + Me.txtAbfNr._TimeOnly_Seconds = False + Me.txtAbfNr._value = "" + Me.txtAbfNr._Waehrung = False + Me.txtAbfNr._WaehrungZeichen = False + Me.txtAbfNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) + Me.txtAbfNr.ForeColor = System.Drawing.Color.Black + Me.txtAbfNr.Location = New System.Drawing.Point(654, 40) + Me.txtAbfNr.MaxLength = 10 + Me.txtAbfNr.MaxLineLength = -1 + Me.txtAbfNr.MaxLines_Warning = "" + Me.txtAbfNr.MaxLines_Warning_Label = Nothing + Me.txtAbfNr.Name = "txtAbfNr" + Me.txtAbfNr.Size = New System.Drawing.Size(146, 23) + Me.txtAbfNr.TabIndex = 18 + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.BackColor = System.Drawing.Color.Transparent + Me.Label8.Cursor = System.Windows.Forms.Cursors.Hand + Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label8.ForeColor = System.Drawing.Color.Black + Me.Label8.Location = New System.Drawing.Point(524, 44) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(112, 17) + Me.Label8.TabIndex = 17 + Me.Label8.Text = "Abfertigungs-Nr:" + ' + 'cbxFiliale + ' + Me.cbxFiliale._allowedValuesFreiText = Nothing + Me.cbxFiliale._allowFreiText = False + Me.cbxFiliale._value = "" + Me.cbxFiliale.DropDownWidth = 120 + Me.cbxFiliale.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.cbxFiliale.FormattingEnabled = True + Me.cbxFiliale.Location = New System.Drawing.Point(429, 39) + Me.cbxFiliale.Name = "cbxFiliale" + Me.cbxFiliale.Size = New System.Drawing.Size(89, 24) + Me.cbxFiliale.TabIndex = 16 + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.BackColor = System.Drawing.Color.Transparent + Me.Label4.Cursor = System.Windows.Forms.Cursors.Hand + Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label4.ForeColor = System.Drawing.Color.Black + Me.Label4.Location = New System.Drawing.Point(363, 44) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(48, 17) + Me.Label4.TabIndex = 15 + Me.Label4.Text = "Filiale:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.BackColor = System.Drawing.Color.Transparent + Me.Label2.Cursor = System.Windows.Forms.Cursors.Hand + Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label2.ForeColor = System.Drawing.Color.Black + Me.Label2.Location = New System.Drawing.Point(524, 13) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(111, 17) + Me.Label2.TabIndex = 13 + Me.Label2.Text = "Bezugs/Pos-Nr.:" + ' + 'txtBezugsNr + ' + Me.txtBezugsNr._DateTimeOnly = False + Me.txtBezugsNr._numbersOnly = True + Me.txtBezugsNr._numbersOnlyKommastellen = "" + Me.txtBezugsNr._numbersOnlyTrennzeichen = False + Me.txtBezugsNr._Prozent = False + Me.txtBezugsNr._ShortDateNew = False + Me.txtBezugsNr._ShortDateOnly = False + Me.txtBezugsNr._TimeOnly = False + Me.txtBezugsNr._TimeOnly_Seconds = False + Me.txtBezugsNr._value = "" + Me.txtBezugsNr._Waehrung = False + Me.txtBezugsNr._WaehrungZeichen = False + Me.txtBezugsNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) + Me.txtBezugsNr.ForeColor = System.Drawing.Color.Black + Me.txtBezugsNr.Location = New System.Drawing.Point(654, 9) + Me.txtBezugsNr.MaxLength = 10 + Me.txtBezugsNr.MaxLineLength = -1 + Me.txtBezugsNr.MaxLines_Warning = "" + Me.txtBezugsNr.MaxLines_Warning_Label = Nothing + Me.txtBezugsNr.Name = "txtBezugsNr" + Me.txtBezugsNr.Size = New System.Drawing.Size(146, 23) + Me.txtBezugsNr.TabIndex = 14 + ' 'cbxWahrung ' Me.cbxWahrung._allowedValuesFreiText = Nothing @@ -424,7 +615,7 @@ Partial Class frmMDM_USTVAntrag Me.txtVon._DateTimeOnly = False Me.txtVon._numbersOnly = False Me.txtVon._numbersOnlyKommastellen = "" - Me.txtVon._numbersOnlyTrennzeichen = True + Me.txtVon._numbersOnlyTrennzeichen = False Me.txtVon._Prozent = False Me.txtVon._ShortDateNew = True Me.txtVon._ShortDateOnly = False @@ -432,7 +623,7 @@ Partial Class frmMDM_USTVAntrag Me.txtVon._TimeOnly_Seconds = False Me.txtVon._value = "" Me.txtVon._Waehrung = False - Me.txtVon._WaehrungZeichen = True + Me.txtVon._WaehrungZeichen = False Me.txtVon.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) Me.txtVon.ForeColor = System.Drawing.Color.Black Me.txtVon.Location = New System.Drawing.Point(101, 10) @@ -449,7 +640,7 @@ Partial Class frmMDM_USTVAntrag Me.txtBis._DateTimeOnly = False Me.txtBis._numbersOnly = False Me.txtBis._numbersOnlyKommastellen = "" - Me.txtBis._numbersOnlyTrennzeichen = True + Me.txtBis._numbersOnlyTrennzeichen = False Me.txtBis._Prozent = False Me.txtBis._ShortDateNew = True Me.txtBis._ShortDateOnly = False @@ -457,7 +648,7 @@ Partial Class frmMDM_USTVAntrag Me.txtBis._TimeOnly_Seconds = False Me.txtBis._value = "" Me.txtBis._Waehrung = False - Me.txtBis._WaehrungZeichen = True + Me.txtBis._WaehrungZeichen = False Me.txtBis.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) Me.txtBis.ForeColor = System.Drawing.Color.Black Me.txtBis.Location = New System.Drawing.Point(227, 10) @@ -892,197 +1083,6 @@ Partial Class frmMDM_USTVAntrag Me.ContextMenuStrip2.Name = "ContextMenuStrip1" Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4) ' - 'lblWarnung - ' - Me.lblWarnung.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.lblWarnung.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) - Me.lblWarnung.Cursor = System.Windows.Forms.Cursors.Default - Me.lblWarnung.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold) - Me.lblWarnung.ForeColor = System.Drawing.Color.Red - Me.lblWarnung.Location = New System.Drawing.Point(475, 10) - Me.lblWarnung.Name = "lblWarnung" - Me.lblWarnung.Size = New System.Drawing.Size(183, 18) - Me.lblWarnung.TabIndex = 23 - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.BackColor = System.Drawing.Color.Transparent - Me.Label2.Cursor = System.Windows.Forms.Cursors.Hand - Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label2.ForeColor = System.Drawing.Color.Black - Me.Label2.Location = New System.Drawing.Point(524, 13) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(111, 17) - Me.Label2.TabIndex = 13 - Me.Label2.Text = "Bezugs/Pos-Nr.:" - ' - 'txtBezugsNr - ' - Me.txtBezugsNr._DateTimeOnly = False - Me.txtBezugsNr._numbersOnly = True - Me.txtBezugsNr._numbersOnlyKommastellen = "" - Me.txtBezugsNr._numbersOnlyTrennzeichen = False - Me.txtBezugsNr._Prozent = False - Me.txtBezugsNr._ShortDateNew = False - Me.txtBezugsNr._ShortDateOnly = False - Me.txtBezugsNr._TimeOnly = False - Me.txtBezugsNr._TimeOnly_Seconds = False - Me.txtBezugsNr._value = "" - Me.txtBezugsNr._Waehrung = False - Me.txtBezugsNr._WaehrungZeichen = False - Me.txtBezugsNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtBezugsNr.ForeColor = System.Drawing.Color.Black - Me.txtBezugsNr.Location = New System.Drawing.Point(654, 9) - Me.txtBezugsNr.MaxLength = 10 - Me.txtBezugsNr.MaxLineLength = -1 - Me.txtBezugsNr.MaxLines_Warning = "" - Me.txtBezugsNr.MaxLines_Warning_Label = Nothing - Me.txtBezugsNr.Name = "txtBezugsNr" - Me.txtBezugsNr.Size = New System.Drawing.Size(146, 23) - Me.txtBezugsNr.TabIndex = 14 - ' - 'cbxFiliale - ' - Me.cbxFiliale._allowedValuesFreiText = Nothing - Me.cbxFiliale._allowFreiText = False - Me.cbxFiliale._value = "" - Me.cbxFiliale.DropDownWidth = 120 - Me.cbxFiliale.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.cbxFiliale.FormattingEnabled = True - Me.cbxFiliale.Location = New System.Drawing.Point(429, 39) - Me.cbxFiliale.Name = "cbxFiliale" - Me.cbxFiliale.Size = New System.Drawing.Size(89, 24) - Me.cbxFiliale.TabIndex = 16 - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.BackColor = System.Drawing.Color.Transparent - Me.Label4.Cursor = System.Windows.Forms.Cursors.Hand - Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label4.ForeColor = System.Drawing.Color.Black - Me.Label4.Location = New System.Drawing.Point(363, 44) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(48, 17) - Me.Label4.TabIndex = 15 - Me.Label4.Text = "Filiale:" - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.BackColor = System.Drawing.Color.Transparent - Me.Label8.Cursor = System.Windows.Forms.Cursors.Hand - Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label8.ForeColor = System.Drawing.Color.Black - Me.Label8.Location = New System.Drawing.Point(524, 44) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(112, 17) - Me.Label8.TabIndex = 17 - Me.Label8.Text = "Abfertigungs-Nr:" - ' - 'txtAbfNr - ' - Me.txtAbfNr._DateTimeOnly = False - Me.txtAbfNr._numbersOnly = True - Me.txtAbfNr._numbersOnlyKommastellen = "" - Me.txtAbfNr._numbersOnlyTrennzeichen = False - Me.txtAbfNr._Prozent = False - Me.txtAbfNr._ShortDateNew = False - Me.txtAbfNr._ShortDateOnly = False - Me.txtAbfNr._TimeOnly = False - Me.txtAbfNr._TimeOnly_Seconds = False - Me.txtAbfNr._value = "" - Me.txtAbfNr._Waehrung = False - Me.txtAbfNr._WaehrungZeichen = False - Me.txtAbfNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtAbfNr.ForeColor = System.Drawing.Color.Black - Me.txtAbfNr.Location = New System.Drawing.Point(654, 40) - Me.txtAbfNr.MaxLength = 10 - Me.txtAbfNr.MaxLineLength = -1 - Me.txtAbfNr.MaxLines_Warning = "" - Me.txtAbfNr.MaxLines_Warning_Label = Nothing - Me.txtAbfNr.Name = "txtAbfNr" - Me.txtAbfNr.Size = New System.Drawing.Size(146, 23) - Me.txtAbfNr.TabIndex = 18 - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.BackColor = System.Drawing.Color.Transparent - Me.Label9.Cursor = System.Windows.Forms.Cursors.Hand - Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label9.ForeColor = System.Drawing.Color.Black - Me.Label9.Location = New System.Drawing.Point(815, 44) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(30, 17) - Me.Label9.TabIndex = 19 - Me.Label9.Text = "VZ:" - ' - 'txtVZ - ' - Me.txtVZ._DateTimeOnly = False - Me.txtVZ._numbersOnly = True - Me.txtVZ._numbersOnlyKommastellen = "" - Me.txtVZ._numbersOnlyTrennzeichen = True - Me.txtVZ._Prozent = False - Me.txtVZ._ShortDateNew = False - Me.txtVZ._ShortDateOnly = False - Me.txtVZ._TimeOnly = False - Me.txtVZ._TimeOnly_Seconds = False - Me.txtVZ._value = "" - Me.txtVZ._Waehrung = True - Me.txtVZ._WaehrungZeichen = True - Me.txtVZ.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtVZ.ForeColor = System.Drawing.Color.Black - Me.txtVZ.Location = New System.Drawing.Point(865, 38) - Me.txtVZ.MaxLength = 10 - Me.txtVZ.MaxLineLength = -1 - Me.txtVZ.MaxLines_Warning = "" - Me.txtVZ.MaxLines_Warning_Label = Nothing - Me.txtVZ.Name = "txtVZ" - Me.txtVZ.Size = New System.Drawing.Size(100, 23) - Me.txtVZ.TabIndex = 20 - ' - 'Label11 - ' - Me.Label11.AutoSize = True - Me.Label11.BackColor = System.Drawing.Color.Transparent - Me.Label11.Cursor = System.Windows.Forms.Cursors.Hand - Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label11.ForeColor = System.Drawing.Color.Black - Me.Label11.Location = New System.Drawing.Point(10, 47) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(74, 17) - Me.Label11.TabIndex = 21 - Me.Label11.Text = "Steuer-Nr:" - ' - 'txtStNr - ' - Me.txtStNr._DateTimeOnly = False - Me.txtStNr._numbersOnly = False - Me.txtStNr._numbersOnlyKommastellen = "" - Me.txtStNr._numbersOnlyTrennzeichen = False - Me.txtStNr._Prozent = False - Me.txtStNr._ShortDateNew = False - Me.txtStNr._ShortDateOnly = False - Me.txtStNr._TimeOnly = False - Me.txtStNr._TimeOnly_Seconds = False - Me.txtStNr._value = "" - Me.txtStNr._Waehrung = False - Me.txtStNr._WaehrungZeichen = False - Me.txtStNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!) - Me.txtStNr.ForeColor = System.Drawing.Color.Black - Me.txtStNr.Location = New System.Drawing.Point(101, 44) - Me.txtStNr.MaxLength = 10 - Me.txtStNr.MaxLineLength = -1 - Me.txtStNr.MaxLines_Warning = "" - Me.txtStNr.MaxLines_Warning_Label = Nothing - Me.txtStNr.Name = "txtStNr" - Me.txtStNr.Size = New System.Drawing.Size(100, 23) - Me.txtStNr.TabIndex = 22 - ' 'UstCntlUSTV_AntragPosition1 ' Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill diff --git a/SDL/USTV/frmMDM_USTVAntrag.vb b/SDL/USTV/frmMDM_USTVAntrag.vb index ef14392d..5ce14afd 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.vb @@ -252,6 +252,7 @@ Public Class frmMDM_USTVAntrag USTV_ANTRAG.UStVAn_Status = cboStatus._value USTV_ANTRAG.UStVAn_AntragArt = cboAntragArt._value USTV_ANTRAG.UStVAn_StatusText = rtbStatusText.Text + USTV_ANTRAG.FilialenNr = cbxFiliale._value If txt3470.Text <> "" AndAlso IsNumeric(txt3470.Text) Then USTV_ANTRAG.UStVAn_3470 = CDbl(txt3470.Text) @@ -265,23 +266,10 @@ Public Class frmMDM_USTVAntrag USTV_ANTRAG.UStVAn_RZBetragVZ = Nothing End If - If txtBezugsNr.Text <> "" Then - USTV_ANTRAG.UStVAn_BezugsNr = txtBezugsNr - Else - USTV_ANTRAG.UStVAn_BezugsNr = "" - End If + USTV_ANTRAG.UStVAn_BezugsNr = txtBezugsNr.Text + USTV_ANTRAG.AbfertigungsNr = txtAbfNr.Text - If txtAbfNr.Text <> "" Then - USTV_ANTRAG.AbfertigungsNr = txtAbfNr - Else - USTV_ANTRAG.AbfertigungsNr = "" - End If - If txtAbfNr.Text <> "" Then - USTV_ANTRAG.AbfertigungsNr = txtAbfNr - Else - USTV_ANTRAG.AbfertigungsNr = "" - End If If ADR IsNot Nothing Then @@ -300,7 +288,6 @@ Public Class frmMDM_USTVAntrag USTV_ANTRAG.UStVAn_BLZ = FIRMA.Firma_BLZ1 USTV_ANTRAG.UStVAn_KTO = FIRMA.Firma_KTO1 - 'fallback laut FM-ZOLL If USTV_ANTRAG.UStVAn_Kontoinhaber Is Nothing Then USTV_ANTRAG.UStVAn_Kontoinhaber = "VERAG 360 GmbH; 4975 Suben" If USTV_ANTRAG.UStVAn_Bankverbindung Is Nothing Then USTV_ANTRAG.UStVAn_Bankverbindung = "Raiba Suben" @@ -310,9 +297,9 @@ Public Class frmMDM_USTVAntrag If USTV_ANTRAG.UStVAn_Erklärung_9_a Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_a = "Warentransport" If USTV_ANTRAG.UStVAn_Ausstellungsort Is Nothing Then USTV_ANTRAG.UStVAn_Ausstellungsort = "Suben" - If USTV_ANTRAG.UStVAn_Erklärung_9_b_1 Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_b_1 = 0 - If USTV_ANTRAG.UStVAn_Erklärung_9_b_2 Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_b_2 = 0 - If USTV_ANTRAG.UStVAn_Erklärung_9_b_3 Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_b_3 = 0 + If USTV_ANTRAG.UStVAn_Erklärung_9_b_1 Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_b_1 = False + If USTV_ANTRAG.UStVAn_Erklärung_9_b_2 Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_b_2 = False + If USTV_ANTRAG.UStVAn_Erklärung_9_b_3 Is Nothing Then USTV_ANTRAG.UStVAn_Erklärung_9_b_3 = False End If @@ -761,14 +748,12 @@ Public Class frmMDM_USTVAntrag Dim umrechKurs As Double = 1 If (CDbl(r.Item("rmc_betragBrutto")) > 0 AndAlso CDbl(r.Item("rmc_euroBrutto")) > 0) Then - Dim eur As Double = CDbl(r.Item("rmc_euroBrutto")) - Dim frmdw As Double = CDbl(r.Item("rmc_betragBrutto")) + Dim UST_EUR As Double = CDbl(r.Item("rmc_euroBrutto")) + Dim UST_org As Double = CDbl(r.Item("rmc_betragBrutto")) 'umrechKurs = frmdw / eur - umrechKurs = (frmdw / eur * 100 + 0.5) / 100 - - + umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100 End If @@ -803,8 +788,6 @@ Public Class frmMDM_USTVAntrag If GET_Antraege Then - Return True - For Each r As DataRow In dt.Rows Dim kdNr = r.Item("customer_id") @@ -834,7 +817,8 @@ Public Class frmMDM_USTVAntrag If (UST_EUR > 0 AndAlso UST_org > 0 AndAlso UST_org <> UST_EUR) Then 'umrechKurs = UST_org / UST_EUR - umrechKurs = (UST_org / UST_EUR * 100 + 0.5) / 100 + + umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100 End If @@ -898,7 +882,8 @@ Public Class frmMDM_USTVAntrag If (UST_org > 0 AndAlso UST_org <> UST_EUR) Then - umrechKurs = (UST_org / UST_EUR * 100 + 0.5) / 100 + + umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100 End If @@ -967,7 +952,7 @@ Public Class frmMDM_USTVAntrag End If If (UST_org > 0 AndAlso UST_org <> UST_EUR) Then - umrechKurs = (UST_org / UST_EUR * 100 + 0.5) / 100 + umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100 End If diff --git a/SDL/USTV/frmUSTVoffeneAntraege.vb b/SDL/USTV/frmUSTVoffeneAntraege.vb index 7d517eed..5e971318 100644 --- a/SDL/USTV/frmUSTVoffeneAntraege.vb +++ b/SDL/USTV/frmUSTVoffeneAntraege.vb @@ -97,7 +97,7 @@ Public Class frmUSTVoffeneAntraege INNER JOIN [tblPLOSE_Produktbeschreibung] ON [plp_ProductCode]=[plose_ProduktCode] WHERE plose_Archiv <> 1 AND plose_LieferantCode IN (0,1,7) AND cast(plose_RechnungsDatum as date) between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "' and plose_RechnungsNr is not null " & sqlwhere & "group by plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_RechnungsDatum],[plose_RechnungsNr],[plose_Lieferant], plp_Land - having sum(plose_MWSTBetrag)>0", "FMZOLL") + having sum(plose_MWSTBetrag) <>0", "FMZOLL") .LOAD() If .Columns.Count > 0 Then @@ -146,7 +146,7 @@ Public Class frmUSTVoffeneAntraege 'MsgBox(.sql) Dim sqlstring = "Select " & top & " [rmc_kdNr], [rmc_kdName], [rmc_landKZ], [rmc_reDatum], [rmc_reNr], [rmc_waehrung], [rmc_betragMWST],rmc_daid as daId FROM [tblRMCImport] where cast(rmc_reDatum As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And rmc_archiv <> 1 " & sqlwhere & - "group by rmc_reDatum, rmc_kdNr,[rmc_kdName], [rmc_landKZ],[rmc_reNr], [rmc_waehrung], [rmc_betragMWST], rmc_daid having [rmc_betragMWST] > 0" + "group by rmc_reDatum, rmc_kdNr,[rmc_kdName], [rmc_landKZ],[rmc_reNr], [rmc_waehrung], [rmc_betragMWST], rmc_daid having [rmc_betragMWST] <> 0" .SET_SQL(sqlstring, "FMZOLL") .LOAD() @@ -206,8 +206,8 @@ Public Class frmUSTVoffeneAntraege 'Exit Sub 'MsgBox(.sql) Dim sqlstring = "Select " & top & " customer_number, customer_name, country, invoice_date, invoice_id, sum(total_amount_euro) as total_amount_euro, sum(total_vat_amount_euro) as total_vat_amount_euro, daId FROM [VERAG].[dbo].[tblMSEInvoices] inner join [tblMSECustomers] on [customer_number] = [customer_id] - where cast(invoice_date As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And imported <> 1 " & sqlwhere & - "group by invoice_date, customer_number,customer_name, country, invoice_id, daId " + where cast(invoice_date As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And [UStVAn_ID] is null " & sqlwhere & + "group by invoice_date, customer_number,customer_name, country, invoice_id, daId having sum(total_vat_amount_euro) <> 0" .SET_SQL(sqlstring, "FMZOLL") .LOAD() @@ -272,8 +272,8 @@ Public Class frmUSTVoffeneAntraege Dim sqlstring = "Select " & top & " [Kundennummer],Adressen.[Name 1], [Lieferland_ISO2], [Rechnungsdatum], [Abrechnungsnummer], sum([Gesamtbetrag_Brutto_in_Darstellwährung]) as [Gesamtbetrag_Brutto_in_Darstellwährung], sum([Gesamtbetrag_Umsatzsteuer_in_Darstellwährung]) as [Gesamtbetrag_Umsatzsteuer_in_Darstellwährung], daId FROM [tblUTAImportNew] INNER JOIN Adressen on Adressen.UTAKundenNr = tblUTAImportNew.Kundennummer - where cast([Rechnungsdatum] As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And [archiv] <> 1 " & sqlwhere & - " group by Kundennummer,Adressen.[Name 1],[Rechnungsdatum], [Lieferland_ISO2], [Abrechnungsnummer], daId " + where cast([Rechnungsdatum] As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And [tblUTAImportNew].UStVAn_ID is null " & sqlwhere & + " group by Kundennummer,Adressen.[Name 1],[Rechnungsdatum], [Lieferland_ISO2], [Abrechnungsnummer], daId having sum([Gesamtbetrag_Umsatzsteuer_in_Darstellwährung]) <> 0 " .SET_SQL(sqlstring, "FMZOLL") .LOAD() @@ -422,9 +422,9 @@ Public Class frmUSTVoffeneAntraege Dim sqlwhereSteuerNr = "" If kdnr > 0 Then - sqlwherePLOSE &= " and plose_POLSEKundennummer = " & kdnr - sqlwhereIDS &= " and tblIDSTransactionsNew.KdNrVERAG = " & kdnr - sqlwhereUTA &= " and Kundennummer = " & kdnr + sqlwherePLOSE &= " and AdressenNr = " & kdnr 'sqlwherePLOSE &= " and plose_POLSEKundennummer = " & kdnr + sqlwhereIDS &= " and AdressenNr = " & kdnr 'sqlwhereIDS &= " and tblIDSTransactionsNew.KdNrVERAG = " & kdnr + sqlwhereUTA &= " and AdressenNr = " & kdnr sqlwhereRMC &= " and rmc_kdNr = " & kdnr sqlwhereMSE &= " and partner_customer_number = " & kdnr End If @@ -446,7 +446,7 @@ Public Class frmUSTVoffeneAntraege .Columns.Clear() 'Exit Sub 'MsgBox(.sql) - Dim sqlstring = "select isnull(UStVAn_ID,0) as antragExisitiert,tblSteuernummern.UStV as SteuerNr , KdNr, Kundenname, Land from ( select " & top & " + Dim sqlstring = "select isnull(UStVAn_ID,0) as antragExisitiert,tblSteuernummern.UStV as SteuerNr,Lieferant , KdNr, Kundenname, Land from ( select " & top & " 'PLOSE' as Lieferant, plose_POLSEKundennummer as KdNr, Adressen.[Name 1] as Kundenname, @@ -459,7 +459,7 @@ Public Class frmUSTVoffeneAntraege WHERE plose_Archiv <> 1 AND plose_LieferantCode IN (0,1,7) AND cast(plose_RechnungsDatum as date) between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "' and plose_RechnungsNr is not null " & sqlwherePLOSE & " group by plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_RechnungsDatum],plp_Land - having sum(plose_MWSTBetrag)>0 + having sum(plose_MWSTBetrag)<>0 UNION ALL @@ -474,7 +474,7 @@ Public Class frmUSTVoffeneAntraege where cast(rmc_reDatum As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And UStVAn_ID is null " & sqlwhereRMC & " group by rmc_reDatum, rmc_kdNr,[rmc_kdName], [rmc_landKZ],[rmc_reNr], [rmc_betragMWST] - having [rmc_betragMWST] > 0 + having [rmc_betragMWST] <> 0 UNION ALL @@ -487,8 +487,8 @@ Public Class frmUSTVoffeneAntraege sum([Gesamtbetrag_Umsatzsteuer_in_Darstellwährung]) as MWSt FROM [tblUTAImportNew] INNER JOIN Adressen on Adressen.UTAKundenNr = tblUTAImportNew.Kundennummer - where cast([Rechnungsdatum] As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And [tblUTAImportNew].UStVAn_ID is null - " & sqlwhereUTA & "group by Adressen.AdressenNr, Kundennummer,Adressen.[Name 1],[Rechnungsdatum], [Lieferland_ISO2] + where cast([Rechnungsdatum] As Date) between '" & dat_Sum_Von.Value & "' And '" & dat_Sum_Bis.Value & "' And [tblUTAImportNew].UStVAn_ID is null + " & sqlwhereUTA & "group by Adressen.AdressenNr, Kundennummer,Adressen.[Name 1],[Rechnungsdatum], [Lieferland_ISO2] having sum([Gesamtbetrag_Umsatzsteuer_in_Darstellwährung]) <> 0 UNION ALL @@ -506,7 +506,7 @@ Public Class frmUSTVoffeneAntraege And [UStVAn_ID] is null " & sqlwhereMSE & " - group by invoice_date, partner_customer_number,customer_name, country + group by invoice_date, partner_customer_number,customer_name, country having sum(total_vat_amount_euro) <> 0 UNION ALL @@ -540,7 +540,7 @@ Public Class frmUSTVoffeneAntraege left join tblUStVAntrag on UStVAn_KuNr = temp.kdnr and UStVAn_ReDatVon <= temp.Rechnungsdatum and UStVAn_ReDatBis >= temp.Rechnungsdatum left JOIN tblSteuernummern On temp.Land = tblSteuernummern.LandKz and KdNr = tblSteuernummern.AdressenNr where 1 = 1 and isnull(kde_keineMWSt,0) = 0 " & sqlwhereLand & sqlwhereSteuerNr & - " group by isnull(UStVAn_ID,0) , KdNr, Kundenname, Land, tblSteuernummern.UStV" + " group by isnull(UStVAn_ID,0) , Lieferant, KdNr, Kundenname, Land, tblSteuernummern.UStV" .SET_SQL(sqlstring, "FMZOLL") .LOAD() diff --git a/SDL/USTV/usrCntlUSTV.vb b/SDL/USTV/usrCntlUSTV.vb index e56edb6b..1e3c1805 100644 --- a/SDL/USTV/usrCntlUSTV.vb +++ b/SDL/USTV/usrCntlUSTV.vb @@ -266,7 +266,7 @@ Public Class usrCntlUSTV For i = 0 To 10 cboJahr.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem(Now.Year - i, Now.Year - i)) Next - cboJahr.changeItem(Now.Year - 2) + cboJahr.changeItem(Now.Year - 1) cboJahrBis.Items.Clear() cboJahrBis.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", "")) diff --git a/SDL/USTV/ustCntlUSTV_AntragPosition.Designer.vb b/SDL/USTV/ustCntlUSTV_AntragPosition.Designer.vb index 61143390..24cf697b 100644 --- a/SDL/USTV/ustCntlUSTV_AntragPosition.Designer.vb +++ b/SDL/USTV/ustCntlUSTV_AntragPosition.Designer.vb @@ -424,7 +424,7 @@ Partial Class ustCntlUSTV_AntragPosition Me.txtUSTBetrag._DateTimeOnly = False Me.txtUSTBetrag._numbersOnly = False Me.txtUSTBetrag._numbersOnlyKommastellen = "" - Me.txtUSTBetrag._numbersOnlyTrennzeichen = True + Me.txtUSTBetrag._numbersOnlyTrennzeichen = False Me.txtUSTBetrag._Prozent = False Me.txtUSTBetrag._ShortDateNew = False Me.txtUSTBetrag._ShortDateOnly = False @@ -492,7 +492,7 @@ Partial Class ustCntlUSTV_AntragPosition Me.txtUSTBetragEUR._DateTimeOnly = False Me.txtUSTBetragEUR._numbersOnly = False Me.txtUSTBetragEUR._numbersOnlyKommastellen = "" - Me.txtUSTBetragEUR._numbersOnlyTrennzeichen = True + Me.txtUSTBetragEUR._numbersOnlyTrennzeichen = False Me.txtUSTBetragEUR._Prozent = False Me.txtUSTBetragEUR._ShortDateNew = False Me.txtUSTBetragEUR._ShortDateOnly = False diff --git a/SDL/USTV/ustCntlUSTV_AntragPosition.vb b/SDL/USTV/ustCntlUSTV_AntragPosition.vb index c7a0ff32..2820f568 100644 --- a/SDL/USTV/ustCntlUSTV_AntragPosition.vb +++ b/SDL/USTV/ustCntlUSTV_AntragPosition.vb @@ -1,9 +1,4 @@ - - - -Imports GrapeCity.ActiveReports.ReportsCore.Tools -Imports GrapeCity.DataVisualization.TypeScript -Imports VERAG_PROG_ALLGEMEIN +Imports VERAG_PROG_ALLGEMEIN Public Class ustCntlUSTV_AntragPosition Public UStV_POS As VERAG_PROG_ALLGEMEIN.cUStVPositionen = Nothing @@ -171,12 +166,15 @@ Public Class ustCntlUSTV_AntragPosition If sender Is cboLeistungsgeber AndAlso cboLeistungsgeber.SelectedItem <> "" Then UStV_POS.UStVPo_Leistender = cboLeistungsgeber.SelectedItem values_changed() + Else txtChanged = True End If - End If + + + End Sub Private Sub txtRgDatum_KeyUp(sender As Object, e As KeyEventArgs) Handles txtRgDatum.KeyUp, txtRgNr.KeyUp, txtUSTBetrag.KeyUp, txtUmrechnungskurs.KeyUp, txtUSTBetragEUR.KeyUp @@ -184,18 +182,36 @@ Public Class ustCntlUSTV_AntragPosition If Not VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MDM_USTVA_bearbeiten", Me.FindForm) Then Exit Sub If gridAktiv And Me.FindForm IsNot Nothing Then - If e.KeyValue = 9 Then - e.SuppressKeyPress = True - If txtChanged Then - values_changed() - txtChanged = False + If sender Is txtUSTBetrag Then + + If IsNumeric(txtUSTBetrag._value) AndAlso IsNumeric(txtUmrechnungskurs._value) Then + txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag._value / txtUmrechnungskurs._value) * 100 + 0.5) / 100 + 'values_changed() End If + ElseIf sender Is txtUSTBetragEUR Then + If IsNumeric(txtUSTBetragEUR._value) AndAlso IsNumeric(txtUmrechnungskurs._value) AndAlso txtUmrechnungskurs._value <> 1 Then + txtUSTBetrag.Text = Math.Floor((txtUSTBetragEUR._value * txtUmrechnungskurs._value) * 100 + 0.5) / 100 + 'values_changed() + End If End If - End If + + + If e.KeyValue = 9 Then + + e.SuppressKeyPress = True + If txtChanged Then + values_changed() + txtChanged = False + End If + + + End If + + End If End Sub diff --git a/SDL/buchhaltung/frmLeistundenFIBUKonten.vb b/SDL/buchhaltung/frmLeistundenFIBUKonten.vb index 959187cc..3fd42268 100644 --- a/SDL/buchhaltung/frmLeistundenFIBUKonten.vb +++ b/SDL/buchhaltung/frmLeistundenFIBUKonten.vb @@ -144,14 +144,14 @@ Public Class frmLeistundenFIBUKonten If checkIfFirmaIsFilled(False) = False Then Return False - For Each row As DataGridViewRow In dgvSachkonten.Rows - If Not IsDBNull(row.Cells("LeistungsNr").Value) AndAlso Not IsDBNull(row.Cells("Firma_ID").Value) Then - If row.Cells("LeistungsNr").Value = LeistungsNrID AndAlso row.Cells("Firma_ID").Value = cbxFirma._value Then - Return False - End If - End If + 'For Each row As DataGridViewRow In dgvSachkonten.Rows + ' If Not IsDBNull(row.Cells("LeistungsNr").Value) AndAlso Not IsDBNull(row.Cells("Firma_ID").Value) Then + ' If row.Cells("LeistungsNr").Value = LeistungsNrID AndAlso row.Cells("Firma_ID").Value = cbxFirma._value Then + ' Return False + ' End If + ' End If - Next + 'Next Return True @@ -216,11 +216,11 @@ Public Class frmLeistundenFIBUKonten End Sub - Private Sub cbxFirma_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxFirma.SelectedValueChanged + Private Sub cbxFirma_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxFirma.SelectedValueChanged, cbxLeistungSelected.SelectedValueChanged Try dgvSachkonten.GetOrder() - initDGVSachkonten(IIf(cbxFirma._value <> "", cbxFirma._value, -1), txtSuche.Text) + initDGVSachkonten(IIf(cbxFirma._value <> "", cbxFirma._value, -1), txtSuche.Text, IIf(cbxLeistungSelected._value <> "", cbxLeistungSelected._value, 0)) dgvSachkonten.SetOrder() Catch ex As Exception diff --git a/SDL/frmLogin.vb b/SDL/frmLogin.vb index 72b38848..592a4a4b 100644 --- a/SDL/frmLogin.vb +++ b/SDL/frmLogin.vb @@ -13,6 +13,11 @@ Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click + If AppDomain.CurrentDomain.BaseDirectory.ToString.StartsWith("\\") Then + MsgBox("SDL kann nur lokal gestartet werden." & vbNewLine & "Bei Fragen bitte an die EDV wenden.") + Exit Sub + End If + If SDL.checkLogin(txtUser.Text, txtPwd.Text, "SDL") Then 'XXXXXX Or true If VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_PasswortChanged Is Nothing Then Dim f As New frmChangePWD(VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER) diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index c8c5d9f4..a67da79d 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -2783,7 +2783,7 @@ Public Class frmMDMDatenverarbetiung sqlstr &= " SELECT Adressen.AdressenNr, Adressen.[Name 1], Adressen.[Name 2], Adressen.Straße, Adressen.LandKz, Adressen.PLZ, Adressen.Ort, Adressen.UstIdKz, Adressen.UstIdNr, tblIDSTransactionsNew.[CustomerCode], " & sqlSelect & ", tbl_IDS_Produkte.ProductDescription, tbl_IDS_Länder.Steuersatz, tblIDSTransactionsNew.Rechenwert, tblIDSTransactionsNew.Kz, Sum(tblIDSTransactionsNew.[TransactionVolume]) AS Liter, Sum(tblIDSTransactionsNew.[TotalNetAmount]) AS Nettobetrag, Sum(tblIDSTransactionsNew.[VATAmount]) AS Steuerbetrag, Sum([TotalNetAmount])/Sum([TransactionVolume]) AS NettopreisProLiter, Sum(tblIDSTransactionsNew.Rabattbetrag) AS [SummevonRabattbetrag], Sum([Rabattbetrag])/Sum([TransactionVolume]) AS RabattbetragProLiter FROM ((tblIDSTransactionsNew INNER JOIN tbl_IDS_Länder ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode) INNER JOIN tbl_IDS_Produkte ON tblIDSTransactionsNew.[ProductTypeCode] = tbl_IDS_Produkte.ProductTypeCode) INNER JOIN Adressen ON tblIDSTransactionsNew.KdNrVERAG = Adressen.AdressenNr - WHERE tblIDSTransactionsNew.KdNrVERAG = " & KdNr & sqlWhere & " + WHERE cast(tblIDSTransactionsNew.YearMonthDay as Date) = '" & DateTimePicker2.Text & "' AND tblIDSTransactionsNew.KdNrVERAG = " & KdNr & sqlWhere & " GROUP BY Adressen.AdressenNr, Adressen.[Name 1], Adressen.[Name 2], Adressen.Straße, Adressen.LandKz, Adressen.PLZ, Adressen.Ort, Adressen.UstIdKz, Adressen.UstIdNr, tblIDSTransactionsNew.[CustomerCode], " & sqlGroup & ", tbl_IDS_Produkte.ProductDescription, tbl_IDS_Länder.Steuersatz, tblIDSTransactionsNew.Rechenwert, tblIDSTransactionsNew.Kz; " @@ -3467,8 +3467,6 @@ Public Class frmMDMDatenverarbetiung Case "UTA" - useNettogesamtbetrag = False - sqlstr = " SELECT Adressen.AdressenNr, Adressen.[Name 1], Adressen.LandKz, Adressen.Ort,Offertenpositionen.OffertenNr, Offertenpositionen.LeistungsNr, Offertenpositionen.LeistungsBez, sum(tblUTAImportNew.Gesamtbetrag_Netto_in_Darstellwährung) as Netto ,sum(tblUTAImportNew.Gesamtbetrag_Brutto_in_Darstellwährung) as Brutto /*,tblUTAFakturierwarenarten.Warenart, tblUTAImportNew.Fakturierwarenart*/ FROM tblUTAFakturierwarenarten INNER JOIN (((Adressen INNER JOIN tblUTAImportNew ON Adressen.UTAKundenNr = tblUTAImportNew.Kundennummer) @@ -3497,11 +3495,9 @@ Public Class frmMDMDatenverarbetiung Case "MSE" - useNettogesamtbetrag = False - 'alles steuerfrei also Brutto = Netto sqlstr = "select customer_id, LeistungsNr, sum(Netto) as Netto, Sum (Brutto) as Brutto, Sum (UST) as UST from (select cust.[customer_id], trans.device_product_type, Offertenpositionen.LeistungsNr , case when trans.device_product_type like '%System Fee' then sum(msts_fee_amount) + sum(transaction_gross_amount) - else sum(transaction_gross_amount) End as Netto, + else sum(transaction_net_amount) End as Netto, case when trans.device_product_type like '%System Fee' then sum(msts_fee_amount) + sum(transaction_gross_amount) else sum(transaction_gross_amount) End as Brutto, sum(USteuer_EUR) as UST @@ -3517,7 +3513,6 @@ Public Class frmMDMDatenverarbetiung For Each r In dt.Rows - Dim NettoBetrag As Double = r("Netto") Dim BruttoBetrag As Double = r("Brutto") Dim UstBetrag As Double = r("UST") @@ -3531,7 +3526,6 @@ Public Class frmMDMDatenverarbetiung Case "IDS", "IDS_AT" - useNettogesamtbetrag = False Dim sqlWhere = " and tblIDSTransactionsNew.OutletCountryCode" sqlWhere &= IIf(Lieferant = "IDS", "<>740543", "=740543") @@ -3580,84 +3574,10 @@ Public Class frmMDMDatenverarbetiung Dim LeistungsBez As String = r("LeistungsBez") Dim OFFERTE As New VERAG_PROG_ALLGEMEIN.cOfferte(KdNr, OffertenNr, True) - allPos(RG, OFFERTE, LeistungsNr, NettoBetrag, BruttoBetrag - Rabatt, UstBetrag, LeistungsBez) 'bei IDS muss ebenfalls die LeistungsBez korrekt sein! + allPos(RG, OFFERTE, LeistungsNr, NettoBetrag, BruttoBetrag - Rabatt, UstBetrag, LeistungsBez) 'bei IDS muss ebenfalls die LeistungsBez ident sein! Next - ' Case 17 'Diesel IDS - '5970 Set qryOffPos = dbs.QueryDefs("qryIDSDieselofferte17") - '5980 qryOffPos.Parameters("[Bitte Kundennummer eingeben:]") = rstRK![RechnungsKundenNr] - '5990 Set rstOffPos = qryOffPos.OpenRecordset(dbOpenSnapshot) - '6000 Do Until rstOffPos.EOF - '6010 Set qryRPPKey = dbs.QueryDefs("qryReErfSchRPPKey") ' - '6020 qryRPPKey.Parameters("[prmRK_ID]") = rstRK!RK_ID - '6030 qryRPPKey.Parameters("[prmLeistungsNr]") = rstOffPos!LeistungsNr - '6040 qryRPPKey.Parameters("[prmSteuerpflichtig]") = False - '6050 qryRPPKey.Parameters("[prmLeistungsBez]") = rstOffPos!LeistungsBez - '6060 qryRPPKey.Parameters("[prmIndexZkteing]") = 0 - '6070 Set rstRPPKey = qryRPPKey.OpenRecordset(dbOpenDynaset, dbSeeChanges) ' - '6080 With rstRPPKey - '6090 If .EOF Then - '6100 .AddNew - '6110 !RK_ID = rstRK!RK_ID - '6120 !LeistungsNr = rstOffPos!LeistungsNr - '6130 !steuerpflichtig = False - '6140 !LeistungsBez = rstOffPos!LeistungsBez - '6150 !BerechnungsartNr = rstOffPos!BerechnungsartNr - '6160 Else - '6170 .Edit - '6180 End If - '6190 !Preis = rstOffPos!Bruttobetrag - rstOffPos![Summe von Rabattbetrag] - '6200 !Anzahl = 1 - '6210 .Update - '6220 .Close - '6230 End With - '6240 Set rstRPPKey = Nothing - '6250 rstOffPos.MoveNext - '6260 Loop - '6270 rstOffPos.Close - '6280 Set rstOffPos = Nothing - '6290 qryOffPos.Close - '6300 Set qryOffPos = Nothing - - - ' Case 21 'Diesel IDS AT - '6320 Set qryOffPos = dbs.QueryDefs("qryIDSDieselofferte21") - '6330 qryOffPos.Parameters("[Bitte Kundennummer eingeben:]") = rstRK![RechnungsKundenNr] - '6340 Set rstOffPos = qryOffPos.OpenRecordset(dbOpenSnapshot) - '6350 Do Until rstOffPos.EOF - '6360 Set qryRPPKey = dbs.QueryDefs("qryReErfSchRPPKey") 'Test - '6370 qryRPPKey.Parameters("[prmRK_ID]") = rstRK!RK_ID - '6380 qryRPPKey.Parameters("[prmLeistungsNr]") = rstOffPos!LeistungsNr - '6390 qryRPPKey.Parameters("[prmSteuerpflichtig]") = False - '6400 qryRPPKey.Parameters("[prmLeistungsBez]") = rstOffPos!LeistungsBez - '6410 qryRPPKey.Parameters("[prmIndexZkteing]") = 0 - '6420 Set rstRPPKey = qryRPPKey.OpenRecordset(dbOpenDynaset, dbSeeChanges) 'Test - '6430 With rstRPPKey - '6440 If .EOF Then - '6450 .AddNew - '6460 !RK_ID = rstRK!RK_ID - '6470 !LeistungsNr = rstOffPos!LeistungsNr - '6480 !steuerpflichtig = False - '6490 !LeistungsBez = rstOffPos!LeistungsBez - '6500 !BerechnungsartNr = rstOffPos!BerechnungsartNr - '6510 Else - '6520 .Edit - '6530 End If - '6540 !Preis = rstOffPos!Bruttobetrag - rstOffPos![Summe von Rabattbetrag] - '6550 !Anzahl = 1 - '6560 .Update - '6570 .Close - '6580 End With - '6590 Set rstRPPKey = Nothing - '6600 rstOffPos.MoveNext - '6610 Loop - '6620 rstOffPos.Close - '6630 Set rstOffPos = Nothing - '6640 qryOffPos.Close - '6650 Set qryOffPos = Nothing - - End Select @@ -3705,7 +3625,7 @@ Public Class frmMDMDatenverarbetiung 'POS.Preis = BruttoBetrag POS.Anzahl = 1 POS.Steuerpflichtig = LEISTUNG.Steuerpflichtig - 'Berrechnunggebühr wird immer vom übergebenen Betrag abzüglich UST berechnet (Nettobetrag)! + 'Berrechnunggebühr wird immer vom übergebenen Betrag abzüglich UST berechnet (Nettobetrag), außer bei UTA! POS.BGebBgl = IIf(LIEFERANT = "UTA", BruttoBetrag - UstBetrag, NettoBetrag - UstBetrag) diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cLeistungenBUKonten.vb b/VERAG_PROG_ALLGEMEIN/Classes/cLeistungenBUKonten.vb index 2f25fb5b..688ae0c8 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cLeistungenBUKonten.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cLeistungenBUKonten.vb @@ -9,7 +9,6 @@ Public Class cLeistungenBUKonten Property LeistungsNr As Integer Property Firma_ID As Integer Property Gl_account As Object = Nothing - Property SachkontoInlandSteuerpflichtig As Object = Nothing Property SachkontoInlandSteuerfrei As Object = Nothing Property SachkontoEUSteuerpflichtig As Object = Nothing diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb index df7bc54f..8047fca0 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb @@ -1137,8 +1137,9 @@ Public Class cMSEAPI If transaction.StringOf("transaction_country") = "HU" Then Dim curBruttobetragEUR = R("msts_fee_amount") + R("transaction_gross_amount") Dim steuersatz = SQL.DLookup("1+[Steuersatz]", "[Länderverzeichnis für die Außenhandelsstatistik]", "[LandNr]=64", "FMZOLL") - Dim curNettobetragEUR = CInt(curBruttobetragEUR / steuersatz * 100 + 0.5) / 100 - USteuer_EUR = Math.Round(curBruttobetragEUR - curNettobetragEUR, 2) + + Dim curNettobetragEUR = Math.Floor((curBruttobetragEUR / steuersatz * 100) + 0.5) / 100 + USteuer_EUR = curBruttobetragEUR - curNettobetragEUR End If End If @@ -1376,7 +1377,7 @@ Public Class cMSEAPI cmd.Parameters.AddWithValue("@von", von) cmd.Parameters.AddWithValue("@bis", bis) cmd.Parameters.AddWithValue("@AdressenNr", KundenNr) - If Archiv IsNot Nothing Then cmd.Parameters.AddWithValue("@Archiv", If(Archiv, "=", "<>")) + If Archiv IsNot Nothing Then cmd.Parameters.AddWithValue("@Archiv", If(Archiv, 1, 0)) Dim dr = cmd.ExecuteReader() dt.Load(dr)