Merge branch 'newMaster2024' of https://dev.azure.com/VeragAG/_git/SDL into newMaster2024
This commit is contained in:
26
SDL/mdm/frmMDMDatenverarbetiung.Designer.vb
generated
26
SDL/mdm/frmMDMDatenverarbetiung.Designer.vb
generated
@@ -78,6 +78,8 @@ Partial Class frmMDMDatenverarbetiung
|
||||
Me.txtPruefsummeBrutto = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.txtPruefsummeNetto = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.txtAnzahl = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.pnlIDS = New System.Windows.Forms.Panel()
|
||||
Me.btnRechenwertesetzen = New System.Windows.Forms.Button()
|
||||
Me.pnl.SuspendLayout()
|
||||
Me.Panel5.SuspendLayout()
|
||||
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
@@ -90,6 +92,7 @@ Partial Class frmMDMDatenverarbetiung
|
||||
Me.Panel3.SuspendLayout()
|
||||
Me.Panel2.SuspendLayout()
|
||||
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.pnlIDS.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'pnl
|
||||
@@ -333,6 +336,7 @@ Partial Class frmMDMDatenverarbetiung
|
||||
'
|
||||
'Panel1
|
||||
'
|
||||
Me.Panel1.Controls.Add(Me.pnlIDS)
|
||||
Me.Panel1.Controls.Add(Me.lblTTRSum)
|
||||
Me.Panel1.Controls.Add(Me.txtTTRSum)
|
||||
Me.Panel1.Controls.Add(Me.lblProzPruef)
|
||||
@@ -739,6 +743,25 @@ Partial Class frmMDMDatenverarbetiung
|
||||
Me.txtAnzahl.TabIndex = 35
|
||||
Me.txtAnzahl.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
|
||||
'
|
||||
'pnlIDS
|
||||
'
|
||||
Me.pnlIDS.Controls.Add(Me.btnRechenwertesetzen)
|
||||
Me.pnlIDS.Location = New System.Drawing.Point(616, 38)
|
||||
Me.pnlIDS.Name = "pnlIDS"
|
||||
Me.pnlIDS.Size = New System.Drawing.Size(311, 32)
|
||||
Me.pnlIDS.TabIndex = 50
|
||||
Me.pnlIDS.Visible = False
|
||||
'
|
||||
'btnRechenwertesetzen
|
||||
'
|
||||
Me.btnRechenwertesetzen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.btnRechenwertesetzen.Location = New System.Drawing.Point(10, 3)
|
||||
Me.btnRechenwertesetzen.Name = "btnRechenwertesetzen"
|
||||
Me.btnRechenwertesetzen.Size = New System.Drawing.Size(129, 23)
|
||||
Me.btnRechenwertesetzen.TabIndex = 48
|
||||
Me.btnRechenwertesetzen.Text = "Rechenwerte setzen"
|
||||
Me.btnRechenwertesetzen.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmMDMDatenverarbetiung
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -769,6 +792,7 @@ Partial Class frmMDMDatenverarbetiung
|
||||
Me.Panel2.ResumeLayout(False)
|
||||
Me.Panel2.PerformLayout()
|
||||
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.pnlIDS.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
@@ -827,4 +851,6 @@ Partial Class frmMDMDatenverarbetiung
|
||||
Friend WithEvents Panel5 As Panel
|
||||
Friend WithEvents Label5 As Label
|
||||
Friend WithEvents DateTimePicker2 As DateTimePicker
|
||||
Friend WithEvents pnlIDS As Panel
|
||||
Friend WithEvents btnRechenwertesetzen As Button
|
||||
End Class
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Imports System.Data.OleDb
|
||||
Imports System.DirectoryServices.ActiveDirectory
|
||||
Imports System.IO
|
||||
|
||||
|
||||
Public Class frmMDMDatenverarbetiung
|
||||
|
||||
Public LIEFERANT = ""
|
||||
@@ -44,7 +44,7 @@ Public Class frmMDMDatenverarbetiung
|
||||
Case "PLOSE" : pruef = pruefData_PLOSE()
|
||||
Case "ASFINAG" : pruef = pruefData_ASFINAG()
|
||||
Case "UTA" : pruef = pruefData_UTA()
|
||||
Case "IDS" : MsgBox("Nicht verfügbar!") : Exit Sub
|
||||
Case "IDS" : pruef = pruefData_IDS()
|
||||
Case "MSE" : pruef = pruefData_MSE()
|
||||
Case Else : MsgBox("Nicht verfügbar!") : Exit Sub
|
||||
End Select
|
||||
@@ -76,7 +76,7 @@ Public Class frmMDMDatenverarbetiung
|
||||
btnDatenLaden.Text = "Daten laden"
|
||||
Case "ASFINAG" : initDgv_ASFINAG(cbxASFINAGAbgerechnet.Checked, cbxBelegeerstellt.Checked)
|
||||
btnDatenLaden.Text = "Daten laden"
|
||||
Case "IDS" 'MsgBox("Nicht verfügbar!")
|
||||
Case "IDS" : initDgv_IDS()
|
||||
btnDatenLaden.Text = "Daten laden"
|
||||
Case "MSE" : initDgv_MSE()
|
||||
btnDatenLaden.Text = "Daten laden"
|
||||
@@ -739,8 +739,6 @@ Public Class frmMDMDatenverarbetiung
|
||||
Sub initDgv_MSE()
|
||||
With MyDatagridview1
|
||||
.Columns.Clear()
|
||||
'Exit Sub
|
||||
'MsgBox(.sql)
|
||||
|
||||
.SET_SQL(" SELECT Adressen.AdressenNr as KundenNr, Adressen.[Name 1] as Name, trans.transaction_country AS Country,trans.device_product_type AS CardType,
|
||||
Sum(trans.transaction_gross_amount) As [Transaktionsbetrag],
|
||||
@@ -756,15 +754,94 @@ Public Class frmMDMDatenverarbetiung
|
||||
|
||||
.LOAD()
|
||||
|
||||
If .Columns.Count > 0 Then
|
||||
|
||||
.Columns("Name").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
|
||||
End If
|
||||
|
||||
Dim sumGes As Double = 0
|
||||
Dim sumFee As Double = 0
|
||||
Dim sumTr As Double = 0
|
||||
For Each r As DataGridViewRow In .Rows
|
||||
sumGes += If(IsNumeric(r.Cells("Gesamtbetrag").Value), CDbl(r.Cells("Gesamtbetrag").Value), 0)
|
||||
sumTr += If(IsNumeric(r.Cells("Transaktionsbetrag").Value), CDbl(r.Cells("Transaktionsbetrag").Value), 0)
|
||||
sumFee += If(IsNumeric(r.Cells("Transaktionskosten").Value), CDbl(r.Cells("Transaktionskosten").Value), 0)
|
||||
Next
|
||||
|
||||
txtAnzahl.Text = .Rows.Count
|
||||
txtPruefsummeNetto.Text = CDbl(sumTr).ToString("C2")
|
||||
txtPruefsummeBrutto.Text = CDbl(sumGes).ToString("C2")
|
||||
txtTTRSum.Text = CDbl(sumFee).ToString("C2")
|
||||
|
||||
lblTTRSum.Visible = True
|
||||
txtTTRSum.Visible = True
|
||||
|
||||
lblTTRSum.Text = "Tr-Kosten"
|
||||
|
||||
|
||||
.ClearSelection()
|
||||
|
||||
End With
|
||||
|
||||
End Sub
|
||||
|
||||
Sub initDgv_IDS()
|
||||
With MyDatagridview1
|
||||
.Columns.Clear()
|
||||
'Exit Sub
|
||||
'MsgBox(.sql)
|
||||
|
||||
.SET_SQL("SELECT trans.[transaction_id]
|
||||
,trans.[YearMonthDay] as Datum
|
||||
,trans.[Paymentsummarynumber] as ZahlungsNr
|
||||
,trans.[CustomerCode]
|
||||
,trans.[CustomerName]
|
||||
,trans.[OutletCountryCode]
|
||||
,trans.[OutletCountry]
|
||||
,trans.[OutletCode]
|
||||
,trans.[OutletName]
|
||||
,trans.[ProductTypeCode]
|
||||
,trans.[TransactionVolume] as Transaktionsbetrag
|
||||
,trans.[AmminclVAT] as Gesamtbetrag
|
||||
,trans.[TotalNetAmount] as Net
|
||||
,trans.[VATAmount] as UST
|
||||
,trans.[avpriceexclVAT]
|
||||
,trans.[Rechenwert]
|
||||
,trans.[Kz]
|
||||
,trans.[Rabattbetrag]
|
||||
,trans.[RabattbetragProLiter]
|
||||
,trans.[Zeitstempel]
|
||||
,trans.[Sachbearbeiter]
|
||||
,trans.[KdNrVERAG]
|
||||
,trans.[CardNumber]
|
||||
,trans.[EmissionNumber]
|
||||
,trans.[CardComments]
|
||||
,trans.[CalendarDate]
|
||||
,trans.[TransactionHHMM]
|
||||
,trans.[UStVAn_ID]
|
||||
,trans.[VRNumber]
|
||||
,trans.[OBONumber]
|
||||
,Kunde.CustomerCode
|
||||
,isnull(KundeOhneR.CustomerCode,0) as KundeOhneRabatt
|
||||
from tblIDSTransactionsNew as trans
|
||||
left join tbl_IDS_Kunden as Kunde on Kunde.CustomerCode = trans.CustomerCode
|
||||
left join tbl_IDS_Kunden_ohne_Rabatt as KundeOhneR on KundeOhneR.CustomerCode = trans.CustomerCode
|
||||
where cast(trans.YearMonthDay as Date) = '" & DateTimePicker2.Text & "' and trans.UStVAn_ID is null", "FMZOLL")
|
||||
|
||||
.LOAD()
|
||||
|
||||
If .Columns.Count > 0 Then
|
||||
|
||||
'.Columns("AdressenNr").HeaderText = "KdNr"
|
||||
'.Columns("Name 1").HeaderText = "Kunde"
|
||||
'.Columns("LandKz").HeaderText = "Land"
|
||||
.Columns("Name").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.Columns("CustomerName").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
|
||||
'.Columns("VERAGLeistungsNr").ReadOnly = False
|
||||
'.Columns("VERAGKdNr").ReadOnly = False
|
||||
.Columns("transaction_id").Visible = False
|
||||
.Columns("Kunde.CustomerCode").Visible = False
|
||||
|
||||
'For Each r As DataGridViewColumn In .Columns
|
||||
' If r.Name = "VERAGLeistungsNr" Or r.Name = "VERAGKdNr" Then
|
||||
@@ -811,7 +888,7 @@ Public Class frmMDMDatenverarbetiung
|
||||
For Each r As DataGridViewRow In .Rows
|
||||
sumGes += If(IsNumeric(r.Cells("Gesamtbetrag").Value), CDbl(r.Cells("Gesamtbetrag").Value), 0)
|
||||
sumTr += If(IsNumeric(r.Cells("Transaktionsbetrag").Value), CDbl(r.Cells("Transaktionsbetrag").Value), 0)
|
||||
sumFee += If(IsNumeric(r.Cells("Transaktionskosten").Value), CDbl(r.Cells("Transaktionskosten").Value), 0)
|
||||
sumFee += If(IsNumeric(r.Cells("Net").Value), CDbl(r.Cells("Net").Value), 0)
|
||||
Next
|
||||
|
||||
txtAnzahl.Text = .Rows.Count
|
||||
@@ -903,6 +980,7 @@ Public Class frmMDMDatenverarbetiung
|
||||
cbxBelegeerstellt.Visible = False
|
||||
cbxTestdaten.Visible = VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMIN", Me.FindForm)
|
||||
pnlAsfinag.Visible = False
|
||||
pnlIDS.Visible = False
|
||||
Panel4.Visible = False
|
||||
Panel5.Visible = False
|
||||
|
||||
@@ -920,12 +998,13 @@ Public Class frmMDMDatenverarbetiung
|
||||
Case "ASFINAG"
|
||||
cbxASFINAGAbgerechnet.Visible = True
|
||||
cbxBelegeerstellt.Visible = True
|
||||
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMIN", Me.FindForm) Then
|
||||
End If
|
||||
pnlAsfinag.Visible = True
|
||||
Exit Sub
|
||||
Case "IDS"
|
||||
MsgBox("Noch nicht verfürbar!")
|
||||
Dim c As New usrCntlMDMDatenverarbeitungAuswertungen_divers(Me, Me.LIEFERANT)
|
||||
Panel3.Controls.Add(c)
|
||||
c.Dock = DockStyle.Fill
|
||||
pnlIDS.Visible = True
|
||||
|
||||
Case "MSE"
|
||||
Panel5.Visible = True
|
||||
@@ -1144,13 +1223,12 @@ Public Class frmMDMDatenverarbetiung
|
||||
If Directory.Exists(dir) Then
|
||||
dir &= "_" & Now.ToShortTimeString.Replace(":", "")
|
||||
End If
|
||||
|
||||
Directory.CreateDirectory(dir)
|
||||
|
||||
|
||||
|
||||
|
||||
Dim displayView = New DataView(dt_Main, "MSEExportCSV = 1", "Customer ID", DataViewRowState.CurrentRows)
|
||||
Dim displayView = New DataView(dt_Main, "MSEExportCSV = 1", "Customer ID", DataViewRowState.CurrentRows)
|
||||
Dim distinctDT_CSV As DataTable = displayView.ToTable(True, "Customer ID", "Customer Nr")
|
||||
|
||||
|
||||
@@ -2644,6 +2722,8 @@ Public Class frmMDMDatenverarbetiung
|
||||
Case "ASFINAG" : OffertenNr = 11 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4814
|
||||
Case "UTA" : OffertenNr = 30 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4823
|
||||
Case "MSE" : OffertenNr = 23 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4821
|
||||
Case "IDS" : OffertenNr = 17 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4868
|
||||
Case "IDS AUT" : OffertenNr = 21 : Abfertigungsart = 10 : SPEDBUCH.FilialenNr = 4868
|
||||
End Select
|
||||
|
||||
SPEDBUCH.AbfertigungsNr = VERAG_PROG_ALLGEMEIN.cAllgemein.getMaxPosNrIncrement(SPEDBUCH.FilialenNr, Now.Year)
|
||||
@@ -2847,6 +2927,8 @@ Public Class frmMDMDatenverarbetiung
|
||||
Case "ASFINAG" : OffertenNr = 11 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang"
|
||||
Case "UTA" : OffertenNr = 30 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang"
|
||||
Case "MSE" : OffertenNr = 23 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang"
|
||||
Case "IDS" : OffertenNr = 17 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang"
|
||||
Case "IDS AUT" : OffertenNr = 21 : Abfertigungsart = 10 : RG.Anlage_1 = "Email Anhang"
|
||||
|
||||
End Select
|
||||
|
||||
@@ -3104,6 +3186,84 @@ Public Class frmMDMDatenverarbetiung
|
||||
|
||||
Next
|
||||
|
||||
|
||||
Case "IDS"
|
||||
|
||||
' Case 17 'Diesel IDS
|
||||
'5970 Set qryOffPos = dbs.QueryDefs("qryIDSDieselofferte17")
|
||||
'5980 qryOffPos.Parameters("[Bitte Kundennummer eingeben:]") = rstRK![RechnungsKundenNr]
|
||||
'5990 Set rstOffPos = qryOffPos.OpenRecordset(dbOpenSnapshot)
|
||||
'6000 Do Until rstOffPos.EOF
|
||||
'6010 Set qryRPPKey = dbs.QueryDefs("qryReErfSchRPPKey") '<SQL Server>
|
||||
'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) '<SQL Server>
|
||||
'6080 With rstRPPKey
|
||||
'6090 If .EOF Then
|
||||
'6100 .AddNew
|
||||
'6110 !RK_ID = rstRK!RK_ID
|
||||
'6120 !LeistungsNr = rstOffPos!LeistungsNr
|
||||
'6130 !steuerpflichtig = False
|
||||
'6140 !LeistungsBez = rstOffPos!LeistungsBez
|
||||
'6150 !BerechnungsartNr = rstOffPos!BerechnungsartNr
|
||||
'6160 Else
|
||||
'6170 .Edit
|
||||
'6180 End If
|
||||
'6190 !Preis = rstOffPos!Bruttobetrag - rstOffPos![Summe von Rabattbetrag]
|
||||
'6200 !Anzahl = 1
|
||||
'6210 .Update
|
||||
'6220 .Close
|
||||
'6230 End With
|
||||
'6240 Set rstRPPKey = Nothing
|
||||
'6250 rstOffPos.MoveNext
|
||||
'6260 Loop
|
||||
'6270 rstOffPos.Close
|
||||
'6280 Set rstOffPos = Nothing
|
||||
'6290 qryOffPos.Close
|
||||
'6300 Set qryOffPos = Nothing
|
||||
|
||||
Case "IDS AUT"
|
||||
|
||||
' Case 21 'Diesel IDS AT
|
||||
'6320 Set qryOffPos = dbs.QueryDefs("qryIDSDieselofferte21")
|
||||
'6330 qryOffPos.Parameters("[Bitte Kundennummer eingeben:]") = rstRK![RechnungsKundenNr]
|
||||
'6340 Set rstOffPos = qryOffPos.OpenRecordset(dbOpenSnapshot)
|
||||
'6350 Do Until rstOffPos.EOF
|
||||
'6360 Set qryRPPKey = dbs.QueryDefs("qryReErfSchRPPKey") '<SQL Server>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) '<SQL Server>Test
|
||||
'6430 With rstRPPKey
|
||||
'6440 If .EOF Then
|
||||
'6450 .AddNew
|
||||
'6460 !RK_ID = rstRK!RK_ID
|
||||
'6470 !LeistungsNr = rstOffPos!LeistungsNr
|
||||
'6480 !steuerpflichtig = False
|
||||
'6490 !LeistungsBez = rstOffPos!LeistungsBez
|
||||
'6500 !BerechnungsartNr = rstOffPos!BerechnungsartNr
|
||||
'6510 Else
|
||||
'6520 .Edit
|
||||
'6530 End If
|
||||
'6540 !Preis = rstOffPos!Bruttobetrag - rstOffPos![Summe von Rabattbetrag]
|
||||
'6550 !Anzahl = 1
|
||||
'6560 .Update
|
||||
'6570 .Close
|
||||
'6580 End With
|
||||
'6590 Set rstRPPKey = Nothing
|
||||
'6600 rstOffPos.MoveNext
|
||||
'6610 Loop
|
||||
'6620 rstOffPos.Close
|
||||
'6630 Set rstOffPos = Nothing
|
||||
'6640 qryOffPos.Close
|
||||
'6650 Set qryOffPos = Nothing
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
@@ -3546,6 +3706,77 @@ Public Class frmMDMDatenverarbetiung
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Function pruefData_IDS() As Boolean
|
||||
pruefData_IDS = True
|
||||
Try
|
||||
|
||||
Dim RechnenWertNichtEingetragen As Integer = CInt((New SQL).getValueTxtBySql("select count(*) from [tblIDSTransactionsNew]
|
||||
WHERE where cast(YearMonthDay as Date) = '" & DateTimePicker2.Text & "' AND [UStVAn_ID] is null AND [Rechenwert] is null ", "FMZOLL"))
|
||||
|
||||
If RechnenWertNichtEingetragen > 0 Then
|
||||
pruefData_IDS = False
|
||||
MsgBox("Es wurden bei " & RechnenWertNichtEingetragen & " Transaktionen die Rechenwerte nicht eingetragen!" & vbNewLine & "Diese müssen nacherfasst werden (von Rechnung " & DateTimePicker2.Text & "). (bitte an Administrator wenden).")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim sqlStringfalscheLeistungsNr = ""
|
||||
|
||||
Dim falscheLeistungsnummern As Integer = CInt((New SQL).getValueTxtBySql(sqlStringfalscheLeistungsNr, "FMZOLL"))
|
||||
|
||||
|
||||
If falscheLeistungsnummern > 0 Then
|
||||
If Not SQL.doSQL("update [VERAG].[dbo].[tblMSETransactions] set device_product_type = 'HUGO SIM renewal cost' where transaction_product_id = 453 and transaction_product_name like 'HUGO SIM renewal cost%'", "FMZOLL") Then
|
||||
MsgBox("Fehler beim Setzen der HUGO SIM renewal cost")
|
||||
Return False
|
||||
End If
|
||||
|
||||
falscheLeistungsnummern = CInt((New SQL).getValueTxtBySql(sqlStringfalscheLeistungsNr, "FMZOLL"))
|
||||
If falscheLeistungsnummern > 0 Then
|
||||
pruefData_IDS = False
|
||||
MsgBox("Es fehlen " & falscheLeistungsnummern & " Leistungsnummern!" & vbNewLine & "Diese Leistungssnummern (von Rechnung " & DateTimePicker2.Text & ") müssen nachgetragen werden. (bitte an Administrator wenden, tblMSELeistungen).")
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Dim nichtAufAbgerechnetGesetzteTransactionen As Integer = 0
|
||||
|
||||
nichtAufAbgerechnetGesetzteTransactionen = CInt((New SQL).getValueTxtBySql("select count (*) FROM [VERAG].[dbo].[tblMSESettlements] as bills inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id] where trans.[transaction_status] <> 'Billed' and [invoice_date] = '" & DateTimePicker2.Text & "'", "FMZOLL"))
|
||||
|
||||
If nichtAufAbgerechnetGesetzteTransactionen > 0 Then
|
||||
Dim hint As String = ""
|
||||
pruefData_IDS = False
|
||||
If nichtAufAbgerechnetGesetzteTransactionen > 500 Then
|
||||
hint = "Batch-Nr: "
|
||||
hint &= SQL.getValueTxtBySql("select distinct(trans.batch_seq_nr) FROM [VERAG].[dbo].[tblMSESettlements] as bills inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id] where trans.[transaction_status] <> 'Billed' and [invoice_date] = '" & DateTimePicker2.Text & "'", "FMZOLL")
|
||||
End If
|
||||
MsgBox("Es sind " & nichtAufAbgerechnetGesetzteTransactionen & " Transaktionen in der Datenbank, die noch nicht auf VERRECHNET gesetzt sind!" & vbNewLine & "Diese Transaktionen (von Rechnung " & DateTimePicker2.Text & ") müssen aktualisiert werden. (bitte an Administrator wenden)." & IIf(hint <> "", vbNewLine & hint, ""))
|
||||
End If
|
||||
|
||||
|
||||
'das muss die letzte Prüfung sein, da uU eine Transaktion fehlen kann!
|
||||
Dim fehlendeTransactionen As Integer = 0
|
||||
|
||||
fehlendeTransactionen = CInt((New SQL).getValueTxtBySql("select count(*) FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & DateTimePicker2.Text & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "FMZOLL"))
|
||||
|
||||
If fehlendeTransactionen > 0 Then
|
||||
pruefData_IDS = False
|
||||
Dim hint As String = ""
|
||||
If fehlendeTransactionen > 500 Then
|
||||
hint = "Batch-Nr: "
|
||||
hint &= SQL.getValueTxtBySql("select distinct(trans.batch_seq_nr) FROM [VERAG].[dbo].[tblMSESettlements] as settle INNER JOIN [VERAG].[dbo].[tblMSETransactions] as trans on trans.transaction_id = settle.transaction_id where [invoice_date] = '" & DateTimePicker2.Text & "' AND trans.[transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "FMZOLL")
|
||||
End If
|
||||
MsgBox("Es fehlen " & fehlendeTransactionen & " Transaktionen in der Datenbank!" & vbNewLine & "Diese Transaktionen (von Rechnung " & DateTimePicker2.Text & ") müssen nachgeladen werden (bitte an Administrator wenden)." & IIf(hint <> "", vbNewLine & hint, ""))
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
pruefData_IDS = False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Function pruefData_PLOSE_old() As Boolean
|
||||
pruefData_PLOSE_old = True
|
||||
Try
|
||||
@@ -3838,6 +4069,169 @@ Public Class frmMDMDatenverarbetiung
|
||||
End If
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
Private Function setRechenwerteIDS() As Boolean
|
||||
'Abrechnungsdatum setzen
|
||||
|
||||
If Not LIEFERANT = "IDS" Then Return False
|
||||
|
||||
If MyDatagridview1.Rows.Count = 0 Then
|
||||
MsgBox("Keine Daten zum Setzen vorhanden!")
|
||||
Return False
|
||||
End If
|
||||
|
||||
For Each row In MyDatagridview1.Rows
|
||||
|
||||
Dim kundeOhneRabatt = True
|
||||
|
||||
Dim trans As New VERAG_PROG_ALLGEMEIN.cIDS(row.Cells("transaction_id").Value)
|
||||
trans.Rechenwert = 0
|
||||
trans.Kz = "R"
|
||||
|
||||
If trans.TransactionVolume <> 0 Then
|
||||
trans.avpriceexclVAT = trans.TotalNetAmount / trans.TransactionVolume
|
||||
End If
|
||||
|
||||
If Not IsDBNull(row.Cells("Kunde.CustomerCode").Value) AndAlso CInt(row.Cells("Kunde.CustomerCode").Value) > 0 Then
|
||||
|
||||
kundeOhneRabatt = row.Cells("KundeOhneRabatt").Value
|
||||
|
||||
If Not kundeOhneRabatt Then 'kundeOhneRabatt -> gleich zu Rabattberechnen!
|
||||
|
||||
'Rechenwert für Land/Station/Kunde/Produkt ermitteln
|
||||
Dim sqlStringLandStationKundeProdukt = "select Case Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") & AND ((OutletCode)=" & row.Cells("OutletCode").Value & ") & And ((CustomerCode)=" & row.Cells("Kunde.CustomerCode").Value & ") AND ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) & ORDER BY Zeitstempel DESC"
|
||||
'Rechenwert für Land/Kunde/Produkt ermittteln
|
||||
Dim sqlStringLandKundeProdukt = "Select Case Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") And ((OutletCode) Is Null) AND ((CustomerCode)=" & row.Cells("Kunde.CustomerCode").Value & ") & And ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) ORDER BY Zeitstempel DESC"
|
||||
|
||||
|
||||
Dim sum As Double = 0
|
||||
If Not IsDBNull(row.Cells("Kunde.CustomerCode").Value) AndAlso CInt(row.Cells("Kunde.CustomerCode").Value) > 0 Then
|
||||
sum = +row.Cells("transaction_id").Value
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'Rabatt_errechnen:
|
||||
Select Case trans.Kz
|
||||
|
||||
Case "P" 'Rechenwert ist Preis pro Liter
|
||||
trans.Rabattbetrag = row.Cells("TotalNetAmount").Value - (row.Cells("Rechenwert").Value * row.Cells("TransactionVolume").Value * 100 + 0.5) / 100
|
||||
|
||||
Case "R" 'Rechenwert ist Rabatt pro Liter
|
||||
trans.Rabattbetrag = (row.Cells("Rechenwert").Value * row.Cells("TransactionVolume").Value * 100 + 0.5) / 100
|
||||
|
||||
End Select
|
||||
|
||||
If trans.TransactionVolume <> 0 Then
|
||||
trans.RabattbetragProLiter = row.Cells("Rabattbetrag").Value / row.Cells("TransactionVolume").Value
|
||||
End If
|
||||
|
||||
trans.Zeitstempel = Now()
|
||||
trans.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
|
||||
Next
|
||||
|
||||
' Kunde ohne Rabatt
|
||||
'1390 strSQL = "Select *" & _
|
||||
' " FROM tbl_IDS_Kunden_ohne_Rabatt" & _
|
||||
' " WHERE (((tbl_IDS_Kunden_ohne_Rabatt.CustomerCode)=" & ![KdNrVERAG] & "));"
|
||||
'1400 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
|
||||
'1410 If Not rstIDSRechenwert.EOF Then
|
||||
'1420 GoTo Rabatt_errechnen
|
||||
'1430 End If
|
||||
'1440 rstIDSRechenwert.Close
|
||||
|
||||
' ' Rechenwert für Land/Station/Kunde/Produkt ermitteln
|
||||
'1450 strSQL = "Select Rechenwert, Kz, KategorieNr" & _
|
||||
' " FROM tbl_IDS_Rechenwerte" & _
|
||||
' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _
|
||||
' " And ((OutletCode)=" & ![Outlet Code] & ")" & _
|
||||
' " And ((CustomerCode)=" & ![KdNrVERAG] & ")" & _
|
||||
' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _
|
||||
' " ORDER BY Zeitstempel DESC;"
|
||||
'1460 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
|
||||
'1470 If Not rstIDSRechenwert.EOF Then
|
||||
'1480 GoTo Rechenwert_eintragen
|
||||
'1490 End If
|
||||
'1500 rstIDSRechenwert.Close
|
||||
|
||||
' ' Rechenwert für Land/Kunde/Produkt ermittteln
|
||||
'1510 strSQL = "Select Rechenwert, Kz, KategorieNr" & _
|
||||
' " FROM tbl_IDS_Rechenwerte" & _
|
||||
' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _
|
||||
' " And ((OutletCode) Is Null)" & _
|
||||
' " And ((CustomerCode)=" & ![KdNrVERAG] & ")" & _
|
||||
' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _
|
||||
' " ORDER BY Zeitstempel DESC;"
|
||||
'1520 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
|
||||
'1530 If Not rstIDSRechenwert.EOF Then
|
||||
'1540 GoTo Rechenwert_eintragen
|
||||
'1550 End If
|
||||
'1560 rstIDSRechenwert.Close
|
||||
|
||||
'1570 End If
|
||||
|
||||
' ' Rechenwert für Land/Station/Produkt ermitteln
|
||||
'1580 strSQL = "Select Rechenwert, Kz, KategorieNr" & _
|
||||
' " FROM tbl_IDS_Rechenwerte" & _
|
||||
' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _
|
||||
' " And ((OutletCode)=" & ![Outlet Code] & ")" & _
|
||||
' " And ((CustomerCode) Is Null)" & _
|
||||
' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _
|
||||
' " ORDER BY Zeitstempel DESC;"
|
||||
'1590 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
|
||||
'1600 If Not rstIDSRechenwert.EOF Then
|
||||
'1610 GoTo Rechenwert_eintragen
|
||||
'1620 End If
|
||||
'1630 rstIDSRechenwert.Close
|
||||
|
||||
' ' Rechenwert für Land/Produkt ermitteln
|
||||
'1640 strSQL = "Select Rechenwert, Kz, KategorieNr" & _
|
||||
' " FROM tbl_IDS_Rechenwerte" & _
|
||||
' " WHERE (((OutletCountryCode)=" & ![Outlet Country Code] & ")" & _
|
||||
' " And ((OutletCode) Is Null)" & _
|
||||
' " And ((CustomerCode) Is Null)" & _
|
||||
' " And ((ProductTypeCode)=" & ![Product Type Code] & "))" & _
|
||||
' " ORDER BY Zeitstempel DESC;"
|
||||
'1650 Set rstIDSRechenwert = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
|
||||
'1660 If Not rstIDSRechenwert.EOF Then
|
||||
'1670 GoTo Rechenwert_eintragen
|
||||
'1680 End If
|
||||
'1690 rstIDSRechenwert.Close
|
||||
|
||||
'1700 GoTo Rabatt_errechnen
|
||||
|
||||
'Rechenwert_eintragen:
|
||||
'1710 !Rechenwert = rstIDSRechenwert!Rechenwert
|
||||
'1720 !Kz = rstIDSRechenwert!Kz
|
||||
'1730 If Not IsNull(rstIDSRechenwert!KategorieNr) Then
|
||||
'1740 Set qry = dbs.QueryDefs("qry_IDS_KategorieNr_ProductTypeCode_Rechenwert")
|
||||
'1750 qry.Parameters("[prmKategorieNr]") = rstIDSRechenwert!KategorieNr
|
||||
'1760 qry.Parameters("[prmProductTypeCode]") = ![Product Type Code]
|
||||
'1770 Set rst = qry.OpenRecordset(dbOpenSnapshot)
|
||||
'1780 If Not rst.EOF Then
|
||||
'1790 !Rechenwert = !Rechenwert + rst!Rechenwert
|
||||
'1800 If !Rechenwert < 0 Then
|
||||
'1810 !Rechenwert = 0
|
||||
'1820 End If
|
||||
'1830 End If
|
||||
'1840 rst.Close
|
||||
'1850 qry.Close
|
||||
'1860 End If
|
||||
'1870 rstIDSRechenwert.Close
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
@@ -3887,7 +4281,9 @@ Public Class frmMDMDatenverarbetiung
|
||||
End Sub
|
||||
|
||||
Private Sub bntDatumsetzen_Click(sender As Object, e As EventArgs) Handles bntDatumsetzen.Click
|
||||
|
||||
setFakturiert_ASFINAG()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cbxBelegeerstellt_CheckedChanged(sender As Object, e As EventArgs) Handles cbxBelegeerstellt.CheckedChanged
|
||||
@@ -3915,4 +4311,8 @@ Public Class frmMDMDatenverarbetiung
|
||||
Private Sub cbxTestdaten_CheckedChanged(sender As Object, e As EventArgs) Handles cbxTestdaten.CheckedChanged
|
||||
test = cbxTestdaten.Checked
|
||||
End Sub
|
||||
|
||||
Private Sub btnRechenwertesetzen_Click(sender As Object, e As EventArgs) Handles btnRechenwertesetzen.Click
|
||||
If vbYes = MsgBox("Haben Sie die Rechenwerte in den IDS-Tabellen aktualisiert?" & vbNewLine & "(Diese werden beim Importieren in die Abrechnungsdaten übernommen)", vbYesNoCancel) Then setRechenwerteIDS()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -51,6 +51,14 @@ Public Class usrCntlMDMDatenverarbeitungAuswertungen_divers
|
||||
Button3.Text = "fehlende Transakt."
|
||||
Button3.Visible = True
|
||||
|
||||
Case "IDS"
|
||||
|
||||
Button6.Text = "Nach Spezifikation"
|
||||
Button2.Text = "Leistungsnummern"
|
||||
Button1.Text = "Kunden"
|
||||
Button3.Text = "fehlende Transakt."
|
||||
Button3.Visible = True
|
||||
|
||||
|
||||
Case Else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user