This commit is contained in:
2021-10-20 22:24:56 +02:00
parent 787491cf6b
commit 2d7bb951d2
26 changed files with 1204 additions and 415 deletions

View File

@@ -23,6 +23,7 @@ Partial Class usrctlStatVERIMEX
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.Button4 = New System.Windows.Forms.Button()
Me.Label9 = New System.Windows.Forms.Label()
Me.Panel4 = New System.Windows.Forms.Panel()
Me.Button3 = New System.Windows.Forms.Button()
@@ -35,10 +36,26 @@ Partial Class usrctlStatVERIMEX
Me.datStatVon = New System.Windows.Forms.DateTimePicker()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.btnAbfDetailbereicht = New System.Windows.Forms.Button()
Me.Label2 = New System.Windows.Forms.Label()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.btnAbfAuswerten = New System.Windows.Forms.Button()
Me.Label3 = New System.Windows.Forms.Label()
Me.cboAbfFirma = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.dgvAbfertigungTR = New System.Windows.Forms.DataGridView()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.datAbfStatBis = New System.Windows.Forms.DateTimePicker()
Me.datAbfStatVon = New System.Windows.Forms.DateTimePicker()
Me.btnAbfBericht = New System.Windows.Forms.Button()
Me.btnAbfExcel = New System.Windows.Forms.Button()
Me.Panel3.SuspendLayout()
Me.Panel4.SuspendLayout()
CType(Me.dgvAbklaerungTR, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.Panel2.SuspendLayout()
CType(Me.dgvAbfertigungTR, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Panel3
@@ -53,6 +70,16 @@ Partial Class usrctlStatVERIMEX
Me.Panel3.Size = New System.Drawing.Size(701, 423)
Me.Panel3.TabIndex = 0
'
'Button4
'
Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button4.Location = New System.Drawing.Point(310, 389)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(135, 23)
Me.Button4.TabIndex = 4
Me.Button4.Text = "Detailbericht (Excel)"
Me.Button4.UseVisualStyleBackColor = True
'
'Label9
'
Me.Label9.AutoSize = True
@@ -105,7 +132,7 @@ Partial Class usrctlStatVERIMEX
Me.cboFirma._value = ""
Me.cboFirma.FormattingEnabled = True
Me.cboFirma.Location = New System.Drawing.Point(386, 11)
Me.cboFirma.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.cboFirma.Margin = New System.Windows.Forms.Padding(2)
Me.cboFirma.Name = "cboFirma"
Me.cboFirma.Size = New System.Drawing.Size(111, 21)
Me.cboFirma.TabIndex = 5
@@ -173,29 +200,165 @@ Partial Class usrctlStatVERIMEX
Me.Button1.Text = "Excel"
Me.Button1.UseVisualStyleBackColor = True
'
'Button4
'Panel1
'
Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button4.Location = New System.Drawing.Point(310, 389)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(135, 23)
Me.Button4.TabIndex = 4
Me.Button4.Text = "Detailbericht (Excel)"
Me.Button4.UseVisualStyleBackColor = True
Me.Panel1.Controls.Add(Me.btnAbfDetailbereicht)
Me.Panel1.Controls.Add(Me.Label2)
Me.Panel1.Controls.Add(Me.Panel2)
Me.Panel1.Controls.Add(Me.btnAbfBericht)
Me.Panel1.Controls.Add(Me.btnAbfExcel)
Me.Panel1.Location = New System.Drawing.Point(15, 467)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(701, 423)
Me.Panel1.TabIndex = 5
'
'btnAbfDetailbereicht
'
Me.btnAbfDetailbereicht.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAbfDetailbereicht.Location = New System.Drawing.Point(310, 389)
Me.btnAbfDetailbereicht.Name = "btnAbfDetailbereicht"
Me.btnAbfDetailbereicht.Size = New System.Drawing.Size(135, 23)
Me.btnAbfDetailbereicht.TabIndex = 4
Me.btnAbfDetailbereicht.Text = "Detailbericht (Excel)"
Me.btnAbfDetailbereicht.UseVisualStyleBackColor = True
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(3, 8)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(208, 13)
Me.Label2.TabIndex = 0
Me.Label2.Text = "Abfertigung TR"
'
'Panel2
'
Me.Panel2.BackColor = System.Drawing.Color.WhiteSmoke
Me.Panel2.Controls.Add(Me.btnAbfAuswerten)
Me.Panel2.Controls.Add(Me.Label3)
Me.Panel2.Controls.Add(Me.cboAbfFirma)
Me.Panel2.Controls.Add(Me.dgvAbfertigungTR)
Me.Panel2.Controls.Add(Me.Label4)
Me.Panel2.Controls.Add(Me.Label5)
Me.Panel2.Controls.Add(Me.datAbfStatBis)
Me.Panel2.Controls.Add(Me.datAbfStatVon)
Me.Panel2.Location = New System.Drawing.Point(3, 24)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(670, 359)
Me.Panel2.TabIndex = 1
'
'btnAbfAuswerten
'
Me.btnAbfAuswerten.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAbfAuswerten.Location = New System.Drawing.Point(532, 8)
Me.btnAbfAuswerten.Name = "btnAbfAuswerten"
Me.btnAbfAuswerten.Size = New System.Drawing.Size(135, 23)
Me.btnAbfAuswerten.TabIndex = 6
Me.btnAbfAuswerten.Text = "Auswerten"
Me.btnAbfAuswerten.UseVisualStyleBackColor = True
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(346, 13)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(35, 13)
Me.Label3.TabIndex = 0
Me.Label3.Text = "Firma:"
'
'cboAbfFirma
'
Me.cboAbfFirma._allowedValuesFreiText = Nothing
Me.cboAbfFirma._allowFreiText = False
Me.cboAbfFirma._value = ""
Me.cboAbfFirma.FormattingEnabled = True
Me.cboAbfFirma.Location = New System.Drawing.Point(386, 11)
Me.cboAbfFirma.Margin = New System.Windows.Forms.Padding(2)
Me.cboAbfFirma.Name = "cboAbfFirma"
Me.cboAbfFirma.Size = New System.Drawing.Size(111, 21)
Me.cboAbfFirma.TabIndex = 5
'
'dgvAbfertigungTR
'
Me.dgvAbfertigungTR.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvAbfertigungTR.Location = New System.Drawing.Point(6, 38)
Me.dgvAbfertigungTR.Name = "dgvAbfertigungTR"
Me.dgvAbfertigungTR.RowHeadersWidth = 62
Me.dgvAbfertigungTR.Size = New System.Drawing.Size(661, 318)
Me.dgvAbfertigungTR.TabIndex = 7
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(179, 15)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(10, 13)
Me.Label4.TabIndex = 3
Me.Label4.Text = "-"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(3, 15)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(51, 13)
Me.Label5.TabIndex = 1
Me.Label5.Text = "Zeitraum:"
'
'datAbfStatBis
'
Me.datAbfStatBis.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.datAbfStatBis.Location = New System.Drawing.Point(194, 12)
Me.datAbfStatBis.Name = "datAbfStatBis"
Me.datAbfStatBis.Size = New System.Drawing.Size(105, 20)
Me.datAbfStatBis.TabIndex = 4
'
'datAbfStatVon
'
Me.datAbfStatVon.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.datAbfStatVon.Location = New System.Drawing.Point(70, 12)
Me.datAbfStatVon.Name = "datAbfStatVon"
Me.datAbfStatVon.Size = New System.Drawing.Size(105, 20)
Me.datAbfStatVon.TabIndex = 2
'
'btnAbfBericht
'
Me.btnAbfBericht.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAbfBericht.Location = New System.Drawing.Point(598, 389)
Me.btnAbfBericht.Name = "btnAbfBericht"
Me.btnAbfBericht.Size = New System.Drawing.Size(75, 23)
Me.btnAbfBericht.TabIndex = 3
Me.btnAbfBericht.Text = "Bericht"
Me.btnAbfBericht.UseVisualStyleBackColor = True
'
'btnAbfExcel
'
Me.btnAbfExcel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAbfExcel.Location = New System.Drawing.Point(517, 389)
Me.btnAbfExcel.Name = "btnAbfExcel"
Me.btnAbfExcel.Size = New System.Drawing.Size(75, 23)
Me.btnAbfExcel.TabIndex = 2
Me.btnAbfExcel.Text = "Excel"
Me.btnAbfExcel.UseVisualStyleBackColor = True
'
'usrctlStatVERIMEX
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.White
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.Panel3)
Me.Name = "usrctlStatVERIMEX"
Me.Size = New System.Drawing.Size(844, 510)
Me.Size = New System.Drawing.Size(844, 927)
Me.Panel3.ResumeLayout(False)
Me.Panel3.PerformLayout()
Me.Panel4.ResumeLayout(False)
Me.Panel4.PerformLayout()
CType(Me.dgvAbklaerungTR, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False)
Me.Panel2.ResumeLayout(False)
Me.Panel2.PerformLayout()
CType(Me.dgvAbfertigungTR, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
@@ -214,4 +377,18 @@ Partial Class usrctlStatVERIMEX
Friend WithEvents cboFirma As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents Button3 As Button
Friend WithEvents Button4 As Button
Friend WithEvents Panel1 As Panel
Friend WithEvents btnAbfDetailbereicht As Button
Friend WithEvents Label2 As Label
Friend WithEvents Panel2 As Panel
Friend WithEvents btnAbfAuswerten As Button
Friend WithEvents Label3 As Label
Friend WithEvents cboAbfFirma As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents dgvAbfertigungTR As DataGridView
Friend WithEvents Label4 As Label
Friend WithEvents Label5 As Label
Friend WithEvents datAbfStatBis As DateTimePicker
Friend WithEvents datAbfStatVon As DateTimePicker
Friend WithEvents btnAbfBericht As Button
Friend WithEvents btnAbfExcel As Button
End Class

View File

@@ -32,6 +32,32 @@ Public Class usrctlStatVERIMEX
End Sub
Sub initAbf()
Dim whereFiliale = ""
Dim innerJoinFiliale = ""
Select Case cboAbfFirma._value
Case ""
Case 0 : whereFiliale = " and tblSendungen.FilialenNr <=0 "
Case "ATILLA" : whereFiliale = " and tblSendungen.FilialenNr='4801' "
Case Else
whereFiliale = " and tblSendungen.FilialenNr<>'4801' and Filialen.Firma='" & cboAbfFirma._value & "' "
innerJoinFiliale = "inner join " & VERAG_PROG_ALLGEMEIN.cAllgemein.FMZOLL_SERVER & ".VERAG.dbo.Filialen on [tblSendungen].FilialenNr=Filialen.FilialenNr"
End Select
With dgvAbfertigungTR
Dim sqlstr = "SELECT mit_vname + ' ' + mit_nname as Mitarbeiter ,sum(tblSnd_anzahlHandling) as Sendungen ,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
dgvAbfertigungTR.DataSource = SQL.loadDgvBySql(sqlstr, "AVISO")
End With
End Sub
@@ -111,6 +137,16 @@ Public Class usrctlStatVERIMEX
cboFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("UNISPED", "UNISPED"))
cboFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("*Nicht zugeordnet", "0"))
cboFirma.changeItem("")
cboAbfFirma.Items.Clear()
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ALLE", ""))
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ATILLA", "ATILLA"))
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("VERAG", "VERAG"))
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("IMEX", "IMEX"))
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("AMBAR", "AMBAR"))
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("UNISPED", "UNISPED"))
cboAbfFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("*Nicht zugeordnet", "0"))
cboAbfFirma.changeItem("ATILLA")
' cboFirma.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ATILLA", ""))
End Sub
@@ -118,11 +154,16 @@ Public Class usrctlStatVERIMEX
init()
End Sub
Private Sub datStatVon_KeyDown(sender As Object, e As KeyEventArgs) Handles datStatVon.KeyDown, datStatBis.KeyDown, cboFirma.KeyDown
Private Sub databfStatVon_KeyDown(sender As Object, e As KeyEventArgs) Handles datStatVon.KeyDown, datStatBis.KeyDown, cboFirma.KeyDown
If e.KeyCode = Keys.Return Then
init()
End If
End Sub
Private Sub datStatVon_KeyDown(sender As Object, e As KeyEventArgs) Handles datAbfStatVon.KeyDown, datAbfStatBis.KeyDown, cboAbfFirma.KeyDown, datStatVon.KeyDown, datStatBis.KeyDown, cboFirma.KeyDown
If e.KeyCode = Keys.Return Then
initAbf()
End If
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Me.Cursor = Cursors.WaitCursor
@@ -156,4 +197,103 @@ Public Class usrctlStatVERIMEX
End Try
Me.Cursor = Cursors.Default
End Sub
Private Sub btnAbfDetailbereicht_Click(sender As Object, e As EventArgs) Handles btnAbfDetailbereicht.Click
Me.Cursor = Cursors.WaitCursor
Try
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
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_AbfertigungTR_MA
" & innerJoinFiliale & "
where cast(tblSnd_AbfertigungTR as date) BETWEEN '" & datStatVon.Value & "' and '" & datStatBis.Value & "' and tblSnd_AbfertigungTR_MA is not null
" & whereFiliale & "
ORDER BY Firma, Mitarbeiter,Auftraggeber,LKW_Nr,tblSnd_PosUnterNr"
SDL.cProgramFunctions.genExcelFromDT_NEW(SQL.loadDgvBySql(sqlstr, "AVISO"))
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
Me.Cursor = Cursors.Default
End Sub
Private Sub btnAbfExcel_Click(sender As Object, e As EventArgs) Handles btnAbfExcel.Click
Me.Cursor = Cursors.WaitCursor
SDL.cProgramFunctions.genExcelFromDGV_NEW(dgvAbfertigungTR, False)
Me.Cursor = Cursors.Default
End Sub
Private Sub btnAbfBericht_Click(sender As Object, e As EventArgs) Handles btnAbfBericht.Click
Dim print As New frmPrintLayout
print.Text = "Speditionsbericht"
Dim rpt As New rptStat_VERIMEX_AbklTR
rpt.DataSource = dgvAbfertigungTR.DataSource
If rpt.DataSource Is Nothing OrElse rpt.DataSource.rows.count = 0 Then
rpt.Dispose() : print.Dispose()
MsgBox("Keine Daten vorhanden!")
Exit Sub
End If
Dim sum = 0
rpt.lblUeberschrift.Text = "Abfertigung (NCTS) 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
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
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.Show()
End Sub
Private Sub btnAbfAuswerten_Click(sender As Object, e As EventArgs) Handles btnAbfAuswerten.Click
initAbf()
End Sub
End Class