mdm-importcheck, IDS-Preise

This commit is contained in:
2025-10-17 17:13:08 +02:00
parent bf9973ab06
commit 1c26105384
6 changed files with 249 additions and 169 deletions

View File

@@ -25,6 +25,7 @@ Partial Class frmMDMDatenverarbetiung
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMDMDatenverarbetiung))
Me.pnl = New System.Windows.Forms.Panel()
Me.cbxIDSmitVerag = New System.Windows.Forms.CheckBox()
Me.Panel5 = New System.Windows.Forms.Panel()
Me.Label5 = New System.Windows.Forms.Label()
Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker()
@@ -33,6 +34,7 @@ Partial Class frmMDMDatenverarbetiung
Me.cbxASFINAGAbgerechnet = New System.Windows.Forms.CheckBox()
Me.cbxTestdaten = New System.Windows.Forms.CheckBox()
Me.Panel4 = New System.Windows.Forms.Panel()
Me.pb_importOK = New System.Windows.Forms.PictureBox()
Me.Label46 = New System.Windows.Forms.Label()
Me.dat_Sum_Bis = New System.Windows.Forms.DateTimePicker()
Me.Label45 = New System.Windows.Forms.Label()
@@ -83,11 +85,11 @@ Partial Class frmMDMDatenverarbetiung
Me.Button2 = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.cbxIDSmitVerag = New System.Windows.Forms.CheckBox()
Me.pnl.SuspendLayout()
Me.Panel5.SuspendLayout()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel4.SuspendLayout()
CType(Me.pb_importOK, System.ComponentModel.ISupportInitialize).BeginInit()
Me.FlowLayoutPanel.SuspendLayout()
Me.Panel1.SuspendLayout()
Me.pnlAsfinag.SuspendLayout()
@@ -101,6 +103,7 @@ Partial Class frmMDMDatenverarbetiung
'
'pnl
'
Me.pnl.Controls.Add(Me.pb_importOK)
Me.pnl.Controls.Add(Me.cbxIDSmitVerag)
Me.pnl.Controls.Add(Me.Panel5)
Me.pnl.Controls.Add(Me.PictureBox5)
@@ -119,6 +122,19 @@ Partial Class frmMDMDatenverarbetiung
Me.pnl.Size = New System.Drawing.Size(1163, 100)
Me.pnl.TabIndex = 1
'
'cbxIDSmitVerag
'
Me.cbxIDSmitVerag.AutoSize = True
Me.cbxIDSmitVerag.Checked = True
Me.cbxIDSmitVerag.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxIDSmitVerag.Location = New System.Drawing.Point(504, 74)
Me.cbxIDSmitVerag.Name = "cbxIDSmitVerag"
Me.cbxIDSmitVerag.Size = New System.Drawing.Size(153, 17)
Me.cbxIDSmitVerag.TabIndex = 131
Me.cbxIDSmitVerag.Text = "Daten mit Verag/Verag360"
Me.cbxIDSmitVerag.UseVisualStyleBackColor = True
Me.cbxIDSmitVerag.Visible = False
'
'Panel5
'
Me.Panel5.Controls.Add(Me.Label5)
@@ -132,7 +148,7 @@ Partial Class frmMDMDatenverarbetiung
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(11, 12)
Me.Label5.Location = New System.Drawing.Point(3, 12)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(113, 13)
Me.Label5.TabIndex = 23
@@ -204,6 +220,17 @@ Partial Class frmMDMDatenverarbetiung
Me.Panel4.Size = New System.Drawing.Size(417, 33)
Me.Panel4.TabIndex = 28
'
'pb_importOK
'
Me.pb_importOK.BackgroundImage = Global.SDL.My.Resources.Resources.ok
Me.pb_importOK.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.pb_importOK.Location = New System.Drawing.Point(81, 42)
Me.pb_importOK.Name = "pb_importOK"
Me.pb_importOK.Size = New System.Drawing.Size(23, 19)
Me.pb_importOK.TabIndex = 53
Me.pb_importOK.TabStop = False
Me.pb_importOK.Visible = False
'
'Label46
'
Me.Label46.AutoSize = True
@@ -797,19 +824,6 @@ Partial Class frmMDMDatenverarbetiung
Me.MyDatagridview1.Size = New System.Drawing.Size(1163, 547)
Me.MyDatagridview1.TabIndex = 0
'
'cbxIDSmitVerag
'
Me.cbxIDSmitVerag.AutoSize = True
Me.cbxIDSmitVerag.Checked = True
Me.cbxIDSmitVerag.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxIDSmitVerag.Location = New System.Drawing.Point(504, 74)
Me.cbxIDSmitVerag.Name = "cbxIDSmitVerag"
Me.cbxIDSmitVerag.Size = New System.Drawing.Size(153, 17)
Me.cbxIDSmitVerag.TabIndex = 131
Me.cbxIDSmitVerag.Text = "Daten mit Verag/Verag360"
Me.cbxIDSmitVerag.UseVisualStyleBackColor = True
Me.cbxIDSmitVerag.Visible = False
'
'frmMDMDatenverarbetiung
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -830,6 +844,7 @@ Partial Class frmMDMDatenverarbetiung
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel4.ResumeLayout(False)
Me.Panel4.PerformLayout()
CType(Me.pb_importOK, System.ComponentModel.ISupportInitialize).EndInit()
Me.FlowLayoutPanel.ResumeLayout(False)
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
@@ -905,4 +920,5 @@ Partial Class frmMDMDatenverarbetiung
Friend WithEvents ContextMenuStrip1 As ContextMenuStrip
Friend WithEvents cbxKopie As CheckBox
Friend WithEvents cbxIDSmitVerag As CheckBox
Friend WithEvents pb_importOK As PictureBox
End Class

