iDS, MDM
This commit is contained in:
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.3.2.6")>
|
||||
<Assembly: AssemblyFileVersion("1.3.2.6")>
|
||||
<Assembly: AssemblyVersion("1.3.2.7")>
|
||||
<Assembly: AssemblyFileVersion("1.3.2.7")>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>AL20231110.pfx</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>Sebastian.pfx</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DelaySign>false</DelaySign>
|
||||
@@ -4488,6 +4488,7 @@
|
||||
</None>
|
||||
<None Include="Resources\SR_EVOLOG.xlsx" />
|
||||
<None Include="Resources\SR_TransFerry360.xlsx" />
|
||||
<None Include="Sebastian.pfx" />
|
||||
<None Include="Web References\eu.europa.ec1\eoriValidationResult.datasource">
|
||||
<DependentUpon>Reference.map</DependentUpon>
|
||||
</None>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports System.Data.OleDb
|
||||
Imports System.IO
|
||||
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class frmMDMDatenverarbetiung
|
||||
|
||||
@@ -26,7 +26,9 @@ Public Class frmMDMDatenverarbetiung
|
||||
Case "PLOSE" : genSummenbericht_PLOSE()
|
||||
Case "ASFINAG" : genSummenbericht_ASFINAG()
|
||||
Case "UTA" : genSummenbericht_UTA()
|
||||
Case "IDS" : MsgBox("Nicht verfügbar!") : Exit Sub
|
||||
Case "IDS"
|
||||
genSummenbericht_IDS(17)
|
||||
genSummenbericht_IDS(21)
|
||||
Case "MSE" : genSummenbericht_MSE()
|
||||
Case Else : MsgBox("Nicht verfügbar!")
|
||||
End Select
|
||||
@@ -560,6 +562,103 @@ Public Class frmMDMDatenverarbetiung
|
||||
End Sub
|
||||
|
||||
|
||||
Sub genSummenbericht_IDS(typ As Integer)
|
||||
Dim displayFilter = False
|
||||
Dim sqlstr As String = ""
|
||||
|
||||
Dim sqlwhere = ""
|
||||
|
||||
Select Case typ
|
||||
Case 17 : sqlwhere = "<>740543"
|
||||
Case 21 : sqlwhere = " =740543"
|
||||
End Select
|
||||
|
||||
sqlstr &= "SELECT Adressen.AdressenNr, Adressen.[Name 1] as Name, tblIDSTransactionsNew.[CustomerCode], Sum(tblIDSTransactionsNew.[TransactionVolume]) AS Liter, Sum(tblIDSTransactionsNew.AmminclVAT) AS Brutto, Sum(tblIDSTransactionsNew.[TotalNetAmount]) AS Netto, Sum(tblIDSTransactionsNew.Rabattbetrag) AS Rabatt
|
||||
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.[OutletCountryCode]" & sqlwhere &
|
||||
"GROUP BY Adressen.AdressenNr, Adressen.[Name 1], tblIDSTransactionsNew.[CustomerCode];"
|
||||
|
||||
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
|
||||
'DataGridView.DataSource = dt
|
||||
|
||||
|
||||
Dim print As New frmPrintLayout
|
||||
print.Text = "IDS"
|
||||
|
||||
Dim rpt As New rptASFINAG_TransaktionenSumary
|
||||
|
||||
rpt.DataSource = dt
|
||||
|
||||
'If cbxProdukt.Checked Then
|
||||
|
||||
'Else
|
||||
' rpt.GroupHeader2.Visible = False
|
||||
' rpt.GroupFooter2.Visible = False
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
Dim sum = 0
|
||||
rpt.lblUeberschrift.Text = "IDS Summenbericht (Offert " & typ & ") " & CDate(Now.ToShortDateString)
|
||||
rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
|
||||
rpt.lblBrutto.Text = "Brutto"
|
||||
rpt.lblNetto.Text = "Netto"
|
||||
rpt.lblMWST.Text = "MwSt."
|
||||
rpt.Label4.Text = rpt.lblNetto.Text
|
||||
rpt.Label2.Text = rpt.lblMWST.Text
|
||||
rpt.Label14.Text = rpt.lblBrutto.Text
|
||||
'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung
|
||||
|
||||
'Dim cnt As Integer = 0
|
||||
rpt.lblDat.Text = Now.ToLongDateString
|
||||
|
||||
Dim sumNetto As Double = 0
|
||||
Dim sumMWST As Double = 0
|
||||
Dim sumBrutto As Double = 0
|
||||
|
||||
Dim sumperKdNrNetto As Double = 0
|
||||
'Dim sumperKdNrMWST As Double = 0
|
||||
Dim sumperKdNrBrutto As Double = 0
|
||||
|
||||
|
||||
AddHandler rpt.Detail.Format, Sub()
|
||||
|
||||
|
||||
rpt.lblKundennr.Text = SQL.isDbnullEmpty(rpt.Fields.Item("CustomerCode").Value, "")
|
||||
rpt.lblName1.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Name").Value, "")
|
||||
rpt.lblKartennr.Text = "Liter: " & SQL.isDbnullEmpty(rpt.Fields.Item("Liter").Value, "") & IIf(SQL.isDbnullEmpty(rpt.Fields.Item("Rabatt").Value, "") <> "", " (abgezogener Rabatt:" & SQL.isDbnullEmpty(rpt.Fields.Item("Rabatt").Value & ")", ""), "")
|
||||
|
||||
rpt.lblNetto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Netto").Value, 2, "")
|
||||
rpt.lblMWST.Text = SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("Brutto").Value) - CDbl(rpt.Fields.Item("Netto").Value), 2, "")
|
||||
rpt.lblBrutto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Brutto").Value, 2, "")
|
||||
|
||||
|
||||
rpt.lblSumNet.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Netto").Value, 2, "")
|
||||
rpt.lblSumVat.Text = SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("Brutto").Value) - CDbl(rpt.Fields.Item("Netto").Value), 2, "")
|
||||
rpt.lblSumBrt.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Brutto").Value, 2, "")
|
||||
|
||||
sumNetto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Netto").Value, 4, 0)
|
||||
sumMWST += SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("Brutto").Value) - CDbl(rpt.Fields.Item("Netto").Value), 4, 0)
|
||||
sumBrutto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Brutto").Value, 4, 0)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
AddHandler rpt.ReportFooter1.Format, Sub()
|
||||
|
||||
rpt.lblSumNetto.Text = sumNetto.ToString("N2")
|
||||
rpt.lblSumMwst.Text = sumMWST.ToString("N2")
|
||||
rpt.lblSumBrutto.Text = sumBrutto.ToString("N2")
|
||||
|
||||
End Sub
|
||||
|
||||
print.Viewer.LoadDocument(rpt)
|
||||
print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous
|
||||
print.Show()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub initDgv_PLOSE()
|
||||
With MyDatagridview1
|
||||
@@ -823,10 +922,10 @@ Public Class frmMDMDatenverarbetiung
|
||||
,trans.[UStVAn_ID]
|
||||
,trans.[VRNumber]
|
||||
,trans.[OBONumber]
|
||||
,Kunde.CustomerCode as KundeCustomerCode
|
||||
,Kunde.KdNrVERAG as KundeCustomerCode
|
||||
,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 as Kunde on Kunde.CustomerCode = trans.CustomerCode And Kunde.KdNrAlt = 0
|
||||
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")
|
||||
|
||||
@@ -3715,65 +3814,53 @@ Public Class frmMDMDatenverarbetiung
|
||||
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"))
|
||||
Dim RechnenWertNichtEingetragen As Integer = CInt((New SQL).getValueTxtBySql("select count(*) from [tblIDSTransactionsNew] 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).")
|
||||
MsgBox("Es wurden bei " & RechnenWertNichtEingetragen & " Transaktionen die Rechenwerte nicht eingetragen!" & vbNewLine & "Diese müssen nacherfasst werden (von Rechnungsdatum " & DateTimePicker2.Text & ").")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim sqlStringfalscheLeistungsNr = ""
|
||||
Dim sqlStringfehlendeKdNr = "SELECT count(*) from tblIDSTransactionsNew as trans left join tbl_IDS_Kunden as Kunde on Kunde.CustomerCode = trans.CustomerCode where cast(trans.YearMonthDay as Date) = '" & DateTimePicker2.Text & "' and Kunde.CustomerCode is null and trans.[CustomerCode] not in (60004479,60013994)" 'Verag360 und VeragAG
|
||||
|
||||
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 = ""
|
||||
Dim fehlendeKdNr As Integer = CInt((New SQL).getValueTxtBySql(sqlStringfehlendeKdNr, "FMZOLL"))
|
||||
If fehlendeKdNr > 0 Then
|
||||
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, ""))
|
||||
MsgBox("Bei " & fehlendeKdNr & " Kunden fehlt die Zuweisung zur IDS-Kundentabelle!" & vbNewLine & "Diese Kundennummern (von Rechnungsdatum " & DateTimePicker2.Text & ") müssen nachgetragen werden.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
'das muss die letzte Prüfung sein, da uU eine Transaktion fehlen kann!
|
||||
Dim fehlendeTransactionen As Integer = 0
|
||||
'Dim nichtAufAbgerechnetGesetzteTransactionen 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"))
|
||||
'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 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
|
||||
'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)
|
||||
@@ -4087,155 +4174,161 @@ Public Class frmMDMDatenverarbetiung
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim i As Integer = 0
|
||||
|
||||
For Each row In MyDatagridview1.Rows
|
||||
|
||||
Dim kundeOhneRabatt = True
|
||||
|
||||
Dim trans As New VERAG_PROG_ALLGEMEIN.cIDS(row.Cells("transaction_id").Value)
|
||||
Dim trans As New VERAG_PROG_ALLGEMEIN.cIDS(row.Cells("transaction_id").value)
|
||||
trans.Rechenwert = 0
|
||||
trans.Kz = "R"
|
||||
|
||||
Dim KategorieNr = 0
|
||||
|
||||
If trans.TransactionVolume <> 0 Then
|
||||
trans.avpriceexclVAT = trans.TotalNetAmount / trans.TransactionVolume
|
||||
End If
|
||||
If trans.KdNrVERAG Is Nothing Then
|
||||
|
||||
Dim rechnenwertVorhanden = False
|
||||
If trans.TransactionVolume <> 0 Then
|
||||
trans.avpriceexclVAT = trans.TotalNetAmount / trans.TransactionVolume
|
||||
End If
|
||||
|
||||
If Not IsDBNull(row.Cells("KundeCustomerCode").Value) AndAlso CInt(row.Cells("KundeCustomerCode").Value) > 0 Then
|
||||
If Not IsDBNull(row.Cells("KundeCustomerCode").Value) AndAlso CInt(row.Cells("KundeCustomerCode").Value) > 0 Then
|
||||
trans.KdNrVERAG = row.Cells("KundeCustomerCode").Value
|
||||
kundeOhneRabatt = row.Cells("KundeOhneRabatt").Value
|
||||
|
||||
kundeOhneRabatt = row.Cells("KundeOhneRabatt").Value
|
||||
If kundeOhneRabatt Then GoTo RabattBerechnen 'kundeOhneRabatt -> gleich zu Rabattberechnen!
|
||||
|
||||
If Not kundeOhneRabatt Then 'kundeOhneRabatt -> gleich zu Rabattberechnen!
|
||||
|
||||
'Rechenwert für Land/Station/Kunde/Produkt ermitteln
|
||||
Dim sqlStringLandStationKundeProdukt = "select Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") AND ((OutletCode)=" & row.Cells("OutletCode").Value & ") And ((CustomerCode)=" & row.Cells("KundeCustomerCode").Value & ") AND ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) ORDER BY Zeitstempel DESC"
|
||||
Dim sqlStringLandStationKundeProdukt = "select Top(1) Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE OutletCountryCode=" & row.Cells("OutletCountryCode").Value & " AND OutletCode=" & row.Cells("OutletCode").Value & " And CustomerCode=" & row.Cells("KundeCustomerCode").Value & " AND ProductTypeCode=" & row.Cells("ProductTypeCode").Value & " ORDER BY Zeitstempel DESC"
|
||||
Dim dtLandStationKundeProdukt As DataTable = SQL.loadDgvBySql(sqlStringLandStationKundeProdukt, "FMZOLL")
|
||||
If dtLandStationKundeProdukt.Rows.Count > 0 Then
|
||||
rechnenwertVorhanden = True
|
||||
For Each r In dtLandStationKundeProdukt.Rows
|
||||
KategorieNr = r.Cell("KategorieNr")
|
||||
trans.Rechenwert = r.Cell("Rechenwert")
|
||||
trans.Kz = r.Cell("Kz")
|
||||
KategorieNr = IIf(IsDBNull(r.Item("KategorieNr")), 0, r.Item("KategorieNr"))
|
||||
trans.Rechenwert = r.Item("Rechenwert")
|
||||
trans.Kz = r.Item("Kz")
|
||||
Next
|
||||
|
||||
GoTo RechenwertBerechnen
|
||||
End If
|
||||
|
||||
'Rechenwert für Land/Kunde/Produkt ermittteln
|
||||
If Not rechnenwertVorhanden Then
|
||||
Dim sqlStringLandKundeProdukt = "Select Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") And ((OutletCode) Is Null) AND ((CustomerCode)=" & row.Cells("KundeCustomerCode").Value & ") And ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) ORDER BY Zeitstempel DESC"
|
||||
Dim dtLandKundeProdukt As DataTable = SQL.loadDgvBySql(sqlStringLandStationKundeProdukt, "FMZOLL")
|
||||
If dtLandKundeProdukt.Rows.Count > 0 Then
|
||||
rechnenwertVorhanden = True
|
||||
For Each r In dtLandKundeProdukt.Rows
|
||||
KategorieNr = r.Cell("KategorieNr")
|
||||
trans.Rechenwert = r.Cell("Rechenwert")
|
||||
trans.Kz = r.Cell("Kz")
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim sqlStringLandKundeProdukt = "Select Top(1) Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE OutletCountryCode=" & row.Cells("OutletCountryCode").Value & " And OutletCode Is Null AND CustomerCode=" & row.Cells("KundeCustomerCode").Value & " And ProductTypeCode=" & row.Cells("ProductTypeCode").Value & " ORDER BY Zeitstempel DESC"
|
||||
Dim dtLandKundeProdukt As DataTable = SQL.loadDgvBySql(sqlStringLandStationKundeProdukt, "FMZOLL")
|
||||
If dtLandKundeProdukt.Rows.Count > 0 Then
|
||||
|
||||
For Each r In dtLandKundeProdukt.Rows
|
||||
KategorieNr = IIf(IsDBNull(r.Item("KategorieNr")), 0, r.Item("KategorieNr"))
|
||||
trans.Rechenwert = r.Item("Rechenwert")
|
||||
trans.Kz = r.Item("Kz")
|
||||
Next
|
||||
GoTo RechenwertBerechnen
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
' Rechenwert für Land/Station/Produkt ermitteln
|
||||
If Not rechnenwertVorhanden Then
|
||||
Dim sqlStringLandStationProdukt = "select Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") AND ((OutletCode)=" & row.Cells("OutletCode").Value & ") AND ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) ORDER BY Zeitstempel DESC"
|
||||
|
||||
|
||||
|
||||
' Rechenwert für Land/Station/Produkt ermitteln
|
||||
|
||||
Dim sqlStringLandStationProdukt = "select Top(1) Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE OutletCountryCode=" & row.Cells("OutletCountryCode").Value & " AND OutletCode=" & row.Cells("OutletCode").Value & " AND ProductTypeCode=" & row.Cells("ProductTypeCode").Value & " ORDER BY Zeitstempel DESC"
|
||||
Dim dtLandStationProdukt As DataTable = SQL.loadDgvBySql(sqlStringLandStationProdukt, "FMZOLL")
|
||||
If dtLandStationProdukt.Rows.Count > 0 Then
|
||||
rechnenwertVorhanden = True
|
||||
For Each r In dtLandStationProdukt.Rows
|
||||
KategorieNr = r.Cell("KategorieNr")
|
||||
trans.Rechenwert = r.Cell("Rechenwert")
|
||||
trans.Kz = r.Cell("Kz")
|
||||
KategorieNr = IIf(IsDBNull(r.Item("KategorieNr")), 0, r.Item("KategorieNr"))
|
||||
trans.Rechenwert += r.Item("Rechenwert")
|
||||
trans.Kz = r.Item("Kz")
|
||||
Next
|
||||
|
||||
GoTo RechenwertBerechnen
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
' Rechenwert für Land/Produkt ermitteln
|
||||
If Not rechnenwertVorhanden Then
|
||||
Dim sqlStringLandProdukt = "Select Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE (((OutletCountryCode)=" & row.Cells("OutletCountryCode").Value & ") And ((OutletCode) Is Null) And ((ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & ")) ORDER BY Zeitstempel DESC"
|
||||
|
||||
' Rechenwert für Land/Produkt ermitteln
|
||||
|
||||
Dim sqlStringLandProdukt = "Select Top(1) Rechenwert, Kz, KategorieNr FROM tbl_IDS_Rechenwerte WHERE OutletCountryCode=" & row.Cells("OutletCountryCode").Value & " And OutletCode Is Null And ProductTypeCode=" & row.Cells("ProductTypeCode").Value & " ORDER BY Zeitstempel DESC"
|
||||
Dim dtLandProdukt As DataTable = SQL.loadDgvBySql(sqlStringLandProdukt, "FMZOLL")
|
||||
If dtLandProdukt.Rows.Count > 0 Then
|
||||
rechnenwertVorhanden = True
|
||||
For Each r In dtLandProdukt.Rows
|
||||
KategorieNr = r.Cell("KategorieNr")
|
||||
trans.Rechenwert = r.Cell("Rechenwert")
|
||||
trans.Kz = r.Cell("Kz")
|
||||
KategorieNr = IIf(IsDBNull(r.Item("KategorieNr")), 0, r.Item("KategorieNr"))
|
||||
trans.Rechenwert += r.Item("Rechenwert")
|
||||
trans.Kz = r.Item("Kz")
|
||||
Next
|
||||
GoTo RechenwertBerechnen
|
||||
End If
|
||||
End If
|
||||
|
||||
GoTo RabattBerechnen
|
||||
|
||||
|
||||
|
||||
RechenwertBerechnen:
|
||||
If KategorieNr > 0 Then
|
||||
|
||||
'Rechenwert eintragen:
|
||||
If KategorieNr > 0 Then
|
||||
|
||||
Dim sqlRechenwert = "SELECT tbl_IDS_Kategorien_Rechenwerte.KategorieNr, tbl_IDS_Kategorien_Rechenwerte.ProductTypeCode, tbl_IDS_Kategorien_Rechenwerte.Rechenwert
|
||||
Dim sqlRechenwert = "SELECT tbl_IDS_Kategorien_Rechenwerte.KategorieNr, tbl_IDS_Kategorien_Rechenwerte.ProductTypeCode, tbl_IDS_Kategorien_Rechenwerte.Rechenwert
|
||||
FROM tbl_IDS_Kategorien_Rechenwerte
|
||||
WHERE (((tbl_IDS_Kategorien_Rechenwerte.KategorieNr)=" & KategorieNr & ") AND ((tbl_IDS_Kategorien_Rechenwerte.ProductTypeCode)=" & row.Cells("ProductTypeCode").Value & "))
|
||||
ORDER BY tbl_IDS_Kategorien_Rechenwerte.Zeitstempel DESC"
|
||||
Dim dtRechenwert As DataTable = SQL.loadDgvBySql(sqlRechenwert, "FMZOLL")
|
||||
If dtRechenwert.Rows.Count > 0 Then
|
||||
Dim dtRechenwert As DataTable = SQL.loadDgvBySql(sqlRechenwert, "FMZOLL")
|
||||
If dtRechenwert.Rows.Count > 0 Then
|
||||
|
||||
For Each r In dtRechenwert.Rows
|
||||
trans.Rechenwert += r.Item("Rechenwert")
|
||||
If trans.Rechenwert < 0 Then trans.Rechenwert = 0
|
||||
Next
|
||||
End If
|
||||
'!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
|
||||
|
||||
|
||||
For Each r In dtRechenwert.Rows
|
||||
trans.Rechenwert = +r.Cell("Rechenwert")
|
||||
If trans.Rechenwert < 0 Then trans.Rechenwert = 0
|
||||
Next
|
||||
End If
|
||||
'!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
|
||||
|
||||
RabattBerechnen:
|
||||
Select Case trans.Kz
|
||||
|
||||
Case "P" 'Rechenwert ist Preis pro Liter
|
||||
trans.Rabattbetrag = trans.TotalNetAmount - (trans.Rechenwert * trans.TransactionVolume * 100 + 0.5) / 100
|
||||
|
||||
Case "R" 'Rechenwert ist Rabatt pro Liter
|
||||
trans.Rabattbetrag = (trans.Rechenwert * trans.TransactionVolume * 100 + 0.5) / 100
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If trans.TransactionVolume <> 0 Then
|
||||
trans.RabattbetragProLiter = trans.Rabattbetrag / trans.TransactionVolume
|
||||
End If
|
||||
|
||||
trans.Zeitstempel = Now()
|
||||
trans.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
If trans.SAVE() Then i += 1
|
||||
End If
|
||||
|
||||
'Rabatt_errechnen:
|
||||
Select Case trans.Kz
|
||||
|
||||
Case "P" 'Rechenwert ist Preis pro Liter
|
||||
trans.Rabattbetrag = row.Cells("TotalNetAmount").Value - (trans.Rechenwert * row.Cells("TransactionVolume").Value * 100 + 0.5) / 100
|
||||
|
||||
Case "R" 'Rechenwert ist Rabatt pro Liter
|
||||
trans.Rabattbetrag = (trans.Rechenwert * 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
|
||||
trans.SAVE()
|
||||
|
||||
Next
|
||||
|
||||
initDgv_IDS()
|
||||
MsgBox(i & " Rechenwerte wurden gesetzt!")
|
||||
|
||||
' Public Function fktDieselIDSImportiereCSV()
|
||||
|
||||
|
||||
@@ -4498,9 +4591,26 @@ Public Class frmMDMDatenverarbetiung
|
||||
End Sub
|
||||
|
||||
Private Sub Button10_Click_1(sender As Object, e As EventArgs) Handles Button10.Click
|
||||
If Not LIEFERANT = "IDS" Then Exit Sub
|
||||
|
||||
If vbYes = MsgBox("Haben Sie die Rechenwerte in den IDS-Tabellen zurücksetzen?", vbYesNoCancel) Then
|
||||
setRechenwerteIDS()
|
||||
If MyDatagridview1.Rows.Count = 0 Then
|
||||
MsgBox("Keine Daten zum ZUrücksetzen vorhanden!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If vbYes = MsgBox("Wollen Sie die Rechenwerte in der IDS-Tabelle zurücksetzen?", vbYesNoCancel) Then
|
||||
Dim i As Integer = 0
|
||||
For Each row In MyDatagridview1.Rows
|
||||
Dim trans As New VERAG_PROG_ALLGEMEIN.cIDS(row.Cells("transaction_id").Value)
|
||||
trans.Rechenwert = 0
|
||||
trans.Kz = "R"
|
||||
trans.Zeitstempel = Now()
|
||||
trans.KdNrVERAG = Nothing
|
||||
trans.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
If trans.SAVE() Then i += 1
|
||||
Next
|
||||
|
||||
MsgBox(i & " Rechenwerte wurden zurückgesetzt!")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -53,10 +53,12 @@ Public Class usrCntlMDMDatenverarbeitungAuswertungen_divers
|
||||
|
||||
Case "IDS"
|
||||
|
||||
Button6.Visible = False
|
||||
Button2.Visible = False
|
||||
Button6.Text = "Nach Spezifikation"
|
||||
Button2.Text = "Leistungsnummern"
|
||||
Button1.Text = "Kunden"
|
||||
Button3.Text = "fehlende Transakt."
|
||||
Button3.Text = "Ländercodes"
|
||||
Button3.Visible = True
|
||||
|
||||
|
||||
@@ -122,6 +124,9 @@ Public Class usrCntlMDMDatenverarbeitungAuswertungen_divers
|
||||
Case "MSE"
|
||||
genMSEBericht("KDNR")
|
||||
|
||||
Case "IDS"
|
||||
genIDSBericht("KDNR")
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
@@ -498,6 +503,153 @@ Public Class usrCntlMDMDatenverarbeitungAuswertungen_divers
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
'AddHandler rpt.ReportFooter1.Format, Sub()
|
||||
' rpt.lblSumNetto.Text = sumNetto.ToString("N2")
|
||||
' rpt.lblSumMwst.Text = sumMWST.ToString("N2")
|
||||
' rpt.lblSumBrutto.Text = sumBrutto.ToString("N2")
|
||||
|
||||
' End Sub
|
||||
|
||||
'print.Viewer.LoadDocument(rpt)
|
||||
'print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous
|
||||
'print.Show()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Sub genIDSBericht(art As String)
|
||||
|
||||
Dim sqlstr = ""
|
||||
|
||||
Select Case art
|
||||
|
||||
Case "LAENDERCODES"
|
||||
|
||||
sqlstr = "SELECT
|
||||
tblIDSTransactionsNew.[OutletCountryCode],
|
||||
tbl_IDS_Länder.OutletCountry,
|
||||
tblIDSTransactionsNew.[ProductTypeCode],
|
||||
tbl_IDS_Produkte.ProductDescription,
|
||||
tbl_IDS_Rechenwerte.Rechenwert
|
||||
FROM
|
||||
tblIDSTransactionsNew
|
||||
LEFT JOIN tbl_IDS_Rechenwerte
|
||||
ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Rechenwerte.OutletCountryCode
|
||||
AND tblIDSTransactionsNew.[ProductTypeCode] = tbl_IDS_Rechenwerte.ProductTypeCode
|
||||
LEFT JOIN tbl_IDS_Produkte
|
||||
ON tblIDSTransactionsNew.[ProductTypeCode] = tbl_IDS_Produkte.ProductTypeCode
|
||||
LEFT JOIN tbl_IDS_Länder
|
||||
ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode
|
||||
WHERE
|
||||
tbl_IDS_Rechenwerte.OutletCode IS NULL
|
||||
AND tbl_IDS_Rechenwerte.CustomerCode IS NULL AND cast(tblIDSTransactionsNew.YearMonthDay as Date) = '" & MAIN.DateTimePicker2.Text & "'
|
||||
GROUP BY
|
||||
tblIDSTransactionsNew.[OutletCountryCode],
|
||||
tbl_IDS_Länder.OutletCountry,
|
||||
tblIDSTransactionsNew.[ProductTypeCode],
|
||||
tbl_IDS_Produkte.ProductDescription,
|
||||
tbl_IDS_Rechenwerte.Rechenwert
|
||||
HAVING
|
||||
tbl_IDS_Rechenwerte.Rechenwert IS NULL
|
||||
ORDER BY
|
||||
tblIDSTransactionsNew.[OutletCountryCode],
|
||||
tblIDSTransactionsNew.[ProductTypeCode];"
|
||||
|
||||
Case "KDNR"
|
||||
|
||||
sqlstr = "SELECT
|
||||
tblIDSTransactionsNew.[CustomerCode],
|
||||
tblIDSTransactionsNew.[CustomerName],
|
||||
tblIDSTransactionsNew.KdNrVERAG,
|
||||
(SELECT Offerten.OffertenNr
|
||||
FROM Offerten
|
||||
WHERE Offerten.KundenNr = ISNULL(tblIDSTransactionsNew.KdNrVERAG, 0)
|
||||
AND Offerten.OffertenNr = 17) AS Offerte_17,
|
||||
(SELECT Offerten.OffertenNr
|
||||
FROM Offerten
|
||||
WHERE Offerten.KundenNr = ISNULL(tblIDSTransactionsNew.KdNrVERAG, 0)
|
||||
AND Offerten.OffertenNr = 21) AS Offerte_21
|
||||
FROM
|
||||
tblIDSTransactionsNew
|
||||
WHERE
|
||||
cast(tblIDSTransactionsNew.YearMonthDay as Date) = '" & MAIN.DateTimePicker2.Text & "'
|
||||
GROUP BY
|
||||
tblIDSTransactionsNew.[CustomerCode],
|
||||
tblIDSTransactionsNew.[CustomerName],
|
||||
tblIDSTransactionsNew.KdNrVERAG
|
||||
HAVING
|
||||
(tblIDSTransactionsNew.KdNrVERAG IS NULL
|
||||
OR (tblIDSTransactionsNew.KdNrVERAG IS NOT NULL
|
||||
AND (SELECT Offerten.OffertenNr
|
||||
FROM Offerten
|
||||
WHERE Offerten.KundenNr = ISNULL(tblIDSTransactionsNew.KdNrVERAG, 0)
|
||||
AND Offerten.OffertenNr = 17) IS NULL)
|
||||
OR (tblIDSTransactionsNew.KdNrVERAG IS NOT NULL
|
||||
AND (SELECT Offerten.OffertenNr
|
||||
FROM Offerten
|
||||
WHERE Offerten.KundenNr = ISNULL(tblIDSTransactionsNew.KdNrVERAG, 0)
|
||||
AND Offerten.OffertenNr = 21) IS NULL))
|
||||
AND CustomerCode not in (60013994, 60004479)
|
||||
|
||||
ORDER BY
|
||||
tblIDSTransactionsNew.[CustomerCode];"
|
||||
|
||||
Case "TRANS"
|
||||
|
||||
sqlstr = ""
|
||||
|
||||
Case Else
|
||||
MsgBox("Auswertungsart nicht definiert!")
|
||||
Exit Sub
|
||||
|
||||
End Select
|
||||
|
||||
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
|
||||
Dim print As New frmPrintLayout
|
||||
print.Text = "IDS"
|
||||
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
|
||||
MsgBox("Keine Daten!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
cProgramFunctions.genExcelCSVFromDT(dt, True)
|
||||
|
||||
'DEAKVIERT weil zu aufwendig, aktuell per Excel-Export
|
||||
'Dim rpt As New rptPLOSE_LaenderGesamt
|
||||
'rpt.DataSource = dt
|
||||
|
||||
'Dim sum = 0
|
||||
'' rpt.lblUeberschrift.Text = "PLOSE Summenbericht " & dat_Sum_Von.Text & " bis " & dat_Sum_Bis.Text
|
||||
'rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
|
||||
''rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung
|
||||
|
||||
''Dim cnt As Integer = 0
|
||||
'rpt.lblDat.Text = Now.ToLongDateString
|
||||
|
||||
|
||||
'Dim sumPreis As Double = 0
|
||||
'Dim sumNetto As Double = 0
|
||||
'Dim sumMWST As Double = 0
|
||||
'Dim sumBrutto As Double = 0
|
||||
'Dim sumBruttoAlleLeistungen As Double = 0
|
||||
'Dim sumMenge As Double = 0
|
||||
|
||||
'AddHandler rpt.Detail.Format, Sub()
|
||||
' rpt.lblLand.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Rechnung").Value, "") & " - " & SQL.isDbnullEmpty(rpt.Fields.Item("Spezifikation_Id").Value, "")
|
||||
' rpt.lblEU.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Spezifikation").Value, "")
|
||||
|
||||
' rpt.lblNetto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaktionsbetrag_Netto").Value, 2, "")
|
||||
' rpt.lblMWST.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Steuerbetrag").Value, 2, "")
|
||||
' rpt.lblBrutto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaktionsbetrag_Brutto").Value, 2, "")
|
||||
|
||||
' sumNetto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaktionsbetrag_Netto").Value, 4, 0)
|
||||
' sumMWST += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Steuerbetrag").Value, 4, 0)
|
||||
' sumBrutto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaktionsbetrag_Brutto").Value, 4, 0)
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
'AddHandler rpt.ReportFooter1.Format, Sub()
|
||||
@@ -622,6 +774,10 @@ Public Class usrCntlMDMDatenverarbeitungAuswertungen_divers
|
||||
Case "MSE"
|
||||
genMSEBericht("TRANS")
|
||||
|
||||
Case "IDS"
|
||||
genIDSBericht("LAENDERCODES")
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -257,10 +257,11 @@ Public Class cIDS
|
||||
.YearMonthDay = isleernothing((currentRow(0)))
|
||||
.CustomerCode = isleernothing((currentRow(1)))
|
||||
.Paymentsummarynumber = isleernothing((currentRow(2)))
|
||||
.CustomerName = isleernothing((currentRow(4)))
|
||||
.OutletCountry = isleernothing((currentRow(5)))
|
||||
.OutletCountryCode = isleernothing((currentRow(6)))
|
||||
.OutletCode = isleernothing((currentRow(7)))
|
||||
.CustomerName = isleernothing((currentRow(3)))
|
||||
.OutletCountry = isleernothing((currentRow(4)))
|
||||
.OutletCountryCode = isleernothing((currentRow(5)))
|
||||
.OutletCode = isleernothing((currentRow(6)))
|
||||
.ProductTypeCode = isleernothing((currentRow(7)))
|
||||
.TransactionVolume = isleernothing((currentRow(8)))
|
||||
.AmminclVAT = isleernothing((currentRow(9)))
|
||||
.TotalNetAmount = isleernothing((currentRow(10)))
|
||||
|
||||
@@ -303,7 +303,7 @@ Public Class cMDMFunctionsAllgemein
|
||||
'2550 End If
|
||||
|
||||
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim summeAlteSchnittstelle As Double
|
||||
Dim summeAlteSchnittstelle As Double = 0
|
||||
|
||||
Dim sqlFMZollDaten = "SELECT dbo.tblTrdinInvoice.RechnungsKundenNr AS AdressenNr, dbo.tblSteuernummern.LandNr, SUM(dbo.tblTrdinInvoice.SteuerbetragLokal) As Vorschaubetrag From dbo.tblTrdinInvoice
|
||||
INNER Join dbo.tblSteuernummern ON dbo.tblTrdinInvoice.RechnungsKundenNr = dbo.tblSteuernummern.AdressenNr
|
||||
@@ -341,7 +341,8 @@ Public Class cMDMFunctionsAllgemein
|
||||
Try
|
||||
|
||||
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim summeAlteSchnittstelle As Double
|
||||
Dim summeAlteSchnittstelle As Double = 0
|
||||
Dim summeNeueSchnittstelle As Double = 0
|
||||
Dim sqlFMZollDaten = "SELECT dbo.tblDieselArchiv.KdNrVERAG AS AdressenNr, dbo.tblSteuernummern.LandNr, SUM(dbo.tblDieselArchiv.[VAT Amount]) AS Vorschaubetrag
|
||||
FROM dbo.tblDieselArchiv INNER JOIN
|
||||
dbo.tblSteuernummern ON dbo.tblDieselArchiv.KdNrVERAG = dbo.tblSteuernummern.AdressenNr INNER JOIN
|
||||
@@ -361,7 +362,27 @@ Public Class cMDMFunctionsAllgemein
|
||||
End If
|
||||
Next
|
||||
|
||||
Return summeAlteSchnittstelle
|
||||
If False Then
|
||||
Dim sqlFMZollDatenNEU = "SELECT [tblIDSTransactionsNew].KdNrVERAG AS AdressenNr, dbo.tblSteuernummern.LandNr, SUM([tblIDSTransactionsNew].[VAT Amount]) AS Vorschaubetrag
|
||||
FROM tblIDSTransactionsNew INNER JOIN
|
||||
dbo.tblSteuernummern ON [tblIDSTransactionsNew].KdNrVERAG = dbo.tblSteuernummern.AdressenNr INNER JOIN
|
||||
dbo.tbl_IDS_Länder ON dbo.tblSteuernummern.LandNr = dbo.tbl_IDS_Länder.LandNr AND [tblIDSTransactionsNew].[Outlet Country Code] = dbo.tbl_IDS_Länder.OutletCountryCode
|
||||
WHERE ([tblIDSTransactionsNew].KdNrVERAG = " & varUStVAn_KuNr & " ) AND ([tblIDSTransactionsNew].[YearMonthDay] >= '" & invoiceDate.ToShortDateString & "') AND ([tblIDSTransactionsNew].UStVAn_ID IS NULL) AND
|
||||
(dbo.tblSteuernummern.UStV = 1)
|
||||
GROUP BY [tblIDSTransactionsNew].KdNrVERAG, dbo.tblSteuernummern.LandNr
|
||||
ORDER BY [tblIDSTransactionsNew].KdNrVERAG, dbo.tblSteuernummern.LandNr"
|
||||
|
||||
Dim dtIDSENeut As DataTable = sql.loadDgvBySql(sqlFMZollDatenNEU, "FMZOLL")
|
||||
|
||||
For Each r As DataRow In dtIDSENeut.Rows
|
||||
Dim UST_org = CDbl(r.Item("UST_EUR"))
|
||||
If UST_org <> 0 Then
|
||||
summeNeueSchnittstelle += UST_org
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Return summeAlteSchnittstelle + summeNeueSchnittstelle
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
||||
@@ -390,7 +411,7 @@ Public Class cMDMFunctionsAllgemein
|
||||
Try
|
||||
|
||||
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim summeSchnittstelle As Double
|
||||
Dim summeSchnittstelle As Double = 0
|
||||
|
||||
Dim sqlPLOSE = "select plose_POLSEKundennummer, sum([plose_MWSTBetragWaehrungAbbuchung])[plose_MWSTBetragWaehrungAbbuchung] FROM [tblPLOSE_Details] INNER JOIN Adressen on PLOSEKundenNr=plose_POLSEKundennummer
|
||||
WHERE plose_Archiv <> 1 AND plose_Fakturiert = 1 AND plose_LieferantCode IN (0,1,7) AND cast(plose_RechnungsDatum as date) >= '" & invoiceDate.ToShortDateString & "' and AdressenNr = " & varUStVAn_KuNr & "
|
||||
@@ -452,7 +473,7 @@ Public Class cMDMFunctionsAllgemein
|
||||
'1770 Set qdf = Nothing
|
||||
'1780 End If
|
||||
Try
|
||||
Dim summechnittstelle As Double
|
||||
Dim summechnittstelle As Double = 0
|
||||
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim sqlITSumme = "SELECT dbo.tblSteuernummern.AdressenNr, dbo.tblSteuernummern.LandNr, dbo.tblMautITArchiv.Verrechnungsdatum AS Rechnungsdatum,
|
||||
dbo.tblMautITArchiv.Code_Adressat_des_Kontoauszugs AS Rechnungsnummer,
|
||||
@@ -508,8 +529,8 @@ Public Class cMDMFunctionsAllgemein
|
||||
'2010 rst.MoveNext
|
||||
Try
|
||||
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim summeNeueSchnittstelle As Double
|
||||
Dim summeAlteSchnittstelle As Double
|
||||
Dim summeNeueSchnittstelle As Double = 0
|
||||
Dim summeAlteSchnittstelle As Double = 0
|
||||
Dim sqlFMZollDatenALT = "SELECT dbo.tblSteuernummern.AdressenNr, dbo.tblSteuernummern.LandNr, dbo.tblMSETransactionsArchiv.[Invoice Date] AS Rechnungsdatum, SUM(dbo.tblMSETransactionsArchiv.[Original VAT Amount]) AS Vorschaubetrag, dbo.tblMSETransactionsArchiv.[Original Currency] AS Währungscode
|
||||
FROM dbo.tblSteuernummern INNER JOIN
|
||||
dbo.Adressen ON dbo.tblSteuernummern.AdressenNr = dbo.Adressen.AdressenNr INNER JOIN
|
||||
@@ -606,8 +627,8 @@ Public Class cMDMFunctionsAllgemein
|
||||
|
||||
Try
|
||||
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim summeAlteSchnittstelle As Double
|
||||
Dim summeNeueSchnittstelle As Double
|
||||
Dim summeAlteSchnittstelle As Double = 0
|
||||
Dim summeNeueSchnittstelle As Double = 0
|
||||
|
||||
Dim sqlFMZollDaten = "SELECT dbo.tblSteuernummern.AdressenNr, dbo.tblSteuernummern.LandNr, SUM(dbo.tblUTAArchiv.Gesamtbetrag_Umsatzsteuer_in_Darstellwährung) AS Vorschaubetrag
|
||||
FROM dbo.tblSteuernummern INNER JOIN
|
||||
|
||||
Reference in New Issue
Block a user