|
|
|
|
@@ -44,6 +44,15 @@ Public Class ustCntlUSTV_AntragPosition
|
|
|
|
|
txtLand.Text = ""
|
|
|
|
|
txtUIDNr.Text = ""
|
|
|
|
|
|
|
|
|
|
gridAktiv = True
|
|
|
|
|
|
|
|
|
|
Dim filter As String = "UstV_aktiv = 1"
|
|
|
|
|
If Antrag_LandKz <> "" AndAlso cbxAntragsfilter.Checked Then
|
|
|
|
|
filter &= " and left(UstV_Leistender_UstNr,2)='" & Antrag_LandKz & "'"
|
|
|
|
|
sbLeistender.initSearchBox(Me.FindForm, "[UStV_LeistenderId],[UStV_Leistender], ([UStV_Leistender] + ' ' + isnull([UstV_Leistender_UstNr],'')) as Leistender,[UstV_Leistender_PLZ] as PLZ, ([UstV_Leistender_Strasse] + ' ' +[UstV_Leistender_StrasseNr]) as Strasse, [UstV_Leistender_Stadt] as Stadt FROM [tblUStVLeistender]", {"UStV_Leistender", "UstV_Leistender_UstNr"}, filter, "UStV_Leistender", "UStV_LeistenderId", "Leistender", "FMZOLL",, 400, 200, {"UStV_Leistender", "UStV_LeistenderId"})
|
|
|
|
|
Else
|
|
|
|
|
sbLeistender.initSearchBox(Me.FindForm, "[UStV_LeistenderId],[UStV_Leistender], ([UStV_Leistender] + ' ' + isnull([UstV_Leistender_UstNr],'')) as Leistender,[UstV_Leistender_PLZ] as PLZ, ([UstV_Leistender_Strasse] + ' ' +[UstV_Leistender_StrasseNr]) as Strasse, [UstV_Leistender_Stadt] as Stadt FROM [tblUStVLeistender]", {"UStV_Leistender", "UstV_Leistender_UstNr"}, filter, "UStV_Leistender", "UStV_LeistenderId", "Leistender", "FMZOLL",, 400, 200, {"UStV_Leistender", "UStV_LeistenderId"})
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
@@ -425,24 +434,33 @@ Public Class ustCntlUSTV_AntragPosition
|
|
|
|
|
If sender Is txtUSTBetrag Then
|
|
|
|
|
If IsNumeric(txtUSTBetrag.Text) AndAlso IsNumeric(txtUmrechnungskurs.Text) Then
|
|
|
|
|
|
|
|
|
|
If CDbl(UStV_POS.UStVPo_USteuerbetrag) <> CDbl(txtUSTBetrag.Text) Then
|
|
|
|
|
If CDbl(UStV_POS.UStVPo_USteuerbetrag) <> CDbl(txtUSTBetrag.Text) OrElse UStV_POS.UStVPo_USteuerbetrag Is Nothing Then
|
|
|
|
|
'Umrechnung bei Währung <> EUR im Antrag!
|
|
|
|
|
|
|
|
|
|
Dim antr As New cUSTVAntrag(UStV_POS.UStVAn_ID)
|
|
|
|
|
|
|
|
|
|
If antr.UStVAn_Währungscode <> "EUR" AndAlso IsDate(UStV_POS.UStVPo_ReDat) Then
|
|
|
|
|
If antr.UStVAn_Währungscode <> "EUR" AndAlso (IsDate(UStV_POS.UStVPo_ReDat) OrElse (txtRgDatum.Text <> "" AndAlso IsDate(txtRgDatum.Text))) Then
|
|
|
|
|
If txtUmrechnungskurs.Text = 1 Or txtUmrechnungskurs.Text = "" Then
|
|
|
|
|
Dim kurs As New cEZB_Waehrungskurse(antr.UStVAn_Währungscode)
|
|
|
|
|
txtUmrechnungskurs.Text = kurs.ezb_kurs
|
|
|
|
|
|
|
|
|
|
If IsDate(UStV_POS.UStVPo_ReDat) Then
|
|
|
|
|
txtUmrechnungskurs.Text = kurs.GET_KURS(antr.UStVAn_Währungscode, CDate(UStV_POS.UStVPo_ReDat))
|
|
|
|
|
ElseIf IsDate(txtRgDatum.Text) Then
|
|
|
|
|
txtUmrechnungskurs.Text = kurs.GET_KURS(antr.UStVAn_Währungscode, CDate(txtRgDatum.Text))
|
|
|
|
|
Else
|
|
|
|
|
txtUmrechnungskurs.Text = kurs.ezb_kurs
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
|
|
|
|
|
txtChanged = True
|
|
|
|
|
End If
|
|
|
|
|
txtChanged = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
ElseIf sender Is txtUSTBetragEUR Then
|
|
|
|
|
|
|
|
|
|
@@ -457,11 +475,11 @@ Public Class ustCntlUSTV_AntragPosition
|
|
|
|
|
|
|
|
|
|
If IsNumeric(txtUSTBetragEUR.Text) AndAlso IsNumeric(txtUSTBetrag.Text) Then
|
|
|
|
|
|
|
|
|
|
If CDbl(UStV_POS.UStVPo_USteuerbetragEUR) <> CDbl(txtUSTBetragEUR.Text) Then
|
|
|
|
|
If CDbl(UStV_POS.UStVPo_USteuerbetragEUR) <> CDbl(txtUSTBetragEUR.Text) OrElse UStV_POS.UStVPo_USteuerbetragEUR Is Nothing Then
|
|
|
|
|
|
|
|
|
|
Dim zahl1 = txtUSTBetragEUR.Text / txtUSTBetrag.Text
|
|
|
|
|
Dim zahl1 = CDbl(txtUSTBetrag.Text) / CDbl(txtUSTBetragEUR.Text)
|
|
|
|
|
|
|
|
|
|
txtUmrechnungskurs.Text = zahl1
|
|
|
|
|
txtUmrechnungskurs.Text = Math.Round(zahl1, 2)
|
|
|
|
|
txtChanged = True
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
@@ -471,7 +489,7 @@ Public Class ustCntlUSTV_AntragPosition
|
|
|
|
|
|
|
|
|
|
If IsNumeric(txtUSTBetrag.Text) AndAlso IsNumeric(txtUmrechnungskurs._value) Then
|
|
|
|
|
|
|
|
|
|
If UStV_POS.UStVPo_Umrechnungskurs <> txtUmrechnungskurs.Text.Replace(",", ".") Then
|
|
|
|
|
If UStV_POS.UStVPo_Umrechnungskurs <> txtUmrechnungskurs.Text.Replace(",", ".") OrElse UStV_POS.UStVPo_Umrechnungskurs Is Nothing Then
|
|
|
|
|
|
|
|
|
|
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
|
|
|
|
|
txtChanged = True
|
|
|
|
|
@@ -485,28 +503,28 @@ Public Class ustCntlUSTV_AntragPosition
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If UStV_Leist.hasEntry Then
|
|
|
|
|
If UStV_Leist.hasEntry Then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UStV_POS.UStVPo_Leistender = UStV_Leist.UStV_Leistender
|
|
|
|
|
If UStV_Leist.UStV_LeistenderId > 0 Then UStV_POS.UStVPo_LeistenderId = UStV_Leist.UStV_LeistenderId
|
|
|
|
|
UStV_POS.UStVPo_Leistender = UStV_Leist.UStV_Leistender
|
|
|
|
|
If UStV_Leist.UStV_LeistenderId > 0 Then UStV_POS.UStVPo_LeistenderId = UStV_Leist.UStV_LeistenderId
|
|
|
|
|
|
|
|
|
|
txtChanged = True
|
|
|
|
|
'UStV_POS.SAVE()
|
|
|
|
|
'RaiseEvent CHANGED(UStV_POS.UStVPo_ID)
|
|
|
|
|
End If
|
|
|
|
|
txtChanged = True
|
|
|
|
|
'UStV_POS.SAVE()
|
|
|
|
|
'RaiseEvent CHANGED(UStV_POS.UStVPo_ID)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ElseIf sender Is txtRgDatum Then
|
|
|
|
|
ElseIf sender Is txtRgDatum Then
|
|
|
|
|
|
|
|
|
|
If txtRgDatum.Text <> "" Then
|
|
|
|
|
If txtRgDatum.Text <> "" Then
|
|
|
|
|
txtRgDatum.Text = txtRgDatum.Text.Replace("-", ".")
|
|
|
|
|
'If IsDate(txtRgDatum.Text) Then txtChanged = True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|