ustva-> dokumente löschen

This commit is contained in:
2025-04-22 18:10:04 +02:00
parent 40482b9841
commit d46d9b758f
3 changed files with 106 additions and 31 deletions

View File

@@ -814,14 +814,42 @@ Public Class usrCntlUSTV
Exit Sub
End If
'1. zuerst prüfen ob Pos aus Schnittstelle und ggf. unterbinden
For Each pos In del_antrag.POSITIONEN
If pos.UStVPo_SchnittstellenNr > 0 Then
MsgBox("Antrag enthält Positionen, die über die Schnittstelle geladen wurden." & vbNewLine & "Positionen manuell löschen.")
MsgBox("Antrag enthält Positionen, die über die Schnittstelle geladen wurden." & vbNewLine & "Positionen manuell löschen!")
Exit Sub
End If
Next
'2. nur Dokumente löschen, die nicht über Schnittstellen geladen wurden oder löschbar sind!
For Each pos In del_antrag.POSITIONEN
If pos.UStVPo_SchnittstellenNr < 0 OrElse pos.UStVPo_daId_loeschbar Then
If pos.UStVPo_daId < 0 Then
Dim DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "MDM", "MDM", "MDM_DATEN", "USTVA_" & pos.UStVAn_ID & "_" & pos.UStVPo_ID, "SONSTIGE", del_antrag.UStVAn_KuNr)
If DS IsNot Nothing Then DS.DELETE_COMPLETE()
ElseIf pos.UStVPo_daId > 0 Then
Dim DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER(pos.UStVPo_daId)
If DS IsNot Nothing AndAlso DS.da_id IsNot Nothing Then
DS.DELETE_COMPLETE()
End If
End If
End If
Next
If del_antrag.DELETE() Then
init()
End If