View File

@@ -1,7 +1,5 @@
Imports System.Data.OleDb
Imports System.IO
Imports com.sun.xml.internal.rngom
Imports DocumentFormat.OpenXml.Drawing.Diagrams
Imports itextsharp.text.pdf
Imports MDM_Worker
Imports VERAG_PROG_ALLGEMEIN
@@ -76,22 +74,76 @@ Public Class frmMDMDatenverarbetiung
txtAnzahl.Text = ""
txtPruefsummeNetto.Text = ""
Button1.Enabled = True
pb_importOK.Visible = False
Select Case LIEFERANT
Case "PLOSE" : initDgv_PLOSE()
Case "PLOSE" : checkImport(LIEFERANT) : initDgv_PLOSE()
btnDatenLaden.Text = "Daten laden"
Case "UTA" : initDgv_UTA()
Case "UTA" : checkImport(LIEFERANT) : initDgv_UTA()
btnDatenLaden.Text = "Daten laden"
Case "ASFINAG" : initDgv_ASFINAG(cbxASFINAGAbgerechnet.Checked, cbxBelegeerstellt.Checked)
Case "ASFINAG" : checkImport(LIEFERANT) : initDgv_ASFINAG(cbxASFINAGAbgerechnet.Checked, cbxBelegeerstellt.Checked)
btnDatenLaden.Text = "Daten laden"
Case "IDS" : initDgv_IDS()
Case "IDS" : checkImport(LIEFERANT) : initDgv_IDS()
btnDatenLaden.Text = "Daten laden"
Button1.Enabled = False
Case "MSE" : initDgv_MSE()
Case "MSE" : checkImport(LIEFERANT) : initDgv_MSE()
btnDatenLaden.Text = "Daten laden"
End Select
End Sub
Private Sub checkImport(LIEFERANT As String)
'autom Import bei Asfinag, Plose und MSE
'(noch) manueller Import bei UTA (weil immer so spät kommt) und IDS (wegen Nacharbeitung)
pb_importOK.Visible = True
Dim Import_OK As Boolean = False
Dim sqlstr As String = ""
Select Case LIEFERANT
Case "PLOSE"
sqlstr = "SELECT * FROM [VERAG].[dbo].[tblMDMEinarbeitung] where supplier = '" & LIEFERANT & "' and invoicedate between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "'"
Case "ASFINAG"
sqlstr = "SELECT * FROM [VERAG].[dbo].[tblMDMEinarbeitung] where supplier = '" & LIEFERANT & "' and YEAR(invoicedate) = " & Today().Year
Case Else
sqlstr = "SELECT * FROM [VERAG].[dbo].[tblMDMEinarbeitung] where supplier = '" & LIEFERANT & "' and invoicedate ='" & DateTimePicker2.Text & "'"
End Select
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
If dt.Rows.Count > 0 Then
Dim hasImcompleIports As Boolean = dt.AsEnumerable().Any(Function(row) row.Field(Of Boolean)("completed") = False)
If hasImcompleIports Then
pb_importOK.BackgroundImage = SDL.My.Resources.Resources.del
Else
If LIEFERANT = "IDS" Then 'IDS Bedard aktuell noch einer Nachbearbeitung!
Dim nacharbeitungNotCompleted As Boolean = dt.AsEnumerable().Any(Function(row) row.Field(Of Boolean)("nacharbeitung_completed") = False)
If nacharbeitungNotCompleted Then
Import_OK = False
Else
Import_OK = True
End If
Else
Import_OK = True
End If
End If
Else
Import_OK = False
End If
If Import_OK Then
pb_importOK.BackgroundImage = SDL.My.Resources.Resources.ok
Else
pb_importOK.BackgroundImage = SDL.My.Resources.Resources.del
End If
End Sub
Private Sub btnREerstellen_Click_1(sender As Object, e As EventArgs) Handles btnREerstellen.Click
Dim errorTmp = False
@@ -120,7 +172,7 @@ Public Class frmMDMDatenverarbetiung
End If
Case "IDS"
If cbxIDSmitVerag.Checked Then
MsgBox("Abrechnung ohne VERAG/VERAG360 !")
MsgBox("Abrechnung ohne VERAG/VERAG360!")
Exit Sub
End If
showIDSContextMenu()
@@ -1049,6 +1101,7 @@ Public Class frmMDMDatenverarbetiung
cbxASFINAGAbgerechnet.Visible = True
cbxBelegeerstellt.Visible = True
pnlAsfinag.Visible = True
checkImport(LIEFERANT)
Exit Sub
Case "IDS"
Panel5.Visible = True
@@ -4857,4 +4910,5 @@ RabattBerechnen:
Private Sub cbxIDSmitVerag_CheckedChanged(sender As Object, e As EventArgs) Handles cbxIDSmitVerag.CheckedChanged
initDgv_IDS()
End Sub
End Class