Declare Anzahl%, ia%,vor!,vor$,vor1$,aus!,aus$,spe!,spe$,summevor!,summeaus!,summespe!, Text$, Datum$
Declare Zeile%, D%,summevor$,summeaus$,summespe$,e%,Anzahl$,Aktuell$,aktuell%,div!
Declare Prev%, Next%, Neu%, First%, Last%, Ende%,Entf%, Schreib%, Reorg%
Set("Decimals",2)
Anzahl%=@db("Open", #1,"Reisekosten.DBF")[B][/B]
@db("Use", #1)
ia% = 1
@db("GetField", ia%)
Anzahl$=Anzahl%
D% = @Create("Dialog",%HWnd,"Spesenabrechnung",0,0,970,860)
anfang
proc anfang
WhileNot ia% > Anzahl%
@db("Go", "*",ia%)
vor!=val(@db("get","Vorschuss"))
vor$=@db("get","Vorschuss")
aus!=val(@db("get","Ausgaben"))
aus$=@db("get","Ausgaben")
spe!=val(@db("get","Spesen"))
spe$=@db("get","Spesen")
datum$=@dtoc$(@db("Get", "DATUM"))
text$=@db("get","Text")
summevor!=vor!+summevor!val(@db("get","SummeVor"))
summevor$=summevor!
summeaus!=aus!+summeaus!@db("get","summeaus")
summeaus$=summeaus!
summespe!=spe!+summespe!@db("get","summespe")
summespe$=summespe!
div!=summevor!-(Summeaus!+summespe!)
anzeigen
Inc ia%
endwhile
endproc
abfrage
@db("Close", #1)
end
Proc Abfrage
Prev% = @Create("Button",D%,"<" , 40,750, 20,30)
Next% = @Create("Button",D%,">" , 60,750, 20,30)
Neu% = @Create("Button",D%,"&Neu" , 20,790, 50,30)
Schreib% = @Create("Button",D%,"&Schreib" ,140,790, 70,30)
Reorg% = @Create("Button",D%,"&Reorg." ,210,790, 70,30)
Ende% = @Create("Button",D%,"&Ende" ,310,790, 70,30)
E% = 0
WhileNot E%
WaitInput
If %Key = 13
Schreibsatz
ElseIf @Clicked(Ende%)
E% = 1
ElseIf @Clicked(Neu%)
Schreibsatz
@db("PutRec",0)
@db("AppendBlank")
GetSatz
ElseIf @Clicked(Schreib%)
Schreibsatz
@db("PutRec",0)
@db("AppendBlank")
GetSatz
ElseIf @Clicked(Prev%)
@db("Go","<")
GetSatz
Datensatz
-----------------------------------------
ElseIf @Clicked(Next%)
@db("Go",">")
GetSatz
Datensatz
ElseIf @Clicked(Reorg%)
ReOrg
GetSatz
Else
SchreibSatz
EndIf
EndWhile
Endproc
PROC SchreibSatz
@db("PutField","Datum" ,GetText$(Datum$))
@db("Put","Vorschuss" ,Vor$)
@db("PutField",aktuell% ,GetText$(Aus$))
@db("PutField","Spesen" ,GetText$(Spe$))
@db("PutField","Text" ,GetText$(Text$))
@db("PutField","SummeVor" ,GetText$(SummeVor$))
@db("PutField","SummeAus" ,GetText$(SummeAus$))
@db("PutField","SummeSpe" ,GetText$(SummeSpe$))
@db("PutRec",aktuell$)
ENDPROC
proc Anzeigen
Zeile% =Zeile% + 25
@Create("Text",D%,"Datum:" , 20,5,90,20)
@Create("Text",D%,"Vorschuss:",120,5,90,20)
@Create("Text",D%,"Ausgaben:" ,230,5,90,20)
@Create("Text",D%,"Spesen:" ,330,5,90,20)
@Create("Text",D%,"Text:" ,440,5,90,20)
@Create("Text",D%,"SummeVor" ,120,700,90,20)
@Create("Text",D%,"SummeAus" ,230,700,90,20)
@Create("Text",D%,"SummeSpe" ,330,700,90,20)
@Create("Text",D%,Datum$ , 20,Zeile%,90,20)
@Create("Text",D%,vor$ ,120,Zeile%,90,20)
@Create("Text",D%,aus$ ,230,Zeile%,90,20)
@Create("Text",D%,spe$ ,330,Zeile%,90,20)
@Create("Text",D%,text$ ,440,Zeile%,400,20)
@create("Text",D%,summevor$ ,120,720,90,25)
@create("Text",D%,summeaus$ ,230,720,90,25)
@create("Text",D%,summespe$ ,330,720,90,25)
@create("Text",D%,"Datensatz" , 20,620,90,20)
@Create("Text",D%,Anzahl$ ,120,620,90,25)
@Create("Edit",D%,Datum$ , 20,600,90,20)
@Create("Edit",D%,vor$ ,120,600,90,20)
@Create("Edit",D%,aus$ ,230,600,90,20)
@Create("Edit",D%,spe$ ,330,600,90,20)
@Create("Edit",D%,text$ ,440,600,400,20)
endproc
proc Datensatz
@Create("Edit",D%,Datum$,20,600,90,20)
@Create("Edit",D%,vor$,120,600,90,20)
@Create("Edit",D%,aus$,230,600,90,20)
@Create("Edit",D%,spe$,330,600,90,20)
@Create("Edit",D%,text$,440,600,400,20)
@create("Text",D%,"Datensatz",20,620,90,20)
Aktuell$=&dbRecNo
aktuell%=val(aktuell$)
@Create("Text",D%,Aktuell$,120,620,90,25)
@Create("Edit",D%,Aktuell%,160,620,90,25)
endproc
PROC GetSatz
Datum$=@dtoc$(@db("Get","Datum"))
vor$= @db("Get","Vorschuss")
aus$ = @db("Get","Ausgaben")
Spe$ = @db("Get","Spesen")
Text$= @db(ss=s3>"Get","Text")
ENDPROC