Attribute VB_Name = "eigenv"


Public Liste(10000) As liste_element
Public kart_liste(1000) As kart_element
Public cnt As Long
Public kartcnt As Integer
Public sema1, sema2, sema3, sema4 As Boolean

Public vpi As Double, vrm As Double, mcproz As Double
Public sammel, nachkjn As Boolean

Public ovkexcl As String, ovkincl As String
Public oanr, last_kart As String
Public dat_start_left, dat_start_top As Integer

Type kart_element
    NR As String
    BEZ As String
End Type

Type liste_element
    EVNR As String
    ANR As String
    MEVKE As String
    DATUM As String
    BEZ1 As String
    GRUND As String
    HKART As String
    UKART As String
    VKE As String
    LKNR As String
End Type

Function liste_pack(ByVal ad1 As String) As liste_element
  With liste_pack
     .EVNR = Piece(ad1, tr, 1)
     .DATUM = Piece(ad1, tr, 2)
     .ANR = Piece(ad1, tr, 3)
     .BEZ1 = Piece(ad1, tr, 4)
     .MEVKE = Piece(ad1, tr, 5)
     .VKE = Piece(ad1, tr, 6)
     .GRUND = Piece(ad1, tr, 7)
     .HKART = Piece(ad1, tr, 8)
     .UKART = Piece(ad1, tr, 9)
     .LKNR = Piece(ad1, tr, 10)
  End With
End Function


Sub vis1(ByVal sammel As Boolean, ByVal nachkjn As Boolean)
With FMDaten
.BEZ1.Enabled = sammel
.BEZ2.Enabled = sammel
.BEZ3.Enabled = sammel
.VKE1.Enabled = sammel
.VKE2.Enabled = sammel
.VRE.Enabled = sammel
.VPE.Enabled = sammel
.VKINCL.Enabled = sammel
.VKEXCL.Enabled = False
.EST.Enabled = sammel
If .EST.Value <> 0 Then .EST.Enabled = False
.MEVKE.MaskDecimalFixed = nachkjn
.MEVKE1.MaskDecimalFixed = nachkjn
.MEVPE.MaskDecimalFixed = nachkjn
.MEVRE.MaskDecimalFixed = True
If nachkjn Then
 .MEVKE.MaskDecimalPlaces = 2
 .MEVKE1.MaskDecimalPlaces = 2
 .MEVPE.MaskDecimalPlaces = 2
 .MEVRE.MaskDecimalPlaces = 2
 Else
 .MEVKE.MaskDecimalPlaces = 0
 .MEVKE1.MaskDecimalPlaces = 0
 .MEVPE.MaskDecimalPlaces = 0
 .MEVRE.MaskDecimalPlaces = 2
End If
DoEvents
End With
End Sub

Function div0(ByVal S As String) As String
If CVar(S) = 0 Then
  div0 = 1
 Else
  div0 = S
End If
End Function

Sub anw_beenden()
    
    End

End Sub

Sub getdata1()

sema3 = True
Dim ad As String
If cnt = 0 Then
  FMDaten.Visible = False
  sstatus = ""
  If FMStart.CHErf.Value Then sstatus = "0"
  sdatum1 = ""
  If FMStart.SDATUM.Text <> "" Then sdatum1 = da_vb_msm(FMStart.SDATUM.DateValue)
  ad = dbcall("D GET1F^BMUEGVA(""" + sdatum1 + """,""" + FMStart.SPCODE.Text + """,""" + sstatus + """)")
 Else
  ad = dbcall("D GET1N^BMUEGVA")
End If

qsw = False
For i = 1 To 10
   ad1 = Piece(ad, Chr(255), i)
   If ad1 = "" Then
        qsw = True
        Exit For
    End If
   cnt = cnt + 1
   Liste(cnt) = liste_pack(ad1)
Next

If qsw Then
   FMStart.LIST.ListCount = cnt * 1
   FMStart.LIST.ReDraw
   FMStart.LIST.ItemSelect = cnt
   FMStart.LIST.ReDraw
Else
   FMStart.LIST.ListCount = cnt * 1.2
End If
sema3 = False

End Sub

Function Kart_Tst() As String

text1 = ""
For i = 1 To kartcnt
  If kart_liste(i).NR = FMDaten.KART.Text Then
    text1 = kart_liste(i).BEZ
    FMDaten.KARTS.Value = i
    Exit For
  End If
Next
Kart_Tst = text1

End Function
