fakt, offeneAntr, Übersetzungen RO, etc.
This commit is contained in:
@@ -1592,10 +1592,17 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
|
||||
'check if already existing 'überschneidungen prüfen!!!!
|
||||
Dim anzUSTVA = CInt((New SQL).getValueTxtBySql("Select count(*) from tblUStVAntrag where UStvAN_KuNr = " & KundenNr & " and (isnull(UStVAn_AntragArt,'MWST') = '" & cboAntragArt._value & "' or UStVAn_AntragArt = '') and UStVAn_LandNr = " & USTV_ANTRAG.UStVAn_LandNr & "
|
||||
AND not((cast(UStVAn_ReDatvon as date) > '" & CDate(txtVon._value).ToShortDateString & "' or cast(UStVAn_ReDatBis as date) < '" & CDate(txtBis._value).ToShortDateString & "'))", "FMZOLL"))
|
||||
|
||||
If anzUSTVA > 0 Then
|
||||
|
||||
Dim dt_existingUSTVA As DataTable = SQL.loadDgvBySql("Select UStVAn_ID,UStVAn_ReDatvon, UStVAn_ReDatBis from tblUStVAntrag where UStvAN_KuNr = " & KundenNr & " and (isnull(UStVAn_AntragArt,'MWST') = '" & cboAntragArt._value & "' or UStVAn_AntragArt = '') and UStVAn_LandNr = " & USTV_ANTRAG.UStVAn_LandNr & "
|
||||
AND not ((cast(UStVAn_ReDatvon as date) > '" & CDate(txtVon._value).ToShortDateString & "' or cast(UStVAn_ReDatBis as date) <= '" & CDate(txtVon._value).ToShortDateString & "' ) and (cast(UStVAn_ReDatBis as date) < '" & CDate(txtBis._value).ToShortDateString & "' or cast(UStVAn_ReDatvon as date) >= '" & CDate(txtBis._value).ToShortDateString & "'))", "FMZOLL")
|
||||
|
||||
'Dim anzUSTVA = CInt((New SQL).getValueTxtBySql("Select count(*) from tblUStVAntrag where UStvAN_KuNr = " & KundenNr & " and (isnull(UStVAn_AntragArt,'MWST') = '" & cboAntragArt._value & "' or UStVAn_AntragArt = '') and UStVAn_LandNr = " & USTV_ANTRAG.UStVAn_LandNr & "
|
||||
' AND not ((cast(UStVAn_ReDatvon as date) > '" & CDate(txtVon._value).ToShortDateString & "' and cast(UStVAn_ReDatBis as date) <= '" & CDate(txtVon._value).ToShortDateString & "') or (cast(UStVAn_ReDatvon as date) < '" & CDate(txtBis._value).ToShortDateString & "' and cast(UStVAn_ReDatBis as date) >= '" & CDate(txtBis._value).ToShortDateString & "'))", "FMZOLL"))
|
||||
|
||||
If dt_existingUSTVA.Rows.Count = 1 Then
|
||||
If Not vbYes = MsgBox("Es existiert bereits ein" & cboAntragArt._value & " -Eintrag von " & dt_existingUSTVA.Rows(0).Item("UStVAn_ReDatvon") & " - " & dt_existingUSTVA.Rows(0).Item("UStVAn_ReDatbis") & " von " & ADR.Name_1 & " für " & cbxLand.SelectedItem.ToString & vbNewLine & "Trotzdem Antrag speichern?", vbYesNoCancel) Then Exit Sub
|
||||
ElseIf dt_existingUSTVA.Rows.Count > 1 Then
|
||||
If Not vbYes = MsgBox("Es existiert bereits mind. ein " & cboAntragArt._value & " -Eintrag in diesem Zeitbereich von " & ADR.Name_1 & " für " & cbxLand.SelectedItem.ToString & vbNewLine & "Trotzdem Antrag speichern?", vbYesNoCancel) Then Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
@@ -677,7 +677,7 @@ Public Class frmUSTVoffeneAntraege
|
||||
|
||||
|
||||
|
||||
Dim sqlstring = "select isnull(UStVAn_ID,0) as antragExisitiert,tblSteuernummern.UStV as UStV,Lieferant , KdNr, Kundenname, Kundenland, Einreichland from (" & SQLPLOSEUMSTELLUNG & "
|
||||
Dim sqlstring = "select isnull(UStVAn_ID,0) as antragExisitiert,cast(case when isnull(UStVAn_AntragEingereichtAm,0) = 0 then 0 else 1 end as bit) as eingereicht,tblSteuernummern.UStV as UStV,Lieferant , KdNr, Kundenname, Kundenland, Einreichland from (" & SQLPLOSEUMSTELLUNG & "
|
||||
|
||||
UNION ALL
|
||||
|
||||
@@ -779,15 +779,10 @@ Public Class frmUSTVoffeneAntraege
|
||||
left join tblUStVAntrag on UStVAn_KuNr = temp.kdnr and UStVAn_ReDatVon <= temp.Rechnungsdatum and UStVAn_ReDatBis >= temp.Rechnungsdatum and [Länderverzeichnis für die Außenhandelsstatistik].LandNr = UStVAn_LandNr and isnull(UStVAn_AntragArt,'MWST') = 'MWST'
|
||||
left JOIN tblSteuernummern On temp.Einreichland = tblSteuernummern.LandKz and KdNr = tblSteuernummern.AdressenNr
|
||||
where 1 = 1 and isnull(kde_keineMWSt,0) = 0 " & sqlwhereLand & sqlwhereSteuerNr &
|
||||
" group by isnull(UStVAn_ID,0) , Lieferant, KdNr, Kundenname,Kundenland, Einreichland, tblSteuernummern.UStV"
|
||||
" group by isnull(UStVAn_ID,0) , Lieferant, KdNr, Kundenname,Kundenland, Einreichland, tblSteuernummern.UStV, case when isnull(UStVAn_AntragEingereichtAm,0) = 0 then 0 else 1 end "
|
||||
|
||||
Dim SQLWhere = ""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.SET_SQL(sqlstring, "FMZOLL")
|
||||
.LOAD()
|
||||
If .Columns.Count > 0 Then
|
||||
@@ -797,6 +792,7 @@ Public Class frmUSTVoffeneAntraege
|
||||
.Columns("Kundenname").HeaderText = "Kunde"
|
||||
.Columns("Kundenland").HeaderText = "Kundenland"
|
||||
.Columns("Einreichland").HeaderText = "Einreichland"
|
||||
.Columns("eingereicht").HeaderText = "einger."
|
||||
.Columns("Kundenname").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
|
||||
@@ -961,13 +957,14 @@ Public Class frmUSTVoffeneAntraege
|
||||
Dim index As Integer = -1
|
||||
If (MyDatagridview1.SelectedRows.Count > 0) Then index = MyDatagridview1.SelectedRows(0).Index
|
||||
|
||||
If MyDatagridview1.SelectedRows(0).Cells("antragExisitiert").Value > 0 Then
|
||||
If MyDatagridview1.SelectedRows(0).Cells("antragExisitiert").Value > 0 AndAlso Not MyDatagridview1.SelectedRows(0).Cells("eingereicht").Value Then
|
||||
|
||||
Dim frm = New frmMDM_USTVAntrag(MyDatagridview1.SelectedRows(0).Cells("antragExisitiert").Value)
|
||||
frm.ShowDialog()
|
||||
|
||||
Else
|
||||
|
||||
|
||||
Dim frm = New frmMDM_USTVAntrag(MyDatagridview1.SelectedRows(0).Cells("KdNr").Value, MyDatagridview1.SelectedRows(0).Cells("Einreichland").Value, dat_Sum_Von.Value, dat_Sum_Bis.Value)
|
||||
frm.ShowDialog()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user