Handling-Abrechnung, etc.
This commit is contained in:
@@ -471,7 +471,7 @@ Partial Public Class rptSpeditionsbericht_HandlingAussenstellen
|
||||
Me.txtUebersicht.Style = "font-family: Microsoft Sans Serif; font-size: 8.25pt; ddo-char-set: 1"
|
||||
Me.txtUebersicht.Text = Nothing
|
||||
Me.txtUebersicht.Top = 0.638189!
|
||||
Me.txtUebersicht.Width = 3.75!
|
||||
Me.txtUebersicht.Width = 7.47441!
|
||||
'
|
||||
'GroupHeader1
|
||||
'
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -101,7 +101,6 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Me.ZFThyrnauZeitraumAuswählenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AuswertungDiversZeitraumAuswählenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.Button20 = New System.Windows.Forms.Button()
|
||||
Me.Label46 = New System.Windows.Forms.Label()
|
||||
Me.Button19 = New System.Windows.Forms.Button()
|
||||
Me.Button18 = New System.Windows.Forms.Button()
|
||||
Me.Button16 = New System.Windows.Forms.Button()
|
||||
@@ -214,6 +213,7 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Me.Label45 = New System.Windows.Forms.Label()
|
||||
Me.cboFilialeHandling = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
||||
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
|
||||
Me.cbxHandlingAbrechnen = New System.Windows.Forms.CheckBox()
|
||||
Me.cntxtCntxtSpeditionsbuch.SuspendLayout()
|
||||
Me.pnlRechts.SuspendLayout()
|
||||
CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
@@ -1069,6 +1069,7 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
'
|
||||
Me.pnlBerichte.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.pnlBerichte.Controls.Add(Me.cbxHandlingAbrechnen)
|
||||
Me.pnlBerichte.Controls.Add(Me.CheckBox4)
|
||||
Me.pnlBerichte.Controls.Add(Me.cbxDetailbericht)
|
||||
Me.pnlBerichte.Controls.Add(Me.MyComboBox2)
|
||||
@@ -1079,7 +1080,6 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Me.pnlBerichte.Controls.Add(Me.cboHandlingssatz)
|
||||
Me.pnlBerichte.Controls.Add(Me.MenuStrip1)
|
||||
Me.pnlBerichte.Controls.Add(Me.Button20)
|
||||
Me.pnlBerichte.Controls.Add(Me.Label46)
|
||||
Me.pnlBerichte.Controls.Add(Me.Button19)
|
||||
Me.pnlBerichte.Controls.Add(Me.Button18)
|
||||
Me.pnlBerichte.Controls.Add(Me.Button16)
|
||||
@@ -1267,17 +1267,6 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Me.Button20.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
||||
Me.Button20.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label46
|
||||
'
|
||||
Me.Label46.AutoSize = True
|
||||
Me.Label46.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.Label46.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.Label46.Location = New System.Drawing.Point(4, 121)
|
||||
Me.Label46.Name = "Label46"
|
||||
Me.Label46.Size = New System.Drawing.Size(61, 13)
|
||||
Me.Label46.TabIndex = 58
|
||||
Me.Label46.Text = "Handling:"
|
||||
'
|
||||
'Button19
|
||||
'
|
||||
Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
@@ -2968,6 +2957,18 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Me.SplitContainer.SplitterWidth = 2
|
||||
Me.SplitContainer.TabIndex = 3
|
||||
'
|
||||
'cbxHandlingAbrechnen
|
||||
'
|
||||
Me.cbxHandlingAbrechnen.AutoSize = True
|
||||
Me.cbxHandlingAbrechnen.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.cbxHandlingAbrechnen.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.cbxHandlingAbrechnen.Location = New System.Drawing.Point(7, 115)
|
||||
Me.cbxHandlingAbrechnen.Name = "cbxHandlingAbrechnen"
|
||||
Me.cbxHandlingAbrechnen.Size = New System.Drawing.Size(140, 17)
|
||||
Me.cbxHandlingAbrechnen.TabIndex = 96
|
||||
Me.cbxHandlingAbrechnen.Text = "Handling abrechnen"
|
||||
Me.cbxHandlingAbrechnen.UseVisualStyleBackColor = False
|
||||
'
|
||||
'usrCntlSpeditionsBuchSuche
|
||||
'
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
|
||||
@@ -3160,7 +3161,6 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Friend WithEvents cboFilialeHandling As VERAG_PROG_ALLGEMEIN.MyComboBox
|
||||
Friend WithEvents Label45 As Label
|
||||
Friend WithEvents Button20 As Button
|
||||
Friend WithEvents Label46 As Label
|
||||
Friend WithEvents Panel2 As Panel
|
||||
Friend WithEvents MyComboBox1 As VERAG_PROG_ALLGEMEIN.MyComboBox
|
||||
Friend WithEvents lstFilialeHandling As VERAG_PROG_ALLGEMEIN.MyListBox
|
||||
@@ -3200,4 +3200,5 @@ Partial Class usrCntlSpeditionsBuchSuche
|
||||
Friend WithEvents CheckBox4 As CheckBox
|
||||
Friend WithEvents cbxfehlZahlung_AVISOID As CheckBox
|
||||
Friend WithEvents cbxfehlZahlung_SENDUNG As CheckBox
|
||||
Friend WithEvents cbxHandlingAbrechnen As CheckBox
|
||||
End Class
|
||||
|
||||
@@ -126,8 +126,8 @@
|
||||
<metadata name="MenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>431, 17</value>
|
||||
</metadata>
|
||||
<metadata name="MenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>431, 17</value>
|
||||
<metadata name="MenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>546, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="ToolStripMenuItem2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@@ -299,7 +299,4 @@
|
||||
<metadata name="MenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>546, 17</value>
|
||||
</metadata>
|
||||
<metadata name="MenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>546, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -1,8 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Globalization
|
||||
Imports GrapeCity.ActiveReports.Viewer.Common.Internal
|
||||
Imports System.Globalization
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
Imports VERAG_PROG_ALLGEMEIN.IDEV_Intrastat
|
||||
|
||||
|
||||
Public Class usrCntlSpeditionsBuchSuche
|
||||
@@ -416,7 +413,7 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
' txtBestimmungszollstelle.initSearchBox(Me.FindForm, "[basncd_dstnr] ,[basncd_dstnr] +' - ' + [basncd_name] +' (' +[basncd_alpha]+')' as displayPARAM,[basncd_dstnr] as Nr,[basncd_name] as Dienststelle,[basncd_alpha] as Land FROM basncd", {" [basncd_dstnr]", "basncd_name"}, " [basncd_gbdat] >= getdate() ", " basncd_alpha,[basncd_name]", "basncd_dstnr", "displayPARAM", "ATLAS", , 400, 200, {"displayPARAM", "basncd_dstnr"})
|
||||
txtZollstelle.initSearchBox(Me.FindForm, "[Code] ,[Code] as Nr,Description as Dienststelle,left(Code,2) as Land,[Description] +' (' +left(Code,2)+')' as display FROM [tbl_DY_ZollDE_C0141_Zollstellen]", {" [Code]", "Description"}, " (StartDate is null OR StartDate< GETDATE()) AND (EndDate is null OR EndDate> GETDATE()) ", " left(Code,2),[Description]", "Code", "display", "FMZOLL", , 400, 200, {"display", "Code"})
|
||||
|
||||
cboHandlingssatz.fillWithSQL("SELECT [hs_Bezeichnung] FROM [tblHandlingssaetzeIntern] group by [hs_Bezeichnung] ", False, "FMZOLL", True)
|
||||
cboHandlingssatz.fillWithSQL("SELECT hs_RgAn,[hs_Bezeichnung] FROM [tblHandlingssaetzeIntern] group by [hs_Bezeichnung],hs_RgAn ", False, "FMZOLL", True)
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.STAMMFILIALE <> "" And Not VERAG_PROG_ALLGEMEIN.cAllgemein.isCLUSTER And FirmaTmp <> "VERAGIMEX" Then
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.CLUSTER = "FRONTOFFICE" Then
|
||||
@@ -1648,26 +1645,21 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
End Sub
|
||||
|
||||
|
||||
Function getrHandlingAussenstellen(Optional showDok As Boolean = True, Optional Handlingssatz As String = "", Optional whereOpt As String = "", Optional ignoreFiliale As Boolean = False) 'Firma As String, kdnrTmp As Integer, Optional showDok As Boolean = False, Optional ByRef VBNr As Integer = -1) As String
|
||||
Function getrHandlingAussenstellen(ByRef year As Integer, ByRef dtAbrechnung As DataTable, Optional showDok As Boolean = True, Optional Handlingssatz As String = "", Optional whereOpt As String = "", Optional ignoreFiliale As Boolean = False) 'Firma As String, kdnrTmp As Integer, Optional showDok As Boolean = False, Optional ByRef VBNr As Integer = -1) As String
|
||||
Dim displayFilter = cbxFilterInBericht.Checked
|
||||
If ignoreFiliale Or VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ZOLL_Auswertungen", "SDL") Then
|
||||
Dim sqlstr As String = ""
|
||||
' If CheckBox1.Checked Then
|
||||
|
||||
Dim sql_KdAuftragsNr = "" '",Speditionsbuch.KdAuftragsNr as KdAuftragsNr"
|
||||
Dim dtAbrechnungLocal As DataTable = dtAbrechnung
|
||||
|
||||
|
||||
'sqlstr &= " SELECT FilialenNr, AbfertigungsNr,UnterNr, Speditionsbuch.Abfertigungsart as Abfertigungsart ,Abfertigungsdatum, BelegNr, Rohmasse, Vermerk, Packstücke, AbsenderKundenNr, Absender, EmpfängerKundenNr, Empfänger,EndEmpfänger,EndEmpfängerKundenNr, VermittlerKundenNr, Vermittler, "
|
||||
'sqlstr &= " FrachtführerKundenNr, Frachtführer, AvisiererKundenNr, Avisierer,Währungscode,Barzahlungsbetrag,Rechnungsbetrag, [LKW Kennzeichen],"
|
||||
'sqlstr &= " Abfertigungsanzahl, Speditionsbuch.Abfertigungsart, Abfertigungsbezeichnung,AvisoID" & sql_KdAuftragsNr & ",Speditionsbuch.KdAuftragsNrAvisierer,Speditionsbuch.KdAuftragsNrEmpfaenger,Speditionsbuch.KdAuftragsNrFrachtfuehrer, Speditionsbuch.Bemerkungen "
|
||||
Dim sql_KdAuftragsNr = ""
|
||||
sqlstr &= " SELECT Speditionsbuch.*,Abfertigungsbezeichnung"
|
||||
sqlstr &= " FROM Speditionsbuch LEFT JOIN Abfertigungsarten ON Speditionsbuch.Abfertigungsart=Abfertigungsarten.Abfertigungsart "
|
||||
sqlstr &= " WHERE 1=1 "
|
||||
sqlstr &= getSpedBuchWhere(ignoreFiliale)
|
||||
sqlstr &= whereOpt
|
||||
' sqlstr &= " order by FilialenNr, AvisoId,Speditionsbuch.Abfertigungsart,Abfertigungsdatum"
|
||||
sqlstr &= " order by Speditionsbuch.Abfertigungsart,FilialenNr,Abfertigungsdatum"
|
||||
' MsgBox(sqlstr)
|
||||
|
||||
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL", , getSpedbuchList())
|
||||
|
||||
Dim header = "Handling / Front-Office "
|
||||
@@ -1675,19 +1667,20 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
|
||||
Case "IMEX" : header &= "IMEX Customs Service GmbH"
|
||||
Case "ATILLA" : header &= "ATILLA Spedition"
|
||||
Case "AMBAR" : header = "AMBAR Logistc Services GmbH - Handling / AMBAR Bad Reichenhall"
|
||||
|
||||
Case "AMBAR" : header = "AMBAR Logistic Services GmbH - Handling / AMBAR Bad Reichenhall"
|
||||
Case Else
|
||||
End Select
|
||||
|
||||
If showDok Then
|
||||
If vbYes = MsgBox("Möchten Sie den Bericht ZUSÄTZLICH als Excel exportieren?", vbYesNoCancel) Then
|
||||
|
||||
If vbYes = MsgBox("Möchten Sie den Bericht ZUSÄTZLICH als Excel exportieren?", vbYesNoCancel) Then
|
||||
|
||||
cProgramFunctions.genExcelFromDT_NEW(dt,,, header)
|
||||
cProgramFunctions.genExcelFromDT_NEW(dt,,, header)
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim print As New frmPrintLayout
|
||||
print.Text = "Handling / Front-Office"
|
||||
|
||||
@@ -1718,27 +1711,24 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
|
||||
Dim sum = 0
|
||||
rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
|
||||
'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung
|
||||
|
||||
Dim defaultHandlingPreis As Double = 15
|
||||
|
||||
Dim HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST = Nothing
|
||||
If Handlingssatz <> "" Then
|
||||
HandlingList = New VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST(Handlingssatz)
|
||||
HandlingList = New VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST(Handlingssatz, year)
|
||||
End If
|
||||
|
||||
'Dim cnt As Integer = 0
|
||||
rpt.lblDat.Text = Now.ToLongDateString
|
||||
'Dim sumRg As Double = 0
|
||||
'Dim gesSumAnz As Double = 0
|
||||
'Dim gesSumBar As Double = 0
|
||||
'Dim gesSumRg As Double = 0
|
||||
'Dim gesgesSumAnz As Double = 0
|
||||
'Dim gesgesSumBar As Double = 0
|
||||
'Dim gesgesSumRg As Double = 0
|
||||
'Dim SumAnzLKW As Double = 0
|
||||
'Dim gesSumAnzLKW As Double = 0
|
||||
'Dim gesgesSumAnzLKW As Double = 0
|
||||
|
||||
Dim dt_summen As New DataTable
|
||||
|
||||
dt_summen.Columns.Add("Anzahl", GetType(Double))
|
||||
dt_summen.Columns.Add("BAR", GetType(Double))
|
||||
dt_summen.Columns.Add("HANDLING", GetType(Double))
|
||||
dt_summen.Columns.Add("zu_kassieren_BAR", GetType(Double))
|
||||
dt_summen.Columns.Add("Grenzstelle", GetType(String))
|
||||
|
||||
|
||||
|
||||
Dim gesAnz As Double = 0
|
||||
@@ -1800,6 +1790,31 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
rpt.lblzuKassierenHandling.Visible = False
|
||||
End Select
|
||||
|
||||
If Not IsDBNull(rpt.Fields.Item("Grenzstelle").Value) Then
|
||||
Dim grenzstelle As String = rpt.Fields.Item("Grenzstelle").Value.ToString()
|
||||
Dim existingRow = dt_summen.AsEnumerable().FirstOrDefault(Function(r) r.Field(Of String)("Grenzstelle") = grenzstelle)
|
||||
|
||||
If existingRow IsNot Nothing Then
|
||||
|
||||
existingRow("Anzahl") = CInt(existingRow("Anzahl")) + anz
|
||||
existingRow("BAR") = CDbl(existingRow("BAR")) + bar
|
||||
existingRow("HANDLING") = CDbl(existingRow("HANDLING")) + handling
|
||||
existingRow("zu_kassieren_BAR") = CDbl(existingRow("zu_kassieren_BAR")) + zukassBAR
|
||||
Else
|
||||
|
||||
Dim R As DataRow = dt_summen.NewRow()
|
||||
R("Anzahl") = anz
|
||||
R("BAR") = bar
|
||||
R("HANDLING") = handling
|
||||
R("zu_kassieren_BAR") = zukassBAR
|
||||
R("Grenzstelle") = grenzstelle
|
||||
|
||||
dt_summen.Rows.Add(R)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
sumAnz += anz
|
||||
sumBar += bar
|
||||
sumhandling += handling
|
||||
@@ -1810,6 +1825,8 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
geshandling += handling
|
||||
geszukassBAR += zukassBAR
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Dim bezeichnung = ""
|
||||
@@ -1819,6 +1836,27 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
rpt.lblSumzuKassierenHandling.Text = sumzukassBAR.ToString("N2")
|
||||
rpt.lblSumHandlingsgebuehr.Text = sumhandling.ToString("N2")
|
||||
|
||||
|
||||
Dim sb As New System.Text.StringBuilder
|
||||
|
||||
sb.AppendLine(String.Format("{0,-15} {1,6} {2,12} {3,15} {4,15}", "Grenzstelle", "Anz", "Bar", "Kassiert BAR", "Handling"))
|
||||
|
||||
sb.AppendLine(New String("-"c, 65))
|
||||
|
||||
For Each r_ As DataRow In dt_summen.Rows
|
||||
|
||||
Dim grenzstelle As String = If(IsDBNull(r_("Grenzstelle")), "", r_("Grenzstelle").ToString())
|
||||
Dim anz As Integer = If(IsDBNull(r_("Anzahl")), 0, CInt(r_("Anzahl")))
|
||||
Dim bar As Double = If(IsDBNull(r_("BAR")), 0, CDbl(r_("BAR")))
|
||||
Dim kass As Double = If(IsDBNull(r_("zu_kassieren_BAR")), 0, CDbl(r_("zu_kassieren_BAR")))
|
||||
Dim handling As Double = If(IsDBNull(r_("HANDLING")), 0, CDbl(r_("HANDLING")))
|
||||
|
||||
sb.AppendLine(String.Format("{0,-15} {1,6} {2,12:N2} {3,15:N2} {4,15:N2}", grenzstelle, anz, bar, kass, handling))
|
||||
Next
|
||||
|
||||
SumText = sb.ToString()
|
||||
|
||||
rpt.txtUebersicht.Font = New Font("Consolas", 10)
|
||||
rpt.txtUebersicht.Text = SumText
|
||||
|
||||
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
|
||||
@@ -1844,7 +1882,10 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
rpt.lblGesBarzahlungsbetrag.Text = gesBar.ToString("N2")
|
||||
rpt.lblGeszuKassierenHandling.Text = geszukassBAR.ToString("N2")
|
||||
rpt.lblGesHandlingsgebuehr.Text = geshandling.ToString("N2")
|
||||
SumText &= gesAnz.ToString("N0") & vbTab & bezeichnung & vbNewLine
|
||||
|
||||
'SumText &= gesAnz.ToString("N0") & vbTab & bezeichnung & vbNewLine
|
||||
|
||||
|
||||
|
||||
Select Case VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA
|
||||
Case "AMBAR"
|
||||
@@ -1855,6 +1896,10 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
If showDok Then
|
||||
print.Viewer.LoadDocument(rpt)
|
||||
print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous
|
||||
If dt_summen.Rows.Count > 0 Then
|
||||
dtAbrechnungLocal = dt_summen.Copy()
|
||||
End If
|
||||
dtAbrechnung = dtAbrechnungLocal
|
||||
print.Show()
|
||||
Else
|
||||
|
||||
@@ -1865,6 +1910,10 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
p.Export(rpt.Document, tmpPath)
|
||||
|
||||
rpt.Dispose()
|
||||
If dt_summen.Rows.Count > 0 Then
|
||||
dtAbrechnungLocal = dt_summen.Copy()
|
||||
End If
|
||||
dtAbrechnung = dtAbrechnungLocal
|
||||
Return tmpPath
|
||||
|
||||
End If
|
||||
@@ -1873,6 +1922,7 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
@@ -2091,7 +2141,22 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
End Sub
|
||||
|
||||
Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
|
||||
getrHandlingAussenstellen(, cboHandlingssatz._value)
|
||||
If CDate(txtAbfertDat.Text).Year <> CDate(txtAbfertDatBis.Text).Year Then
|
||||
MsgBox("keine jahresüberschneidende Handlingsauswertung möglich!")
|
||||
Exit Sub
|
||||
End If
|
||||
Dim dtAbrechnung As New DataTable
|
||||
getrHandlingAussenstellen(CDate(txtAbfertDat.Text).Year, dtAbrechnung, Not cbxHandlingAbrechnen.Checked, cboHandlingssatz.Text.Trim)
|
||||
|
||||
If cbxHandlingAbrechnen.Checked Then
|
||||
|
||||
If lstFiliale.SelectedItems.Count > 1 Then
|
||||
MsgBox("Es darf nur eine Filiale ausgewählt werden!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
createHandlingAbrechnung(dtAbrechnung, cboHandlingssatz.Text.Trim, cboHandlingssatz._value, CInt(lstFiliale._value), CDate(txtAbfertDat.Text), CDate(txtAbfertDatBis.Text))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MyComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles MyComboBox1.SelectedIndexChanged
|
||||
@@ -2805,6 +2870,12 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
End Function
|
||||
|
||||
Private Sub Button25_Click(sender As Object, e As EventArgs) Handles Button25.Click
|
||||
|
||||
If CDate(txtAbfertDat.Text).Year <> CDate(txtAbfertDatBis.Text).Year Then
|
||||
MsgBox("keine jahresüberschneidende Handlingsauswertung möglich!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim where = ""
|
||||
Select Case MyComboBox2._value
|
||||
Case "VERAG" : where = " AND FilialenNr IN (SELECT Filialen.FilialenNr FROM Filialen WHERE Filialen.Firma='VERAG' AND Filialen.FilialenNr NOT IN (4801,4802)) "
|
||||
@@ -2813,8 +2884,17 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
'Case "ATILLA" : where = " AND FilialenNr IN (SELECT Filialen.FilialenNr FROM Filialen WHERE Filialen.Firma='VERAG' AND Filialen.FilialenNr NOT IN (5601)) "
|
||||
End Select
|
||||
where &= " and Grenzstelle='AMB' "
|
||||
Dim dtAbrechnung As New DataTable
|
||||
getrHandlingAussenstellen(CDate(txtAbfertDat.Text).Year, dtAbrechnung, Not cbxHandlingAbrechnen.Checked, "AMBAR an ALL", where, True)
|
||||
If cbxHandlingAbrechnen.Checked Then
|
||||
|
||||
getrHandlingAussenstellen(, "AMBAR an ALL", where, True)
|
||||
If lstFiliale.SelectedItems.Count > 1 Then
|
||||
MsgBox("Es darf nur eine Filiale ausgewählt werden!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
createHandlingAbrechnung(dtAbrechnung, MyComboBox2._value, MyComboBox2._value, lstFiliale._value, CDate(txtAbfertDat.Text), CDate(txtAbfertDatBis.Text))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SendungsdetailsÖffnenToolStripMenuItem_Click(
|
||||
@@ -2839,6 +2919,439 @@ Public Class usrCntlSpeditionsBuchSuche
|
||||
|
||||
End Sub
|
||||
|
||||
Private Shared Function createHandlingAbrechnung(dt As DataTable, title As String, anFirma As String, filiale As Integer, von As Date, bis As Date) As Boolean
|
||||
|
||||
Try
|
||||
|
||||
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
|
||||
MessageBox.Show("Keine Daten vorhanden.", "Handling-Abrechnung",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Information)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Using frm As New Form
|
||||
Using dgv As New DataGridView
|
||||
Using pnlBottom As New Panel
|
||||
Using btnOk As New Button
|
||||
Using btnCancel As New Button
|
||||
|
||||
' =========================
|
||||
' FORM
|
||||
' =========================
|
||||
frm.Text = anFirma & " Handling-Abrechnung - PL:" & title
|
||||
frm.StartPosition = FormStartPosition.CenterScreen
|
||||
frm.Size = New Size(1400, 900)
|
||||
frm.BackColor = Color.White
|
||||
frm.Font = New Font("Segoe UI", 10)
|
||||
|
||||
' =========================
|
||||
' DATAGRIDVIEW
|
||||
' =========================
|
||||
dgv.DataSource = dt
|
||||
dgv.Dock = DockStyle.Fill
|
||||
dgv.ReadOnly = True
|
||||
dgv.MultiSelect = True
|
||||
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect
|
||||
dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
|
||||
dgv.AllowUserToAddRows = False
|
||||
dgv.AllowUserToDeleteRows = False
|
||||
dgv.AllowUserToResizeRows = False
|
||||
dgv.RowHeadersVisible = False
|
||||
dgv.BackgroundColor = Color.White
|
||||
dgv.BorderStyle = BorderStyle.None
|
||||
dgv.EnableHeadersVisualStyles = False
|
||||
|
||||
' Header Style
|
||||
dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(45, 45, 48)
|
||||
dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
|
||||
dgv.ColumnHeadersDefaultCellStyle.Font = New Font("Segoe UI", 10, FontStyle.Bold)
|
||||
dgv.ColumnHeadersHeight = 40
|
||||
|
||||
' Row Style
|
||||
dgv.DefaultCellStyle.SelectionBackColor = Color.FromArgb(0, 120, 215)
|
||||
dgv.DefaultCellStyle.SelectionForeColor = Color.White
|
||||
dgv.DefaultCellStyle.Font = New Font("Segoe UI", 10)
|
||||
dgv.RowTemplate.Height = 32
|
||||
dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(245, 245, 245)
|
||||
|
||||
' =========================
|
||||
' BUTTON PANEL
|
||||
' =========================
|
||||
pnlBottom.Dock = DockStyle.Bottom
|
||||
pnlBottom.Height = 60
|
||||
pnlBottom.Padding = New Padding(10)
|
||||
pnlBottom.BackColor = Color.WhiteSmoke
|
||||
|
||||
' OK BUTTON
|
||||
btnOk.Text = "Rechnung erstellen"
|
||||
btnOk.Width = 180
|
||||
btnOk.Height = 35
|
||||
btnOk.Anchor = AnchorStyles.Right
|
||||
btnOk.BackColor = Color.FromArgb(0, 120, 215)
|
||||
btnOk.ForeColor = Color.White
|
||||
btnOk.FlatStyle = FlatStyle.Flat
|
||||
btnOk.FlatAppearance.BorderSize = 0
|
||||
btnOk.DialogResult = DialogResult.OK
|
||||
|
||||
' CANCEL BUTTON
|
||||
btnCancel.Text = "Abbrechen"
|
||||
btnCancel.Width = 120
|
||||
btnCancel.Height = 35
|
||||
btnCancel.Left = btnOk.Right + 10
|
||||
btnCancel.BackColor = Color.LightGray
|
||||
btnCancel.FlatStyle = FlatStyle.Flat
|
||||
btnCancel.DialogResult = DialogResult.Cancel
|
||||
|
||||
' Position Buttons
|
||||
btnCancel.Dock = DockStyle.Right
|
||||
btnOk.Dock = DockStyle.Right
|
||||
|
||||
pnlBottom.Controls.Add(btnCancel)
|
||||
pnlBottom.Controls.Add(btnOk)
|
||||
|
||||
' =========================
|
||||
' ADD CONTROLS
|
||||
' =========================
|
||||
frm.Controls.Add(dgv)
|
||||
frm.Controls.Add(pnlBottom)
|
||||
|
||||
frm.AcceptButton = btnOk
|
||||
frm.CancelButton = btnCancel
|
||||
|
||||
' =========================
|
||||
' SHOW FORM
|
||||
' =========================
|
||||
If frm.ShowDialog() = DialogResult.OK Then
|
||||
Dim kdNr As Integer = -1
|
||||
Select Case anFirma.Trim()
|
||||
Case "UNISPED" : kdNr = 704028
|
||||
Case "IMEX" : kdNr = 550574
|
||||
Case "AMBAR" : kdNr = 725012
|
||||
Case Else
|
||||
MsgBox("falscher Kunde!")
|
||||
Return False
|
||||
End Select
|
||||
|
||||
Dim counter = 0
|
||||
|
||||
For Each row As DataGridViewRow In dgv.SelectedRows
|
||||
|
||||
doRechnung(filiale, kdNr, row.Cells("Grenzstelle").Value, row.Cells("Anzahl").Value, von, bis, row.Cells("HANDLING").Value, row.Cells("zu_kassieren_BAR").Value, counter)
|
||||
|
||||
Next
|
||||
|
||||
MsgBox("Es wurden " & counter & " Belege erstellt!")
|
||||
|
||||
Return True
|
||||
End If
|
||||
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
|
||||
Return False
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(
|
||||
ex.Message,
|
||||
ex.StackTrace,
|
||||
Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
|
||||
Return False
|
||||
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Private Shared Function doRechnung(filiale As Integer, kdNr As Integer, grenzstelle As String, Anzahl As Integer, von As Date, bis As Date, AB_Handling As Double, AB_Handling_BAR As Double, ByRef counter As Integer) As Boolean
|
||||
|
||||
Dim verarbOK As Boolean = True
|
||||
Dim AbfertigungNr As Integer = 0
|
||||
|
||||
For i = 0 To 1
|
||||
|
||||
|
||||
Dim SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch = Nothing
|
||||
Dim RK_ID As Integer = -1
|
||||
Dim isGutschrift As Boolean = False
|
||||
Dim nettobetrag As Double = 0
|
||||
Dim bruttobetrag As Double = 0
|
||||
Dim Ust As Double = 0
|
||||
If i = 1 Then
|
||||
isGutschrift = True
|
||||
nettobetrag = AB_Handling_BAR
|
||||
bruttobetrag = AB_Handling_BAR
|
||||
Ust = 0
|
||||
Else
|
||||
nettobetrag = AB_Handling
|
||||
bruttobetrag = AB_Handling
|
||||
End If
|
||||
|
||||
If bruttobetrag <> 0 AndAlso nettobetrag <> 0 Then
|
||||
If Not gen_SPEDBUCH_ByKdNr(kdNr, SPEDBUCH, filiale, AbfertigungNr, Anzahl, von, bis) Then verarbOK = False
|
||||
If Not gen_RECHNUNG_BySPEDBUCH(kdNr, SPEDBUCH, RK_ID, grenzstelle, isGutschrift, nettobetrag, bruttobetrag, Ust) Then verarbOK = False
|
||||
If verarbOK Then
|
||||
counter += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Return verarbOK
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Private Shared Function gen_SPEDBUCH_ByKdNr(ByRef KdNr As String, ByRef SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, ByRef Filiale As Integer, ByRef AbfertigungsNr As Integer, ByRef anzahl As Integer, ByRef von As Date, ByRef bis As Date)
|
||||
Try
|
||||
If KdNr = "" Then Return False
|
||||
|
||||
Dim AD As New VERAG_PROG_ALLGEMEIN.cAdressen(KdNr)
|
||||
SPEDBUCH = New VERAG_PROG_ALLGEMEIN.cSpeditionsbuch
|
||||
Dim OffertenNr As Integer
|
||||
Dim Abfertigungsart As Integer
|
||||
|
||||
OffertenNr = 2 : Abfertigungsart = 23 : SPEDBUCH.FilialenNr = Filiale
|
||||
|
||||
|
||||
Dim GJ = Now.Year
|
||||
If IsDate(bis) AndAlso bis > Now.AddYears(-5) Then GJ = cRKSV.getGJ(bis, 1)
|
||||
|
||||
If AbfertigungsNr > 0 Then
|
||||
SPEDBUCH = New VERAG_PROG_ALLGEMEIN.cSpeditionsbuch(Filiale, AbfertigungsNr)
|
||||
Else
|
||||
SPEDBUCH.AbfertigungsNr = VERAG_PROG_ALLGEMEIN.cAllgemein.getMaxPosNrIncrement(SPEDBUCH.FilialenNr, GJ)
|
||||
AbfertigungsNr = SPEDBUCH.AbfertigungsNr
|
||||
End If
|
||||
|
||||
SPEDBUCH.NewUNTER_NR()
|
||||
|
||||
SPEDBUCH.Vermittler = AD.Ordnungsbegriff
|
||||
SPEDBUCH.VermittlerKundenNr = KdNr
|
||||
SPEDBUCH.VermittlerOffertenNr = OffertenNr
|
||||
SPEDBUCH.Abfertigungsdatum = bis.ToShortDateString
|
||||
SPEDBUCH.Zollsystem_Land = "DE"
|
||||
|
||||
SPEDBUCH.Abfertigungsart = Abfertigungsart
|
||||
SPEDBUCH.Bar = 0
|
||||
SPEDBUCH.Fakturiert = 1
|
||||
SPEDBUCH.AnzahlSonstiges = 1
|
||||
SPEDBUCH.Abfertigungsanzahl = 1
|
||||
|
||||
SPEDBUCH.AvisUhrzeit = Nothing
|
||||
SPEDBUCH.Umrechnungskurs = Nothing
|
||||
SPEDBUCH.veoerz_basbtg = Nothing
|
||||
SPEDBUCH.Sicherheitsbetrag = Nothing
|
||||
|
||||
SPEDBUCH.Abfertigungsanzahl = anzahl
|
||||
SPEDBUCH.Bemerkungen = "Sammelrechnung " & von.ToShortDateString & " - " & bis.ToShortDateString & " / Abfertigungen: " & anzahl
|
||||
|
||||
SPEDBUCH.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
|
||||
|
||||
Return SPEDBUCH.SAVE
|
||||
|
||||
Catch ex As System.Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
Return False
|
||||
|
||||
End Function
|
||||
|
||||
Private Shared Function gen_RECHNUNG_BySPEDBUCH(KdNr As String, SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, ByRef RK_ID As Integer, ByRef grenzstelle As String, isGutschrift As Boolean, Nettobetrag As Double, Bruttobetrag As Double, UstBetrag As Double)
|
||||
Try
|
||||
|
||||
If KdNr = "" Then Return False
|
||||
|
||||
Dim AD As New VERAG_PROG_ALLGEMEIN.cAdressen(SPEDBUCH.VermittlerKundenNr)
|
||||
Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(SPEDBUCH.VermittlerKundenNr)
|
||||
Dim RG As New VERAG_PROG_ALLGEMEIN.cRechnungsausgang
|
||||
|
||||
Dim OffertenNr As Integer
|
||||
Dim Abfertigungsart As Integer
|
||||
|
||||
OffertenNr = 2 : Abfertigungsart = 23
|
||||
If isGutschrift Then
|
||||
RG.Anlage_1 = "SA Handling " & grenzstelle
|
||||
Else
|
||||
RG.Anlage_1 = "SA Gutschrift " & grenzstelle
|
||||
End If
|
||||
|
||||
If grenzstelle = "NKD" AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA_ID = 1 Then
|
||||
RG.Firma_ID = 11 'wenn NKD
|
||||
Else
|
||||
RG.Firma_ID = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA_ID
|
||||
End If
|
||||
|
||||
|
||||
RG.FilialenNr = SPEDBUCH.FilialenNr
|
||||
RG.AbfertigungsNr = SPEDBUCH.AbfertigungsNr
|
||||
RG.SpeditionsbuchUnterNr = SPEDBUCH.UnterNr
|
||||
RG.UnterNr = RG.getMaxRGUnterNr()
|
||||
|
||||
RG.Buchungsjahr = cRKSV.getGJ(SPEDBUCH.Abfertigungsdatum, RG.Firma_ID) 'If(Now.Month = 1, Now.Year - 1, Now.Year)
|
||||
RG.FilialenNr = SPEDBUCH.FilialenNr
|
||||
RG.Abfertigungsdatum = SPEDBUCH.Abfertigungsdatum
|
||||
RG.Sammelrechnung = 0
|
||||
|
||||
If isGutschrift Then
|
||||
|
||||
RG.[BelegartenKz] = "AG"
|
||||
RG.[BelegartenNr] = 71
|
||||
RG.Vorzeichen = "-"
|
||||
RG.BelegartenBez = "Gutschrift"
|
||||
RG.Steuerschlüssel = 10 'RC weil Bar!
|
||||
|
||||
Else
|
||||
|
||||
RG.BelegartenKz = "AR"
|
||||
RG.BelegartenNr = 70
|
||||
RG.BelegartenBez = "Rechnung"
|
||||
RG.Vorzeichen = "+"
|
||||
RG.Steuerschlüssel = KD.Steuerschlüssel
|
||||
|
||||
End If
|
||||
|
||||
|
||||
RG.VermittlerKundenNr = AD.AdressenNr
|
||||
RG.VermittlerLandKz = AD.LandKz
|
||||
RG.VermittlerName_1 = AD.Name_1
|
||||
RG.VermittlerName_2 = AD.Name_2
|
||||
RG.VermittlerOffertenNr = OffertenNr
|
||||
RG.VermittlerOrt = (If(AD.LandKz, "") & " " & If(AD.PLZ, "") & " " & If(AD.Ort, ""))
|
||||
RG.VermittlerStraße = AD.Straße
|
||||
RG.Rechnung_an = 3
|
||||
RG.OffertenNr = OffertenNr
|
||||
|
||||
RG.KundenNrZentrale = KD.KundenNrZentrale
|
||||
RG.RechnungsKundenNr = AD.AdressenNr
|
||||
RG.RechnungsLandKz = AD.LandKz
|
||||
RG.RechnungsName_1 = AD.Name_1
|
||||
RG.RechnungsName_2 = AD.Name_2
|
||||
RG.RechnungsOrt = (If(AD.LandKz, "") & " " & If(AD.PLZ, "") & " " & If(AD.Ort, ""))
|
||||
RG.RechnungsStraße = AD.Straße
|
||||
|
||||
RG.RechnungsUstIdKz = AD.UstIdKz
|
||||
RG.RechnungsUstIdNr = AD.UstIdNr
|
||||
RG.RechnungsUstIdGeprüft = AD.UstIdGeprüft
|
||||
|
||||
RG.Lastschrift = KD.Lastschrift
|
||||
RG.Kunden_SVS = KD.SVS
|
||||
|
||||
RG.Vorkasse = KD.Vorkasse
|
||||
RG.Vorlageprovision_Proz = KD.Vorlageprovision
|
||||
RG.Kreditaufwendungen_Proz = KD.Kreditaufwendungen
|
||||
RG.RechnungSprache = "DE"
|
||||
|
||||
RG.Anlage_2 = ""
|
||||
RG.Anlage_3 = ""
|
||||
RG.Anlage_4 = ""
|
||||
RG.Anlage_5 = ""
|
||||
RG.Anlage_6 = ""
|
||||
|
||||
RG.Nettozahlungsziel = KD.Zahlungsziel
|
||||
RG.Grenze = grenzstelle
|
||||
|
||||
RG.SteuerpflichtigerGesamtbetrag = 0
|
||||
RG.SteuerfreierGesamtbetrag = 0
|
||||
RG.Status = 0
|
||||
|
||||
RG.[Vorkosten] = 0
|
||||
RG.[Erlös] = 0
|
||||
RG.[Währungscode] = "EUR"
|
||||
RG.ReErfZeitstempel = Now
|
||||
|
||||
RG.Vermerk = SPEDBUCH.Vermerk
|
||||
|
||||
RG.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
|
||||
Dim sqlstr As String = ""
|
||||
Dim useNettogesamtbetrag As Boolean = False
|
||||
|
||||
Dim OFFERTE As New VERAG_PROG_ALLGEMEIN.cOfferte(KdNr, OffertenNr, True)
|
||||
RG.LOAD_OFFERT_POSITIONEN() ' --> OFFERTE MIT ANZAHL >0 und Preis >0
|
||||
|
||||
If isGutschrift Then
|
||||
allPos(RG, OFFERTE, 496, Nettobetrag, Bruttobetrag, UstBetrag, "Barinkasso Handling " & grenzstelle)
|
||||
Else
|
||||
allPos(RG, OFFERTE, 345, Nettobetrag, Bruttobetrag, UstBetrag, "Handling " & grenzstelle)
|
||||
End If
|
||||
|
||||
Dim dtSt As DataTable = (New SQL).loadDgvBySql("SELECT TOP 1 isnull([Steuersatz %],0),isnull([Steuerbezeichnung],'') FROM [Steuertabelle] WHERE [Steuerschlüssel]='" & RG.Steuerschlüssel & "'", "FMZOLL")
|
||||
If dtSt IsNot Nothing AndAlso dtSt.Rows.Count > 0 Then
|
||||
RG.Steuersatz_Proz = dtSt.Rows(0)(0)
|
||||
End If
|
||||
|
||||
cFakturierung.setGesamtBetraege(RG,, useNettogesamtbetrag)
|
||||
|
||||
RG.Text = (cFakturierung.przRechnungstextTXT(RG, SPEDBUCH) & vbNewLine & cFakturierung.przRechnungstextZZ(RG)).Trim
|
||||
|
||||
If RG.SAVE Then
|
||||
RK_ID = RG.RK_ID
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
Catch ex As System.Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
Return ""
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Shared Function allPos(ByRef RG As VERAG_PROG_ALLGEMEIN.cRechnungsausgang, OFFERTE As VERAG_PROG_ALLGEMEIN.cOfferte, LeistungsNr As Integer, NettoBetrag As Double, BruttoBetrag As Double, Optional UstBetrag As Double = 0, Optional leistungsBez As String = "")
|
||||
Try
|
||||
|
||||
For Each o In OFFERTE.POSITIONEN
|
||||
If o.LeistungsNr = LeistungsNr Then
|
||||
|
||||
Dim POS As New VERAG_PROG_ALLGEMEIN.cRechnungsausgangPositionen()
|
||||
Dim LEISTUNG As New VERAG_PROG_ALLGEMEIN.cLeistungen(o.LeistungsNr)
|
||||
POS.LeistungsNr = o.LeistungsNr
|
||||
POS.LeistungsBez = IIf(leistungsBez <> "", leistungsBez, o.LeistungsBez)
|
||||
|
||||
POS.BerechnungsartNr = o.BerechnungsartNr
|
||||
POS.Anzahl = 1
|
||||
POS.Steuerpflichtig = LEISTUNG.Steuerpflichtig
|
||||
POS.BGebBgl = NettoBetrag - UstBetrag
|
||||
|
||||
|
||||
If POS.Steuerpflichtig Then
|
||||
POS.SteuerpflichtigerBetrag = NettoBetrag
|
||||
POS.Preis = NettoBetrag
|
||||
Else
|
||||
POS.SteuerfreierBetrag = BruttoBetrag
|
||||
POS.Preis = BruttoBetrag
|
||||
End If
|
||||
POS.BGebLeistungsNr = o.BGebLeistungsNr
|
||||
POS.BGebProzent = o.BGebProzent
|
||||
POS.BGebMinBetrag = o.BGebMinBetrag
|
||||
|
||||
RG.POSITIONEN.Add(POS)
|
||||
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click, ToolStripMenuItem19.Click
|
||||
|
||||
Dim kdnrsrch As Integer = -1
|
||||
@@ -4582,4 +5095,5 @@ Class cSpeditionsbuchReport
|
||||
Return headerDocs & " || " & itemDocs
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports Microsoft.Office.Interop
|
||||
|
||||
|
||||
Imports Microsoft.Office.Interop
|
||||
Imports Microsoft.Office.Interop.Excel
|
||||
Public Class usrCntlOfferte
|
||||
|
||||
Dim FUNC As New cProgramFunctions
|
||||
@@ -12,7 +13,7 @@ Public Class usrCntlOfferte
|
||||
Dim OFFERTEBind As cEasyBinding
|
||||
Dim table
|
||||
Public BIND_DB = "FMZOLL"
|
||||
Dim tmpDataTable As New DataTable
|
||||
Dim tmpDataTable As New System.Data.DataTable
|
||||
Dim currentOffert As VERAG_PROG_ALLGEMEIN.cOfferte
|
||||
Dim currentOffertArchiv As VERAG_PROG_ALLGEMEIN.cOfferteArchiv
|
||||
Dim edit As Boolean
|
||||
@@ -262,7 +263,7 @@ Public Class usrCntlOfferte
|
||||
|
||||
btnAddLeistung.ContextMenuStrip = cntxtAddSdl
|
||||
' cntxtAddSdl
|
||||
Dim ptLowerLeft As New Point(sender.width, sender.Height)
|
||||
Dim ptLowerLeft As New System.Drawing.Point(sender.width, sender.Height)
|
||||
ptLowerLeft = sender.PointToScreen(ptLowerLeft)
|
||||
ptLowerLeft.X -= sender.width
|
||||
cntxtAddSdl.Show(ptLowerLeft)
|
||||
@@ -894,7 +895,7 @@ Public Class usrCntlOfferte
|
||||
|
||||
If dgvOfferteDetails.Rows.Count = 0 Then Exit Sub
|
||||
|
||||
Dim dtKostenkalk As DataTable = cProgramFunctions.dgridViewTods(dgvOfferteDetails)
|
||||
Dim dtKostenkalk As System.Data.DataTable = cProgramFunctions.dgridViewTods(dgvOfferteDetails)
|
||||
|
||||
If dtKostenkalk.Rows.Count < 1 Then
|
||||
MsgBox("keine Daten!")
|
||||
@@ -968,7 +969,7 @@ Public Class usrCntlOfferte
|
||||
|
||||
Dim currentRow As Integer = 13
|
||||
|
||||
Dim dtkeineMdtKostenkalk_mitPreise As DataTable = dtKostenkalk.Select("Preis <> ''").CopyToDataTable
|
||||
Dim dtkeineMdtKostenkalk_mitPreise As System.Data.DataTable = dtKostenkalk.Select("Preis <> ''").CopyToDataTable
|
||||
dtkeineMdtKostenkalk_mitPreise.Columns.Add("price_new", System.Type.GetType("System.Int32"))
|
||||
|
||||
Dim DatumDerZollabf As String = dtkeineMdtKostenkalk_mitPreise.Rows(0).Item("Geändert am")
|
||||
@@ -1018,6 +1019,19 @@ Public Class usrCntlOfferte
|
||||
Select Case sender.name
|
||||
Case "btnKK_Mail"
|
||||
|
||||
|
||||
exclApp.Visible = False
|
||||
|
||||
' Datei öffnen
|
||||
|
||||
|
||||
' Als PDF exportieren
|
||||
Dim tmpPath_Report = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(ExcelBez & kdNr & ".pdf", ".pdf", , False)
|
||||
|
||||
Datei.ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, tmpPath_Report, XlFixedFormatQuality.xlQualityStandard, True, False)
|
||||
|
||||
|
||||
|
||||
Dim outl As New Outlook.Application
|
||||
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
|
||||
Mail = outl.CreateItem(0)
|
||||
@@ -1034,11 +1048,11 @@ Public Class usrCntlOfferte
|
||||
<li>Personalkostenerhöhungen in der Branche</li>
|
||||
<li>Verlagerung der Aufgaben von der Zollverwaltung zu den Spediteuren</li>
|
||||
<li>Verschärfte gesetzliche Bestimmungen (CBAM, NCTS5,..)</li>
|
||||
<li>Permanentes Update der elektronischen Zollsysteme</li>
|
||||
<li>Permanente Updates der elektronischen Zollsysteme</li>
|
||||
<li>Fortlaufende Weiterbildung unserer Zollsachbearbeitenden</li>
|
||||
<li>Verlängerte Öffnungszeiten</li>
|
||||
<li>Inflation, Wirtschaftskrise</li>
|
||||
<li>Gesteigerte Energiekosten, Versorgungskosten</li>
|
||||
<li>Gestiegene Energiekosten, Versorgungskosten</li>
|
||||
</ul>
|
||||
<br>
|
||||
Beiliegend erhalten Sie eine Aufstellung mit den angepassten Abfertigungssätzen, gültig ab <b> 01. Juni 2026.</b><br>
|
||||
@@ -1055,7 +1069,7 @@ Public Class usrCntlOfferte
|
||||
|
||||
Mail.HTMLBody = "<div style=""font-family:Calibri, Arial"">" & TextHTML & "</div>"
|
||||
Mail.Subject = "Preiserhöhung " & Today().Year
|
||||
Mail.Attachments.Add(Path)
|
||||
Mail.Attachments.Add(tmpPath_Report)
|
||||
Mail.Display()
|
||||
|
||||
|
||||
|
||||
@@ -5,26 +5,45 @@ Imports System.Data.SqlClient
|
||||
|
||||
Public Class cHandlingssaetzeInternLIST
|
||||
Property hs_Bezeichnung As Object = Nothing
|
||||
Property hs_jahr As Object = Nothing
|
||||
' Property OffertenNr As Object = Nothing
|
||||
Public LIST As New List(Of cHandlingssaetzeIntern)
|
||||
Dim SQL As New SQL
|
||||
'Dim listTodelete As New List(Of cHandlingssaetzeIntern)
|
||||
|
||||
Sub New(hs_Bezeichnung)
|
||||
Sub New(hs_Bezeichnung, hs_jahr)
|
||||
Me.hs_Bezeichnung = hs_Bezeichnung
|
||||
Me.hs_jahr = hs_jahr
|
||||
' Me.OffertenNr = OffertenNr
|
||||
LOAD_LIST(Me.hs_Bezeichnung)
|
||||
LOAD_LIST(Me.hs_Bezeichnung, Me.hs_jahr)
|
||||
End Sub
|
||||
Public Sub CLEAR()
|
||||
LIST.Clear()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub LOAD_LIST(hs_Bezeichnung)
|
||||
Public Sub LOAD_LIST(hs_Bezeichnung, Jahr)
|
||||
|
||||
Dim SQLString = " AND ISNULL(hs_gueltigAbJahr, " & Jahr & ") =
|
||||
CASE
|
||||
WHEN EXISTS (
|
||||
SELECT 1
|
||||
FROM [VERAG].[dbo].[tblHandlingssaetzeIntern]
|
||||
WHERE hs_Bezeichnung = @hs_Bezeichnung
|
||||
AND ISNULL(hs_gueltigAbJahr, " & Jahr & ") = " & Jahr & "
|
||||
)
|
||||
THEN 2023
|
||||
ELSE (
|
||||
SELECT MAX(ISNULL(hs_gueltigAbJahr, " & Jahr & "))
|
||||
FROM [VERAG].[dbo].[tblHandlingssaetzeIntern]
|
||||
WHERE hs_Bezeichnung = @hs_Bezeichnung
|
||||
)
|
||||
END"
|
||||
|
||||
Try
|
||||
LIST.Clear()
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
Using cmd As New SqlCommand("SELECT * FROM tblHandlingssaetzeIntern WHERE hs_Bezeichnung=@hs_Bezeichnung ", conn)
|
||||
Using cmd As New SqlCommand("SELECT * FROM tblHandlingssaetzeIntern WHERE hs_Bezeichnung=@hs_Bezeichnung " & SQLString, conn)
|
||||
cmd.Parameters.AddWithValue("@hs_Bezeichnung", hs_Bezeichnung)
|
||||
' cmd.Parameters.AddWithValue("@OffertenNr", OffertenNr)
|
||||
Dim dr = cmd.ExecuteReader()
|
||||
|
||||
Reference in New Issue
Block a user