This commit is contained in:
2025-05-30 09:31:08 +02:00
parent ef855d9add
commit 9f6e03b975

View File

@@ -2616,62 +2616,6 @@ Public Class usrCntlFaktAbrechnung
End Function
Private Sub prBearbGeb(POS_ As cRechnungsausgangPositionen, OFFERTE As cOfferte, RE As cRechnungsausgang, BGebLeistungsNr As Integer, BGebProzent As Double, BGebBgl As Integer)
If POS_.Anzahl <> 0 Then
If (BGebLeistungsNr > 0 AndAlso BGebProzent > 0 AndAlso BGebBgl <> 0) Then
Dim Betrag As Double = Math.Round(BGebBgl * BGebProzent, 1)
For Each o In OFFERTE.POSITIONEN
If o.LeistungsNr = BGebLeistungsNr Then
'Falls schon vorhanden...
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
' POS.BGebLeistungsNr = BGebLeistungsNr
RE.POSITIONEN.Add(POS)
End If
POS.Preis += Betrag
'End If
If POS.Steuerpflichtig Then
POS.SteuerpflichtigerBetrag += Betrag
Else
POS.SteuerfreierBetrag += Betrag
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
' Return False
'End Function
End If
End If
End Sub
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)
@@ -2715,10 +2659,10 @@ Public Class usrCntlFaktAbrechnung
For Each o In OFFERTE.POSITIONEN
If o.LeistungsNr = BGebLeistungsNr And o.BerechnungsartNr = 9 Then
If o.LeistungsNr = BGebLeistungsNr And o.BerechnungsartNr = 9 Then
'Falls schon vorhanden...
Dim POS = RE.POSITIONEN.Find(Function(x) x.LeistungsNr = BGebLeistungsNr And x.BerechnungsartNr = 9)
Dim POS = RE.POSITIONEN.Find(Function(x) x.LeistungsNr = BGebLeistungsNr And x.LeistungsBez = o.LeistungsBez And x.BerechnungsartNr = 9)
If POS Is Nothing Then
POS = New VERAG_PROG_ALLGEMEIN.cRechnungsausgangPositionen()
POS.Preis = 0
@@ -2726,20 +2670,17 @@ Public Class usrCntlFaktAbrechnung
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
' POS.BGebLeistungsNr = BGebLeistungsNr
RE.POSITIONEN.Add(POS)
End If
POS.Preis += curBGebBetrag
If POS.Anzahl = 0 Then POS.Anzahl = 1
If POS.Preis = curBGebBetrag * 2 AndAlso minBetragRMCUsed Then 'wenn RMCPOS und MIND-BERTAG 2x verrechnet -> nur 1x berechnen
POS.Preis = POS.Preis / 2