fremdrechnungen, etc.
This commit is contained in:
@@ -36,6 +36,14 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
sbLeistender._value = ""
|
||||
sbLeistender.Text = ""
|
||||
|
||||
pnlAdresse.Enabled = True 'enablePanel 'immer änderbar!
|
||||
txtStrasse.Text = ""
|
||||
txtStrassenNr.Text = ""
|
||||
txtPLZ.Text = ""
|
||||
txtOrt.Text = ""
|
||||
txtLand.Text = ""
|
||||
txtUIDNr.Text = ""
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -72,7 +80,7 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
Else
|
||||
|
||||
Select Case If(UStV_POS.UStVPo_SchnittstellenNr, -1)
|
||||
Case 6, 0 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & UStV_POS.UStVPo_ReDat & "' and plInv_SupplierRechnungsNr='" & UStV_POS.UStVPo_ReNr & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1)
|
||||
Case 6, 0, 11 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & UStV_POS.UStVPo_ReDat & "' and plInv_SupplierRechnungsNr='" & UStV_POS.UStVPo_ReNr & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1)
|
||||
Case 7 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [rmc_daId] FROM [tblRMCImport] where rmc_reDatum='" & UStV_POS.UStVPo_ReDat & "' and rmc_reNr='" & UStV_POS.UStVPo_ReNr & "' and rmc_landKZ='" & Antrag_LandKz & "' AND [rmc_daId] is not null", "FMZOLL",,, -1)
|
||||
Case 4, 9 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblMSEInvoices] as inv inner join tblMSECustomers on inv.customer_number = customer_id where invoice_date='" & UStV_POS.UStVPo_ReDat & "' and country='" & Antrag_LandKz & "' AND partner_customer_number = " & kdnr & " AND daId is not null", "FMZOLL",,, -1)
|
||||
Case 10 : da_id = sql.getValueTxtBySql("SELECT TOP(1) [daId] FROM [tblUTAImportNew] where Rechnungsdatum='" & UStV_POS.UStVPo_ReDat & "' and Abrechnungsnummer='" & UStV_POS.UStVPo_ReNr & "' and Lieferland_ISO2='" & Antrag_LandKz & "' AND daId is not null", "FMZOLL",,, -1)
|
||||
@@ -97,10 +105,9 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
scanUSTVVollmachten.INIT(kdnr, "KUNDENDATEN", "USTV_Vollmachten")
|
||||
|
||||
Dim filter As String = "UstV_aktiv = 1"
|
||||
If Antrag_LandKz <> "" Then
|
||||
If cbxAntragsfilter.Checked Then filter &= " and left(UstV_Leistender_UstNr,2)='" & Antrag_LandKz & "'"
|
||||
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
|
||||
@@ -155,10 +162,10 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
If sbLeistender._value IsNot Nothing AndAlso sbLeistender._value <> "" Then
|
||||
|
||||
If IsNumeric(sbLeistender._value) Then
|
||||
UStV_Leist = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(CInt(sbLeistender._value))
|
||||
Else
|
||||
UStV_Leist = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(sbLeistender._value)
|
||||
End If
|
||||
UStV_Leist = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(CInt(sbLeistender._value))
|
||||
Else
|
||||
UStV_Leist = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(sbLeistender._value)
|
||||
End If
|
||||
|
||||
UStV_POS.UStVPo_Leistender = UStV_Leist.UStV_Leistender
|
||||
If UStV_Leist.UStV_LeistenderId > 0 Then UStV_POS.UStVPo_LeistenderId = UStV_Leist.UStV_LeistenderId
|
||||
@@ -217,7 +224,9 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
lblAenderungsdatum.Text = Now.ToString("dd.MM.yyyy HH:mm")
|
||||
' If e.Column.ColumnName = "Sachbearbeiter" Or e.Column.ColumnName = "Änderungsdatum" Then Exit Sub
|
||||
If save() Then RaiseEvent CHANGED(UStV_POS.UStVPo_ID)
|
||||
If save() Then
|
||||
RaiseEvent CHANGED(UStV_POS.UStVPo_ID)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -227,13 +236,24 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
|
||||
'If newLeistender <> "" Then UStV_Leist = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(newLeistender)
|
||||
|
||||
pnlAdresse.Enabled = True 'enablePanel 'immer änderbar!
|
||||
txtStrasse.Text = If(UStV_Leist.UstV_Leistender_Strasse, "")
|
||||
txtStrassenNr.Text = If(UStV_Leist.UstV_Leistender_StrasseNr, "")
|
||||
txtPLZ.Text = If(UStV_Leist.UstV_Leistender_PLZ, "")
|
||||
txtOrt.Text = If(UStV_Leist.UstV_Leistender_Stadt, "")
|
||||
txtLand.Text = If(UStV_Leist.UstV_Leistender_Land, "")
|
||||
txtUIDNr.Text = If(UStV_Leist.UstV_Leistender_UstNr, "")
|
||||
If UStV_Leist Is Nothing Then
|
||||
txtStrasse.Text = ""
|
||||
txtStrassenNr.Text = ""
|
||||
txtPLZ.Text = ""
|
||||
txtOrt.Text = ""
|
||||
txtLand.Text = ""
|
||||
txtUIDNr.Text = ""
|
||||
|
||||
Else
|
||||
|
||||
pnlAdresse.Enabled = True 'enablePanel 'immer änderbar!
|
||||
txtStrasse.Text = If(UStV_Leist.UstV_Leistender_Strasse, "")
|
||||
txtStrassenNr.Text = If(UStV_Leist.UstV_Leistender_StrasseNr, "")
|
||||
txtPLZ.Text = If(UStV_Leist.UstV_Leistender_PLZ, "")
|
||||
txtOrt.Text = If(UStV_Leist.UstV_Leistender_Stadt, "")
|
||||
txtLand.Text = If(UStV_Leist.UstV_Leistender_Land, "")
|
||||
txtUIDNr.Text = If(UStV_Leist.UstV_Leistender_UstNr, "")
|
||||
End If
|
||||
|
||||
btnLeistenderSave.Visible = True
|
||||
|
||||
@@ -375,6 +395,8 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
End If
|
||||
|
||||
loadChangedDSToPanel(UStV_Leist)
|
||||
Else
|
||||
loadChangedDSToPanel(Nothing)
|
||||
End If
|
||||
|
||||
|
||||
@@ -403,24 +425,29 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
If sender Is txtUSTBetrag Then
|
||||
If IsNumeric(txtUSTBetrag.Text) AndAlso IsNumeric(txtUmrechnungskurs.Text) Then
|
||||
|
||||
'Umrechnung bei Währung <> EUR im Antrag!
|
||||
Dim antr As New cUSTVAntrag(UStV_POS.UStVAn_ID)
|
||||
If CDbl(UStV_POS.UStVPo_USteuerbetrag) <> CDbl(txtUSTBetrag.Text) 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 txtUmrechnungskurs.Text = 1 Or txtUmrechnungskurs.Text = "" Then
|
||||
Dim kurs As New cEZB_Waehrungskurse(antr.UStVAn_Währungscode)
|
||||
txtUmrechnungskurs.Text = kurs.ezb_kurs
|
||||
End If
|
||||
|
||||
If antr.UStVAn_Währungscode <> "EUR" AndAlso IsDate(UStV_POS.UStVPo_ReDat) Then
|
||||
If txtUmrechnungskurs.Text = 1 Or txtUmrechnungskurs.Text = "" Then
|
||||
Dim kurs As New cEZB_Waehrungskurse(antr.UStVAn_Währungscode)
|
||||
txtUmrechnungskurs.Text = kurs.ezb_kurs
|
||||
End If
|
||||
|
||||
|
||||
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
|
||||
txtChanged = True
|
||||
End If
|
||||
|
||||
|
||||
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
|
||||
txtChanged = True
|
||||
End If
|
||||
|
||||
ElseIf sender Is txtUSTBetragEUR Then
|
||||
|
||||
|
||||
|
||||
'so herum nicht umrechnen!!!!
|
||||
'If IsNumeric(txtUSTBetragEUR._value) AndAlso IsNumeric(txtUmrechnungskurs._value) Then
|
||||
' txtUSTBetrag.Text = Math.Floor((txtUSTBetragEUR._value * txtUmrechnungskurs._value) * 100 + 0.5) / 100
|
||||
@@ -430,42 +457,50 @@ Public Class ustCntlUSTV_AntragPosition
|
||||
|
||||
If IsNumeric(txtUSTBetragEUR.Text) AndAlso IsNumeric(txtUSTBetrag.Text) Then
|
||||
|
||||
Dim zahl1 = txtUSTBetragEUR.Text / txtUSTBetrag.Text
|
||||
If CDbl(UStV_POS.UStVPo_USteuerbetragEUR) <> CDbl(txtUSTBetragEUR.Text) Then
|
||||
|
||||
txtUmrechnungskurs.Text = zahl1
|
||||
txtChanged = True
|
||||
Dim zahl1 = txtUSTBetragEUR.Text / txtUSTBetrag.Text
|
||||
|
||||
txtUmrechnungskurs.Text = zahl1
|
||||
txtChanged = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ElseIf sender Is txtUmrechnungskurs Then
|
||||
|
||||
|
||||
If IsNumeric(txtUSTBetrag.Text) AndAlso IsNumeric(txtUmrechnungskurs._value) Then
|
||||
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
|
||||
txtChanged = True
|
||||
|
||||
If UStV_POS.UStVPo_Umrechnungskurs <> txtUmrechnungskurs.Text.Replace(",", ".") Then
|
||||
|
||||
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
|
||||
txtChanged = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
ElseIf sender Is sbLeistender Then
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user