diff --git a/SDL/Classes/cFiskaltrustClient.vb b/SDL/Classes/cFiskaltrustClient.vb new file mode 100644 index 00000000..1c0245bf --- /dev/null +++ b/SDL/Classes/cFiskaltrustClient.vb @@ -0,0 +1,181 @@ +Imports System.Net.Http +Imports System.Text +Imports Newtonsoft.Json +Imports System.Threading + +Public Class cFiskaltrustClient + + + Private ReadOnly _baseUrl As String + Private ReadOnly _cashboxId As String + Private ReadOnly _accessToken As String + Private ReadOnly _country As String + + Private Shared ReadOnly _httpClient As New HttpClient() + + Public Sub New(baseUrl As String, cashboxId As String, accessToken As String, country As String) + _baseUrl = baseUrl.TrimEnd("/"c) + _cashboxId = cashboxId + _accessToken = accessToken + _country = country + End Sub + + ' ================================ + ' PUBLIC API + ' ================================ + Public Async Function SignReceiptAsync(amount As Double, vat As Double, POS As List(Of EABelegPositionen)) As Task(Of String) + + Dim payload = BuildPayload(amount, vat, POS) + Dim endpoint = GetEndpoint() + + Return Await SendAsync(endpoint, payload) + + End Function + + ' Optional: Storno Beispiel + Public Async Function CancelReceiptAsync(reference As String) As Task(Of String) + + Dim payload = New With { + .ftCashBoxID = _cashboxId, + .ftPosSystemId = "POS-1", + .cbTerminalID = "T1", + .cbReceiptReference = reference, + .cbReceiptMoment = DateTime.UtcNow.ToString("o"), + .ftReceiptCase = 4919338172267102210 ' Storno + } + + Return Await SendAsync(GetEndpoint(), payload) + + End Function + + ' ================================ + ' CORE HTTP LOGIC (RETRY!) + ' ================================ + Private Async Function SendAsync(endpoint As String, payload As Object) As Task(Of String) + + Dim exToThrow As Exception = Nothing + + Dim json As String = JsonConvert.SerializeObject(payload) + Dim url = _baseUrl & endpoint + + Dim retries As Integer = 3 + Dim delayMs As Integer = 500 + + For attempt = 1 To retries + + Try + Using request As New HttpRequestMessage(HttpMethod.Post, url) + + request.Headers.Add("cashboxid", _cashboxId) + request.Headers.Add("accesstoken", _accessToken) + + request.Content = New StringContent(json, Encoding.UTF8, "application/json") + + Dim response = Await _httpClient.SendAsync(request) + Dim result = Await response.Content.ReadAsStringAsync() + + ' Logging Hook + Log($"[{DateTime.Now}] Response ({response.StatusCode}): {result}") + + If response.IsSuccessStatusCode Then + Return result + End If + + ' Retry only on transient errors + If CType(response.StatusCode, Integer) >= 500 Then + Throw New Exception("Server error: " & result) + Else + ' Client error → no retry + Throw New Exception("Client error: " & result) + End If + + End Using + + Catch ex As Exception + + Log($"[{DateTime.Now}] Attempt {attempt} failed: {ex.Message}") + + If attempt = retries Then + exToThrow = ex + End If + + End Try + + If exToThrow IsNot Nothing Then + Await Task.Delay(1000) ' ✅ jetzt OK + Throw exToThrow + End If + + Next + + Throw New Exception("Unexpected error") + + End Function + + ' ================================ + ' PAYLOAD BUILDER + ' ================================ + Private Function BuildPayload(amount As Double, vat As Double, POS As List(Of EABelegPositionen)) As Object + + ' ChargeItems Liste vorbereiten + Dim chargeItems = New List(Of Object) + + For Each p In POS + chargeItems.Add(New With { + .Quantity = p.Anzahl, + .Amount = p.Preis, + .VATRate = vat, + .Description = p.LeistungsBez, + .ftChargeItemCase = 4919338167972134929 + }) + Next + + ' Payload Objekt erstellen + Dim payload = New With { + .ftCashBoxID = _cashboxId, + .ftPosSystemId = "POS-1", + .cbTerminalID = "T1", + .cbReceiptReference = Guid.NewGuid().ToString(), + .cbReceiptMoment = DateTime.UtcNow.ToString("o"), + .cbChargeItems = chargeItems, + .cbPayItems = New Object() { + New With { + .Quantity = 1.0, + .Amount = amount, + .Description = "Cash", + .ftPayItemCase = 4919338167972134913 + } + }, + .ftReceiptCase = 4919338172267102209 + } + + Return payload + + End Function + + ' ================================ + ' ENDPOINT SWITCH + ' ================================ + Private Function GetEndpoint() As String + Select Case _country + Case "DE" + Return "/json/v1/Sign" + Case "AT" + Return "/json/Sign" + Case Else + Throw New Exception("Unsupported country") + End Select + End Function + + ' ================================ + ' LOGGING (REPLACE IN PROD!) + ' ================================ + Private Sub Log(message As String) + ' 👉 Hier anschließen: + ' - Datei + ' - Datenbank + ' - Serilog / NLog + Console.WriteLine(message) + End Sub + +End Class \ No newline at end of file diff --git a/SDL/Classes/cRKSV.vb b/SDL/Classes/cRKSV.vb index 77c8f400..9042c38f 100644 --- a/SDL/Classes/cRKSV.vb +++ b/SDL/Classes/cRKSV.vb @@ -1,6 +1,8 @@ -Imports System.Globalization +Imports System.Net.Http +Imports System.Text Imports GrapeCity.ActiveReports -Imports GrapeCity.DataVisualization.TypeScript +Imports GrapeCity.DataVisualization.Options +Imports Newtonsoft.json Imports SDL.RKSVServer Imports VERAG_PROG_ALLGEMEIN.DSFinVKService @@ -89,6 +91,54 @@ Public Class cRKSV Return False End Function + + Shared Function insertRKSVFiskaltrust(ByVal kasse As cRKSV_Kasse, CompanyGUID As String, ByVal umsatzZaehler As Double, ByVal belegDat As DateTime, ByVal steuerSchluessel As Integer, ByVal RKSV_Beleg_Id As Integer, ByVal summeBRUTTO As Double, TEST As Boolean, POS As List(Of EABelegPositionen)) As Boolean + Try + + + Dim credentials As New SDL.RKSVServer.DBUserCredentials + + credentials.Database = "RKSVWcfDB" + credentials.Server = "AVISO\SQLEXPRESS" + credentials.Username = "Admin" + credentials.Password = "verag#2" + credentials.CashboxID = kasse.rksv_FT_CashboxID + credentials.CompanyGUID = CompanyGUID + Dim AccessToken As String = kasse.rksv_FT_AccessToken + + Dim jws As String = String.Empty + Dim qr As String = String.Empty + Dim ocra As String = String.Empty + 'Dim answer As String = String.Empty + + Dim Belegnummer = RKSV_Beleg_Id + Dim BelegDatumUhrzeit = belegDat ' BELEG.BelegDat + + Dim steuersatz As Double = SQL.getValueTxtBySql("SELECT isnull(tblSteuersätze.Steuersatz,0) FROM tblSteuersätze WHERE tblSteuersätze.Nr='" & steuerSchluessel & "' ", "FMZOLL") + + + + Dim BetragSatzNormal = IIf(steuersatz = 0.2, summeBRUTTO, 0.0) 'summe + Dim BetragSatzErm1 = IIf(steuersatz = 0.1, summeBRUTTO, 0.0) + Dim BetragSatzErm2 = IIf(steuersatz = 0.13, summeBRUTTO, 0.0) + Dim BetragSatzNull = IIf(steuersatz = 0.0, summeBRUTTO, 0.0) + Dim BetragSatzBesonders = IIf(steuersatz = 0.19, summeBRUTTO, 0.0) + Dim StandUmsatzzaehler = umsatzZaehler 'KASSE.rksv_Umsatzzaehler + + Dim countryID As String + + Dim client As New cFiskaltrustClient(kasse.rksv_FT_RestServiceURL, kasse.rksv_FT_CashboxID, kasse.rksv_FT_AccessToken, kasse.rksv_FT_Country) + + Dim result = client.SignReceiptAsync(summeBRUTTO, steuersatz, POS) + + + Catch ex As Exception + MsgBox("Es ist ein Fehler bei der Signatur aufgetreten (insertRKSV): " & vbNewLine & ex.Message & ex.StackTrace) + End Try + Return False + End Function + + Shared Function getKB(BELEG As EABeleg, PERSONAL As cPersonal, ByRef KBEntry As cKassenbuch, ByRef KBEntryGB As cKassenbuch, Firma As String) As Boolean Dim j1 = SQL.getValueTxtBySql("SELECT [JournalNr] FROM [tblKassenbuch] " & " WHERE [Mandant]='" & PERSONAL.Mandant & "' AND [Niederlassung]='" & PERSONAL.Niederlassung & "' AND [Benutzer]='" & PERSONAL.ID & "' AND [Geschäftsjahr]='" & cRKSV.getGJ_FIRMA(BELEG.BelegDat, Firma) & "' AND [BelegNr] ='" & BELEG.BelegNr & "' and Steuer <=0 AND Soll <> 0", "FMZOLL") @@ -2354,7 +2404,7 @@ Public Class cRKSV End If Dim Buchungstext As String = "Umb.BK / KASSA" - if BELEG.ECZahlungsNr IsNot Nothing AndAlso BELEG.ECZahlungsNr <> "" Then + If BELEG.ECZahlungsNr IsNot Nothing AndAlso BELEG.ECZahlungsNr <> "" Then Buchungstext &= " " & BELEG.ECZahlungsNr End If @@ -2478,7 +2528,7 @@ Public Class cRKSV End If - End Sub + End Sub Private Shared Sub getDEBDaten(ByRef Mandant As String, ByRef DebKonto As Integer, ByRef c_sprache As String, ByRef c_ustidnr As String, ByRef c_zahlziel As String, ByRef si_tage As Integer, ByRef dec_skonto As Integer, ByRef si_ntage As Integer, ByRef SkontoDatum As Date, ByRef Nettodatum As Date) diff --git a/SDL/Classes/cRKSV_Kasse.vb b/SDL/Classes/cRKSV_Kasse.vb index c786ad68..f76d0f02 100644 --- a/SDL/Classes/cRKSV_Kasse.vb +++ b/SDL/Classes/cRKSV_Kasse.vb @@ -25,6 +25,10 @@ Public Class cRKSV_Kasse Property rksv_DE_apiToken As Object = Nothing Property rksv_DE_license As Object = Nothing Property rksv_StornoIncreaseBelegCnt As Object = Nothing + Property rksv_FT_CashboxID As Object = Nothing + Property rksv_FT_AccessToken As Object = Nothing + Property rksv_FT_RestServiceURL As Object = Nothing + Property rksv_FT_Country As Object = Nothing Dim SQL As New SQL @@ -224,6 +228,10 @@ Public Class cRKSV_Kasse Me.rksv_DE_apiToken = cSqlDb.checkNullReturnValue(dr.Item("rksv_DE_apiToken"), Nothing) Me.rksv_DE_license = cSqlDb.checkNullReturnValue(dr.Item("rksv_DE_license"), Nothing) Me.rksv_StornoIncreaseBelegCnt = cSqlDb.checkNullBool(dr.Item("rksv_StornoIncreaseBelegCnt")) + Me.rksv_FT_CashboxID = cSqlDb.checkNullReturnValue(dr.Item("rksv_FT_CashboxID"), Nothing) + Me.rksv_FT_AccessToken = cSqlDb.checkNullReturnValue(dr.Item("rksv_FT_AccessToken"), Nothing) + Me.rksv_FT_RestServiceURL = cSqlDb.checkNullReturnValue(dr.Item("rksv_FT_RestServiceURL"), Nothing) + Me.rksv_FT_Country = cSqlDb.checkNullReturnValue(dr.Item("rksv_FT_Country"), Nothing) End If dr.Close() @@ -261,6 +269,10 @@ Public Class cRKSV_Kasse list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_DE_apiToken", rksv_DE_apiToken)) list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_DE_license", rksv_DE_license)) list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_StornoIncreaseBelegCnt", rksv_StornoIncreaseBelegCnt)) + list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_FT_CashboxID", rksv_FT_CashboxID)) + list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_FT_AccessToken", rksv_FT_AccessToken)) + list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_FT_RestServiceURL", rksv_FT_RestServiceURL)) + list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem2("rksv_FT_Country", rksv_FT_Country)) Return list diff --git a/SDL/Fakturierung/cFakturierung.vb b/SDL/Fakturierung/cFakturierung.vb index 1683ad09..bb4dc212 100644 --- a/SDL/Fakturierung/cFakturierung.vb +++ b/SDL/Fakturierung/cFakturierung.vb @@ -1197,6 +1197,7 @@ Public Class cFakturierung If Buchungsjahr Is Nothing Then Buchungsjahr = Now.Year rpt.txtBank3.Visible = False + rpt.txtBank2.Visible = True ' Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA Select Case FIRMA.Firma_ID @@ -1213,6 +1214,8 @@ Public Class cFakturierung rpt.txtBank2.Text = If(FIRMA.Firma_Bankverbindung2, "") & vbNewLine & If(FIRMA.Firma_IBAN2, "") & vbNewLine & If(FIRMA.Firma_BIC2, "").ToString.Trim rpt.txtBank3.Visible = True + rpt.txtBank2.Visible = False 'soll beim AMBAR ausgeblendet werden (Laut I.Ordu am 27.03.2026) + 'Änderung Ticket_Nr.: 6983 'rpt.txtBank3.Text = "Garanti Bank Türkei – Euro Konto" & vbNewLine & "IBAN: TR90 0006 2001 6040 0009 0804 66" & vbNewLine & "BIC/SWIFT: TGBATRISXXX".ToString.Trim 'rpt.txtBank3.Text = "Garanti Bank Türkei – Euro Konto" & vbNewLine & "IBAN: TR90 0006 2001 6040 0009 0804 66" & vbNewLine & "BIC/SWIFT: TGBATRISXXX".ToString.Trim diff --git a/SDL/Fakturierung/frmRechnungenSuche.Designer.vb b/SDL/Fakturierung/frmRechnungenSuche.Designer.vb index 9c9f772d..f9cf363b 100644 --- a/SDL/Fakturierung/frmRechnungenSuche.Designer.vb +++ b/SDL/Fakturierung/frmRechnungenSuche.Designer.vb @@ -115,6 +115,7 @@ Partial Class frmRechnungenSuche Me.NachRechnungslandToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.NachLeistungsnummerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.NachZollabfertigungspreisenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.RechnungenOhnePositionenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.Button3 = New System.Windows.Forms.Button() Me.Button1 = New System.Windows.Forms.Button() Me.Label10 = New System.Windows.Forms.Label() @@ -140,7 +141,7 @@ Partial Class frmRechnungenSuche Me.pnlTop = New System.Windows.Forms.Panel() Me.PictureBox5 = New System.Windows.Forms.PictureBox() Me.TestToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.RechnungenOhnePositionenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainer.Panel1.SuspendLayout() Me.SplitContainer.Panel2.SuspendLayout() @@ -162,6 +163,7 @@ Partial Class frmRechnungenSuche Me.ctxtRg.SuspendLayout() Me.pnlTop.SuspendLayout() CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'SplitContainer @@ -1543,6 +1545,7 @@ Partial Class frmRechnungenSuche ' 'pnlBerichte ' + Me.pnlBerichte.Controls.Add(Me.PictureBox1) Me.pnlBerichte.Controls.Add(Me.Button8) Me.pnlBerichte.Controls.Add(Me.MenuStrip2) Me.pnlBerichte.Controls.Add(Me.Button3) @@ -1580,7 +1583,7 @@ Partial Class frmRechnungenSuche Me.MenuStrip2.Location = New System.Drawing.Point(3, 27) Me.MenuStrip2.Name = "MenuStrip2" Me.MenuStrip2.Padding = New System.Windows.Forms.Padding(5, 2, 0, 2) - Me.MenuStrip2.Size = New System.Drawing.Size(263, 28) + Me.MenuStrip2.Size = New System.Drawing.Size(143, 28) Me.MenuStrip2.TabIndex = 45 Me.MenuStrip2.Text = "Kundenauswertungen" ' @@ -1599,30 +1602,37 @@ Partial Class frmRechnungenSuche ' Me.ToolStripMenuItem3.Image = Global.SDL.My.Resources.Resources.statistik_small Me.ToolStripMenuItem3.Name = "ToolStripMenuItem3" - Me.ToolStripMenuItem3.Size = New System.Drawing.Size(276, 26) + Me.ToolStripMenuItem3.Size = New System.Drawing.Size(272, 24) Me.ToolStripMenuItem3.Text = "Nach Rechnungsanschrift" ' 'NachRechnungslandToolStripMenuItem ' Me.NachRechnungslandToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.Excel_logo Me.NachRechnungslandToolStripMenuItem.Name = "NachRechnungslandToolStripMenuItem" - Me.NachRechnungslandToolStripMenuItem.Size = New System.Drawing.Size(276, 26) + Me.NachRechnungslandToolStripMenuItem.Size = New System.Drawing.Size(272, 24) Me.NachRechnungslandToolStripMenuItem.Text = "Nach Rechnungsland" ' 'NachLeistungsnummerToolStripMenuItem ' Me.NachLeistungsnummerToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.Excel_logo Me.NachLeistungsnummerToolStripMenuItem.Name = "NachLeistungsnummerToolStripMenuItem" - Me.NachLeistungsnummerToolStripMenuItem.Size = New System.Drawing.Size(276, 26) + Me.NachLeistungsnummerToolStripMenuItem.Size = New System.Drawing.Size(272, 24) Me.NachLeistungsnummerToolStripMenuItem.Text = "Nach Leistungsnummer" ' 'NachZollabfertigungspreisenToolStripMenuItem ' Me.NachZollabfertigungspreisenToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.Excel_logo Me.NachZollabfertigungspreisenToolStripMenuItem.Name = "NachZollabfertigungspreisenToolStripMenuItem" - Me.NachZollabfertigungspreisenToolStripMenuItem.Size = New System.Drawing.Size(276, 26) + Me.NachZollabfertigungspreisenToolStripMenuItem.Size = New System.Drawing.Size(272, 24) Me.NachZollabfertigungspreisenToolStripMenuItem.Text = "Nach Zollabf.-preisen (LNr: 340)" ' + 'RechnungenOhnePositionenToolStripMenuItem + ' + Me.RechnungenOhnePositionenToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.Excel_logo + Me.RechnungenOhnePositionenToolStripMenuItem.Name = "RechnungenOhnePositionenToolStripMenuItem" + Me.RechnungenOhnePositionenToolStripMenuItem.Size = New System.Drawing.Size(272, 24) + Me.RechnungenOhnePositionenToolStripMenuItem.Text = "Rechnungen ohne Positionen" + ' 'Button3 ' Me.Button3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) @@ -1881,12 +1891,16 @@ Partial Class frmRechnungenSuche Me.TestToolStripMenuItem.Size = New System.Drawing.Size(150, 19) Me.TestToolStripMenuItem.Text = "test" ' - 'RechnungenOhnePositionenToolStripMenuItem + 'PictureBox1 ' - Me.RechnungenOhnePositionenToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.Excel_logo - Me.RechnungenOhnePositionenToolStripMenuItem.Name = "RechnungenOhnePositionenToolStripMenuItem" - Me.RechnungenOhnePositionenToolStripMenuItem.Size = New System.Drawing.Size(276, 26) - Me.RechnungenOhnePositionenToolStripMenuItem.Text = "Rechnungen ohne Positionen" + Me.PictureBox1.BackgroundImage = Global.SDL.My.Resources.Resources.fragezeichen + Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom + Me.PictureBox1.Location = New System.Drawing.Point(900, 20) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(18, 19) + Me.PictureBox1.TabIndex = 132 + Me.PictureBox1.TabStop = False + Me.PictureBox1.Visible = False ' 'frmRechnungenSuche ' @@ -1929,6 +1943,7 @@ Partial Class frmRechnungenSuche Me.pnlTop.ResumeLayout(False) Me.pnlTop.PerformLayout() CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub @@ -2049,4 +2064,5 @@ Partial Class frmRechnungenSuche Friend WithEvents NachLeistungsnummerToolStripMenuItem As ToolStripMenuItem Friend WithEvents Button8 As Button Friend WithEvents RechnungenOhnePositionenToolStripMenuItem As ToolStripMenuItem + Friend WithEvents PictureBox1 As PictureBox End Class diff --git a/SDL/Fakturierung/frmRechnungenSuche.vb b/SDL/Fakturierung/frmRechnungenSuche.vb index 4fa0ddb2..0cebf993 100644 --- a/SDL/Fakturierung/frmRechnungenSuche.vb +++ b/SDL/Fakturierung/frmRechnungenSuche.vb @@ -1031,4 +1031,8 @@ Public Class frmRechnungenSuche End Try End Sub + Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click + Dim webAddress As String = "https://wiki.verag.ag/de/abteilungen/verrechnung/xxxx#provisionsverg%C3%BCtung" + Process.Start(webAddress) + End Sub End Class \ No newline at end of file diff --git a/SDL/Fakturierung/usrCntlFaktAbrechnung.vb b/SDL/Fakturierung/usrCntlFaktAbrechnung.vb index 4000099d..3577381b 100644 --- a/SDL/Fakturierung/usrCntlFaktAbrechnung.vb +++ b/SDL/Fakturierung/usrCntlFaktAbrechnung.vb @@ -1,6 +1,7 @@ Imports System.Data.SqlClient Imports System.IO Imports System.Web.UI.WebControls.Expressions +Imports com.sun.xml.internal.rngom Imports VERAG_PROG_ALLGEMEIN Public Class usrCntlFaktAbrechnung @@ -1885,6 +1886,8 @@ Public Class usrCntlFaktAbrechnung .Rows.Add(0, r("anh_Art"), r("anh_Name"), r("anh_docId"), r("anh_id")) Next End If + + End If RECHNUNG.LOAD_ANHAENGE() @@ -1899,7 +1902,7 @@ Public Class usrCntlFaktAbrechnung End If Next '----------------------------- - + addCBamFlyer(dgvAnhaenge) '----------------------------- 'ANHÄNGE SELEKTIEREN '----------------------------- @@ -5363,10 +5366,7 @@ mwst: Return isMWST End Function - Private Sub ApplyPreis( - r As DataGridViewRow, - summen As AntragSummen, - isRMCKunde As Boolean) + Private Sub ApplyPreis(r As DataGridViewRow, summen As AntragSummen, isRMCKunde As Boolean) r.Cells("Anzahl").Value = 1 @@ -5381,24 +5381,13 @@ mwst: End Sub - Private Sub ApplyBearbeitungsGebuehr( - r As DataGridViewRow, - summen As AntragSummen, - ByRef summeRMC As Double, - ByRef summeFremd As Double, - ByRef fremdUndRMC As Boolean, - ByRef posChanged As Boolean, - changed As Boolean, - sumOffertRMC As Double, - sumOffertFremd As Double) + Private Sub ApplyBearbeitungsGebuehr(r As DataGridViewRow, summen As AntragSummen, ByRef summeRMC As Double, ByRef summeFremd As Double, ByRef fremdUndRMC As Boolean, ByRef posChanged As Boolean, changed As Boolean, sumOffertRMC As Double, sumOffertFremd As Double) If IsDBNull(r.Cells("BGebLeistungsNr").Value) Then Exit Sub If IsDBNull(r.Cells("BGebProzent").Value) Then Exit Sub If IsDBNull(r.Cells("Preis").Value) Then Exit Sub - ' hier nur noch Gebühr-Logik - ' KEINE MWST-Logik mehr - ' KEINE Antrag-Logik mehr + posChanged = True @@ -5419,4 +5408,40 @@ mwst: OrElse SPEDBUCH.Abfertigungsart = 10 End Function + Private Sub addCBamFlyer(dgv As DataGridView) + + If RECHNUNG Is Nothing Then Exit Sub + If SPEDBUCH Is Nothing Then Exit Sub + + + If RECHNUNG.ReErfZeitstempel IsNot Nothing AndAlso CDate(RECHNUNG.ReErfZeitstempel) <= DateTime.Parse("26/05/2026") AndAlso RECHNUNG.DruckDatumZeit Is Nothing Then + + Select Case FIRMA.Firma_ID + Case 7, 19 + Case Else + If SPEDBUCH.Abfertigungsart IsNot Nothing Then + If RECHNUNG.RechnungsLandKz <> "TR" AndAlso RECHNUNG.RechnungsLandKz <> "GB" Then + Select Case SPEDBUCH.Abfertigungsart + Case 1, 3, 5, 7, 26, 28, 38, 39, 29, 66 + Dim docID As Integer = IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, 13567402, 13638537) + + Dim exists = dgv.Rows.Cast(Of DataGridViewRow)().Any(Function(r) Not r.IsNewRow AndAlso CInt(r.Cells("anh_docId").Value) = docID) + + If Not exists Then + dgv.Rows.Add(1, "INFO", "CBAM-FLYER", docID, 0) + End If + + End Select + End If + End If + + + End Select + + + + End If + + End Sub + End Class \ No newline at end of file diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index 5edcb0c8..a3e6ccc3 100644 --- a/SDL/My Project/AssemblyInfo.vb +++ b/SDL/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/SDL/SDL.vbproj b/SDL/SDL.vbproj index 1e8bd8ae..00e785ef 100644 --- a/SDL/SDL.vbproj +++ b/SDL/SDL.vbproj @@ -408,6 +408,9 @@ True + + ..\..\..\Aviso\AVISO\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll + ..\..\..\dll\NumericBox.dll @@ -442,6 +445,11 @@ + + ..\..\..\Aviso\AVISO\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll True @@ -451,9 +459,39 @@ ..\packages\System.IO.Packaging.4.5.0\lib\net46\System.IO.Packaging.dll + + ..\..\..\Aviso\AVISO\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + True + True + + + ..\..\..\Aviso\AVISO\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + + + ..\..\..\Aviso\AVISO\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\..\..\Aviso\AVISO\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\..\..\Aviso\AVISO\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\..\..\Aviso\AVISO\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + @@ -684,6 +722,7 @@ + diff --git a/SDL/Speditionsbuch/frmProvisionisverguetung.vb b/SDL/Speditionsbuch/frmProvisionisverguetung.vb index b7de5417..be5bd19f 100644 --- a/SDL/Speditionsbuch/frmProvisionisverguetung.vb +++ b/SDL/Speditionsbuch/frmProvisionisverguetung.vb @@ -152,7 +152,7 @@ Public Class frmProvisionisverguetung Dim mailText As String = "Sehr geehrte Damen und Herren," & vbNewLine & vbNewLine & "anbei die PROVISIONSABRECHNUNG von " & txtAbfertDat._value & " bis " & txtAbfertDatBis._value & "." & vbNewLine & vbNewLine & vbNewLine mailText &= "" - mailText &= "" + mailText &= "" Dim sumProv As Double = 0 Dim sumUmsatz As Double = 0 @@ -161,7 +161,7 @@ Public Class frmProvisionisverguetung For Each row As DataGridViewRow In dgv.SelectedRows mailText &= "" - mailText &= "" + mailText &= "" mailText &= "" mailText &= "" mailText &= "" @@ -189,6 +189,8 @@ Public Class frmProvisionisverguetung Mail.HTMLBody = TextHTML End If + Mail.Subject = "Provisionsauswertung" + Mail.To = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(ad.AdressenNr, "Rechnung an") Mail.CC = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressCC(ad.AdressenNr, "Rechnung an") Mail.BCC = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressBCC(ad.AdressenNr, "Rechnung an") diff --git a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb index 2ee0f24f..d02e6ce2 100644 --- a/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb +++ b/SDL/Speditionsbuch/usrCntlSpeditionsBuchSuche.vb @@ -54,7 +54,7 @@ Public Class usrCntlSpeditionsBuchSuche dgvLKW.Visible = False sqlstr &= " SELECT " & TopMax & " [FilialenNr],[AbfertigungsNr],[UnterNr],[Abfertigungsdatum],speditionsbuch.[Abfertigungsart],Abfertigungsarten.Abfertigungsbezeichnung, " & - " isnull(cast([AbsenderKundenNr] as nvarchar(7)) + ' ','') + [Absender] as Absender,isnull(cast([EmpfängerKundenNr] as nvarchar(7)) + ' ','') + [Empfänger] as Empfänger,isnull(cast([VermittlerKundenNr] as nvarchar(7)) + ' ','') + [Vermittler] as Vermittler,isnull(cast([FrachtführerKundenNr] as nvarchar(7)) + ' ','') + [Frachtführer] as Frachtführer, " & + " isnull(cast([AbsenderKundenNr] as nvarchar(7)) + ' ','') + [Absender] as Absender,isnull(cast([EmpfängerKundenNr] as nvarchar(7)) + ' ','') + [Empfänger] as Empfänger,isnull(cast([VermittlerKundenNr] as nvarchar(7)) + ' ','') + [Vermittler] as Vermittler,isnull(cast([FrachtführerKundenNr] as nvarchar(7)) + ' ','') + [Frachtführer] as Frachtführer,isnull(cast([AvisiererKundenNr] as nvarchar(7)) + ' ','') + [Avisierer] as Avisierer, " & " [LKW Kennzeichen],QKN,(SELECT isnull(Name,'') FROM Personal Where Personalnummer=ID) AS Sachbearbeiter,BelegNr, Grenzstelle FROM [Speditionsbuch] LEFT JOIN Abfertigungsarten ON Abfertigungsarten.Abfertigungsart=speditionsbuch.Abfertigungsart WHERE 1=1 " '/*Sachbearbeiter ,[Bar],[Fakturiert],[BelegNr],[ErfassungsNr],[AnzahlZA],[AnzahlZAFremd],[AnzahlZnV],[AnzahlZnVFremd],[AnzahlT1],[AnzahlT2],[AnzahlAE],[AnzahlCarnetTIR],[AnzahlBarvorlagen],[AnzahlSonstiges],[AnzahlGrenzgebühren],[AvisUhrzeit],[Rechnungsbetrag],[Abfertigungsanzahl],[Barzahlungsbetrag],[Sachbearbeiter],[Personalnummer],[AtlasBezNrEZA],[AtlasBezNrNCTS],[Versendungsland],[SB_CMR],[SB_CMRDatum],[veoerz_basbtg],[Zucker_MRN_Nr],[Zucker_MRN_Datum],[Zucker_Aufschub],[Zollsystem],[Bestimmungszollstelle],[Bürgschaft],[Sicherheitsbetrag],[SgutKompl],[Bestimmungsland],[EuFiskalEmpfänger],[QKN],[EndempfängerKundenNr],[Endempfänger] */ With DataGridView @@ -103,9 +103,11 @@ Public Class usrCntlSpeditionsBuchSuche .Columns("Frächter").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill .Columns("Frächter").MinimumWidth = 150 + .Columns("Avisierer").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill .Columns("Avisierer").MinimumWidth = 150 + .Columns("Freigabe").Width = 105 @@ -116,7 +118,7 @@ Public Class usrCntlSpeditionsBuchSuche If dgvLKW.SelectedRows().Count = 0 Then Exit Sub Dim sqlstrTmp = " SELECT " & TopMax & " [FilialenNr],[AbfertigungsNr],[UnterNr],[Abfertigungsdatum],speditionsbuch.[Abfertigungsart],Abfertigungsarten.Abfertigungsbezeichnung, " & - " isnull(cast([AbsenderKundenNr] as nvarchar(7)) + ' ','') + [Absender] as Absender,isnull(cast([EmpfängerKundenNr] as nvarchar(7)) + ' ','') + [Empfänger] as Empfänger,isnull(cast([VermittlerKundenNr] as nvarchar(7)) + ' ','') + [Vermittler] as Vermittler,isnull(cast([FrachtführerKundenNr] as nvarchar(7)) + ' ','') + [Frachtführer] as Frachtführer, " & + " isnull(cast([AbsenderKundenNr] as nvarchar(7)) + ' ','') + [Absender] as Absender,isnull(cast([EmpfängerKundenNr] as nvarchar(7)) + ' ','') + [Empfänger] as Empfänger,isnull(cast([VermittlerKundenNr] as nvarchar(7)) + ' ','') + [Vermittler] as Vermittler,isnull(cast([FrachtführerKundenNr] as nvarchar(7)) + ' ','') + [Frachtführer] as Frachtführer,isnull(cast([AvisiererKundenNr] as nvarchar(7)) + ' ','') + [Avisierer] as Avisierer, " & " [LKW Kennzeichen],QKN,(SELECT isnull(Name,'') FROM Personal Where Personalnummer=ID) AS Sachbearbeiter ,BelegNr, Grenzstelle FROM [Speditionsbuch] LEFT JOIN Abfertigungsarten ON Abfertigungsarten.Abfertigungsart=speditionsbuch.Abfertigungsart WHERE 1=1 " With DataGridView @@ -179,10 +181,18 @@ Public Class usrCntlSpeditionsBuchSuche .Columns("Frachtführer").HeaderText = "Frachtführer" .Columns("Frachtführer").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill + .Columns("Avisierer").MinimumWidth = 150 + .Columns("Avisierer").HeaderText = "Avisierer" + .Columns("Avisierer").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill + .Columns("LKW Kennzeichen").Width = 120 .Columns("LKW Kennzeichen").HeaderText = "LKW Kennzeichen" .Columns("Grenzstelle").Visible = False + '.Columns("Avisierer").Visible = False + + + .Columns("BelegNr").Width = 160 .Columns("Sachbearbeiter").MinimumWidth = 100 'MsgBox(VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_niederlassung) diff --git a/SDL/USTV/frmMDM_USTVAntrag.vb b/SDL/USTV/frmMDM_USTVAntrag.vb index 8fd7cb2f..19d1ff40 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.vb @@ -267,6 +267,13 @@ Public Class frmMDM_USTVAntrag pnlHeader.BackColor = Color.FromArgb(0, 54, 128) End If + If USTV_ANTRAG.UStVAn_AntragEingereichtAm IsNot Nothing AndAlso IsDate(USTV_ANTRAG.UStVAn_AntragEingereichtAm) Then + looked = True + Else + looked = False + End If + + lookFields(looked) If KUNDE_ERW IsNot Nothing Then @@ -543,13 +550,13 @@ Public Class frmMDM_USTVAntrag btnRMCQuartal.Visible = False End If - If USTV_ANTRAG.UStVAn_AntragEingereichtAm IsNot Nothing AndAlso IsDate(USTV_ANTRAG.UStVAn_AntragEingereichtAm) Then - looked = True - Else - looked = False - End If + 'If USTV_ANTRAG.UStVAn_AntragEingereichtAm IsNot Nothing AndAlso IsDate(USTV_ANTRAG.UStVAn_AntragEingereichtAm) Then + ' looked = True + 'Else + ' looked = False + 'End If - lookFields(looked) + 'lookFields(looked) Else @@ -1806,7 +1813,7 @@ Public Class frmMDM_USTVAntrag For Each row In dgvUSTVPositionen.Rows averageUmrechnungskurs += row.Cells("UStVPo_Umrechnungskurs").Value - Dim reDat As Date = IIf(Not IsDBNull(row.Cells("invoice_date").Value) AndAlso IsDate(row.Cells("invoice_date").Value), row.Cells("invoice_date").Value, Nothing) + Dim reDat As Date = IIf(Not IsDBNull(row.Cells("UStVPo_ReDat").Value) AndAlso IsDate(row.Cells("UStVPo_ReDat").Value), row.Cells("UStVPo_ReDat").Value, Nothing) If reDat > USTV_ANTRAG.UStVAn_ReDatBis Or reDat < USTV_ANTRAG.UStVAn_ReDatVon Then invoicedateOK = False @@ -4178,7 +4185,7 @@ Public Class frmMDM_USTVAntrag Case Else 'Bank aus Kunden! Dim dtBank As New DataTable - dtBank = SQL.loadDgvBySql("SELECT isnull(bnk_name,'') as bnk_name ,bnk_anschrift,ISNULL(bnk_iban,'') as bnk_iban,ISNULL(bnk_bic,'') as bnk_bic FROM [tblBankverbindungen] WHERE isnull(bnk_hauptkonto,0) = 0 and bnk_archiv = 0 and bnk_KundenNr = " & KUNDE.KundenNr, "FMZOLL") + dtBank = SQL.loadDgvBySql("SELECT isnull(bnk_name,'') as bnk_name ,bnk_anschrift,ISNULL(bnk_iban,'') as bnk_iban,ISNULL(bnk_bic,'') as bnk_bic FROM [tblBankverbindungen] WHERE isnull(bnk_hauptkonto,0) = 0 and isnull(bnk_archiv,0) = 0 and bnk_KundenNr = " & KUNDE.KundenNr, "FMZOLL") If dtBank.Rows.Count > 0 Then BANK_OWNER = ADR.Name_1 @@ -4535,8 +4542,7 @@ Public Class frmMDM_USTVAntrag Private Function lookFields(look As Boolean) For Each c As Control In Panel8.Controls - - If c.Name <> "cbxWahrung" AndAlso c.Name <> "txtEingereichtAm" AndAlso c.Name <> "cbxInterneNr" Then + If c.Name <> "cbxWahrung" AndAlso c.Name <> "txtEingereichtAm" AndAlso c.Name <> "cbxInterneNr" AndAlso c.Name <> "cbxSicherheit" AndAlso c.Name <> "txt3470" AndAlso c.Name <> "txtVZam" AndAlso c.Name <> "txtRZam" AndAlso c.Name <> "txtRZ" AndAlso c.Name <> "txtVZ" AndAlso c.Name <> "Label1" AndAlso c.Name <> "Label15" AndAlso c.Name <> "Label16" AndAlso c.Name <> "Label17" AndAlso c.Name <> "Label9" Then c.Enabled = Not look End If Next diff --git a/SDL/USTV/frmUSTVoffeneAntraege.vb b/SDL/USTV/frmUSTVoffeneAntraege.vb index da9a85dd..29f3695f 100644 --- a/SDL/USTV/frmUSTVoffeneAntraege.vb +++ b/SDL/USTV/frmUSTVoffeneAntraege.vb @@ -1093,33 +1093,35 @@ Public Class frmUSTVoffeneAntraege Dim dtfehlendePDF As New DataTable Dim dtPartInvoicesIDS As New DataTable + Dim fehlendePDFS As Integer = 0 + Dim fehlendePDFSPartInvoicesIDS As Integer = 0 Select Case LIEFERANT.ToString.ToLower Case "plose" Dim LIEFERANT As cPLOSE_Inv_Data - dtfehlendePDF = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + fehlendePDFS = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, dtfehlendePDF) Case "rmc" Dim LIEFERANT As cRMC - dtfehlendePDF = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + fehlendePDFS = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, dtfehlendePDF) Case "mse" Dim LIEFERANT As cMSEAPI - dtfehlendePDF = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + fehlendePDFS = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, dtfehlendePDF) Case "uta" Dim LIEFERANT As cUTA - dtfehlendePDF = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + fehlendePDFS = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, dtfehlendePDF) Case "ids" Dim LIEFERANT As cIDS - dtfehlendePDF = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) - dtPartInvoicesIDS = LIEFERANT.checkPartInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + fehlendePDFS = LIEFERANT.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, dtfehlendePDF) + fehlendePDFSPartInvoicesIDS = LIEFERANT.checkPartInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, dtPartInvoicesIDS) Case "verag" @@ -1135,9 +1137,8 @@ Public Class frmUSTVoffeneAntraege End Select - Dim fehlendePDFs As Integer = 0 - MsgBox("Anzahl fehlende PDFs: " & dtfehlendePDF.Rows.Count & IIf(CDate(dat_Sum_Von.Value).Year <= 2024 OrElse CDate(dat_Sum_Bis.Value).Year <= 2024, vbNewLine & "PDF-Rechnungen vor 2025 wurden tlw. nicht importiert!", "")) + MsgBox("Anzahl fehlende PDFs: " & fehlendePDFS & IIf(CDate(dat_Sum_Von.Value).Year <= 2024 OrElse CDate(dat_Sum_Bis.Value).Year <= 2024, vbNewLine & "PDF-Rechnungen vor 2025 wurden tlw. nicht importiert!", "")) If dtfehlendePDF.Rows.Count > 0 Then If vbYes = MsgBox("Details der fehlenden PDF-Rechnungen anzeigen?", vbYesNo) Then @@ -1149,9 +1150,9 @@ Public Class frmUSTVoffeneAntraege 'extra bei IDS ->Prüft ob es zur Gesamtrechnung Teilrechnungen gibt!! If LIEFERANT.ToString.ToLower = "ids" Then - If dtPartInvoicesIDS.Rows.Count > 0 Then + If fehlendePDFSPartInvoicesIDS > 0 Then - If vbYes = MsgBox("Es fehlen " & dtPartInvoicesIDS.Rows.Count & " Teilrechnungen" & vbNewLine & "Details der fehlenden Teilrechnungen anzeigen?", vbYesNo) Then + If vbYes = MsgBox("Es fehlen " & fehlendePDFSPartInvoicesIDS & " Teilrechnungen" & vbNewLine & "Details der fehlenden Teilrechnungen anzeigen?", vbYesNo) Then cProgramFunctions.genExcelFromDT_NEW(dtPartInvoicesIDS,,, "Fehlende PDF-Teilrechnungen inkl. Datensatz " & dat_Sum_Von.Value.ToShortDateString & " - " & dat_Sum_Bis.Value.ToShortDateString) End If diff --git a/SDL/kassenbuch/frmBelegNeu.vb b/SDL/kassenbuch/frmBelegNeu.vb index d1d7d8f6..3aa13fc6 100644 --- a/SDL/kassenbuch/frmBelegNeu.vb +++ b/SDL/kassenbuch/frmBelegNeu.vb @@ -1590,7 +1590,9 @@ Public Class frmBelegNeu Me.Cursor = Cursors.WaitCursor If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - KASSE.LOAD(6) 'Laden der Kasse anhand der Auswahlbox + 'KASSE.LOAD(6) 'AT-Kasse + KASSE.LOAD(12) 'DE-kasse + 'Laden der Kasse anhand der Auswahlbox Else KASSE.LOAD(cboKassen._value) 'Laden der Kasse anhand der Auswahlbox End If @@ -1686,9 +1688,17 @@ Public Class frmBelegNeu Dim QR_CodeString As String = "" Dim LastJWS As String = "" - If KASSE.rksv_aktiv Then ' WENN für die Kasse die RKSV ÖSTERREICH gilt + If KASSE.rksv_aktiv Then ' WENN für die Kasse die RKSV Dim answer = "" - If Not cRKSV.insertRKSV(KASSE, KASSE.rksv_CompanyGUID, KASSE.rksv_Umsatzzaehler, BELEG.BelegDat, BELEG.Steuerschlüssel, RKSV_Beleg_Id, If(EA = "E", summeBRUTTO, summeBRUTTO * -1), QR_CodeString, LastJWS, TESTBUCHUNG, answer) Then 'Digitale Signierung und Erfassung in die RKSV-Datenbank mittels ITG-Service + + Dim verarbeitet As Boolean = False + If KASSE.rksv_FT_RestServiceURL <> "" Then + verarbeitet = cRKSV.insertRKSVFiskaltrust(KASSE, KASSE.rksv_CompanyGUID, KASSE.rksv_Umsatzzaehler, BELEG.BelegDat, BELEG.Steuerschlüssel, RKSV_Beleg_Id, If(EA = "E", summeBRUTTO, summeBRUTTO * -1), TESTBUCHUNG, BELEG.POS) + Else + verarbeitet = cRKSV.insertRKSV(KASSE, KASSE.rksv_CompanyGUID, KASSE.rksv_Umsatzzaehler, BELEG.BelegDat, BELEG.Steuerschlüssel, RKSV_Beleg_Id, If(EA = "E", summeBRUTTO, summeBRUTTO * -1), QR_CodeString, LastJWS, TESTBUCHUNG, answer) 'Digitale Signierung und Erfassung in die RKSV-Datenbank mittels ITG-Service + End If + + If Not verarbeitet Then If Not TESTBUCHUNG Then KASSE.DECREASE_BELEG_UMSATZ(oldBelegZaehler, If(EA = "E", summeBRUTTO * -1, summeBRUTTO)) cRKSV.DELETE(BELEG, KASSE.rksv_firma) @@ -1699,7 +1709,9 @@ Public Class frmBelegNeu Me.Cursor = Cursors.Default : warnClose = False : Me.Close() : Exit Sub End If KASSE.SET_LAST_QR_JWS(LastJWS, QR_CodeString) - End If + + End If + 'If Not cRKSV_DE.insertRKSV_DE(PERSONAL, BELEG, KASSE, RKSV_Beleg_Id, 0, QR_CodeString, LastJWS, TESTBUCHUNG, answer) Then 'Digitale Signierung und Erfassung in die RKSV-Datenbank mittels ITG-Service ' If Not TESTBUCHUNG Then diff --git a/SDL/mdm/usrcntlFremdrechnungen.Designer.vb b/SDL/mdm/usrcntlFremdrechnungen.Designer.vb index c8e0f446..a0990917 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.Designer.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.Designer.vb @@ -23,8 +23,8 @@ Partial Class usrcntlFremdrechnungen Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.DetailsAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel() Me.btnSDL_Alle = New System.Windows.Forms.Button() @@ -37,7 +37,12 @@ Partial Class usrcntlFremdrechnungen Me.btnSDL_PLOSE = New System.Windows.Forms.Button() Me.btnSDL_RMC = New System.Windows.Forms.Button() Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.PDFLöschenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.Panel1 = New System.Windows.Forms.Panel() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label9 = New System.Windows.Forms.Label() + Me.Label8 = New System.Windows.Forms.Label() + Me.lblCountOrigRechnungen = New System.Windows.Forms.Label() Me.cbxTest = New System.Windows.Forms.CheckBox() Me.Label7 = New System.Windows.Forms.Label() Me.txtKundenNrbis = New VERAG_PROG_ALLGEMEIN.MyTextBox() @@ -49,8 +54,6 @@ Partial Class usrcntlFremdrechnungen Me.cbxPDFhinterlegt = New System.Windows.Forms.CheckBox() Me.cbx = New System.Windows.Forms.CheckBox() Me.Label4 = New System.Windows.Forms.Label() - Me.Label2 = New System.Windows.Forms.Label() - Me.Label1 = New System.Windows.Forms.Label() Me.dat_Sum_Bis = New System.Windows.Forms.DateTimePicker() Me.dat_Sum_Von = New System.Windows.Forms.DateTimePicker() Me.Button1 = New System.Windows.Forms.Button() @@ -65,7 +68,8 @@ Partial Class usrcntlFremdrechnungen Me.dgvLFRechnung = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.dgvDetails = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.Panel4 = New System.Windows.Forms.Panel() - Me.PDFLöschenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.Label1 = New System.Windows.Forms.Label() + Me.lblCountMissingInvoices = New System.Windows.Forms.Label() Me.FlowLayoutPanel.SuspendLayout() Me.ContextMenuStrip1.SuspendLayout() Me.Panel1.SuspendLayout() @@ -268,11 +272,24 @@ Partial Class usrcntlFremdrechnungen Me.ContextMenuStrip1.Name = "ContextMenuStrip1" Me.ContextMenuStrip1.Size = New System.Drawing.Size(155, 48) ' + 'PDFLöschenToolStripMenuItem + ' + Me.PDFLöschenToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.del + Me.PDFLöschenToolStripMenuItem.Name = "PDFLöschenToolStripMenuItem" + Me.PDFLöschenToolStripMenuItem.Size = New System.Drawing.Size(154, 22) + Me.PDFLöschenToolStripMenuItem.Text = "PDF löschen" + ' 'Panel1 ' Me.Panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.Panel1.BackColor = System.Drawing.SystemColors.ControlLightLight Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.Panel1.Controls.Add(Me.lblCountMissingInvoices) + Me.Panel1.Controls.Add(Me.Label1) + Me.Panel1.Controls.Add(Me.Label2) + Me.Panel1.Controls.Add(Me.Label9) + Me.Panel1.Controls.Add(Me.Label8) + Me.Panel1.Controls.Add(Me.lblCountOrigRechnungen) Me.Panel1.Controls.Add(Me.cbxTest) Me.Panel1.Controls.Add(Me.Label7) Me.Panel1.Controls.Add(Me.txtKundenNrbis) @@ -284,8 +301,6 @@ Partial Class usrcntlFremdrechnungen Me.Panel1.Controls.Add(Me.cbxPDFhinterlegt) Me.Panel1.Controls.Add(Me.cbx) Me.Panel1.Controls.Add(Me.Label4) - Me.Panel1.Controls.Add(Me.Label2) - Me.Panel1.Controls.Add(Me.Label1) Me.Panel1.Controls.Add(Me.dat_Sum_Bis) Me.Panel1.Controls.Add(Me.dat_Sum_Von) Me.Panel1.Controls.Add(Me.Button1) @@ -301,10 +316,49 @@ Partial Class usrcntlFremdrechnungen Me.Panel1.Size = New System.Drawing.Size(260, 907) Me.Panel1.TabIndex = 23 ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(124, 151) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(10, 13) + Me.Label2.TabIndex = 65 + Me.Label2.Text = "-" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(2, 3) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(42, 13) + Me.Label9.TabIndex = 64 + Me.Label9.Text = "Anzahl:" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(2, 45) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(90, 13) + Me.Label8.TabIndex = 63 + Me.Label8.Text = "ITC nicht gesetzt:" + ' + 'lblCountOrigRechnungen + ' + Me.lblCountOrigRechnungen.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.lblCountOrigRechnungen.BackColor = System.Drawing.Color.White + Me.lblCountOrigRechnungen.Location = New System.Drawing.Point(173, 45) + Me.lblCountOrigRechnungen.Name = "lblCountOrigRechnungen" + Me.lblCountOrigRechnungen.RightToLeft = System.Windows.Forms.RightToLeft.Yes + Me.lblCountOrigRechnungen.Size = New System.Drawing.Size(74, 13) + Me.lblCountOrigRechnungen.TabIndex = 62 + Me.lblCountOrigRechnungen.Text = "0" + Me.lblCountOrigRechnungen.TextAlign = System.Drawing.ContentAlignment.TopRight + ' 'cbxTest ' Me.cbxTest.AutoSize = True - Me.cbxTest.Location = New System.Drawing.Point(146, 214) + Me.cbxTest.Location = New System.Drawing.Point(146, 274) Me.cbxTest.Name = "cbxTest" Me.cbxTest.Size = New System.Drawing.Size(61, 17) Me.cbxTest.TabIndex = 61 @@ -315,7 +369,7 @@ Partial Class usrcntlFremdrechnungen 'Label7 ' Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(121, 126) + Me.Label7.Location = New System.Drawing.Point(121, 193) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(10, 13) Me.Label7.TabIndex = 60 @@ -336,7 +390,7 @@ Partial Class usrcntlFremdrechnungen Me.txtKundenNrbis._Waehrung = False Me.txtKundenNrbis._WaehrungZeichen = False Me.txtKundenNrbis.ForeColor = System.Drawing.Color.Black - Me.txtKundenNrbis.Location = New System.Drawing.Point(146, 123) + Me.txtKundenNrbis.Location = New System.Drawing.Point(146, 190) Me.txtKundenNrbis.MaxLineLength = -1 Me.txtKundenNrbis.MaxLines_Warning = "" Me.txtKundenNrbis.MaxLines_Warning_Label = Nothing @@ -359,7 +413,7 @@ Partial Class usrcntlFremdrechnungen Me.txtKundenNrvon._Waehrung = False Me.txtKundenNrvon._WaehrungZeichen = False Me.txtKundenNrvon.ForeColor = System.Drawing.Color.Black - Me.txtKundenNrvon.Location = New System.Drawing.Point(11, 123) + Me.txtKundenNrvon.Location = New System.Drawing.Point(11, 190) Me.txtKundenNrvon.MaxLineLength = -1 Me.txtKundenNrvon.MaxLines_Warning = "" Me.txtKundenNrvon.MaxLines_Warning_Label = Nothing @@ -370,26 +424,28 @@ Partial Class usrcntlFremdrechnungen 'Label6 ' Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(8, 107) + Me.Label6.Location = New System.Drawing.Point(8, 174) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(58, 13) Me.Label6.TabIndex = 57 - Me.Label6.Text = "KundenNr." + Me.Label6.Text = "KundenNr:" ' 'lblSumBto ' - Me.lblSumBto.AutoSize = True + Me.lblSumBto.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.lblSumBto.BackColor = System.Drawing.Color.White - Me.lblSumBto.Location = New System.Drawing.Point(190, 20) + Me.lblSumBto.Location = New System.Drawing.Point(173, 24) Me.lblSumBto.Name = "lblSumBto" - Me.lblSumBto.Size = New System.Drawing.Size(13, 13) + Me.lblSumBto.RightToLeft = System.Windows.Forms.RightToLeft.Yes + Me.lblSumBto.Size = New System.Drawing.Size(74, 13) Me.lblSumBto.TabIndex = 56 Me.lblSumBto.Text = "0" + Me.lblSumBto.TextAlign = System.Drawing.ContentAlignment.TopRight ' 'Label5 ' Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(3, 20) + Me.Label5.Location = New System.Drawing.Point(2, 24) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(76, 13) Me.Label5.TabIndex = 55 @@ -400,7 +456,7 @@ Partial Class usrcntlFremdrechnungen Me.cbxMailoeffnen.AutoSize = True Me.cbxMailoeffnen.Checked = True Me.cbxMailoeffnen.CheckState = System.Windows.Forms.CheckState.Checked - Me.cbxMailoeffnen.Location = New System.Drawing.Point(146, 237) + Me.cbxMailoeffnen.Location = New System.Drawing.Point(146, 297) Me.cbxMailoeffnen.Name = "cbxMailoeffnen" Me.cbxMailoeffnen.Size = New System.Drawing.Size(91, 17) Me.cbxMailoeffnen.TabIndex = 54 @@ -412,7 +468,7 @@ Partial Class usrcntlFremdrechnungen Me.cbxPDFhinterlegt.AutoSize = True Me.cbxPDFhinterlegt.Checked = True Me.cbxPDFhinterlegt.CheckState = System.Windows.Forms.CheckState.Indeterminate - Me.cbxPDFhinterlegt.Location = New System.Drawing.Point(8, 179) + Me.cbxPDFhinterlegt.Location = New System.Drawing.Point(8, 239) Me.cbxPDFhinterlegt.Name = "cbxPDFhinterlegt" Me.cbxPDFhinterlegt.Size = New System.Drawing.Size(101, 17) Me.cbxPDFhinterlegt.TabIndex = 53 @@ -423,7 +479,7 @@ Partial Class usrcntlFremdrechnungen 'cbx ' Me.cbx.AutoSize = True - Me.cbx.Location = New System.Drawing.Point(8, 161) + Me.cbx.Location = New System.Drawing.Point(8, 221) Me.cbx.Name = "cbx" Me.cbx.Size = New System.Drawing.Size(169, 17) Me.cbx.TabIndex = 52 @@ -433,44 +489,26 @@ Partial Class usrcntlFremdrechnungen 'Label4 ' Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(2, 35) + Me.Label4.Location = New System.Drawing.Point(8, 132) Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(91, 13) + Me.Label4.Size = New System.Drawing.Size(94, 13) Me.Label4.TabIndex = 51 - Me.Label4.Text = "Rechnungsdatum" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(5, 83) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(20, 13) - Me.Label2.TabIndex = 50 - Me.Label2.Text = "bis" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(5, 57) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(28, 13) - Me.Label1.TabIndex = 49 - Me.Label1.Text = "von:" + Me.Label4.Text = "Rechnungsdatum:" ' 'dat_Sum_Bis ' Me.dat_Sum_Bis.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dat_Sum_Bis.Location = New System.Drawing.Point(60, 77) + Me.dat_Sum_Bis.Location = New System.Drawing.Point(146, 148) Me.dat_Sum_Bis.Name = "dat_Sum_Bis" - Me.dat_Sum_Bis.Size = New System.Drawing.Size(103, 20) + Me.dat_Sum_Bis.Size = New System.Drawing.Size(98, 20) Me.dat_Sum_Bis.TabIndex = 48 ' 'dat_Sum_Von ' Me.dat_Sum_Von.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dat_Sum_Von.Location = New System.Drawing.Point(60, 51) + Me.dat_Sum_Von.Location = New System.Drawing.Point(11, 148) Me.dat_Sum_Von.Name = "dat_Sum_Von" - Me.dat_Sum_Von.Size = New System.Drawing.Size(103, 20) + Me.dat_Sum_Von.Size = New System.Drawing.Size(98, 20) Me.dat_Sum_Von.TabIndex = 46 ' 'Button1 @@ -479,7 +517,7 @@ Partial Class usrcntlFremdrechnungen Me.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button1.Location = New System.Drawing.Point(11, 322) + Me.Button1.Location = New System.Drawing.Point(11, 382) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(50, 44) Me.Button1.TabIndex = 45 @@ -491,7 +529,7 @@ Partial Class usrcntlFremdrechnungen Me.cbxMax1000Eintrage.AutoSize = True Me.cbxMax1000Eintrage.Checked = True Me.cbxMax1000Eintrage.CheckState = System.Windows.Forms.CheckState.Checked - Me.cbxMax1000Eintrage.Location = New System.Drawing.Point(8, 199) + Me.cbxMax1000Eintrage.Location = New System.Drawing.Point(8, 259) Me.cbxMax1000Eintrage.Name = "cbxMax1000Eintrage" Me.cbxMax1000Eintrage.Size = New System.Drawing.Size(117, 17) Me.cbxMax1000Eintrage.TabIndex = 41 @@ -500,20 +538,22 @@ Partial Class usrcntlFremdrechnungen ' 'lblEinträge ' - Me.lblEinträge.AutoSize = True + Me.lblEinträge.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.lblEinträge.BackColor = System.Drawing.Color.White - Me.lblEinträge.Location = New System.Drawing.Point(190, 3) + Me.lblEinträge.Location = New System.Drawing.Point(173, 3) Me.lblEinträge.Name = "lblEinträge" - Me.lblEinträge.Size = New System.Drawing.Size(58, 13) + Me.lblEinträge.RightToLeft = System.Windows.Forms.RightToLeft.Yes + Me.lblEinträge.Size = New System.Drawing.Size(74, 13) Me.lblEinträge.TabIndex = 40 - Me.lblEinträge.Text = "0 Einträge " + Me.lblEinträge.Text = "0" + Me.lblEinträge.TextAlign = System.Drawing.ContentAlignment.TopRight ' 'Button4 ' Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button4.Image = Global.SDL.My.Resources.Resources.checklist Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button4.Location = New System.Drawing.Point(8, 272) + Me.Button4.Location = New System.Drawing.Point(8, 332) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(118, 44) Me.Button4.TabIndex = 21 @@ -526,7 +566,7 @@ Partial Class usrcntlFremdrechnungen Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button5.Image = Global.SDL.My.Resources.Resources.email_big1 Me.Button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button5.Location = New System.Drawing.Point(8, 222) + Me.Button5.Location = New System.Drawing.Point(8, 282) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(118, 44) Me.Button5.TabIndex = 22 @@ -537,9 +577,10 @@ Partial Class usrcntlFremdrechnungen 'Label3 ' Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(3, 3) + Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label3.Location = New System.Drawing.Point(8, 107) Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(32, 13) + Me.Label3.Size = New System.Drawing.Size(39, 13) Me.Label3.TabIndex = 25 Me.Label3.Text = "Filter:" ' @@ -548,7 +589,7 @@ Partial Class usrcntlFremdrechnungen Me.Button8.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button8.Image = Global.SDL.My.Resources.Resources.Excel_logo Me.Button8.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button8.Location = New System.Drawing.Point(132, 272) + Me.Button8.Location = New System.Drawing.Point(132, 332) Me.Button8.Name = "Button8" Me.Button8.Size = New System.Drawing.Size(118, 44) Me.Button8.TabIndex = 31 @@ -596,8 +637,8 @@ Partial Class usrcntlFremdrechnungen Me.dgvLFRechnung.AllowUserToDeleteRows = False Me.dgvLFRechnung.AllowUserToResizeColumns = False Me.dgvLFRechnung.AllowUserToResizeRows = False - DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.dgvLFRechnung.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3 + DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvLFRechnung.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1 Me.dgvLFRechnung.BackgroundColor = System.Drawing.Color.White Me.dgvLFRechnung.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvLFRechnung.Location = New System.Drawing.Point(4, 3) @@ -614,8 +655,8 @@ Partial Class usrcntlFremdrechnungen Me.dgvDetails.AllowUserToDeleteRows = False Me.dgvDetails.AllowUserToResizeColumns = False Me.dgvDetails.AllowUserToResizeRows = False - DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.dgvDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4 + DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2 Me.dgvDetails.BackgroundColor = System.Drawing.Color.White Me.dgvDetails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvDetails.Location = New System.Drawing.Point(-1, 3) @@ -634,12 +675,26 @@ Partial Class usrcntlFremdrechnungen Me.Panel4.Size = New System.Drawing.Size(1356, 108) Me.Panel4.TabIndex = 11 ' - 'PDFLöschenToolStripMenuItem + 'Label1 ' - Me.PDFLöschenToolStripMenuItem.Image = Global.SDL.My.Resources.Resources.del - Me.PDFLöschenToolStripMenuItem.Name = "PDFLöschenToolStripMenuItem" - Me.PDFLöschenToolStripMenuItem.Size = New System.Drawing.Size(154, 22) - Me.PDFLöschenToolStripMenuItem.Text = "PDF löschen" + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(3, 66) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(116, 13) + Me.Label1.TabIndex = 66 + Me.Label1.Text = "fehlende Rechnungen:" + ' + 'lblCountMissingInvoices + ' + Me.lblCountMissingInvoices.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.lblCountMissingInvoices.BackColor = System.Drawing.Color.White + Me.lblCountMissingInvoices.Location = New System.Drawing.Point(173, 66) + Me.lblCountMissingInvoices.Name = "lblCountMissingInvoices" + Me.lblCountMissingInvoices.RightToLeft = System.Windows.Forms.RightToLeft.Yes + Me.lblCountMissingInvoices.Size = New System.Drawing.Size(74, 13) + Me.lblCountMissingInvoices.TabIndex = 67 + Me.lblCountMissingInvoices.Text = "0" + Me.lblCountMissingInvoices.TextAlign = System.Drawing.ContentAlignment.TopRight ' 'usrcntlFremdrechnungen ' @@ -690,10 +745,7 @@ Partial Class usrcntlFremdrechnungen Friend WithEvents btnSDL_RMC As Button Friend WithEvents dgvLFRechnung As VERAG_PROG_ALLGEMEIN.MyDatagridview Friend WithEvents Label4 As Label - Friend WithEvents Label2 As Label - Friend WithEvents Label1 As Label Friend WithEvents cbx As CheckBox - Friend WithEvents dat_Sum_Bis As DateTimePicker Friend WithEvents dat_Sum_Von As DateTimePicker Friend WithEvents dgvDetails As VERAG_PROG_ALLGEMEIN.MyDatagridview Friend WithEvents cbxPDFhinterlegt As CheckBox @@ -706,4 +758,11 @@ Partial Class usrcntlFremdrechnungen Friend WithEvents Label6 As Label Friend WithEvents cbxTest As CheckBox Friend WithEvents PDFLöschenToolStripMenuItem As ToolStripMenuItem + Friend WithEvents lblCountOrigRechnungen As Label + Friend WithEvents Label8 As Label + Friend WithEvents Label2 As Label + Friend WithEvents Label9 As Label + Friend WithEvents dat_Sum_Bis As DateTimePicker + Friend WithEvents lblCountMissingInvoices As Label + Friend WithEvents Label1 As Label End Class diff --git a/SDL/mdm/usrcntlFremdrechnungen.vb b/SDL/mdm/usrcntlFremdrechnungen.vb index 8886d7b0..fbc03d37 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.vb @@ -2,6 +2,7 @@ Imports System.Reflection Imports com.sun.tools.corba.se.idl Imports DocumentFormat.OpenXml.VariantTypes +Imports MDM_Worker Imports Microsoft.Office.Interop Imports VERAG_PROG_ALLGEMEIN @@ -19,6 +20,8 @@ Public Class usrcntlFremdrechnungen Dim dtkeineMWST As DataTable Dim dtKundeMWST As DataTable + Dim countbtcNotSet As Integer = 0 + Dim countMissingInvoices As Integer = 0 Private Sub usrCntlDaten_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -56,6 +59,14 @@ Public Class usrcntlFremdrechnungen txtKundenNrvon.Enabled = kdNr <= 0 txtKundenNrbis.Enabled = kdNr <= 0 + If kdNr > 0 Then + txtKundenNrvon.Text = kdNr + txtKundenNrbis.Text = kdNr + End If + + + + If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMINFUNCTIONS", "SDL") Then cbxTest.Visible = True End If @@ -612,9 +623,6 @@ Public Class usrcntlFremdrechnungen End Function - - - Function getSDLNrButton(SDLNrTmp) As Object Select Case SDLNrTmp Case "IDS" : Return btnSDL_IDS @@ -629,42 +637,116 @@ Public Class usrcntlFremdrechnungen End Select End Function Private Sub btnSDL_Alle_Click(sender As Object, e As EventArgs) Handles btnSDL_Alle.Click + 'SET_SDL("ALLE") + Dim btcNotSet As Integer = 0 + Dim missingInvoices As Integer = 0 + + Dim uta As cUTA + Dim ids As cIDS + Dim rmc As cRMC + Dim ploseRE As cPLOSE_Inv_Data + Dim mse As cMSEAPI + + + If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then SET_SDL("ALLE", txtKundenNrvon.Text, txtKundenNrbis.Text) + btcNotSet += ids.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + btcNotSet += uta.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + btcNotSet += rmc.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + btcNotSet += ploseRE.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + btcNotSet += mse.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + missingInvoices += ids.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + missingInvoices += uta.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + missingInvoices += rmc.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + missingInvoices += ploseRE.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + missingInvoices += mse.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then - SET_SDL("ALLE") + + + btcNotSet += ids.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + btcNotSet += uta.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + btcNotSet += rmc.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + btcNotSet += ploseRE.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + btcNotSet += mse.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + missingInvoices += ids.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + missingInvoices += uta.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + missingInvoices += rmc.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + missingInvoices += ploseRE.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + missingInvoices += mse.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices + End If End Sub Private Sub btnSDL_IDS_Click(sender As Object, e As EventArgs) Handles btnSDL_IDS.Click 'SET_SDL("IDS") + Dim ids As New cIDS If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then SET_SDL("IDS", txtKundenNrvon.Text, txtKundenNrbis.Text) + Dim btcNotSet As Integer = ids.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = ids.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value,, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then SET_SDL("IDS") + Dim btcNotSet As Integer = ids.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + Dim missingInvoices As Integer = ids.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices End If + End Sub Private Sub btnSDL_UTA_Click(sender As Object, e As EventArgs) Handles btnSDL_UTA.Click 'SET_SDL("UTA") + Dim uta As cUTA If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then SET_SDL("UTA", txtKundenNrvon.Text, txtKundenNrbis.Text) + Dim btcNotSet As Integer = uta.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = uta.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then SET_SDL("UTA") + Dim btcNotSet As Integer = uta.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = uta.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices End If End Sub @@ -686,14 +768,29 @@ Public Class usrcntlFremdrechnungen Private Sub btnSDL_PLOSE_Click(sender As Object, e As EventArgs) Handles btnSDL_PLOSE.Click 'SET_SDL("PLOSE") - + Dim ploseRE As cPLOSE_Inv_Data If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then SET_SDL("PLOSE", txtKundenNrvon.Text, txtKundenNrbis.Text) - ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then + Dim btcNotSet As Integer = ploseRE.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + Dim missingInvoices As Integer = ploseRE.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value,, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices + + ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then SET_SDL("PLOSE") + Dim btcNotSet As Integer = ploseRE.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = ploseRE.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices + End If End Sub @@ -701,13 +798,28 @@ Public Class usrcntlFremdrechnungen Private Sub btnSDL_MautMSE_Click(sender As Object, e As EventArgs) Handles btnSDL_MautMSE.Click 'SET_SDL("MSE") + Dim MSE As cMSEAPI If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then SET_SDL("MSE", txtKundenNrvon.Text, txtKundenNrbis.Text) + Dim btcNotSet As Integer = MSE.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = MSE.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value, , txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then SET_SDL("MSE") + Dim btcNotSet As Integer = MSE.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = MSE.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices End If End Sub @@ -755,12 +867,28 @@ Public Class usrcntlFremdrechnungen Private Sub btnSDL_RMC_Click(sender As Object, e As EventArgs) Handles btnSDL_RMC.Click + Dim rmc As cRMC If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then SET_SDL("RMC", txtKundenNrvon.Text, txtKundenNrbis.Text) + Dim btcNotSet As Integer = rmc.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = rmc.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value,, txtKundenNrvon.Text, txtKundenNrbis.Text) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices + ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then SET_SDL("RMC") + Dim btcNotSet As Integer = rmc.countBackToCustomerNotSet(New VERAG_PROG_ALLGEMEIN.SQL) + lblCountOrigRechnungen.Text = btcNotSet + countbtcNotSet = btcNotSet + + Dim missingInvoices As Integer = rmc.checkPDFInvoices(dat_Sum_Von.Value, dat_Sum_Bis.Value) + lblCountMissingInvoices.Text = missingInvoices + countMissingInvoices = missingInvoices End If @@ -880,6 +1008,11 @@ Public Class usrcntlFremdrechnungen Exit Sub End If + If countbtcNotSet > 0 Then + MsgBox("ACHTUNG!" & vbNewLine & "es wurden bei " & countbtcNotSet & " Rechnungen die Werte für das Rücksenden der Originalrechnung nicht gesetzt!" & vbNewLine & "Bitte an Administrator wenden") + Exit Sub + End If + If groups.Count > 0 Then @@ -1638,4 +1771,6 @@ Public Class usrcntlFremdrechnungen End Sub + + End Class diff --git a/SDL/packages.config b/SDL/packages.config index 2e6bbac4..5d05f257 100644 --- a/SDL/packages.config +++ b/SDL/packages.config @@ -53,10 +53,17 @@ - + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb b/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb index fb210b0b..99b8b7f0 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cIDS.vb @@ -634,7 +634,11 @@ Public Class cIDS End Function Public Shared Function countBackToCustomerNotSet(SQL As SQL) As Integer - Return SQL.getValueTxtBySql("SELECT count(InvToCustomer) FROM [tblIDSInvoicesNewSplittedByCountry] where InvToCustomer Is null ", "FMZOLL",,, -1) + Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblIDSInvoicesNewSplittedByCountry] where InvToCustomer Is null ", "FMZOLL",,, -1) + End Function + + Public Shared Function countBackToCustomerNotSet(SQL As SQL, AdressenNrVon As Integer, AdressenNrBis As Integer) As Integer + Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblIDSInvoicesNewSplittedByCountry] Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =[tblIDSInvoicesNewSplittedByCountry].CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where InvToCustomer Is null and Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis, "FMZOLL",,, -1) End Function Public Shared Function UPDATE_ARCHIV(reDat As Date, reNr As String, ids_kdNr As Integer, country As String, UStVAn_ID As Integer) As Boolean @@ -663,21 +667,35 @@ Public Class cIDS Return "" End Function - Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing) As DataTable + Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing, Optional dt As DataTable = Nothing, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer Try Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL Dim sqlTime As String = "" + Dim sqlAdressenNr As String = "" If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then sqlTime = " And cast(YearMonthDay as Date) between '" & reDatVon.ToShortDateString & "' and '" & reDatBis.ToShortDateString & "'" End If - Dim SQLstr = "select Invoicenumber as RechnungsNr,YearMonthDay as Rechnungsdatum, Adressen.AdressenNr as KundenNr,Adressen.[Name 1] as Kunde, kde_keineMWSt from tblIDSInvoicesNew Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =tblIDSInvoicesNew.CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where DocumentName is null " & sqlTime & " group by Invoicenumber, Adressen.AdressenNr, Adressen.[Name 1], YearMonthDay, kde_keineMWSt" + If AdressenNrVon > 0 AndAlso AdressenNrBis > 0 Then + sqlAdressenNr = " AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis + End If + + If dt IsNot Nothing Then + Dim SQLstr = "select Invoicenumber as RechnungsNr,YearMonthDay as Rechnungsdatum, Adressen.AdressenNr as KundenNr,Adressen.[Name 1] as Kunde, kde_keineMWSt from tblIDSInvoicesNew Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =tblIDSInvoicesNew.CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where DocumentName is null " & sqlTime & sqlAdressenNr & " group by Invoicenumber, Adressen.AdressenNr, Adressen.[Name 1], YearMonthDay, kde_keineMWSt" + dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") + Return dt.Rows.Count + Else + + Dim SQLstr = "select count(*) from tblIDSInvoicesNew Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =tblIDSInvoicesNew.CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where DocumentName is null " & sqlTime & sqlAdressenNr + Return SQL.getValueTxtBySql(SQLstr, "FMZOLL",,, 0) + + End If + + - Dim dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") - Return dt Catch ex As Exception @@ -688,22 +706,37 @@ Public Class cIDS End Function - Public Shared Function checkPartInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing) As DataTable + Public Shared Function checkPartInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing, Optional dt As DataTable = Nothing, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer Try 'Prüft, ob es zu Gesamtrechnungen Teilrechnungen gibt! Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL + Dim SQLstrForDT = " " Dim SQLstr = " " + Dim sqlAdressenNr As String = "" - If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then - SQLstr &= "select Invoicenumber as RechnungsNr ,YearMonthDay as Rechnungsdatum, Adressen.AdressenNr as KundenNr,Adressen.[Name 1] as Kunde, kde_keineMWSt,daId from tblIDSInvoicesNew Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =tblIDSInvoicesNew.CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where invoice_id not in (select TotalInvoiceId from tblIDSInvoicesNewSplittedByCountry) AND YearMonthDay >= '" & reDatVon.ToShortDateString & "' and YearMonthDay < '" & reDatBis.ToShortDateString & "'" - Else - SQLstr &= "select * from tblIDSInvoicesNew where invoice_id not in (select TotalInvoiceId from tblIDSInvoicesNewSplittedByCountry) AND Year(YearMonthDay) >= 2025" + If AdressenNrVon > 0 AndAlso AdressenNrBis > 0 Then + sqlAdressenNr = " AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis End If - Dim dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") + If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then + SQLstrForDT &= "select Invoicenumber as RechnungsNr ,YearMonthDay as Rechnungsdatum, Adressen.AdressenNr as KundenNr,Adressen.[Name 1] as Kunde, kde_keineMWSt,daId from tblIDSInvoicesNew Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =tblIDSInvoicesNew.CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where invoice_id not in (select TotalInvoiceId from tblIDSInvoicesNewSplittedByCountry) AND YearMonthDay >= '" & reDatVon.ToShortDateString & "' and YearMonthDay < '" & reDatBis.ToShortDateString & "'" & sqlAdressenNr + SQLstr &= "select count(*) from tblIDSInvoicesNew Inner join [tbl_IDS_Kunden] on [tbl_IDS_Kunden].CustomerCode =tblIDSInvoicesNew.CustomerCode and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 Inner join Adressen on Adressen.AdressenNr = [tbl_IDS_Kunden].KdNrVERAG INNER JOIN tblKundenErweitert on Adressen.AdressenNr = kde_KundenNr where invoice_id not in (select TotalInvoiceId from tblIDSInvoicesNewSplittedByCountry) AND YearMonthDay >= '" & reDatVon.ToShortDateString & "' and YearMonthDay < '" & reDatBis.ToShortDateString & "'" & sqlAdressenNr + Else + SQLstrForDT &= "select * from tblIDSInvoicesNew where invoice_id not in (select TotalInvoiceId from tblIDSInvoicesNewSplittedByCountry) AND Year(YearMonthDay) >= 2025" + SQLstr &= "select count(*) from tblIDSInvoicesNew where invoice_id not in (select TotalInvoiceId from tblIDSInvoicesNewSplittedByCountry) AND Year(YearMonthDay) >= 2025" + End If + + + If dt IsNot Nothing Then + dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstrForDT, "FMZOLL") + Return dt.Rows.Count + Else + + Return SQL.getValueTxtBySql(SQLstr, "FMZOLL",,, -1) + + End If - Return dt Catch ex As Exception diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb b/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb index 73300dd3..64c9f979 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cMitarbeiter.vb @@ -88,7 +88,7 @@ Public Class cMitarbeiter Property mit_CSuser As Object = Nothing Property mit_CSpwd As Object = Nothing Property mit_PersonalNr As Object = Nothing - Property mit_timasId As Object = Nothing + Property mit_timasId As Object = Nothing 'interne ID von TIMAS Property mit_ATGRNAccessCode_AT51FP7 As Object = Nothing Property mit_ATGRNAccessCode_AT52VA6 As Object = Nothing Property mit_Sprachkentnisse As Object = Nothing @@ -97,12 +97,12 @@ Public Class cMitarbeiter Property mit_ausstempelnBeiBeenden As Boolean = False Property mit_timasMehrereFirmen As Boolean = False Property mit_timasFirmen As Object = Nothing - Property mit_Notfall_Name As Object = Nothing Property mit_Notfall_Handy As Object = Nothing Property mit_Notfall_Mail As Object = Nothing Property mit_SchalterID As Object = Nothing Property mit_Funktion As Object = Nothing + Property mit_terminalTimasId As Object = Nothing 'externe ID von TIMAS @@ -223,6 +223,7 @@ Public Class cMitarbeiter list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_Notfall_Mail", mit_Notfall_Mail)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_SchalterID", mit_SchalterID)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_Funktion", mit_Funktion)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_terminalTimasId", mit_terminalTimasId)) @@ -434,6 +435,7 @@ Public Class cMitarbeiter If Not dr.Item("mit_Notfall_Mail") Is DBNull.Value Then Me.mit_Notfall_Mail = dr.Item("mit_Notfall_Mail") If Not dr.Item("mit_SchalterID") Is DBNull.Value Then Me.mit_SchalterID = dr.Item("mit_SchalterID") If Not dr.Item("mit_Funktion") Is DBNull.Value Then Me.mit_Funktion = dr.Item("mit_Funktion") + If Not dr.Item("mit_terminalTimasId") Is DBNull.Value Then Me.mit_terminalTimasId = dr.Item("mit_terminalTimasId") Catch ex As Exception diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cRMC.vb b/VERAG_PROG_ALLGEMEIN/Classes/cRMC.vb index 709163ab..a548e9c6 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cRMC.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cRMC.vb @@ -285,6 +285,10 @@ Public Class cRMC Return SQL.getValueTxtBySql("SELECT count(InvToCustomer) FROM [tblRMCImport] where InvToCustomer Is null ", "FMZOLL",,, -1) End Function + Public Shared Function countBackToCustomerNotSet(SQL As SQL, AdressenNrVon As Integer, AdressenNrBis As Integer) As Integer + Return SQL.getValueTxtBySql("SELECT count(InvToCustomer) FROM [tblRMCImport] INNER JOIN Adressen On WölflKundenNr=[rmc_kdNr] Or weitereWölflKundenNr=[rmc_kdNr] where InvToCustomer Is null and Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis, "FMZOLL",,, -1) + End Function + Public Shared Function getRMCQuartalsAbrechnungen(SQL As SQL, quartal As Integer, jahr As Integer, LeistungsNr As String, Optional USTV_ANTRAG As cUSTVAntrag = Nothing, Optional LANDKZ As String = "", Optional nurUnter50anzeigen As Boolean = True) As DataTable @@ -365,21 +369,34 @@ Public Class cRMC End Function - Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing) As DataTable + Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing, Optional dt As DataTable = Nothing, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer Try Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL Dim sqlTime As String = "" + Dim sqlAdressenNr As String = "" If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then sqlTime = " And cast([rmc_reDatum] As Date) between '" & reDatVon.ToShortDateString & "' and '" & reDatBis.ToShortDateString & "'" End If - Dim SQLstr = "Select rmc_reNr As RechnungsNr,rmc_reDatum As Rechnungsdatum, Adressen.AdressenNr As KundenNr,Adressen.[Name 1] As Kunde, kde_keineMWSt As keineMWST from [tblRMCImport] INNER JOIN Adressen On WölflKundenNr=[rmc_kdNr] Or weitereWölflKundenNr=[rmc_kdNr] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where rmc_daId Is null " & sqlTime & " group by rmc_reNr, Adressen.AdressenNr, Adressen.[Name 1],rmc_reDatum, kde_keineMWSt" + If AdressenNrVon > 0 AndAlso AdressenNrBis > 0 Then + sqlAdressenNr = " AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis + End If + + If dt IsNot Nothing Then + Dim SQLstr = "Select rmc_reNr As RechnungsNr,rmc_reDatum As Rechnungsdatum, Adressen.AdressenNr As KundenNr,Adressen.[Name 1] As Kunde, kde_keineMWSt As keineMWST from [tblRMCImport] INNER JOIN Adressen On WölflKundenNr=[rmc_kdNr] Or weitereWölflKundenNr=[rmc_kdNr] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where rmc_daId Is null " & sqlTime & sqlAdressenNr & " group by rmc_reNr, Adressen.AdressenNr, Adressen.[Name 1],rmc_reDatum, kde_keineMWSt" + dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") + Return dt.Rows.Count + Else + + Dim SQLstr = "Select count(*) from [tblRMCImport] INNER JOIN Adressen On WölflKundenNr=[rmc_kdNr] Or weitereWölflKundenNr=[rmc_kdNr] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where rmc_daId Is null " & sqlTime & sqlAdressenNr + Return SQL.getValueTxtBySql(SQLstr, "FMZOLL",,, 0) + + + End If - Dim dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") - Return dt Catch ex As Exception diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb b/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb index 97b5ddb1..76accc02 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cUTA.vb @@ -1,7 +1,6 @@ Imports System.Data.SqlClient Imports System.IO Imports System.Reflection -Imports System.Web.Configuration Public Class cUTA @@ -42,24 +41,42 @@ Public Class cUTA End Function Public Shared Function countBackToCustomerNotSet(SQL As SQL) As Integer - Return SQL.getValueTxtBySql("SELECT count(InvToCustomer) FROM [tblUTAImportNew] where InvToCustomer Is null ", "FMZOLL",,, -1) + Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblUTAImportNew] where InvToCustomer Is null ", "FMZOLL",,, -1) End Function - Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing) As DataTable + Public Shared Function countBackToCustomerNotSet(SQL As SQL, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer + Return SQL.getValueTxtBySql(" SELECT count(*) FROM [tblUTAImportNew] U INNER JOIN Adressen A On A.UTAKundenNr = U.Kundennummer where U.InvToCustomer Is null AND A.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis, "FMZOLL",,, -1) + End Function + + Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing, Optional dt As DataTable = Nothing, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer Try Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL Dim sqlTime As String = "" + Dim sqlAdressenNr As String = "" If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then sqlTime = " And CAST(U.Rechnungsdatum As Date) BETWEEN '" & reDatVon.ToShortDateString & "' and '" & reDatBis.ToShortDateString & "'" End If - Dim SQLstr = "Select U.Abrechnungsnummer As Abrechnungsnummer,U.Rechnungsnummer_pro_Lieferland,U.Lieferland,CAST(U.Rechnungsdatum As Date) As Rechnungsdatum,A.AdressenNr As KundenNr,A.UTAKundenNr As UTAKundenNr,A.[Name 1] As Kunde,A.LandKz, kde_keineMWSt As keineMWST FROM tblUTAImportNew U INNER JOIN Adressen A On A.UTAKundenNr = U.Kundennummer INNER JOIN tblKundenErweitert On A.AdressenNr = kde_KundenNr WHERE U.daId Is NULL " & sqlTime & " AND NOT (A.LandKz = 'RO' AND U.Lieferland = 'ROM') GROUP BY U.Abrechnungsnummer,U.Rechnungsnummer_pro_Lieferland,U.Lieferland,U.Rechnungsdatum,A.AdressenNr,A.UTAKundenNr ,A.[Name 1],A.LandKz, kde_keineMWSt ORDER BY U.Rechnungsdatum" + If AdressenNrVon > 0 AndAlso AdressenNrBis > 0 Then + sqlAdressenNr = " AND A.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis + End If + + If dt IsNot Nothing Then + Dim SQLstr = "Select U.Abrechnungsnummer As Abrechnungsnummer,U.Rechnungsnummer_pro_Lieferland,U.Lieferland,CAST(U.Rechnungsdatum As Date) As Rechnungsdatum,A.AdressenNr As KundenNr,A.UTAKundenNr As UTAKundenNr,A.[Name 1] As Kunde,A.LandKz, kde_keineMWSt As keineMWST FROM tblUTAImportNew U INNER JOIN Adressen A On A.UTAKundenNr = U.Kundennummer INNER JOIN tblKundenErweitert On A.AdressenNr = kde_KundenNr WHERE U.daId Is NULL " & sqlTime & sqlAdressenNr & " AND NOT (A.LandKz = 'RO' AND U.Lieferland = 'ROM') GROUP BY U.Abrechnungsnummer,U.Rechnungsnummer_pro_Lieferland,U.Lieferland,U.Rechnungsdatum,A.AdressenNr,A.UTAKundenNr ,A.[Name 1],A.LandKz, kde_keineMWSt ORDER BY U.Rechnungsdatum" + dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") + Return dt.Rows.Count + Else + + Dim SQLstr = "Select count(*) FROM tblUTAImportNew U INNER JOIN Adressen A On A.UTAKundenNr = U.Kundennummer INNER JOIN tblKundenErweitert On A.AdressenNr = kde_KundenNr WHERE U.daId Is NULL " & sqlTime & sqlAdressenNr & " AND NOT (A.LandKz = 'RO' AND U.Lieferland = 'ROM')" + Return SQL.getValueTxtBySql(SQLstr, "FMZOLL",,, 0) + + + End If + - Dim dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") - Return dt Catch ex As Exception diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb index 47710036..f2a4b77d 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.Designer.vb @@ -28,6 +28,7 @@ Partial Class frmMitarbeitersuche Me.Button4 = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button() Me.PictureBox2 = New System.Windows.Forms.PictureBox() + Me.sbMitarbeiter = New VERAG_PROG_ALLGEMEIN.MySearchBox() Me.pnlMain = New System.Windows.Forms.Panel() Me.pnl = New System.Windows.Forms.Panel() Me.Button3 = New System.Windows.Forms.Button() @@ -73,7 +74,6 @@ Partial Class frmMitarbeitersuche Me.pnlGeburtstag = New System.Windows.Forms.Panel() Me.lblGeburtstag = New System.Windows.Forms.Label() Me.PictureBox1 = New System.Windows.Forms.PictureBox() - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.MyPanel1 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components) Me.Panel1 = New System.Windows.Forms.Panel() Me.lblPosition = New System.Windows.Forms.Label() @@ -89,7 +89,9 @@ Partial Class frmMitarbeitersuche Me.Label17 = New System.Windows.Forms.Label() Me.lblNotfall_Handy = New System.Windows.Forms.Label() Me.lblNotfall_Name = New System.Windows.Forms.Label() - Me.sbMitarbeiter = New VERAG_PROG_ALLGEMEIN.MySearchBox() + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.Label14 = New System.Windows.Forms.Label() + Me.lblTimasID = New System.Windows.Forms.Label() Me.pnlSrch.SuspendLayout() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() Me.pnlMain.SuspendLayout() @@ -163,6 +165,32 @@ Partial Class frmMitarbeitersuche Me.PictureBox2.TabIndex = 18 Me.PictureBox2.TabStop = False ' + 'sbMitarbeiter + ' + Me.sbMitarbeiter._allowFreitext = False + Me.sbMitarbeiter._AllowSetValue = False + Me.sbMitarbeiter._allowSpaceAsSplitter = True + Me.sbMitarbeiter._autoSizeGross = False + Me.sbMitarbeiter._hideIfListEmpty = True + Me.sbMitarbeiter._value = Nothing + Me.sbMitarbeiter.conn_art = "FMZOLL" + Me.sbMitarbeiter.dgvpos = "LEFT" + Me.sbMitarbeiter.DISPLAY_PARAM = Nothing + Me.sbMitarbeiter.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!) + Me.sbMitarbeiter.INVISIBLE_COLUMNS = Nothing + Me.sbMitarbeiter.key_visible = False + Me.sbMitarbeiter.KEYPARAM = Nothing + Me.sbMitarbeiter.Location = New System.Drawing.Point(45, 11) + Me.sbMitarbeiter.Name = "sbMitarbeiter" + Me.sbMitarbeiter.searchActive = True + Me.sbMitarbeiter.Size = New System.Drawing.Size(582, 29) + Me.sbMitarbeiter.SQL_ORDER_BY = Nothing + Me.sbMitarbeiter.SQL_SELECT = Nothing + Me.sbMitarbeiter.SQL_WHERE = Nothing + Me.sbMitarbeiter.SQL_WhereParamList = Nothing + Me.sbMitarbeiter.TabIndex = 0 + Me.sbMitarbeiter.usrcntl = Nothing + ' 'pnlMain ' Me.pnlMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink @@ -178,6 +206,8 @@ Partial Class frmMitarbeitersuche ' Me.pnl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.pnl.BackColor = System.Drawing.Color.FromArgb(CType(CType(250, Byte), Integer), CType(CType(254, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.pnl.Controls.Add(Me.lblTimasID) + Me.pnl.Controls.Add(Me.Label14) Me.pnl.Controls.Add(Me.Button3) Me.pnl.Controls.Add(Me.Panel2) Me.pnl.Controls.Add(Me.pnlZeiten) @@ -698,11 +728,6 @@ Partial Class frmMitarbeitersuche Me.PictureBox1.TabIndex = 13 Me.PictureBox1.TabStop = False ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4) - ' 'MyPanel1 ' Me.MyPanel1.BackColor = System.Drawing.Color.FromArgb(CType(CType(250, Byte), Integer), CType(CType(254, Byte), Integer), CType(CType(255, Byte), Integer)) @@ -874,31 +899,32 @@ Partial Class frmMitarbeitersuche Me.lblNotfall_Name.Text = "-" Me.lblNotfall_Name.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' - 'sbMitarbeiter + 'ContextMenuStrip1 ' - Me.sbMitarbeiter._allowFreitext = False - Me.sbMitarbeiter._AllowSetValue = False - Me.sbMitarbeiter._allowSpaceAsSplitter = True - Me.sbMitarbeiter._autoSizeGross = False - Me.sbMitarbeiter._hideIfListEmpty = True - Me.sbMitarbeiter._value = Nothing - Me.sbMitarbeiter.conn_art = "FMZOLL" - Me.sbMitarbeiter.dgvpos = "LEFT" - Me.sbMitarbeiter.DISPLAY_PARAM = Nothing - Me.sbMitarbeiter.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!) - Me.sbMitarbeiter.INVISIBLE_COLUMNS = Nothing - Me.sbMitarbeiter.key_visible = False - Me.sbMitarbeiter.KEYPARAM = Nothing - Me.sbMitarbeiter.Location = New System.Drawing.Point(45, 11) - Me.sbMitarbeiter.Name = "sbMitarbeiter" - Me.sbMitarbeiter.searchActive = True - Me.sbMitarbeiter.Size = New System.Drawing.Size(582, 29) - Me.sbMitarbeiter.SQL_ORDER_BY = Nothing - Me.sbMitarbeiter.SQL_SELECT = Nothing - Me.sbMitarbeiter.SQL_WHERE = Nothing - Me.sbMitarbeiter.SQL_WhereParamList = Nothing - Me.sbMitarbeiter.TabIndex = 0 - Me.sbMitarbeiter.usrcntl = Nothing + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4) + ' + 'Label14 + ' + Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label14.Location = New System.Drawing.Point(501, 93) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(74, 20) + Me.Label14.TabIndex = 130 + Me.Label14.Text = "TiMas-ID:" + Me.Label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'lblTimasID + ' + Me.lblTimasID.AutoSize = True + Me.lblTimasID.Cursor = System.Windows.Forms.Cursors.Hand + Me.lblTimasID.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblTimasID.Location = New System.Drawing.Point(581, 93) + Me.lblTimasID.Name = "lblTimasID" + Me.lblTimasID.Size = New System.Drawing.Size(59, 20) + Me.lblTimasID.TabIndex = 131 + Me.lblTimasID.Text = "12345" + Me.lblTimasID.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'frmMitarbeitersuche ' @@ -1006,4 +1032,6 @@ Partial Class frmMitarbeitersuche Friend WithEvents lblNotfall_Handy As Windows.Forms.Label Friend WithEvents lblNotfall_Name As Windows.Forms.Label Friend WithEvents cbxLaengergearbeitet As Windows.Forms.CheckBox + Friend WithEvents lblTimasID As Windows.Forms.Label + Friend WithEvents Label14 As Windows.Forms.Label End Class diff --git a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb index d328e095..1dfaac8e 100644 --- a/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb +++ b/VERAG_PROG_ALLGEMEIN/Mitarbeiterverzeichnis/frmMitarbeitersuche.vb @@ -87,6 +87,7 @@ Public Class frmMitarbeitersuche lblFirma.Text = MA.getFirma lblNiederlassung.Text = If(MA.mit_niederlassung, "") lblMAId.Text = MA.mit_id + lblTimasID.Text = MA.mit_terminalTimasId lblTelefon.Text = If(MA.mit_durchwahl, "") lblMail.Text = If(MA.mit_email, "") diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb index f6401477..b009662e 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb @@ -81,24 +81,40 @@ Public Class cMSEAPI End Function Public Shared Function countBackToCustomerNotSet(SQL As SQL) As Integer - Return SQL.getValueTxtBySql("SELECT count(InvToCustomer) FROM [tblMSEInvoices] where InvToCustomer Is null ", "FMZOLL",,, -1) + Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblMSEInvoices] where InvToCustomer Is null ", "FMZOLL",,, -1) End Function - Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing) As DataTable + Public Shared Function countBackToCustomerNotSet(SQL As SQL, AdressenNrVon As Integer, AdressenNrBis As Integer) As Integer + Return SQL.getValueTxtBySql("SELECT count(*) FROM [tblMSEInvoices] inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] where InvToCustomer Is null AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis, "FMZOLL",,, -1) + End Function + + Public Shared Function checkPDFInvoices(Optional reDatVon As Date = Nothing, Optional reDatBis As Date = Nothing, Optional dt As DataTable = Nothing, Optional AdressenNrVon As Integer = -1, Optional AdressenNrBis As Integer = -1) As Integer Try Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL Dim sqlTime As String = "" + Dim sqlAdressenNr As String = "" If IsDate(reDatVon) AndAlso CDate(reDatVon) > "01.01.2020" AndAlso IsDate(reDatBis) AndAlso CDate(reDatBis) > "01.01.2020" Then sqlTime = " And cast(invoice_date As Date) between '" & reDatVon.ToShortDateString & "' and '" & reDatBis.ToShortDateString & "'" End If - Dim SQLstr = "Select invoice_id As RechnungsNr,[invoice_date] As Rechnungsdatum, Adressen.AdressenNr As KundenNr,Adressen.[Name 1] As Kunde, kde_keineMWSt As keineMWST from tblMSEInvoices inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where daId Is null " & sqlTime & " group by invoice_id, Adressen.AdressenNr, Adressen.[Name 1], invoice_date, kde_keineMWSt" + If AdressenNrVon > 0 AndAlso AdressenNrBis > 0 Then + sqlAdressenNr = " AND Adressen.AdressenNr between " & AdressenNrVon & " AND " & AdressenNrBis + End If + + + If dt IsNot Nothing Then + Dim SQLstr = "Select invoice_id As RechnungsNr,[invoice_date] As Rechnungsdatum, Adressen.AdressenNr As KundenNr,Adressen.[Name 1] As Kunde, kde_keineMWSt As keineMWST from tblMSEInvoices inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where daId Is null " & sqlTime & sqlAdressenNr & " group by invoice_id, Adressen.AdressenNr, Adressen.[Name 1], invoice_date, kde_keineMWSt" + dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") + Return dt.Rows.Count + Else + Dim SQLstr = "Select count(*) from tblMSEInvoices inner join [tblMSECustomers] On [customer_number] = [customer_id] INNER JOIN Adressen On Adressen.MSEKundenNr = [customer_number] INNER JOIN tblKundenErweitert On AdressenNr = kde_KundenNr where daId Is null " & sqlTime & sqlAdressenNr + Return SQL.getValueTxtBySql(SQLstr, "FMZOLL",,, 0) + End If + - Dim dt = (New VERAG_PROG_ALLGEMEIN.SQL).loadDgvBySql(SQLstr, "FMZOLL") - Return dt Catch ex As Exception @@ -1179,36 +1195,46 @@ Public Class cMSEAPI ' Amounts If Not IsDBNull(currentRow(35)) Then - Double.TryParse(currentRow(35).ToString(), total_amount_euro) + Double.TryParse(currentRow(35).ToString().Replace(".", ","), total_amount_euro) End If If Not IsDBNull(currentRow(36)) Then Double.TryParse(currentRow(36).ToString().Replace(".", ","), total_vat_amount_euro) End If - + 'If total_amount_euro <> 0 OrElse total_vat_amount_euro <> 0 Then + ' MsgBox("Hier " & total_amount_euro & " " & total_vat_amount_euro) + 'End If Dim inv As New cMSEInvoices(invoiceDate, Country, customerID) - inv.invoice_id = invoiceID - If lngRecordCount = 2 Then - MDMEinarb.invoicedate = invoiceDate - End If + If Not inv.hasEntry Then + inv.invoice_id = invoiceID + + If lngRecordCount = 2 Then + MDMEinarb.invoicedate = invoiceDate + End If - If inv.hasEntry Then - inv.total_amount_euro += total_amount_euro - inv.total_vat_amount_euro += total_vat_amount_euro - Else inv.total_amount_euro = total_amount_euro inv.total_vat_amount_euro = total_vat_amount_euro - End If - inv.name = "TEMP" - inv.msts_vat_number = -1 - inv.alternativeImport = True - inv.SAVEBYCUSTOMERIDDATE() + inv.name = "TEMP" + inv.msts_vat_number = -1 + inv.alternativeImport = True + inv.SAVEBYCUSTOMERIDDATE() - Console.WriteLine("MSE: " & isleernothing((currentRow(1))) & " - " & lngRecordCount & " - " & isleernothing((currentRow(10)))) + Else + If total_amount_euro <> 0 OrElse total_vat_amount_euro <> 0 Then 'nicht relevanten Änderungen überspringen! + + inv.total_amount_euro += total_amount_euro + inv.total_vat_amount_euro += total_vat_amount_euro + inv.SAVEBYCUSTOMERIDDATE() + End If + + End If + + + Console.WriteLine("MSE: " & isleernothing((currentRow(1))) & " - " & lngRecordCount & " - " & isleernothing((currentRow(10)))) @@ -1780,7 +1806,7 @@ Public Class cMSEInvoices Public Function SAVEBYCUSTOMERIDDATE() As Boolean Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() - Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSEInvoices WHERE invoice_date=@invoice_date AND invoice_id = @invoice_id AND customer_number = @customer_number) " & + Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSEInvoices WHERE invoice_date=@invoice_date AND invoice_id = @invoice_id AND customer_number = @customer_number AND country = @country) " & " BEGIN " & getUpdateCmdBYCustomeridDate() & " END " & " Else " & " BEGIN " & getInsertCmd() & " END " & @@ -1793,7 +1819,7 @@ Public Class cMSEInvoices Public Function SAVEBYCountry() As Boolean Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList() - Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSEInvoices WHERE invoice_date=@invoice_date AND invoice_id = @invoice_id AND customer_number = @customer_number) " & + Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSEInvoices WHERE invoice_date=@invoice_date AND country = @country AND customer_number = @customer_number) " & " BEGIN " & getUpdateCmdBYCustomeridDateCountry() & " END " & " Else " & " BEGIN " & getInsertCmd() & " END " & @@ -1950,7 +1976,7 @@ Public Class cMSEInvoices End If Next str = str.Substring(0, str.Length - 1) 'wg. ',' - Return (" UPDATE tblMSEInvoices SET " & str & " WHERE invoice_date=@invoice_date AND invoice_id = @invoice_id AND customer_number = @customer_number ") + Return (" UPDATE tblMSEInvoices SET " & str & " WHERE invoice_date=@invoice_date AND invoice_id = @invoice_id AND customer_number = @customer_number AND country = @country ") Catch ex As Exception VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb index 31d6ec89..ac188e62 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/TIMAS/cTimasAPI.vb @@ -304,14 +304,14 @@ Public Class cTimasAPI Dim success As Boolean Dim json As New Chilkat.JsonObject - success = json.UpdateString("externid", mitarbeiter.mit_id) + success = json.UpdateString("externid", mitarbeiter.mit_terminalTimasId) success = json.UpdateString("markingColor", "#3acc2d") success = json.UpdateString("pnr1", mitarbeiter.mit_PersonalNr) 'für Personalverr. 'success = json.UpdateString("pnr2", "ZZ-3A-Q") success = json.UpdateString("firstname", mitarbeiter.mit_vname) success = json.UpdateString("lastname", mitarbeiter.mit_nname) success = json.UpdateString("gender", IIf(mitarbeiter.mit_geschlecht = "m", "male", "female")) - success = json.UpdateInt("card", mitarbeiter.mit_id) + success = json.UpdateInt("card", mitarbeiter.mit_terminalTimasId) success = json.UpdateString("info", mitarbeiter.mit_firma & " - " & mitarbeiter.mit_abteilung) If mitarbeiter.mit_gebdat <> "" And IsDate(mitarbeiter.mit_gebdat) Then success = json.UpdateString("birthday", CDate(mitarbeiter.mit_gebdat).ToString("yyyy-MM-dd"))
Anzahl RechnungenUmsatzProvision
KundeAnzahl RechnungenUmsatzProvision
" & row.Cells("Ordnungsbegriff").Value & "" & row.Cells("Anzahl").Value & "" & CDbl(row.Cells("Umsatz").Value) & "" & CDbl(row.Cells("Provision").Value) & "