fakt, Abrechnung, ustva.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Imports System.IO
|
||||
Imports System.Web.UI.WebControls.Expressions
|
||||
Imports Chilkat
|
||||
Imports com.sun.org.apache.bcel.internal.generic
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class usrCntlFaktAbrechnung
|
||||
@@ -1401,11 +1402,11 @@ Public Class usrCntlFaktAbrechnung
|
||||
Try
|
||||
If dgvOfferteDetailsUebersicht.Columns IsNot Nothing AndAlso dgvOfferteDetailsUebersicht.Columns("LeistungsNr") IsNot Nothing Then dgvOfferteDetailsUebersicht.Sort(dgvOfferteDetailsUebersicht.Columns("LeistungsNr"), System.ComponentModel.ListSortDirection.Ascending)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
|
||||
Try
|
||||
Dim landNr As String = ""
|
||||
Dim landBez = CheckLandNr_getLandBezFromLandNr(landNr)
|
||||
|
||||
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
|
||||
If r.Cells("Preis").Value IsNot DBNull.Value AndAlso Not IsNumeric(r.Cells("Preis").Value) Then r.Cells("Preis").Value = 0
|
||||
@@ -1419,32 +1420,10 @@ Public Class usrCntlFaktAbrechnung
|
||||
POS.Preis = If(r.Cells("Preis").Value Is DBNull.Value, 0, CDbl(r.Cells("Preis").Value.ToString.Replace(".", "")))
|
||||
POS.Anzahl = If(r.Cells("Anzahl").Value Is DBNull.Value, 0, r.Cells("Anzahl").Value)
|
||||
|
||||
If SPEDBUCH.Abfertigungsart = 114 Or SPEDBUCH.Abfertigungsart = 115 Or SPEDBUCH.Abfertigungsart = 10 Then 'MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
Dim LeistungsBez = r.Cells("LeistungsBez").Value
|
||||
If LeistungsBez <> "" Then
|
||||
Dim isMWST As Boolean = False
|
||||
If SPEDBUCH.Packstücke.ToString.Contains("Mehrwertsteuerrückerstattung") Then
|
||||
Dim LandNr As String = SPEDBUCH.Packstücke.ToString.Replace("Mehrwertsteuerrückerstattung ", "")
|
||||
LandNr = LandNr.Substring(0, 2).Trim()
|
||||
Dim LandBez = SQL.getValueTxtBySql("select LandKz from [Länderverzeichnis für die Außenhandelsstatistik] where LandNr = " & LandNr, "FMZOLL")
|
||||
'-----------------------MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
setMWSTABRfromSPEDinPOS(r, POS, landNr, landBez)
|
||||
'-----------------------MWST-Abrechnung! + Kompat. zu FM-Zoll
|
||||
|
||||
If LandBez <> "" AndAlso SPEDBUCH.Packstücke.ToString.Replace("Mehrwertsteuerrückerstattung " & LandNr, "MWSt-Rückerstattung " & LandBez).StartsWith(LeistungsBez.ToString) Then isMWST = True
|
||||
Else
|
||||
|
||||
If SPEDBUCH.Packstücke.ToString().StartsWith(LeistungsBez.ToString) Then isMWST = True
|
||||
|
||||
End If
|
||||
If isMWST Then
|
||||
POS.Anzahl = 1
|
||||
|
||||
If POS.Preis = 0 Then
|
||||
POS.Preis = IIf(SPEDBUCH.Rechnungsbetrag IsNot Nothing, 0, SPEDBUCH.Rechnungsbetrag) * -1
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If POS.Anzahl = 0 And POS.BerechnungsartNr = 8 And POS.Preis <> 0 Then
|
||||
POS.Preis = 0 'Wenn Anzahl =0 bei Berart 8, dann Preis auch 0
|
||||
@@ -1791,7 +1770,7 @@ Public Class usrCntlFaktAbrechnung
|
||||
If DAID <> "" AndAlso IsNumeric(DAID) Then
|
||||
Dim daidno As Integer = CInt(DAID)
|
||||
Dim ds As New cDATENSERVER(daidno)
|
||||
.Rows.Add(0, nameLief, ds.da_name, ds.da_id, ds.da_id)
|
||||
.Rows.Add(1, nameLief, ds.da_name, ds.da_id, ds.da_id)
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -1803,7 +1782,7 @@ Public Class usrCntlFaktAbrechnung
|
||||
Dim FI As New FileInfo(pfadExcel)
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "MDM", "POS_LISTE", "", "", SPEDBUCH.AbfertigungsNr & FI.Extension, USTV.UStVAn_KuNr, False)
|
||||
DS.uploadDataToDATENSERVER(pfadExcel, FI.Name, FI.Extension,,,, True)
|
||||
.Rows.Add(0, "POS-LIST", DS.da_name, DS.da_id, DS.da_id)
|
||||
.Rows.Add(1, "POS-LIST", DS.da_name, DS.da_id, DS.da_id)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -4364,6 +4343,46 @@ Nächste_Textzeile_lesen:
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Function CheckLandNr_getLandBezFromLandNr(ByRef LandNr As String) As String
|
||||
|
||||
Dim landbez As String = ""
|
||||
If SPEDBUCH Is Nothing Then Return landbez
|
||||
If SPEDBUCH.Packstücke.ToString.Contains("Mehrwertsteuerrückerstattung") Then
|
||||
LandNr = SPEDBUCH.Packstücke.ToString.Replace("Mehrwertsteuerrückerstattung ", "")
|
||||
LandNr = LandNr.Substring(0, 2).Trim()
|
||||
If IsNumeric(LandNr) Then
|
||||
landbez = SQL.getValueTxtBySql("select LandKz from [Länderverzeichnis für die Außenhandelsstatistik] where LandNr = " & LandNr, "FMZOLL")
|
||||
Return landbez
|
||||
ElseIf LandNr = "AT" Then
|
||||
landbez = LandNr
|
||||
Return landbez
|
||||
End If
|
||||
End If
|
||||
Return landbez
|
||||
End Function
|
||||
|
||||
Private Sub setMWSTABRfromSPEDinPOS(r As DataGridViewRow, POS As cRechnungsausgangPositionen, LandNr As String, LandBez As String)
|
||||
|
||||
If SPEDBUCH.Abfertigungsart = 114 Or SPEDBUCH.Abfertigungsart = 115 Or SPEDBUCH.Abfertigungsart = 10 Then
|
||||
Dim LeistungsBez = r.Cells("LeistungsBez").Value
|
||||
If LeistungsBez <> "" Then
|
||||
Dim isMWST As Boolean = False
|
||||
If LandBez <> "" AndAlso LandNr <> "" Then
|
||||
If SPEDBUCH.Packstücke.ToString.Replace("Mehrwertsteuerrückerstattung " & LandNr, "MWSt-Rückerstattung " & LandBez).StartsWith(LeistungsBez.ToString) Then isMWST = True
|
||||
Else
|
||||
If SPEDBUCH.Packstücke.ToString().StartsWith(LeistungsBez.ToString) Then isMWST = True
|
||||
End If
|
||||
|
||||
If isMWST Then
|
||||
POS.Anzahl = 1
|
||||
|
||||
If POS.Preis = 0 Then
|
||||
POS.Preis = IIf(SPEDBUCH.Rechnungsbetrag Is Nothing, 0, SPEDBUCH.Rechnungsbetrag) * -1
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user