ustv, etc.
This commit is contained in:
101
SDL/Fakturierung/usrCntlFaktAbrechnung.Designer.vb
generated
101
SDL/Fakturierung/usrCntlFaktAbrechnung.Designer.vb
generated
@@ -83,6 +83,11 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.lblRechnungsNummer = New System.Windows.Forms.Label()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.Button17 = New System.Windows.Forms.Button()
|
||||
Me.ContextMenuStrip3 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.AbsenderToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.EmpfängerToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AuftraggeberToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AvisiererToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.txtTextZZ = New VERAG_PROG_ALLGEMEIN.MyRichTextBox()
|
||||
Me.dgvAnhaenge = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||
Me.optAnhSel = New System.Windows.Forms.DataGridViewCheckBoxColumn()
|
||||
@@ -238,6 +243,7 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.lblEUR_4 = New System.Windows.Forms.Label()
|
||||
Me.Label55 = New System.Windows.Forms.Label()
|
||||
Me.cboSteuerschlüssel = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
||||
Me.rtbAbf_Besonderheiten = New SDL.usrCntlKundenBesonderheiten()
|
||||
Me.cbxOriginalPrint = New System.Windows.Forms.CheckBox()
|
||||
Me.Label46 = New System.Windows.Forms.Label()
|
||||
Me.Button9 = New System.Windows.Forms.Button()
|
||||
@@ -274,21 +280,16 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.EmpfängerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AuftraggeberToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AvisiererToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ContextMenuStrip3 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.AbsenderToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.EmpfängerToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AuftraggeberToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.AvisiererToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.GutschriftAusRechnungToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.SeperateRechnungFürEUSTToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.GutschriftAnVeragToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.VeragAGToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.VeragCSToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.rtbAbf_Besonderheiten = New SDL.usrCntlKundenBesonderheiten()
|
||||
Me.pnlTop.SuspendLayout()
|
||||
Me.Panel3.SuspendLayout()
|
||||
Me.Panel1.SuspendLayout()
|
||||
Me.ContextMenuStrip3.SuspendLayout()
|
||||
CType(Me.dgvAnhaenge, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.Panel2.SuspendLayout()
|
||||
Me.pnlAvisierer.SuspendLayout()
|
||||
@@ -310,7 +311,6 @@ Partial Class usrCntlFaktAbrechnung
|
||||
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.CntxtAbfArt.SuspendLayout()
|
||||
Me.ContextMenuStrip1.SuspendLayout()
|
||||
Me.ContextMenuStrip3.SuspendLayout()
|
||||
Me.ContextMenuStrip2.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
@@ -871,6 +871,37 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.Button17.Text = "E-Mail Erstellen"
|
||||
Me.Button17.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ContextMenuStrip3
|
||||
'
|
||||
Me.ContextMenuStrip3.ImageScalingSize = New System.Drawing.Size(24, 24)
|
||||
Me.ContextMenuStrip3.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AbsenderToolStripMenuItem2, Me.EmpfängerToolStripMenuItem2, Me.AuftraggeberToolStripMenuItem2, Me.AvisiererToolStripMenuItem2})
|
||||
Me.ContextMenuStrip3.Name = "ContextMenuStrip3"
|
||||
Me.ContextMenuStrip3.Size = New System.Drawing.Size(154, 92)
|
||||
'
|
||||
'AbsenderToolStripMenuItem2
|
||||
'
|
||||
Me.AbsenderToolStripMenuItem2.Name = "AbsenderToolStripMenuItem2"
|
||||
Me.AbsenderToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AbsenderToolStripMenuItem2.Text = "1 Absender"
|
||||
'
|
||||
'EmpfängerToolStripMenuItem2
|
||||
'
|
||||
Me.EmpfängerToolStripMenuItem2.Name = "EmpfängerToolStripMenuItem2"
|
||||
Me.EmpfängerToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.EmpfängerToolStripMenuItem2.Text = "2 Empfänger"
|
||||
'
|
||||
'AuftraggeberToolStripMenuItem2
|
||||
'
|
||||
Me.AuftraggeberToolStripMenuItem2.Name = "AuftraggeberToolStripMenuItem2"
|
||||
Me.AuftraggeberToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AuftraggeberToolStripMenuItem2.Text = "3 Auftraggeber"
|
||||
'
|
||||
'AvisiererToolStripMenuItem2
|
||||
'
|
||||
Me.AvisiererToolStripMenuItem2.Name = "AvisiererToolStripMenuItem2"
|
||||
Me.AvisiererToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AvisiererToolStripMenuItem2.Text = "4 Avisierer"
|
||||
'
|
||||
'txtTextZZ
|
||||
'
|
||||
Me.txtTextZZ.Location = New System.Drawing.Point(64, 1061)
|
||||
@@ -3515,6 +3546,17 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.cboSteuerschlüssel.Size = New System.Drawing.Size(145, 21)
|
||||
Me.cboSteuerschlüssel.TabIndex = 3
|
||||
'
|
||||
'rtbAbf_Besonderheiten
|
||||
'
|
||||
Me.rtbAbf_Besonderheiten.BackColor = System.Drawing.Color.White
|
||||
Me.rtbAbf_Besonderheiten.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.rtbAbf_Besonderheiten.Location = New System.Drawing.Point(10, 19)
|
||||
Me.rtbAbf_Besonderheiten.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
|
||||
Me.rtbAbf_Besonderheiten.Name = "rtbAbf_Besonderheiten"
|
||||
Me.rtbAbf_Besonderheiten.Size = New System.Drawing.Size(107, 133)
|
||||
Me.rtbAbf_Besonderheiten.TabIndex = 235
|
||||
Me.rtbAbf_Besonderheiten.Visible = False
|
||||
'
|
||||
'cbxOriginalPrint
|
||||
'
|
||||
Me.cbxOriginalPrint.AutoSize = True
|
||||
@@ -3952,37 +3994,6 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.AvisiererToolStripMenuItem.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AvisiererToolStripMenuItem.Text = "4 Avisierer"
|
||||
'
|
||||
'ContextMenuStrip3
|
||||
'
|
||||
Me.ContextMenuStrip3.ImageScalingSize = New System.Drawing.Size(24, 24)
|
||||
Me.ContextMenuStrip3.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AbsenderToolStripMenuItem2, Me.EmpfängerToolStripMenuItem2, Me.AuftraggeberToolStripMenuItem2, Me.AvisiererToolStripMenuItem2})
|
||||
Me.ContextMenuStrip3.Name = "ContextMenuStrip3"
|
||||
Me.ContextMenuStrip3.Size = New System.Drawing.Size(154, 92)
|
||||
'
|
||||
'AbsenderToolStripMenuItem2
|
||||
'
|
||||
Me.AbsenderToolStripMenuItem2.Name = "AbsenderToolStripMenuItem2"
|
||||
Me.AbsenderToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AbsenderToolStripMenuItem2.Text = "1 Absender"
|
||||
'
|
||||
'EmpfängerToolStripMenuItem2
|
||||
'
|
||||
Me.EmpfängerToolStripMenuItem2.Name = "EmpfängerToolStripMenuItem2"
|
||||
Me.EmpfängerToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.EmpfängerToolStripMenuItem2.Text = "2 Empfänger"
|
||||
'
|
||||
'AuftraggeberToolStripMenuItem2
|
||||
'
|
||||
Me.AuftraggeberToolStripMenuItem2.Name = "AuftraggeberToolStripMenuItem2"
|
||||
Me.AuftraggeberToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AuftraggeberToolStripMenuItem2.Text = "3 Auftraggeber"
|
||||
'
|
||||
'AvisiererToolStripMenuItem2
|
||||
'
|
||||
Me.AvisiererToolStripMenuItem2.Name = "AvisiererToolStripMenuItem2"
|
||||
Me.AvisiererToolStripMenuItem2.Size = New System.Drawing.Size(153, 22)
|
||||
Me.AvisiererToolStripMenuItem2.Text = "4 Avisierer"
|
||||
'
|
||||
'ContextMenuStrip2
|
||||
'
|
||||
Me.ContextMenuStrip2.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.GutschriftAusRechnungToolStripMenuItem, Me.SeperateRechnungFürEUSTToolStripMenuItem, Me.GutschriftAnVeragToolStripMenuItem})
|
||||
@@ -4020,17 +4031,6 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.VeragCSToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
|
||||
Me.VeragCSToolStripMenuItem.Text = "Verag CS"
|
||||
'
|
||||
'rtbAbf_Besonderheiten
|
||||
'
|
||||
Me.rtbAbf_Besonderheiten.BackColor = System.Drawing.Color.White
|
||||
Me.rtbAbf_Besonderheiten.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.rtbAbf_Besonderheiten.Location = New System.Drawing.Point(10, 19)
|
||||
Me.rtbAbf_Besonderheiten.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
|
||||
Me.rtbAbf_Besonderheiten.Name = "rtbAbf_Besonderheiten"
|
||||
Me.rtbAbf_Besonderheiten.Size = New System.Drawing.Size(107, 133)
|
||||
Me.rtbAbf_Besonderheiten.TabIndex = 235
|
||||
Me.rtbAbf_Besonderheiten.Visible = False
|
||||
'
|
||||
'usrCntlFaktAbrechnung
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -4047,6 +4047,7 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Me.Panel3.ResumeLayout(False)
|
||||
Me.Panel1.ResumeLayout(False)
|
||||
Me.Panel1.PerformLayout()
|
||||
Me.ContextMenuStrip3.ResumeLayout(False)
|
||||
CType(Me.dgvAnhaenge, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.Panel2.ResumeLayout(False)
|
||||
Me.Panel2.PerformLayout()
|
||||
@@ -4077,7 +4078,6 @@ Partial Class usrCntlFaktAbrechnung
|
||||
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.CntxtAbfArt.ResumeLayout(False)
|
||||
Me.ContextMenuStrip1.ResumeLayout(False)
|
||||
Me.ContextMenuStrip3.ResumeLayout(False)
|
||||
Me.ContextMenuStrip2.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
@@ -4323,5 +4323,4 @@ Partial Class usrCntlFaktAbrechnung
|
||||
Friend WithEvents VeragCSToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents lblOFgesperrt As Label
|
||||
Friend WithEvents cboVorauskasse As VERAG_PROG_ALLGEMEIN.MyComboBox
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
|
||||
Imports System.IO
|
||||
Imports System.Web.UI.WebControls.Expressions
|
||||
Imports com.sun.org.apache.bcel.internal.generic
|
||||
Imports DAKOSY_Worker.DETPDD
|
||||
Imports GrapeCity.DataVisualization.Chart
|
||||
Imports System.Web.UI.WebControls.Expressions
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class usrCntlFaktAbrechnung
|
||||
@@ -416,107 +411,96 @@ Public Class usrCntlFaktAbrechnung
|
||||
'Dann die Werte eintragen:
|
||||
' MsgBox("G: " & RECHNUNG.POSITIONEN.Count)
|
||||
Dim vorzeichen = 1 'If(RECHNUNG.Vorzeichen = "-", -1, 1)
|
||||
For Each POS In RECHNUNG.POSITIONEN
|
||||
Dim found = False
|
||||
For Each r As DataGridViewRow In dgvOfferteDetailsUebersicht.Rows
|
||||
If r.Cells("LeistungsNr").Value = POS.LeistungsNr And r.Cells("LeistungsBez").Value = POS.LeistungsBez Then
|
||||
r.Cells("Preis").Value = If(POS.Preis, 0) * vorzeichen
|
||||
r.Cells("Anzahl").Value = If(POS.Anzahl, 0)
|
||||
|
||||
r.Cells("BGebLeistungsNr").Value = If(POS.BGebLeistungsNr, DBNull.Value)
|
||||
r.Cells("BGebProzent").Value = If(POS.BGebProzent, DBNull.Value)
|
||||
r.Cells("BGebMinBetrag").Value = If(POS.BGebMinBetrag, DBNull.Value)
|
||||
If RECHNUNG.ForceSteuerschlüssel IsNot Nothing Then
|
||||
POS.Steuerpflichtig = (RECHNUNG.ForceSteuerschlüssel > 0)
|
||||
Try
|
||||
|
||||
|
||||
For Each POS In RECHNUNG.POSITIONEN.OrderBy(Function(x) If(IsNumeric(x.Preis), CDbl(x.Preis), CDbl(0)))
|
||||
Dim found = False
|
||||
For Each r As DataGridViewRow In dgvOfferteDetailsUebersicht.Rows
|
||||
If r.Cells("LeistungsNr").Value = POS.LeistungsNr And r.Cells("LeistungsBez").Value = POS.LeistungsBez Then
|
||||
|
||||
r.Cells("Preis").Value = If(POS.Preis, 0) * vorzeichen
|
||||
r.Cells("Anzahl").Value = If(POS.Anzahl, 0)
|
||||
|
||||
r.Cells("BGebLeistungsNr").Value = If(POS.BGebLeistungsNr, DBNull.Value)
|
||||
r.Cells("BGebProzent").Value = If(POS.BGebProzent, DBNull.Value)
|
||||
r.Cells("BGebMinBetrag").Value = If(POS.BGebMinBetrag, DBNull.Value)
|
||||
If RECHNUNG.ForceSteuerschlüssel IsNot Nothing Then
|
||||
POS.Steuerpflichtig = (RECHNUNG.ForceSteuerschlüssel > 0)
|
||||
End If
|
||||
|
||||
r.Cells("Steuerpflichtig").Value = POS.Steuerpflichtig
|
||||
r.Cells("IndexZkteing").Value = If(POS.IndexZkteing <= 0, DBNull.Value, POS.IndexZkteing)
|
||||
r.Cells("AufschubkontoNr").Value = If(POS.AufschubkontoNr, DBNull.Value)
|
||||
r.Cells("Aufschubfälligkeit").Value = If(POS.Aufschubfälligkeit, DBNull.Value)
|
||||
r.Cells("DateiNameAufschub").Value = If(POS.DateiNameAufschub, DBNull.Value)
|
||||
r.Cells("Belegdaten").Value = If(POS.Belegdaten, DBNull.Value)
|
||||
'MsgBox(r.Cells("LeistungsBez").Value & " : " & If(POS.Preis, 0) & " : " & If(POS.Anzahl, 0))
|
||||
|
||||
found = True : Exit For
|
||||
End If
|
||||
Next
|
||||
' MsgBox("G2: " & RECHNUNG.POSITIONEN.Count)
|
||||
|
||||
If Not found Then
|
||||
' Dim dRow As DataRow = SQL.loadDgvBySql(" SELECT * FROM [Leistungen] WHERE LeistungsNr=" & POS.LeistungsNr, "FMZOLL").Rows(0)
|
||||
'dgvOfferteDetailsUebersicht.DataBindings.clear
|
||||
Dim dtable As DataTable = dgvOfferteDetailsUebersicht.DataSource
|
||||
' If dgvOfferteDetailsUebersicht.Rows.Count > 0 Then dgvOfferteDetailsUebersicht.Rows.Clear()
|
||||
|
||||
If dtable IsNot Nothing Then
|
||||
'Sortierung
|
||||
'Dim dataView As New DataView(dtable)
|
||||
'dataView.Sort = " LeistungsNr ASC "
|
||||
'Dim dt As DataTable = dataView.ToTable()
|
||||
'For Each r As DataColumn In dt.Columns
|
||||
' MsgBox(r.ColumnName)
|
||||
'Next
|
||||
'dt.Rows.Add(POS.LeistungsNr, POS.LeistungsBez, POS.Anzahl, POS.Preis, POS.BerechnungsartNr, POS.[BGebLeistungsNr], POS.[BGebProzent], POS.[BGebMinBetrag], POS.Steuerpflichtig,
|
||||
' POS.IndexZkteing, POS.AufschubkontoNr, POS.Aufschubfälligkeit, POS.DateiNameAufschub, POS.Belegdaten)
|
||||
'dgvOfferteDetailsUebersicht.DataSource = dt
|
||||
'MsgBox("ASF")
|
||||
'dgvOfferteDetailsUebersicht.Rows.Add(POS.LeistungsNr, POS.LeistungsBez, POS.Anzahl, POS.Preis, POS.BerechnungsartNr, POS.[BGebLeistungsNr], POS.[BGebProzent], POS.[BGebMinBetrag], POS.Steuerpflichtig,
|
||||
' POS.IndexZkteing, POS.AufschubkontoNr, POS.Aufschubfälligkeit, POS.DateiNameAufschub, POS.Belegdaten)
|
||||
End If
|
||||
'SELECT [Offertenpositionen].[LeistungsNr],[Offertenpositionen].[LeistungsBez],[Offertenpositionen].[BerechnungsartNr],[Anzahl],[Preis],[BGebLeistungsNr],[BGebProzent],[BGebMinBetrag],/*[Eingegeben am],[PreisänderungProzent],[PreisAlt],[Preisänderung],*/Steuerpflichtig,[Geändert am],[Sachbearbeiter] " &
|
||||
If dgvOfferteDetailsUebersicht.Columns.Count > 0 And dgvOfferteDetailsUebersicht.Rows.Count > 0 Then
|
||||
'If(POS.BerechnungsartNr, 1)
|
||||
Try
|
||||
' POS.BerechnungsartNr !!!
|
||||
Dim newR As DataGridViewRow = dgvOfferteDetailsUebersicht.Rows(0).Clone ' dgvOfferteDetailsUebersicht.DataSource.Tables(0).NewRow()
|
||||
|
||||
newR.Cells(0).Value = POS.LeistungsNr
|
||||
newR.Cells(1).Value = If(POS.LeistungsBez, DBNull.Value)
|
||||
newR.Cells(2).Value = If(POS.Anzahl, DBNull.Value)
|
||||
newR.Cells(3).Value = If(POS.Preis, DBNull.Value) '* vorzeichen
|
||||
newR.Cells(4).Value = POS.BerechnungsartNr
|
||||
newR.Cells(5).Value = If(POS.BGebLeistungsNr, DBNull.Value)
|
||||
newR.Cells(6).Value = If(POS.BGebProzent, DBNull.Value)
|
||||
newR.Cells(7).Value = If(POS.BGebMinBetrag, DBNull.Value)
|
||||
newR.Cells(8).Value = POS.Steuerpflichtig ' * vorzeichen
|
||||
newR.Cells(9).Value = POS.IndexZkteing
|
||||
newR.Cells(10).Value = If(POS.AufschubkontoNr, DBNull.Value)
|
||||
newR.Cells(11).Value = If(POS.Aufschubfälligkeit, DBNull.Value)
|
||||
newR.Cells(12).Value = If(POS.DateiNameAufschub, DBNull.Value)
|
||||
newR.Cells(13).Value = If(POS.Belegdaten, DBNull.Value)
|
||||
dgvOfferteDetailsUebersicht.Rows.Add(newR)
|
||||
setBerartValue(newR, POS.BerechnungsartNr)
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
r.Cells("Steuerpflichtig").Value = POS.Steuerpflichtig
|
||||
r.Cells("IndexZkteing").Value = If(POS.IndexZkteing <= 0, DBNull.Value, POS.IndexZkteing)
|
||||
r.Cells("AufschubkontoNr").Value = If(POS.AufschubkontoNr, DBNull.Value)
|
||||
r.Cells("Aufschubfälligkeit").Value = If(POS.Aufschubfälligkeit, DBNull.Value)
|
||||
r.Cells("DateiNameAufschub").Value = If(POS.DateiNameAufschub, DBNull.Value)
|
||||
r.Cells("Belegdaten").Value = If(POS.Belegdaten, DBNull.Value)
|
||||
'MsgBox(r.Cells("LeistungsBez").Value & " : " & If(POS.Preis, 0) & " : " & If(POS.Anzahl, 0))
|
||||
|
||||
found = True : Exit For
|
||||
End If
|
||||
Next
|
||||
' MsgBox("G2: " & RECHNUNG.POSITIONEN.Count)
|
||||
|
||||
If Not found Then
|
||||
' Dim dRow As DataRow = SQL.loadDgvBySql(" SELECT * FROM [Leistungen] WHERE LeistungsNr=" & POS.LeistungsNr, "FMZOLL").Rows(0)
|
||||
'dgvOfferteDetailsUebersicht.DataBindings.clear
|
||||
Dim dtable As DataTable = dgvOfferteDetailsUebersicht.DataSource
|
||||
' If dgvOfferteDetailsUebersicht.Rows.Count > 0 Then dgvOfferteDetailsUebersicht.Rows.Clear()
|
||||
|
||||
If dtable IsNot Nothing Then
|
||||
'Sortierung
|
||||
'Dim dataView As New DataView(dtable)
|
||||
'dataView.Sort = " LeistungsNr ASC "
|
||||
'Dim dt As DataTable = dataView.ToTable()
|
||||
'For Each r As DataColumn In dt.Columns
|
||||
' MsgBox(r.ColumnName)
|
||||
'Next
|
||||
'dt.Rows.Add(POS.LeistungsNr, POS.LeistungsBez, POS.Anzahl, POS.Preis, POS.BerechnungsartNr, POS.[BGebLeistungsNr], POS.[BGebProzent], POS.[BGebMinBetrag], POS.Steuerpflichtig,
|
||||
' POS.IndexZkteing, POS.AufschubkontoNr, POS.Aufschubfälligkeit, POS.DateiNameAufschub, POS.Belegdaten)
|
||||
'dgvOfferteDetailsUebersicht.DataSource = dt
|
||||
'MsgBox("ASF")
|
||||
'dgvOfferteDetailsUebersicht.Rows.Add(POS.LeistungsNr, POS.LeistungsBez, POS.Anzahl, POS.Preis, POS.BerechnungsartNr, POS.[BGebLeistungsNr], POS.[BGebProzent], POS.[BGebMinBetrag], POS.Steuerpflichtig,
|
||||
' POS.IndexZkteing, POS.AufschubkontoNr, POS.Aufschubfälligkeit, POS.DateiNameAufschub, POS.Belegdaten)
|
||||
End If
|
||||
'SELECT [Offertenpositionen].[LeistungsNr],[Offertenpositionen].[LeistungsBez],[Offertenpositionen].[BerechnungsartNr],[Anzahl],[Preis],[BGebLeistungsNr],[BGebProzent],[BGebMinBetrag],/*[Eingegeben am],[PreisänderungProzent],[PreisAlt],[Preisänderung],*/Steuerpflichtig,[Geändert am],[Sachbearbeiter] " &
|
||||
If dgvOfferteDetailsUebersicht.Columns.Count > 0 And dgvOfferteDetailsUebersicht.Rows.Count > 0 Then
|
||||
'If(POS.BerechnungsartNr, 1)
|
||||
Try
|
||||
' POS.BerechnungsartNr !!!
|
||||
Dim newR As DataGridViewRow = dgvOfferteDetailsUebersicht.Rows(0).Clone ' dgvOfferteDetailsUebersicht.DataSource.Tables(0).NewRow()
|
||||
|
||||
newR.Cells(0).Value = POS.LeistungsNr
|
||||
newR.Cells(1).Value = If(POS.LeistungsBez, DBNull.Value)
|
||||
newR.Cells(2).Value = If(POS.Anzahl, DBNull.Value)
|
||||
newR.Cells(3).Value = If(POS.Preis, DBNull.Value) '* vorzeichen
|
||||
newR.Cells(4).Value = POS.BerechnungsartNr
|
||||
newR.Cells(5).Value = If(POS.BGebLeistungsNr, DBNull.Value)
|
||||
newR.Cells(6).Value = If(POS.BGebProzent, DBNull.Value)
|
||||
newR.Cells(7).Value = If(POS.BGebMinBetrag, DBNull.Value)
|
||||
newR.Cells(8).Value = POS.Steuerpflichtig ' * vorzeichen
|
||||
newR.Cells(9).Value = POS.IndexZkteing
|
||||
newR.Cells(10).Value = If(POS.AufschubkontoNr, DBNull.Value)
|
||||
newR.Cells(11).Value = If(POS.Aufschubfälligkeit, DBNull.Value)
|
||||
newR.Cells(12).Value = If(POS.DateiNameAufschub, DBNull.Value)
|
||||
newR.Cells(13).Value = If(POS.Belegdaten, DBNull.Value)
|
||||
|
||||
|
||||
'' dgvOfferteDetailsUebersicht.DataSource.AcceptChanges()
|
||||
' dgvOfferteDetailsUebersicht.DataSource.Tables(0).Rows.add(newR)
|
||||
' dgvOfferteDetailsUebersicht.Rows(dgvOfferteDetailsUebersicht.Rows.Count - 1).Cells("BerechnungsartNr").DefaultNewRowValue = POS.BerechnungsartNr.ToString
|
||||
|
||||
dgvOfferteDetailsUebersicht.Rows.Add(newR)
|
||||
setBerartValue(newR, POS.BerechnungsartNr)
|
||||
|
||||
|
||||
'newR.Cells(4).Value = POS.BerechnungsartNr
|
||||
|
||||
' dgvOfferteDetailsUebersicht.Rows(dgvOfferteDetailsUebersicht.Rows.Count - 1).Cells("BerechnungsartNr"). = POS.BerechnungsartNr.ToString
|
||||
|
||||
' MsgBox(DirectCast(newR.Cells(4), DataGridViewComboBoxCell).ValueMember.Count) '= POS.BerechnungsartNr
|
||||
'dgvOfferteDetailsUebersicht.DataSource.AcceptChanges()
|
||||
|
||||
' dgvOfferteDetailsUebersicht.Rows.Add(POS.LeistungsNr, POS.LeistungsBez, POS.Anzahl, POS.Preis, DBNull.Value, POS.[BGebLeistungsNr], POS.[BGebProzent], POS.[BGebMinBetrag], POS.Steuerpflichtig,
|
||||
' POS.IndexZkteing, POS.AufschubkontoNr, POS.Aufschubfälligkeit, POS.DateiNameAufschub, POS.Belegdaten)
|
||||
|
||||
' dgvOfferteDetailsUebersicht.Rows(dgvOfferteDetailsUebersicht.Rows.Count - 1).Cells("BerechnungsartNr").Value = POS.BerechnungsartNr
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
loaded = tmpLoaded
|
||||
End Sub
|
||||
|
||||
@@ -1187,6 +1171,12 @@ Public Class usrCntlFaktAbrechnung
|
||||
|
||||
If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 Then addFieldsBoolean = True
|
||||
|
||||
Dim landNr As String = ""
|
||||
Dim landBez As String = ""
|
||||
Dim antrag As cUSTVAntrag = Nothing
|
||||
Dim summeRMC As Double = 0
|
||||
If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso SPEDBUCH IsNot Nothing AndAlso SPEDBUCH.FilialenNr = 4817 Then landBez = CheckLandNr_getLandBezFromAntrag(landNr, antrag)
|
||||
|
||||
Dim addFields As String = ""
|
||||
|
||||
If addFieldsBoolean Then
|
||||
@@ -1200,10 +1190,6 @@ Public Class usrCntlFaktAbrechnung
|
||||
End If
|
||||
Dim loadedtmp = loaded
|
||||
loaded = False
|
||||
' .Columns.Clear()
|
||||
|
||||
' FUNC.dgvCellToCbo(dgvOfferteDetailsUebersicht, 4, "Berechnungsart", "BerechnungsartNr", " SELECT [BerechnungsartNr], CAST(BerechnungsartNr as varchar(3)) + ' - ' + [BerechnungsartBez] as [BerechnungsartBez] FROM [Berechnungsart] ORDER BY BerechnungsartNr ", "FMZOLL", 150)
|
||||
'NAMEN:::::::::::
|
||||
|
||||
Dim c As New DataGridViewTextBoxColumn() : c.Name = "LeistungsNr" : .Columns.Add(c)
|
||||
c = New DataGridViewTextBoxColumn() : c.Name = "LeistungsBez" : .Columns.Add(c)
|
||||
@@ -1224,22 +1210,16 @@ Public Class usrCntlFaktAbrechnung
|
||||
c = New DataGridViewTextBoxColumn() : c.Name = "ReverseCharge" : .Columns.Add(c)
|
||||
|
||||
If addFieldsBoolean Then
|
||||
|
||||
c = New DataGridViewTextBoxColumn() : c.Name = "Land" : .Columns.Add(c)
|
||||
c = New DataGridViewTextBoxColumn() : c.Name = "RMC" : .Columns.Add(c)
|
||||
c = New DataGridViewTextBoxColumn() : c.Name = "Fremd" : .Columns.Add(c)
|
||||
c = New DataGridViewTextBoxColumn() : c.Name = "VZ" : .Columns.Add(c)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim dt As DataTable = SQL.loadDgvBySql(" SELECT [Offertenpositionen].[LeistungsNr],[Offertenpositionen].[LeistungsBez],[Anzahl],[Preis],[Offertenpositionen].[BerechnungsartNr],[BGebLeistungsNr],[BGebProzent],[BGebMinBetrag],Steuerpflichtig, ReverseCharge/*,[Geändert am],[Sachbearbeiter]*/,BerechnungsartPosInkludiert " & addFields &
|
||||
" FROM [Offertenpositionen] INNER JOIN [Leistungen] ON leistungen.LeistungsNr=Offertenpositionen.LeistungsNr " &
|
||||
" WHERE KundenNr='" & kdNr & "' and OffertenNr='" & OffertenNr & "' ORDER BY LeistungsNr ", "FMZOLL")
|
||||
|
||||
|
||||
'If .ColumnCount = 0 Then Exit Sub
|
||||
.Columns("LeistungsNr").Width = 30
|
||||
.Columns("LeistungsNr").HeaderText = "Nr"
|
||||
.Columns("LeistungsBez").MinimumWidth = 180
|
||||
@@ -1250,51 +1230,17 @@ Public Class usrCntlFaktAbrechnung
|
||||
.Columns("LeistungsNr").ReadOnly = True
|
||||
.Columns("LeistungsBez").ReadOnly = False
|
||||
.Columns("BerechnungsartNr").ReadOnly = False
|
||||
'.Columns("BerechnungsartNr").DefaultCellStyle.NullValue = 1
|
||||
|
||||
|
||||
' .Columns("BerechnungsartNr").MinimumWidth = 130
|
||||
.Columns("Preis").Width = 60
|
||||
.Columns("Preis").DefaultCellStyle.Format = "N2"
|
||||
.Columns("Preis").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight
|
||||
'.Columns("Anzahl").Width = 50
|
||||
'.Columns("Anzahl").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter
|
||||
'.Columns("BGebLeistungsNr").Width = 60
|
||||
'.Columns("BGebProzent").Width = 55
|
||||
'.Columns("BGebProzent").HeaderText = "BGeb %"
|
||||
'.Columns("BGebProzent").DefaultCellStyle.Format = "P"
|
||||
'.Columns("BGebProzent").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight
|
||||
'.Columns("BGebMinBetrag").Width = 60
|
||||
'.Columns("BGebMinBetrag").HeaderText = "BGebMinBetr."
|
||||
'.Columns("BGebMinBetrag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight
|
||||
'.Columns("Eingegeben am").Visible = False
|
||||
|
||||
'.Columns("Sachbearbeiter").Width = 65
|
||||
' .Columns("Geändert am").Width = 95
|
||||
.Columns("BGebProzent").Width = 65
|
||||
.Columns("BGebMinBetrag").Width = 65
|
||||
'.Columns("PreisänderungProzent").Width = 65
|
||||
'.Columns("PreisänderungProzent").HeaderText = "Preisänd.%"
|
||||
'.Columns("PreisänderungProzent").DefaultCellStyle.Format = "P"
|
||||
'.Columns("PreisänderungProzent").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight
|
||||
'.Columns("PreisAlt").Width = 60
|
||||
'.Columns("PreisAlt").DefaultCellStyle.Format = "N2"
|
||||
'.Columns("PreisAlt").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight
|
||||
'.Columns("Preisänderung").Width = 60
|
||||
'.Columns("Preisänderung").HeaderText = "PreisNeu"
|
||||
'.Columns("Preisänderung").DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopRight
|
||||
|
||||
|
||||
.Columns("BGebLeistungsNr").Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||
.Columns("BGebProzent").Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||
.Columns("BGebMinBetrag").Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||
.Columns("Steuerpflichtig").Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||
.Columns("BerechnungsartPosInkludiert").Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||
.Columns("ReverseCharge").Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM
|
||||
' .Columns("Geändert am").Visible = False
|
||||
'.Columns("Sachbearbeiter").Visible = False
|
||||
|
||||
|
||||
.Columns("IndexZkteing").Visible = False
|
||||
.Columns("AufschubkontoNr").Visible = False
|
||||
.Columns("Aufschubfälligkeit").Visible = False
|
||||
@@ -1318,17 +1264,21 @@ Public Class usrCntlFaktAbrechnung
|
||||
DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, r("BerechnungsartPosInkludiert"), r("ReverseCharge"))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Next
|
||||
|
||||
For Each r As DataGridViewRow In dgvOfferteDetailsUebersicht.Rows
|
||||
' Try : If (r.Cells("BerechnungsartNr").Value = 8) And r.Cells("Anzahl").Value > 1 Then r.Cells("Anzahl").Value = 1
|
||||
' Catch ex As Exception : End Try
|
||||
Try : r.Cells("Preis").ReadOnly = (r.Cells("BerechnungsartNr").Value = 8)
|
||||
|
||||
If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso RECHNUNG.DruckDatumZeit Is Nothing Then
|
||||
Dim isRC As Boolean = If(r.Cells("ReverseCharge").Value IsNot DBNull.Value, r.Cells("ReverseCharge").Value, False)
|
||||
setMWSTABRfromSPEDinPOS(r, landNr, landBez, summeRMC, False, antrag, isVZ)
|
||||
End If
|
||||
|
||||
Catch ex As Exception : End Try
|
||||
Next
|
||||
|
||||
przRefreshDGV_Positionen()
|
||||
|
||||
' loaded = True
|
||||
@@ -1432,6 +1382,49 @@ Public Class usrCntlFaktAbrechnung
|
||||
|
||||
Private Sub dgvOfferteDetailsUebersicht_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles dgvOfferteDetailsUebersicht.CellValueChanged
|
||||
If Not loaded Then Exit Sub
|
||||
|
||||
If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso SPEDBUCH IsNot Nothing AndAlso SPEDBUCH.FilialenNr = 4817 AndAlso RECHNUNG.DruckDatumZeit Is Nothing AndAlso e.ColumnIndex = 3 Then
|
||||
|
||||
Dim landNr As String = ""
|
||||
Dim landBez As String = ""
|
||||
Dim antrag As cUSTVAntrag = Nothing
|
||||
Dim summeRMC As Double = 0
|
||||
|
||||
landBez = CheckLandNr_getLandBezFromAntrag(landNr, antrag)
|
||||
|
||||
Dim containRMC As Boolean = False
|
||||
Dim containFremd As Boolean = False
|
||||
|
||||
For Each r In dgvOfferteDetailsUebersicht.Rows
|
||||
|
||||
If r.Cells("LeistungsBez").Value.Contains("Fremd-RG") AndAlso r.Cells("Anzahl").Value > 0 Then
|
||||
containFremd = True
|
||||
End If
|
||||
If r.Cells("LeistungsBez").Value.Contains("RMC-RG") AndAlso r.Cells("Anzahl").Value > 0 Then
|
||||
containRMC = True
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
For Each r In dgvOfferteDetailsUebersicht.Rows
|
||||
|
||||
setMWSTABRfromSPEDinPOS(r, landNr, landBez, summeRMC, (containRMC AndAlso containFremd), antrag, isVZ, True)
|
||||
|
||||
Next
|
||||
|
||||
'Dim datarow As DataGridViewRow = dgvOfferteDetailsUebersicht.Rows(e.RowIndex)
|
||||
|
||||
'-----------------------MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
'If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso RECHNUNG.DruckDatumZeit Is Nothing Then
|
||||
' Dim isRC As Boolean = If(r.Cells("ReverseCharge").Value IsNot DBNull.Value, r.Cells("ReverseCharge").Value, False)
|
||||
|
||||
'End If
|
||||
|
||||
'-----------------------MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
End If
|
||||
|
||||
|
||||
przRefreshDGV_Positionen()
|
||||
End Sub
|
||||
|
||||
@@ -1444,11 +1437,6 @@ Public Class usrCntlFaktAbrechnung
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Try
|
||||
Dim landNr As String = ""
|
||||
Dim landBez As String = ""
|
||||
Dim antrag As cUSTVAntrag = Nothing
|
||||
Dim summeRMC As Double = 0
|
||||
If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso SPEDBUCH IsNot Nothing AndAlso SPEDBUCH.FilialenNr = 4817 Then landBez = CheckLandNr_getLandBezFromAntrag(landNr, antrag)
|
||||
|
||||
For Each r As DataGridViewRow In dgvOfferteDetailsUebersicht.Rows
|
||||
If r.Cells("Anzahl").Value IsNot DBNull.Value AndAlso Not IsNumeric(r.Cells("Anzahl").Value) Then r.Cells("Anzahl").Value = 0
|
||||
@@ -1467,10 +1455,10 @@ Public Class usrCntlFaktAbrechnung
|
||||
POS.Anzahl = If(r.Cells("Anzahl").Value Is DBNull.Value, 0, r.Cells("Anzahl").Value)
|
||||
|
||||
'-----------------------MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso RECHNUNG.DruckDatumZeit Is Nothing Then
|
||||
Dim isRC As Boolean = If(r.Cells("ReverseCharge").Value IsNot DBNull.Value, r.Cells("ReverseCharge").Value, False)
|
||||
setMWSTABRfromSPEDinPOS(r, POS, landNr, landBez, summeRMC, antrag, isVZ)
|
||||
End If
|
||||
'If FIRMA IsNot Nothing AndAlso FIRMA.Firma_ID = 19 AndAlso RECHNUNG.DruckDatumZeit Is Nothing Then
|
||||
' Dim isRC As Boolean = If(r.Cells("ReverseCharge").Value IsNot DBNull.Value, r.Cells("ReverseCharge").Value, False)
|
||||
' setMWSTABRfromSPEDinPOS(r, POS, landNr, landBez, summeRMC, antrag, isVZ)
|
||||
'End If
|
||||
|
||||
'-----------------------MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
|
||||
@@ -2616,16 +2604,15 @@ Public Class usrCntlFaktAbrechnung
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub prBearbGeb_NEW(POS_ As cRechnungsausgangPositionen, OFFERTE As cOfferte, RE As cRechnungsausgang, BGebLeistungsNr As Integer, BGebProzent As Double, BGebMinBetrag As Double, BGebBgl As Integer, ByRef summeRMCBearb As Double, isRMC As Boolean)
|
||||
Private Sub prBearbGeb_NEW(r As DataGridViewRow, OFFERTE As cOfferte, RE As cRechnungsausgang, BGebLeistungsNr As Integer, BGebProzent As Double, BGebMinBetrag As Double, BGebBgl As Integer, ByRef summeRMCBearb As Double, isRMC As Boolean, isFREMD As Boolean, FremdUndRMC As Boolean, changed As Boolean)
|
||||
|
||||
|
||||
If POS_.Anzahl <> 0 Then
|
||||
If r.Cells("Anzahl").Value <> 0 Then
|
||||
|
||||
If (BGebLeistungsNr > 0 AndAlso BGebProzent > 0 AndAlso BGebBgl <> 0) Then
|
||||
|
||||
Dim minBetragRMCUsed As Boolean = False
|
||||
|
||||
'Dim RMCUsed = IIf(POS_.LeistungsBez.Contains("Fremd-RG") OrElse POS_.LeistungsBez.Contains("RMC-RG"), True, False)
|
||||
Dim curBGebMinBetrag = BGebMinBetrag
|
||||
|
||||
Dim curBGebErrBetrag As Double = Math.Round(BGebBgl * BGebProzent, 1)
|
||||
@@ -2641,76 +2628,180 @@ Public Class usrCntlFaktAbrechnung
|
||||
'Größeren Betrag bereitstellen.
|
||||
If curBGebErrBetrag > curBGebMinBetrag Then
|
||||
curBGebBetrag = curBGebErrBetrag 'Errechneten Betrag verwenden
|
||||
summeRMCBearb += If(POS_.LeistungsBez.Contains("Fremd-RG") OrElse POS_.LeistungsBez.Contains("RMC-RG"), curBGebErrBetrag, 0)
|
||||
summeRMCBearb += If(r.Cells("LeistungsBez").Value.Contains("Fremd-RG") OrElse r.Cells("LeistungsBez").Value.Contains("RMC-RG"), curBGebErrBetrag, 0)
|
||||
Else
|
||||
curBGebBetrag = curBGebMinBetrag 'Mindestbetrag verwenden
|
||||
summeRMCBearb += If(POS_.LeistungsBez.Contains("Fremd-RG") OrElse POS_.LeistungsBez.Contains("RMC-RG"), curBGebErrBetrag, 0)
|
||||
minBetragRMCUsed = IIf(POS_.LeistungsBez.Contains("Fremd-RG") OrElse POS_.LeistungsBez.Contains("RMC-RG"), True, False)
|
||||
summeRMCBearb += If(r.Cells("LeistungsBez").Value.Contains("Fremd-RG") OrElse r.Cells("LeistungsBez").Value.Contains("RMC-RG"), curBGebErrBetrag, 0)
|
||||
minBetragRMCUsed = IIf(r.Cells("LeistungsBez").Value.Contains("Fremd-RG") OrElse r.Cells("LeistungsBez").Value.Contains("RMC-RG"), True, False)
|
||||
End If
|
||||
'Vorzeichen einstellen.
|
||||
If POS_.Preis < 0 Then
|
||||
If (r.Cells("Preis").Value < 0) Then
|
||||
curBGebBetrag = 0 - curBGebBetrag 'Vorzeichen von Plus in Minus ändern.
|
||||
End If
|
||||
|
||||
If SQL.DLookup("[BGebUStV]", "Leistungen", "[LeistungsNr] = '" & POS_.LeistungsNr & "'", "FMZOLL") Then
|
||||
If SQL.DLookup("[BGebUStV]", "Leistungen", "[LeistungsNr] = '" & r.Cells("LeistungsNr").Value & "'", "FMZOLL") Then
|
||||
curBGebBetrag = 0 - curBGebBetrag 'Vorzeichen wechseln.
|
||||
End If
|
||||
|
||||
|
||||
|
||||
For Each o In OFFERTE.POSITIONEN
|
||||
|
||||
If o.LeistungsNr = BGebLeistungsNr And o.BerechnungsartNr = 9 Then
|
||||
|
||||
Dim preisInital As Double = 0
|
||||
|
||||
If Not IsDBNull(r.Cells("Preis").Value) Then
|
||||
preisInital = curBGebBetrag
|
||||
End If
|
||||
|
||||
'Falls schon vorhanden...
|
||||
Dim POS = RE.POSITIONEN.Find(Function(x) x.LeistungsNr = BGebLeistungsNr And x.LeistungsBez = o.LeistungsBez And x.BerechnungsartNr = 9)
|
||||
Dim POS = RE.POSITIONEN.Find(Function(x) x.LeistungsNr = BGebLeistungsNr And x.BerechnungsartNr = 9)
|
||||
If POS Is Nothing Then
|
||||
POS = New VERAG_PROG_ALLGEMEIN.cRechnungsausgangPositionen()
|
||||
POS.Preis = 0
|
||||
POS.SteuerpflichtigerBetrag = 0
|
||||
POS.SteuerfreierBetrag = 0
|
||||
Dim LEISTUNG As New VERAG_PROG_ALLGEMEIN.cLeistungen(o.LeistungsNr)
|
||||
POS.Steuerpflichtig = LEISTUNG.Steuerpflichtig
|
||||
POS.LeistungsNr = o.LeistungsNr
|
||||
POS.LeistungsBez = o.LeistungsBez
|
||||
POS.BerechnungsartNr = o.BerechnungsartNr
|
||||
POS.Anzahl = 1
|
||||
RE.POSITIONEN.Add(POS)
|
||||
'hier wird die BearbeitungsPOS gesetzt!
|
||||
For Each row As DataGridViewRow In dgvOfferteDetailsUebersicht.Rows
|
||||
If row.Cells("LeistungsNr").Value = BGebLeistungsNr And row.Cells("BerechnungsartNr").Value = 9 Then
|
||||
row.Cells("Anzahl").Value = 1
|
||||
preisInital = curBGebBetrag
|
||||
|
||||
If preisInital = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
preisInital = preisInital / 2
|
||||
row.Cells("Preis").Value = preisInital
|
||||
Exit For
|
||||
ElseIf preisInital <> curBGebBetrag * 2 AndAlso summeRMCBearb <> preisInital AndAlso (minBetragRMCUsed OrElse isRMC OrElse isFREMD) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
preisInital = summeRMCBearb
|
||||
row.Cells("Preis").Value = preisInital
|
||||
Exit For
|
||||
Else
|
||||
row.Cells("Preis").Value = preisInital
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
POS.Preis += curBGebBetrag
|
||||
'hier wird der Betrag der BearbeitungsPOS NEU berechnet!
|
||||
|
||||
If POS.Anzahl = 0 Then POS.Anzahl = 1
|
||||
Dim curBearbPreis As Double = 0
|
||||
|
||||
If changed Then
|
||||
|
||||
For Each row As DataGridViewRow In dgvOfferteDetailsUebersicht.Rows
|
||||
If row.Cells("LeistungsNr").Value = BGebLeistungsNr And row.Cells("BerechnungsartNr").Value = 9 AndAlso row.Cells("Anzahl").Value = 1 Then
|
||||
|
||||
If IsDBNull(row.Cells("Preis").Value) Then row.Cells("Preis").Value = preisInital
|
||||
|
||||
curBearbPreis += row.Cells("Preis").Value
|
||||
|
||||
|
||||
If POS.Preis = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
POS.Preis = POS.Preis / 2
|
||||
ElseIf POS.Preis <> curBGebBetrag * 2 AndAlso summeRMCBearb <> POS.Preis AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
POS.Preis = summeRMCBearb
|
||||
End If
|
||||
If FremdUndRMC Then
|
||||
'beide POS sind enthalten
|
||||
If curBearbPreis = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
If curBearbPreis <> row.Cells("Preis").Value Then row.Cells("Preis").Value = curBGebBetrag / 2
|
||||
ElseIf curBearbPreis <> curBGebBetrag * 2 AndAlso summeRMCBearb <> curBearbPreis AndAlso (minBetragRMCUsed OrElse isRMC OrElse isFREMD) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
If summeRMCBearb <> row.Cells("Preis").Value Then row.Cells("Preis").Value = summeRMCBearb
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If minBetragRMCUsed Then
|
||||
|
||||
If curBearbPreis > curBGebBetrag AndAlso summeRMCBearb > 0 Then
|
||||
If curBearbPreis <> summeRMCBearb Then row.Cells("Preis").Value = summeRMCBearb
|
||||
Else
|
||||
If curBearbPreis <> curBGebMinBetrag Then row.Cells("Preis").Value = curBGebMinBetrag
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If curBearbPreis > curBGebBetrag AndAlso summeRMCBearb > 0 Then
|
||||
If curBearbPreis <> summeRMCBearb Then row.Cells("Preis").Value = summeRMCBearb
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If POS.Steuerpflichtig Then
|
||||
POS.SteuerpflichtigerBetrag += curBGebBetrag
|
||||
|
||||
If POS.SteuerpflichtigerBetrag = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
POS.SteuerpflichtigerBetrag = POS.SteuerpflichtigerBetrag / 2
|
||||
ElseIf POS.SteuerpflichtigerBetrag <> curBGebBetrag * 2 AndAlso summeRMCBearb <> POS.SteuerpflichtigerBetrag AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
POS.SteuerpflichtigerBetrag = summeRMCBearb
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'If curBearbPreis <> curBGebBetrag * 2 AndAlso curBearbPreis <> summeRMCBearb AndAlso (minBetragRMCUsed OrElse isRMC) Then
|
||||
|
||||
' If summeRMCBearb > curBGebMinBetrag AndAlso summeRMCBearb <> 0 Then
|
||||
' If curBearbPreis <> summeRMCBearb Then row.Cells("Preis").Value = summeRMCBearb
|
||||
' ElseIf curBGebErrBetrag = summeRMCBearb Then
|
||||
|
||||
' If Not FremdUndRMC Then 'dann ist das die die erste POS und es gibt nur 1 hier setzen, sonder überspringen!! '!!!!!!!!! außer beide POS fallen unter die Mindestgrenze!!!
|
||||
' If curBearbPreis <> curBGebMinBetrag Then row.Cells("Preis").Value = curBGebMinBetrag
|
||||
' End If
|
||||
|
||||
' ElseIf curBGebErrBetrag <> summeRMCBearb And FremdUndRMC Then 'dann ist das die NICHT die erste POS, hier setzen
|
||||
' If curBearbPreis <> curBGebMinBetrag Then row.Cells("Preis").Value = curBGebMinBetrag
|
||||
' End If
|
||||
|
||||
|
||||
'ElseIf curBearbPreis = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then
|
||||
|
||||
' If curBearbPreis <> curBGebBetrag Then row.Cells("Preis").Value = curBGebBetrag
|
||||
|
||||
'ElseIf Not isRMC AndAlso curBearbPreis <> curBGebBetrag Then
|
||||
|
||||
' If curBearbPreis <> curBGebBetrag Then row.Cells("Preis").Value = curBGebBetrag
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
'If row.Cells("Preis").Value = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
' row.Cells("Preis").Value = row.Cells("Preis").Value / 2
|
||||
'ElseIf row.Cells("Preis").Value <> curBGebBetrag * 2 AndAlso summeRMCBearb <> row.Cells("Preis").Value AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
' row.Cells("Preis").Value = summeRMCBearb
|
||||
'End If
|
||||
End If
|
||||
|
||||
Else
|
||||
POS.SteuerfreierBetrag += curBGebBetrag
|
||||
Next
|
||||
|
||||
If POS.SteuerfreierBetrag = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
POS.SteuerfreierBetrag = POS.SteuerfreierBetrag / 2
|
||||
ElseIf POS.SteuerpflichtigerBetrag <> curBGebBetrag * 2 AndAlso summeRMCBearb <> POS.SteuerpflichtigerBetrag AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
POS.SteuerpflichtigerBetrag = summeRMCBearb
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'POS.Preis += curBGebBetrag
|
||||
|
||||
'If POS.Preis = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
' POS.Preis = POS.Preis / 2
|
||||
'ElseIf POS.Preis <> curBGebBetrag * 2 AndAlso summeRMCBearb <> POS.Preis AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
' POS.Preis = summeRMCBearb
|
||||
'End If
|
||||
|
||||
|
||||
'If POS.Steuerpflichtig Then
|
||||
' POS.SteuerpflichtigerBetrag += curBGebBetrag
|
||||
|
||||
' If POS.SteuerpflichtigerBetrag = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
' POS.SteuerpflichtigerBetrag = POS.SteuerpflichtigerBetrag / 2
|
||||
' ElseIf POS.SteuerpflichtigerBetrag <> curBGebBetrag * 2 AndAlso summeRMCBearb <> POS.SteuerpflichtigerBetrag AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
' POS.SteuerpflichtigerBetrag = summeRMCBearb
|
||||
|
||||
' End If
|
||||
|
||||
'Else
|
||||
' POS.SteuerfreierBetrag += curBGebBetrag
|
||||
|
||||
' If POS.SteuerfreierBetrag = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
|
||||
' POS.SteuerfreierBetrag = POS.SteuerfreierBetrag / 2
|
||||
' ElseIf POS.SteuerpflichtigerBetrag <> curBGebBetrag * 2 AndAlso summeRMCBearb <> POS.SteuerpflichtigerBetrag AndAlso (minBetragRMCUsed OrElse isRMC) AndAlso summeRMCBearb > curBGebMinBetrag Then 'wenn RMCPOS und Summe der berechneten Bearb > Mindestbetrag --> berechnetBearb verrechnet!
|
||||
' POS.SteuerpflichtigerBetrag = summeRMCBearb
|
||||
' End If
|
||||
|
||||
'End If
|
||||
|
||||
End If
|
||||
Next
|
||||
'Catch ex As Exception
|
||||
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
@@ -2810,8 +2901,8 @@ Public Class usrCntlFaktAbrechnung
|
||||
Next
|
||||
' mind??KD
|
||||
If BS415_Berechnungbetrag <> 0 Then
|
||||
If BS415_Berechnungbetrag < 0 Then BS415_Berechnungbetrag *= -1
|
||||
BS415 = Int(BS415_Berechnungbetrag * KD.Bankspesen + 0.5)
|
||||
If BS415_Berechnungbetrag <0 Then BS415_Berechnungbetrag *= -1
|
||||
BS415= Int(BS415_Berechnungbetrag * KD.Bankspesen + 0.5)
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -4629,7 +4720,7 @@ Nächste_Textzeile_lesen:
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub setMWSTABRfromSPEDinPOS(r As DataGridViewRow, POS As cRechnungsausgangPositionen, LandNr As String, LandBez As String, ByRef summeRMC As Double, Optional antrag As cUSTVAntrag = Nothing, Optional isVZ As Boolean = False)
|
||||
Private Sub setMWSTABRfromSPEDinPOS(r As DataGridViewRow, LandNr As String, LandBez As String, ByRef summeRMC As Double, ByRef FremdUndRMC As Boolean, Optional antrag As cUSTVAntrag = Nothing, Optional isVZ As Boolean = False, Optional changed As Boolean = False)
|
||||
|
||||
If SPEDBUCH IsNot Nothing AndAlso (SPEDBUCH.Abfertigungsart = 114 Or SPEDBUCH.Abfertigungsart = 115 Or SPEDBUCH.Abfertigungsart = 10) Then
|
||||
|
||||
@@ -4706,7 +4797,6 @@ Nächste_Textzeile_lesen:
|
||||
|
||||
'SPEDBUCH.Abfertigungsart = 114 -> EU
|
||||
'SPEDBUCH.Abfertigungsart = 115 -> DL Drittland
|
||||
|
||||
Dim BEZ_LAND_RMC As String = ""
|
||||
Select Case SPEDBUCH.Abfertigungsart
|
||||
Case 114 : BEZ_LAND_RMC = IIf(isVZ, "00", "00-00")
|
||||
@@ -4754,23 +4844,23 @@ Nächste_Textzeile_lesen:
|
||||
mwst:
|
||||
|
||||
If isMWST Then
|
||||
POS.Anzahl = 1
|
||||
r.Cells("Anzahl").Value = 1
|
||||
|
||||
|
||||
If antrag IsNot Nothing AndAlso antrag.UStVAn_ID > 0 Then
|
||||
|
||||
If POS.Preis = 0 Then
|
||||
If IsDBNull(r.Cells("Preis").Value) OrElse r.Cells("Preis").Value = 0 Then
|
||||
|
||||
If isRMCKunde Then
|
||||
If OFFERT_RMC AndAlso sumRMC <> 0 Then
|
||||
POS.Preis = sumRMC * -1
|
||||
r.Cells("Preis").Value = sumRMC * -1
|
||||
ElseIf OFFERT_FREMD AndAlso sumFremdBeleg <> 0 Then
|
||||
POS.Preis = sumFremdBeleg * -1
|
||||
r.Cells("Preis").Value = sumFremdBeleg * -1
|
||||
End If
|
||||
|
||||
Else
|
||||
If sumBelegVZ <> 0 Then
|
||||
POS.Preis = sumBelegVZ * -1
|
||||
r.Cells("Preis").Value = sumBelegVZ * -1
|
||||
Else
|
||||
|
||||
Dim GesamtUSteuerEUR As Double = SQL.DLookup("isnull(sum(UStVPo_USteuerbetragEUR),0)", "tblUStVPositionen", "UStVAn_ID='" & antrag.UStVAn_ID & "'", "FMZOLL", "0")
|
||||
@@ -4778,7 +4868,7 @@ mwst:
|
||||
Dim DiffernezbetragEUR As Double = GesamtUSteuerEUR - GesamtErstattungEUR
|
||||
|
||||
If DiffernezbetragEUR <> 0 Then
|
||||
POS.Preis = DiffernezbetragEUR * -1
|
||||
r.Cells("Preis").Value = DiffernezbetragEUR * -1
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -4797,7 +4887,7 @@ mwst:
|
||||
If OffertNr < 0 Then OffertNr = 15
|
||||
|
||||
Dim OFFERTE As New VERAG_PROG_ALLGEMEIN.cOfferte(IIf(RECHNUNG.RechnungsKundenNr > 0, RECHNUNG.RechnungsKundenNr, kdFirmaRechnungAn.KdNr), OffertNr, True)
|
||||
Call prBearbGeb_NEW(POS, OFFERTE, RECHNUNG, r.Cells("BGebLeistungsNr").Value, r.Cells("BGebProzent").Value, IIf(Not IsDBNull(r.Cells("BGebMinBetrag").Value), r.Cells("BGebMinBetrag").Value, 0), POS.Preis * If(RECHNUNG.Vorzeichen = "-", -1, 1), summeRMC, (OFFERT_RMC Or OFFERT_FREMD))
|
||||
Call prBearbGeb_NEW(r, OFFERTE, RECHNUNG, r.Cells("BGebLeistungsNr").Value, r.Cells("BGebProzent").Value, IIf(Not IsDBNull(r.Cells("BGebMinBetrag").Value), r.Cells("BGebMinBetrag").Value, 0), r.Cells("Preis").Value * If(RECHNUNG.Vorzeichen = "-", -1, 1), summeRMC, OFFERT_RMC, OFFERT_FREMD, FremdUndRMC, changed)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.4.1.1")>
|
||||
<Assembly: AssemblyFileVersion("1.4.1.1")>
|
||||
<Assembly: AssemblyVersion("1.4.1.4")>
|
||||
<Assembly: AssemblyFileVersion("1.4.1.4")>
|
||||
|
||||
@@ -174,12 +174,17 @@ Public Class ustCntlUSTV_ErstattungPosition
|
||||
|
||||
If IsNumeric(txtUSTBetragEUR.Text) AndAlso IsNumeric(txtUSTBetrag.Text) Then
|
||||
|
||||
txtUmrechnungskurs.Text = txtUSTBetrag.Text / txtUSTBetragEUR.Text
|
||||
If txtUSTBetrag.Text = 0 AndAlso txtUSTBetragEUR.Text = 0 Then
|
||||
txtUmrechnungskurs.Text = 1
|
||||
Else
|
||||
txtUmrechnungskurs.Text = txtUSTBetrag.Text / txtUSTBetragEUR.Text
|
||||
End If
|
||||
|
||||
|
||||
txtChanged = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ElseIf sender Is txtBelegDatum Then
|
||||
ElseIf sender Is txtBelegDatum Then
|
||||
|
||||
If txtBelegDatum.Text <> "" Then
|
||||
txtBelegDatum.Text = txtBelegDatum.Text.Replace("-", ".")
|
||||
|
||||
Reference in New Issue
Block a user