Merge branch 'newMaster2024' of https://verag.visualstudio.com/SDL/_git/SDL into newMaster2024
This commit is contained in:
@@ -122,6 +122,8 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
Select Case If(r.Cells("UStVPo_SchnittstellenNr").Value, -1)
|
||||
Case 6, 0 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & r.Cells("UStVPo_ReDat").Value & "' and plInv_SupplierRechnungsNr='" & r.Cells("UStVPo_ReNr").Value & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1)
|
||||
Case 4 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblMSEInvoices] as inv inner join tblMSECustomers on inv.customer_number = customer_id where invoice_date='" & r.Cells("UStVPo_ReDat").Value & "' and country='" & Antrag_LandKz & "' AND partner_customer_number = " & USTV_ANTRAG.UStVAn_KuNr & " AND daId is not null", "FMZOLL",,, -1)
|
||||
Case 5 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblUTAImportNew] where Rechnungsdatum='" & r.Cells("UStVPo_ReDat").Value & "' and Abrechnungsnummer='" & r.Cells("UStVPo_ReNr").Value & "' and Lieferland_ISO2='" & Antrag_LandKz & "' AND daId is not null", "FMZOLL",,, -1)
|
||||
Case 7 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [rmc_daId] FROM [tblRMCImport] where rmc_reDatum='" & r.Cells("UStVPo_ReDat").Value & "' and rmc_reNr='" & r.Cells("UStVPo_ReNr").Value & "' and rmc_landKZ='" & Antrag_LandKz & "' AND [rmc_daId] is not null", "FMZOLL",,, -1)
|
||||
End Select
|
||||
|
||||
@@ -545,16 +547,16 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
For Each r As DataRow In dt.Rows
|
||||
|
||||
Dim kdNr = r.Item("customer_id")
|
||||
Dim kdnr = r.Item("Kundennummer")
|
||||
|
||||
Dim USTV_POS As New VERAG_PROG_ALLGEMEIN.cUStVPositionen
|
||||
USTV_POS.UStVAn_ID = USTV_ANTRAG.[UStVAn_ID]
|
||||
USTV_POS.UStVPo_ID = USTV_ANTRAG.getMaxPosNr
|
||||
USTV_POS.UStVPo_ReDat = r.Item("invoice_date")
|
||||
USTV_POS.UStVPo_ReNr = r.Item("invoice_number") & " - " & kdNr
|
||||
USTV_POS.UStVPo_ReDat = r.Item("Rechnungsdatum")
|
||||
USTV_POS.UStVPo_ReNr = r.Item("Rechnungsnummer")
|
||||
USTV_POS.UStVPo_SchnittstellenNr = bytSchnittstellenNr
|
||||
|
||||
If Not alreadyExists(USTV_ANTRAG.UStVAn_KuNr, USTV_ANTRAG.UStVAn_LandNr, USTV_POS) Then
|
||||
If True Then 'Not alreadyExists(USTV_ANTRAG.UStVAn_KuNr, USTV_ANTRAG.UStVAn_LandNr, USTV_POS) Then
|
||||
|
||||
USTV_POS.UStVPo_Schnittstelle = True
|
||||
USTV_POS.UStVPo_Leistungsbezeichnung = "MAUT, DIESEL oder KFZ-Zubehör"
|
||||
@@ -569,25 +571,26 @@ Public Class frmMDM_USTVAntrag
|
||||
'!UStVPo_USteuerbetragEUR = Int(![UStVPo_USteuerbetrag] / !UStVPo_Umrechnungskurs * 100 + 0.5) / 100
|
||||
|
||||
Dim umrechKurs As Double = 1
|
||||
Dim UST_EUR = CDbl(r.Item("UST_EUR"))
|
||||
Dim UST_org = CDbl(r.Item("UST"))
|
||||
|
||||
If (UST_EUR > 0 AndAlso UST_org > 0 AndAlso UST_org <> UST_EUR) Then
|
||||
Dim UST_org = CDbl(r.Item("Umsatzsteuerbetrag_in_Lieferlandwährung"))
|
||||
Dim UST_EUR = CDbl(r.Item("Umsatzsteuerbetrag_in_Darstellwährung")) 'ist immer EUR
|
||||
|
||||
If (UST_org > 0 AndAlso UST_org <> UST_EUR AndAlso r.Item("Darstellwährung_ISO") = "EUR") Then
|
||||
|
||||
umrechKurs = UST_org / UST_EUR
|
||||
|
||||
End If
|
||||
|
||||
If UST_org > 0 Then
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = UST_EUR 'Math.Round((UST_org / umrechKurs), 2)
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = UST_org 'Math.Round((UST_org / umrechKurs), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = umrechKurs
|
||||
USTV_POS.UStVPo_USteuerbetrag = UST_org
|
||||
End If
|
||||
|
||||
If USTV_POS.INSERT() Then
|
||||
cUTA.UPDATE_ARCHIV(USTV_POS.UStVPo_ReDat, USTV_POS.UStVPo_ReNr, kdNr)
|
||||
cUTA.UPDATE_ARCHIV(USTV_POS.UStVPo_ReDat, USTV_POS.UStVPo_ReNr, kdnr)
|
||||
End If
|
||||
|
||||
'tblUStVPositionen
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
@@ -187,7 +187,7 @@ Public Class frmUSTVoffeneAntraege
|
||||
Dim sqlwhere = ""
|
||||
|
||||
If kdnr > 0 Then
|
||||
sqlwhere &= " and customer_number = " & kdnr
|
||||
sqlwhere &= " and partner_customer_number = " & kdnr
|
||||
End If
|
||||
|
||||
With MyDatagridview1
|
||||
|
||||
36
SDL/USTV/usrCntlUSTV.Designer.vb
generated
36
SDL/USTV/usrCntlUSTV.Designer.vb
generated
@@ -23,11 +23,12 @@ Partial Class usrCntlUSTV
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Me.pnlFilter = New System.Windows.Forms.Panel()
|
||||
Me.dgvUSTV = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.btnKundendatenaktualisieren = New System.Windows.Forms.Button()
|
||||
Me.txtVZBetrag = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.Label8 = New System.Windows.Forms.Label()
|
||||
Me.txt3470Betrag = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
@@ -60,7 +61,6 @@ Partial Class usrCntlUSTV
|
||||
Me.Button8 = New System.Windows.Forms.Button()
|
||||
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.btnKundendatenaktualisieren = New System.Windows.Forms.Button()
|
||||
CType(Me.dgvUSTV, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.Panel1.SuspendLayout()
|
||||
Me.Panel2.SuspendLayout()
|
||||
@@ -82,8 +82,8 @@ Partial Class usrCntlUSTV
|
||||
Me.dgvUSTV.AKTUALISIERUNGS_INTERVALL = -1
|
||||
Me.dgvUSTV.AllowUserToAddRows = False
|
||||
Me.dgvUSTV.AllowUserToDeleteRows = False
|
||||
DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
|
||||
Me.dgvUSTV.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
|
||||
DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
|
||||
Me.dgvUSTV.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
|
||||
Me.dgvUSTV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvUSTV.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.dgvUSTV.Location = New System.Drawing.Point(0, 84)
|
||||
@@ -132,6 +132,19 @@ Partial Class usrCntlUSTV
|
||||
Me.Panel1.Size = New System.Drawing.Size(1627, 84)
|
||||
Me.Panel1.TabIndex = 0
|
||||
'
|
||||
'btnKundendatenaktualisieren
|
||||
'
|
||||
Me.btnKundendatenaktualisieren.Enabled = False
|
||||
Me.btnKundendatenaktualisieren.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.btnKundendatenaktualisieren.ForeColor = System.Drawing.Color.Black
|
||||
Me.btnKundendatenaktualisieren.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnKundendatenaktualisieren.Location = New System.Drawing.Point(1468, 6)
|
||||
Me.btnKundendatenaktualisieren.Name = "btnKundendatenaktualisieren"
|
||||
Me.btnKundendatenaktualisieren.Size = New System.Drawing.Size(127, 39)
|
||||
Me.btnKundendatenaktualisieren.TabIndex = 33
|
||||
Me.btnKundendatenaktualisieren.Text = "Kundendaten aktualisieren"
|
||||
Me.btnKundendatenaktualisieren.UseVisualStyleBackColor = True
|
||||
'
|
||||
'txtVZBetrag
|
||||
'
|
||||
Me.txtVZBetrag._DateTimeOnly = False
|
||||
@@ -557,7 +570,7 @@ Partial Class usrCntlUSTV
|
||||
Me.btnMail.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.btnMail.ForeColor = System.Drawing.Color.Black
|
||||
Me.btnMail.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnMail.Location = New System.Drawing.Point(750, 5)
|
||||
Me.btnMail.Location = New System.Drawing.Point(972, 5)
|
||||
Me.btnMail.Name = "btnMail"
|
||||
Me.btnMail.Size = New System.Drawing.Size(75, 39)
|
||||
Me.btnMail.TabIndex = 25
|
||||
@@ -617,19 +630,6 @@ Partial Class usrCntlUSTV
|
||||
Me.ContextMenuStrip2.Name = "ContextMenuStrip1"
|
||||
Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4)
|
||||
'
|
||||
'btnKundendatenaktualisieren
|
||||
'
|
||||
Me.btnKundendatenaktualisieren.Enabled = False
|
||||
Me.btnKundendatenaktualisieren.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.btnKundendatenaktualisieren.ForeColor = System.Drawing.Color.Black
|
||||
Me.btnKundendatenaktualisieren.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnKundendatenaktualisieren.Location = New System.Drawing.Point(1468, 6)
|
||||
Me.btnKundendatenaktualisieren.Name = "btnKundendatenaktualisieren"
|
||||
Me.btnKundendatenaktualisieren.Size = New System.Drawing.Size(127, 39)
|
||||
Me.btnKundendatenaktualisieren.TabIndex = 33
|
||||
Me.btnKundendatenaktualisieren.Text = "Kundendaten aktualisieren"
|
||||
Me.btnKundendatenaktualisieren.UseVisualStyleBackColor = True
|
||||
'
|
||||
'usrCntlUSTV
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
|
||||
Imports com.sun.org.apache.bcel.internal.generic
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class ustCntlUSTV_AntragPosition
|
||||
@@ -29,8 +30,6 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
|
||||
Sub setValues(kdnr As Integer, UStV_POS As VERAG_PROG_ALLGEMEIN.cUStVPositionen, Antrag_LandKz As String, UStV_Leitender As VERAG_PROG_ALLGEMEIN.cUStVLeistender)
|
||||
|
||||
|
||||
|
||||
gridAktiv = False
|
||||
picSave.Visible = False
|
||||
Me.Antrag_LandKz = Antrag_LandKz
|
||||
@@ -57,11 +56,14 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
Select Case If(UStV_POS.UStVPo_SchnittstellenNr, -1)
|
||||
Case 6, 0 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & UStV_POS.UStVPo_ReDat & "' and plInv_SupplierRechnungsNr='" & UStV_POS.UStVPo_ReNr & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1)
|
||||
Case 7 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [rmc_daId] FROM [tblRMCImport] where rmc_reDatum='" & UStV_POS.UStVPo_ReDat & "' and rmc_reNr='" & UStV_POS.UStVPo_ReNr & "' and rmc_landKZ='" & Antrag_LandKz & "' AND [rmc_daId] is not null", "FMZOLL",,, -1)
|
||||
Case 4 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblMSEInvoices] as inv inner join tblMSECustomers on inv.customer_number = customer_id where invoice_date='" & UStV_POS.UStVPo_ReDat & "' and country='" & Antrag_LandKz & "' AND partner_customer_number = " & kdnr & " AND daId is not null", "FMZOLL",,, -1)
|
||||
Case 5 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblUTAImportNew] where Rechnungsdatum='" & UStV_POS.UStVPo_ReDat & "' and Abrechnungsnummer='" & UStV_POS.UStVPo_ReNr & "' and Lieferland_ISO2='" & Antrag_LandKz & "' AND daId is not null", "FMZOLL",,, -1)
|
||||
|
||||
|
||||
End Select
|
||||
scanSonstiges.INIT_daId(da_id)
|
||||
scanUSTVFABest.INIT(kdnr, "KUNDENDATEN", "FA_Bestaetigungen")
|
||||
scanUSTVVollmachten.INIT(kdnr, "KUNDENDATEN", "USTV_Vollmachten")
|
||||
scanSonstiges.INIT_daId(da_id)
|
||||
scanUSTVFABest.INIT(kdnr, "KUNDENDATEN", "FA_Bestaetigungen")
|
||||
scanUSTVVollmachten.INIT(kdnr, "KUNDENDATEN", "USTV_Vollmachten")
|
||||
|
||||
gridAktiv = True
|
||||
End Sub
|
||||
@@ -73,7 +75,12 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
UStV_POS.UStVPo_Zeitstempel = Now
|
||||
|
||||
|
||||
'TO DO!!!!!
|
||||
'TO DO-> aktuell nur RechnungsNr!!!!!
|
||||
If txtRgNr._value <> "" Then
|
||||
UStV_POS.UStVPo_ReNr = txtRgNr._value
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ustCntlUSTV_AntragPosition_KeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles Me.PreviewKeyDown
|
||||
|
||||
@@ -1182,7 +1182,6 @@ Public Class frmMDMDatenverarbetiung
|
||||
clmns &= dt_CSV_selected.Rows(i)(j).ToString.Replace(";", ", ") & ";"
|
||||
Next
|
||||
outFile.WriteLine(clmns)
|
||||
|
||||
Next
|
||||
outFile.Close()
|
||||
Next
|
||||
|
||||
@@ -1213,10 +1213,12 @@ Public Class cUTA
|
||||
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
|
||||
Using cmd As New SqlCommand("SELECT [tblUTAImportNew].Rechnungsdatum, [tblUTAImportNew].Rechnungsnummer_pro_Lieferland AS Rechnungsnummer, Sum([Gesamtbetrag_Brutto_in_Lieferlandwährung]-[Gesamtbetrag_Netto_in_Lieferlandwährung]) AS Umsatzsteuerbetrag_in_Lieferlandwährung
|
||||
Using cmd As New SqlCommand("SELECT [tblUTAImportNew].Rechnungsdatum, [tblUTAImportNew].Rechnungsnummer_pro_Lieferland AS Rechnungsnummer,Adressen.AdressenNr as Kundennummer,
|
||||
Sum([Gesamtbetrag_Brutto_in_Lieferlandwährung]-[Gesamtbetrag_Netto_in_Lieferlandwährung]) AS Umsatzsteuerbetrag_in_Lieferlandwährung, Lieferlandwährung_ISO,
|
||||
Sum([Gesamtbetrag_Brutto_in_Darstellwährung]-[Gesamtbetrag_Netto_in_Darstellwährung]) AS Umsatzsteuerbetrag_in_Darstellwährung, Darstellwährung_ISO
|
||||
FROM [tblUTAImportNew] INNER JOIN Adressen ON [tblUTAImportNew].Kundennummer = Adressen.UTAKundenNr
|
||||
WHERE ([tblUTAImportNew].Rechnungsdatum Between '" & von.ToShortDateString & "' And '" & bis.ToShortDateString & "' AND [tblUTAImportNew].Lieferland_ISO2='" & LandKZ & "' AND [tblUTAImportNew].Lieferlandwährung_ISO='" & Wahrungscode & "' AND Adressen.AdressenNr=" & KundenNr & " AND abgerechnet = 1)
|
||||
GROUP BY [tblUTAImportNew].Rechnungsdatum, [tblUTAImportNew].Rechnungsnummer_pro_Lieferland
|
||||
GROUP BY [tblUTAImportNew].Rechnungsdatum, [tblUTAImportNew].Rechnungsnummer_pro_Lieferland, Lieferlandwährung_ISO ,Darstellwährung_ISO,Adressen.AdressenNr
|
||||
HAVING (((Sum([Gesamtbetrag_Brutto_in_Lieferlandwährung]-[Gesamtbetrag_Netto_in_Lieferlandwährung]))<>0));", conn)
|
||||
|
||||
cmd.Parameters.AddWithValue("@von", von)
|
||||
@@ -1254,8 +1256,8 @@ Public Class cUTA
|
||||
|
||||
Return SQL.doSQLVarList("
|
||||
|
||||
UPDATE [tblMSEInvoices] set archiv=1, [archiviertDatum]=GETDATE()
|
||||
WHERE cast(invoice_date as date) = @reDat and invoice_id = @reNr and customer_number=@mse_kdNr
|
||||
UPDATE [tblUTAImportNew] set abgerechnet=1, [abgerechnetDatum]=GETDATE()
|
||||
WHERE cast(Rechnungsdatum as date) = @reDat and Rechnungsnummer_pro_Lieferland = @reNr and Kundennummer=@uta_kdNr
|
||||
", "FMZOLL",, list)
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -1019,7 +1019,7 @@ Public Class cMSEAPI
|
||||
|
||||
If r("url") <> "" AndAlso r("name") <> "" AndAlso r("name").contains("VAT") Then 'only VAT-Invoices
|
||||
Dim inv As New cMSEInvoices(r("name"), r("invoice_id"))
|
||||
If IsDBNull(inv.daId) Then 'verhindert unnötige Downloads
|
||||
If inv.daId Is Nothing Then 'verhindert unnötige Downloads
|
||||
Dim filepath = VERAG_PROG_ALLGEMEIN.cFormularManager.getPDFViaSpirePDF_FromURLStream(r("url"), r("name"), PDFRECHNUNGENPFAD, False)
|
||||
If filepath <> "" AndAlso uploadToDs Then
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("MDM", "MDM_DATEN", "MSE", Now.Year, Now.ToString("yyyyMMdd"), r("name"))
|
||||
|
||||
Reference in New Issue
Block a user