From d84f837dc6fcae605ba20e094438c48398cf751e Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Thu, 12 Jan 2023 14:39:32 +0100 Subject: [PATCH 1/2] Abfertigung TR Statistik --- Aviso/Auswertung/usrctlStatVERIMEX.vb | 82 +++++++++++++-------------- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmHauptfenster.vb | 4 +- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Aviso/Auswertung/usrctlStatVERIMEX.vb b/Aviso/Auswertung/usrctlStatVERIMEX.vb index ec1a3c9..155e74f 100644 --- a/Aviso/Auswertung/usrctlStatVERIMEX.vb +++ b/Aviso/Auswertung/usrctlStatVERIMEX.vb @@ -46,14 +46,14 @@ Public Class usrctlStatVERIMEX End Select With dgvAbfertigungTR - Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,sum(tblSnd_anzahlHandling) as Versandscheine ,sum(tblSnd_anzahlHandlingPos) as Positionen ,count(distinct(avisoid)) as LKW + Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,sum(tblSnd_AbfertigungTRAnzahl) as Versandscheine ,sum(tblSnd_AbfertigungTRAnzahlPos) as Positionen ,count(distinct(avisoid)) as LKW FROM [tblSendungen] inner join Aviso on AvisoID = tblSnd_AvisoID inner join admin.dbo.tblMitarbeiter on mit_id=tblSnd_AbfertigungTR_MA " & innerJoinFiliale & " where cast(tblSnd_AbfertigungTR as date) BETWEEN '" & datAbfStatVon.Value & "' and '" & datAbfStatBis.Value & "' and tblSnd_AbfertigungTR_MA is not null " & whereFiliale & " group by mit_vname,mit_nname" 'früher: Datum statt tblSnd_AbfertigungTR - + MsgBox(sqlstr) dgvAbfertigungTR.DataSource = SQL.loadDgvBySql(sqlstr, "AVISO") End With @@ -76,11 +76,11 @@ Public Class usrctlStatVERIMEX Dim print As New frmPrintLayout - print.Text = "Speditionsbericht" + print.Text = "Speditionsbericht" - Dim rpt As New rptStat_VERIMEX_AbklTR + Dim rpt As New rptStat_VERIMEX_AbklTR - rpt.DataSource = dgvAbklaerungTR.DataSource + rpt.DataSource = dgvAbklaerungTR.DataSource @@ -92,39 +92,39 @@ Public Class usrctlStatVERIMEX End If Dim sum = 0 - rpt.lblUeberschrift.Text = "Sendungserfassung TR " & datStatVon.Text & " bis " & datStatBis.Text - rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME - 'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung + rpt.lblUeberschrift.Text = "Sendungserfassung TR " & datStatVon.Text & " bis " & datStatBis.Text + rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME + 'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung - 'Dim cnt As Integer = 0 - rpt.lblDat.Text = Now.ToLongDateString - Dim sumSnd As Integer = 0 - Dim sumLKW As Integer = 0 + 'Dim cnt As Integer = 0 + rpt.lblDat.Text = Now.ToLongDateString + Dim sumSnd As Integer = 0 + Dim sumLKW As Integer = 0 - AddHandler rpt.Detail.Format, Sub() - 'rpt.lblVon.Text = CDate(rpt.Fields.Item("von").Value).ToShortDateString - 'rpt.lblBis.Text = CDate(rpt.Fields.Item("bis").Value).ToShortDateString - rpt.lblAnzSnd.Text = rpt.Fields.Item("Sendungen").Value - rpt.lblAnzLKW.Text = rpt.Fields.Item("LKW").Value + AddHandler rpt.Detail.Format, Sub() + 'rpt.lblVon.Text = CDate(rpt.Fields.Item("von").Value).ToShortDateString + 'rpt.lblBis.Text = CDate(rpt.Fields.Item("bis").Value).ToShortDateString + rpt.lblAnzSnd.Text = rpt.Fields.Item("Sendungen").Value + rpt.lblAnzLKW.Text = rpt.Fields.Item("LKW").Value - rpt.lblMitarbeiter.Text = rpt.Fields.Item("Mitarbeiter").Value + rpt.lblMitarbeiter.Text = rpt.Fields.Item("Mitarbeiter").Value - sumSnd += CInt(rpt.Fields.Item("Sendungen").Value) - sumLKW += CInt(rpt.Fields.Item("LKW").Value) - End Sub - AddHandler rpt.GroupHeader1.Format, Sub() - ' If CheckBox1.Checked Then rpt.lblFiliale.Text = SQL.getValueTxtBySql("SELECT CAST(FilialenNr as varchar (4)) + ' ' + Grenzstelle FROM filialen WHERE FilialenNr='" & rpt.Fields.Item("FilialenNr").Value & "'", "FMZOLL") - sumSnd = 0 - sumLKW = 0 - End Sub - AddHandler rpt.GroupFooter1.Format, Sub() - rpt.lblAnzSndSum.Text = sumSnd - rpt.lblAnzLKWSum.Text = sumLKW - End Sub + sumSnd += CInt(rpt.Fields.Item("Sendungen").Value) + sumLKW += CInt(rpt.Fields.Item("LKW").Value) + End Sub + AddHandler rpt.GroupHeader1.Format, Sub() + ' If CheckBox1.Checked Then rpt.lblFiliale.Text = SQL.getValueTxtBySql("SELECT CAST(FilialenNr as varchar (4)) + ' ' + Grenzstelle FROM filialen WHERE FilialenNr='" & rpt.Fields.Item("FilialenNr").Value & "'", "FMZOLL") + sumSnd = 0 + sumLKW = 0 + End Sub + AddHandler rpt.GroupFooter1.Format, Sub() + rpt.lblAnzSndSum.Text = sumSnd + rpt.lblAnzLKWSum.Text = sumLKW + End Sub - print.Viewer.LoadDocument(rpt) - print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous + print.Viewer.LoadDocument(rpt) + print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous print.Show() End Sub @@ -173,16 +173,16 @@ Public Class usrctlStatVERIMEX Dim whereFiliale = "" Dim innerJoinFiliale = "" - Select Case cboFirma._value - Case "" - Case 0 : whereFiliale = " and tblSendungen.FilialenNr <=0 " - Case Else - whereFiliale = " and Filialen.Firma='" & cboFirma._value & "' " - innerJoinFiliale = "inner join " & VERAG_PROG_ALLGEMEIN.cAllgemein.FMZOLL_SERVER & ".VERAG.dbo.Filialen on [tblSendungen].FilialenNr=Filialen.FilialenNr" - End Select + Select Case cboFirma._value + Case "" + Case 0 : whereFiliale = " and tblSendungen.FilialenNr <=0 " + Case Else + whereFiliale = " and Filialen.Firma='" & cboFirma._value & "' " + innerJoinFiliale = "inner join " & VERAG_PROG_ALLGEMEIN.cAllgemein.FMZOLL_SERVER & ".VERAG.dbo.Filialen on [tblSendungen].FilialenNr=Filialen.FilialenNr" + End Select - Dim sqlstr = "SELECT (Select isnull(Filialen.firma,'') FROM [FMZOLL\SQLFMZOLL].VERAG.dbo.Filialen WHERE [tblSendungen].FilialenNr=Filialen.FilialenNr) Firma, + Dim sqlstr = "SELECT (Select isnull(Filialen.firma,'') FROM [FMZOLL\SQLFMZOLL].VERAG.dbo.Filialen WHERE [tblSendungen].FilialenNr=Filialen.FilialenNr) Firma, mit_vname + ' ' + mit_nname as Mitarbeiter, aviso.LKW_Nr [LKW Kennzeichen],tblSnd_AvisoID [LKW-ID], Auftraggeber as Avisierer, Frächter, tblSnd_Empfaenger as Empfänger, tblSnd_Colli Colli, tblSnd_Gewicht Gewicht, tblSnd_Abfertigungsart_ID Abfertigungsart, tblSendungen.FilialenNr , tblSendungen.AbfertigungsNr, replace(Ankunft,'1899-12-30 00:00:00','') Ankunft, replace(Freigabe,'1899-12-30 00:00:00','') Freigabe FROM [tblSendungen] inner join Aviso on AvisoID = tblSnd_AvisoID inner join admin.dbo.tblMitarbeiter on mit_id=tblSnd_AbklaerungTR_MA " & innerJoinFiliale & " @@ -215,7 +215,7 @@ Public Class usrctlStatVERIMEX innerJoinFiliale = "inner join " & VERAG_PROG_ALLGEMEIN.cAllgemein.FMZOLL_SERVER & ".VERAG.dbo.Filialen on [tblSendungen].FilialenNr=Filialen.FilialenNr" End Select - Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,tblSnd_anzahlHandling as AnzahlVersandscheine ,tblSnd_anzahlHandlingPos as AnzahlPositionen, aviso.LKW_Nr [LKW Kennzeichen],tblSnd_AvisoID [LKW-ID], Auftraggeber as Avisierer, Frächter, tblSendungen.FilialenNr , tblSendungen.AbfertigungsNr, replace(Ankunft,'1899-12-30 00:00:00','') Ankunft, replace(Freigabe,'1899-12-30 00:00:00','') Freigabe + Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,tblSnd_AbfertigungTRAnzahl as AnzahlVersandscheine ,tblSnd_AbfertigungTRAnzahlPos as AnzahlPositionen, aviso.LKW_Nr [LKW Kennzeichen],tblSnd_AvisoID [LKW-ID], Auftraggeber as Avisierer, Frächter, tblSendungen.FilialenNr , tblSendungen.AbfertigungsNr, replace(Ankunft,'1899-12-30 00:00:00','') Ankunft, replace(Freigabe,'1899-12-30 00:00:00','') Freigabe FROM [tblSendungen] inner join Aviso on AvisoID = tblSnd_AvisoID inner join admin.dbo.tblMitarbeiter on mit_id=tblSnd_AbfertigungTR_MA " & innerJoinFiliale & " where cast(tblSnd_AbfertigungTR as date) BETWEEN '" & datAbfStatVon.Value & "' and '" & datAbfStatBis.Value & "' and tblSnd_AbfertigungTR_MA is not null diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index a92149f..57ab87b 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/frmHauptfenster.vb b/Aviso/frmHauptfenster.vb index 77ccf05..90c924f 100644 --- a/Aviso/frmHauptfenster.vb +++ b/Aviso/frmHauptfenster.vb @@ -6172,8 +6172,8 @@ Public Class AvisoStatusFunctions ' Return False 'End If - SENDUNG_TMP.tblSnd_anzahlHandling = anzahl - SENDUNG_TMP.tblSnd_anzahlHandlingPos = anzahlPos + SENDUNG_TMP.tblSnd_AbfertigungTRAnzahl = anzahl + SENDUNG_TMP.tblSnd_AbfertigungTRAnzahlPos = anzahlPos If SENDUNG_TMP.tblSnd_AbfertigungTR Is Nothing Then SENDUNG_TMP.tblSnd_AbfertigungTR_MA = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID From f0091f9c39d8f59f8e615b57cd5529f90a27bce7 Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Fri, 13 Jan 2023 23:51:56 +0100 Subject: [PATCH 2/2] Statistik VERIMEX 2 --- Aviso/Auswertung/usrctlStatVERIMEX.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Aviso/Auswertung/usrctlStatVERIMEX.vb b/Aviso/Auswertung/usrctlStatVERIMEX.vb index 155e74f..d6b7e5b 100644 --- a/Aviso/Auswertung/usrctlStatVERIMEX.vb +++ b/Aviso/Auswertung/usrctlStatVERIMEX.vb @@ -53,7 +53,7 @@ Public Class usrctlStatVERIMEX " & whereFiliale & " group by mit_vname,mit_nname" 'früher: Datum statt tblSnd_AbfertigungTR - MsgBox(sqlstr) + 'MsgBox(sqlstr) dgvAbfertigungTR.DataSource = SQL.loadDgvBySql(sqlstr, "AVISO") End With