hmg 3.4.1 error help
Moderator: Rathinagiri
hmg 3.4.1 error help
hi,
good evening
can you help me in resolving the following error ?
Unrecoverable error 9003: Too many recursive error handler calls
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from MYMAIN(12) in ub2911.prg
Called from MAIN(6) in ub2911.prg
best regards,
good evening
can you help me in resolving the following error ?
Unrecoverable error 9003: Too many recursive error handler calls
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from DEFERROR(73) in source\ErrorSys.prg
Called from (b)ERRORSYS(55) in source\ErrorSys.prg
Called from MYMAIN(12) in ub2911.prg
Called from MAIN(6) in ub2911.prg
best regards,
-
- Posts: 245
- Joined: Sat Aug 02, 2008 5:03 pm
Re: hmg 3.4.1 error help
Hi
can you post the related code of ub2911.prg. MYMAIN() and MAIN
In this way someone can help you
can you post the related code of ub2911.prg. MYMAIN() and MAIN
In this way someone can help you
Regards/Saludos, Carlos (bcd12a)
Re: hmg 3.4.1 error help
hi
good evening
total source code is here
# include <hmg.ch>
//REQUEST HB_GT_WIN_DEFAULT
FUNCTION MAIN
set date brit
set century on
set font to "ms san sarif",15
SET TOOLTIPSTYLE BALLOON
# define RNDCOLOR {RANDOM(255),RANDOM(255),RANDOM(255)}
# define my_red {255,0,0}
# define my_green {0,255,0}
DEFINE WINDOW winK AT 138 , 235 WIDTH 1004 HEIGHT 430 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE 'software developedment assisted by kirit b. ved @9869015508/09167551554' ICON NIL NOSIZE CURSOR NIL ON INIT NIL ON RELEASE NIL ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE NIL ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil main
define main menu
define popup 'accounts'
menuitem 'accounts normal hotkey alt+a' action acc_main()
separator
menuitem 'account-speed entry hotkey alt+s' action acc_se()
separator
menuitem 'print ledger hotkey alt+l' action my_print()
end popup
define popup 'credits'
menuitem 'credit hotkey alt+c' action credits()
separator
menuitem 'credit speed entry alt+q' action cred_se()
separator
menuitem 'credit report alt+r' action cr_rep()
end popup
define popup 'quit'
menuitem 'quit program' action (wink.release)
end popup
end menu
DEFINE IMAGE Image_1
ROW 0
COL 0
WIDTH 1606
HEIGHT 137
PICTURE "header.bmp"
HELPID Nil
VISIBLE .T.
STRETCH .T.
ACTION Nil
END IMAGE
on key ALT+A of win action acc_main()
on key ALT+S of win action acc_se()
on key ALT+L of win action my_print()
on key ALT+c of win action credits()
on key ALT+q of win action cred_se()
END WINDOW
maximize window winK
ACTIVATE WINDOW WINK
retu
procedure acc_main
open_win1()
retu nil
function gen_dbf
if !file("acc.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','c',1,0})
dbcreate("acc",sdbf)
endif
retu nil
function gen_ind()
sele 0
use acc alias acc
if !file("acc.ntx")
inde on srno to acc
endif
if !file("acc1.ntx")
inde on dtoc(tran_dt) to acc1
endif
set index to acc.NTX,acc1.NTX
set order to 1
return nil
procedure open_win1
DEFINE WINDOW win1 AT 132 , 235 WIDTH 1200 HEIGHT 800 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm1(),gen_dbf() ,gen_ind()) ON RELEASE CD() ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 70
COL 230
WIDTH 520
HEIGHT 40
VALUE "account data entry form"
FONTNAME "Arial"
FONTSIZE 16
TOOLTIP ""
FONTBOLD .T.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 180
COL 200
WIDTH 120
HEIGHT 24
VALUE "serial number :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 180
COL 390
WIDTH 120
HEIGHT 24
field acc->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 230
COL 200
WIDTH 120
HEIGHT 24
VALUE "transaction date :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 230
COL 390
WIDTH 120
HEIGHT 24
field acc->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 280
COL 200
WIDTH 120
HEIGHT 24
VALUE "narration :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 280
COL 390
WIDTH 200
HEIGHT 100
field acc->narr
VALUE ""
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
MAXLENGTH 100
END EDITBOX
DEFINE LABEL Label_5
ROW 450
COL 200
WIDTH 120
HEIGHT 24
VALUE "amount :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_3
ROW 450
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->amt
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .T.
VALUE Nil
END TEXTBOX
DEFINE TEXTBOX Text_4
ROW 510
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->rp
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS lb()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
tooltip 'enter only r or p for receipt & paid '
END TEXTBOX
DEFINE LABEL Label_6
ROW 510
COL 200
WIDTH 120
HEIGHT 50
VALUE "mode of payment (received or paid)"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
@ 400 ,650 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc()
win1.lb.visible:=.f.
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh1() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh1() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh1() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh1() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( Save() , Refresh1() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh1() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del(),Refresh1() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add1() ) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search1()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept1())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel1())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 650
HEIGHT 800
VALUE 0
WIDTHS {100,100,100,100,400}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA acc
FIELDS {'acc->srno','acc->tran_dt' ,'acc->amt','acc->rp','acc->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE refresh11()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR NIL
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find())
END WINDOW
maximize window win1
activate window win1
retu nil
Procedure Refresh1
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.edit_1.Refresh
win1.Text_3.Refresh
win1.text_4.Refresh
m:=recno()
win1.browse_1.value:=m
win1.browse_1.refresh
Return
Procedure Refresh11
m:= win1.browse_1.value
go m
/*
win1.text_1.value:=acc->srno
win1.text_2.value:=acc->tran_dt
win1.edit_1.value:=acc->narr
win1.text_3.value:=acc->amt
win1.text_4.value:=acc->rp
*/
refresh1()
Return
/*
text_1
edit_1
monthcal_1
text_2
check_1
*/
procedure bm1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure Save
Win1.Text_1.Save
Win1.Text_2.Save
win1.text_3.save
win1.edit_1.save
win1.text_4.save
Return
procedure my_del
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh()
endif
retu
procedure my_add1
dbgobottom()
skip 1
refresh1()
win1.text_2.value:=date()
win1.b_accept.enabled := .t.
win1.b_cancel.enabled:= .t.
win1.toolbar_1.top.enabled:=.f.
win1.toolbar_1.next.enabled:=.f.
win1.toolbar_1.previous.enabled:=.f.
win1.toolbar_1.bottom.enabled:=.f.
win1.toolbar_1.save.enabled:=.f.
win1.toolbar_1.gundo.enabled:=.f.
win1.toolbar_1.delete.enabled:=.f.
win1.toolbar_1.add.enabled:=.f.
win1.toolbar_1.find.enabled:=.f.
retu
procedure my_search1
win1.label_61.visible:= .t.
win1.text_61.visible:= .t.
win1.b_1.visible:= .t.
win1.text_61.setfocus
retu
procedure my_accept1
if my_valid(win1.text_1.value,"acc")
dbappend()
acc->srno:=win1.text_1.value
acc->tran_dt:=win1.text_2.value
acc->narr:=win1.edit_1.value
acc->amt:=win1.text_3.value
acc->rp:=win1.text_4.value
else
dbgotop()
endif
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
win1.toolbar_1.find.enabled:=.t.
refresh1()
retu
procedure my_cancel1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
refresh()
retu
Procedure my_Refresh1
m:=win1.browse_1.value
go m
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.text_3.refresh
win1.edit_1.refresh
win1.text_4.refresh
Return
procedure my_find
//local rs:=alltrim(lower(win1.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele acc
set filter to alltrim(lower(win1.text_61.value)) $ narr
go top
refresh()
my_refresh()
set filter to
sele &save_sel
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure my_Refresh
m:=win1.browse_1.value
go m
Win1.Text_1.Refresh
Win1.Text_2.Refresh
win1.text_3.refresh
win1.text_4.refresh
Return
Procedure Refresh
Win1.Text_1.Refresh
Win1.Text_2.Refresh
Win1.Text_3.Refresh
Win1.Text_4.Refresh
win1.browse_1.value:=recno()
win1.browse_1.refresh
Return
function my_valid(s,als)
local rl:=.f.,rn,save_sel
if len(alltrim(s)) > 0
rl:=.t.
else
msginfo("code can not be blank")
win1.text_1.setfocus
endif
if rl==.t.
save_sel:=alias()
sele &als
seek s
if found()
rl:=.f.
msginfo("code already exists in database")
win1.text_1.setfocus
endif
sele &save_sel
endif
retu rl
function pqr
local rv
select acc
if acc->rp="r"
rv:=1
else
rv:=2
endif
retu rv
procedure qwe
my:={'r','p'}
retu nil
//syntex for the function chk is chk({'flat','shop'},"s")
function chk(a,b)
local r:=0
local p:=0
k:=len(a)
for i=1 to k
r=chk1(a,b)
if r==1
p:=i
exit
endif
next
retu p
function chk1(p,q)
local r:=0
if p == q
r:=1
endif
retu r
procedure lb
if chk({'r','p'}, win1.text_4.value)=0
win1.lb.visible:=.t.
win1.lb.setfocus
endif
retu nil
procedure lbproc
win1.text_4.value:=win1.lb.item(win1.lb.value)
win1.lb.visible:=.f.
retu nil
PROCEDURE CD
CLOSE ALL
RETU
PROCEDURE meri_jaan
run d.exe
RUN DEL *.NTX)
retu
procedure acc_se
define window win2 at 0, 0 height 600 width 600 title 'hi' on init (od(),se()) on release cd1() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50}
HEADERS {'narration ','receipt/paid','amount'}
WORKAREA acc
FIELDS {'acc->narr','acc->rp','acc->amt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr1(),se())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr1())
@ 60, 540 button btn_4 caption 'exit ' on click (win2.release)
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
win2.lb.visible:=.f.
end window
maximize window win2
activate window win2
retu nil
procedure od
use acc alias acc new
select acc
retu nil
procedure cd1
use
run del *.ntx
retu nil
procedure acc_sa
retu
procedure se
win2.text_1.value:=space(40)
win2.text_2.value:=space(40)
win2.text_3.value:='r'
win2.text_4.value:=0
win2.text_1.setfocus
retu
procedure pqr1()
local m1
local m2 :=date()
go bott
m3:=val(acc->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(win2.text_1.value)+' '+alltrim(win2.text_2.value)
repl rp with win2.text_3.value
repl amt with win2.text_4.value
go top
win2.browse_1.refresh
retu nil
procedure lb1
if chk({'r','p'}, win2.text_3.value)=0
MessageBoxTimeout('only r for receipt & p for paid is allowed here','attention',0,3000)
win2.text_3.setfocus
endif
retu nil
procedure lbproc1
msginfo(win2.text_3.value)
retu nil
procedure my_print
set date brit
set century on
DEFINE WINDOW winx AT 138 , 235 WIDTH 808 HEIGHT 494 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil child
DEFINE LABEL Label_1
ROW 60
COL 170
WIDTH 450
HEIGHT 30
VALUE "printing of accounts between two dates"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE MONTHCALENDAR MonthCal_1
ROW 140
COL 140
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter start date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
DEFINE MONTHCALENDAR MonthCal_2
ROW 140
COL 430
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter end date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
/*
define textbox mc_1
row 400
col 140
//autosize .t.
width 100
date .t.
value winx.monthcal_1.value
end textbox
define textbox mc_2
row 400
col 430
width 100
date .t.
value winx.monthcal_2.value
//autosize .t.
end textbox
*/
DEFINE BUTTON Button_1
ROW 350
COL 350
WIDTH 100
HEIGHT 28
ACTION my_pxxx()
CAPTION "get ledger"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
PICTALIGNMENT TOP
END BUTTON
END WINDOW
center window winx
maximize window winx
activate window winx
retu
procedure mc
/*
winx.mc_1.value:=winx.monthcal_1.value
winx.mc_2.value:=winx.monthcal_2.value
*/
retu
procedure my_pxxx
my_od()
/*
set date brit
set century on
*/
go top
m1:=tran_dt
go bott
m2:=tran_dt
mdt1:=winx.monthcal_1.value
mdt2:=winx.monthcal_2.value
/*
if !( (mdt1>=m1 .and. mdt2<=m2 ) .or. (mdt2>=mdt1))
msginfo('dates must be between ' + dtoc(mdt1) +' & '+dtoc(mdt2) )
winx.monthcal_1.setfocus
endif
*/
go top
repl all fl1 with 1 for tran_dt< mdt1
repl all fl1 with 2 for tran_dt>=mdt1 .and. tran_dt<=mdt2
go top
sum(iif(rp='r',amt,-amt)) to myob for fl1=1
sum(iif(rp='r',amt,-amt)) to mycb for fl1=1 .or. fl1=2
if file('tmp.dbf')
run del tmp.dbf
endif
copy to tmp.dbf for fl1=2
use tmp new
appe blank
repl srno with '00000000'
repl narr with 'opening balance'
if myob>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(myob)
repl tran_dt with mdt1
appe blank
repl srno with '99999999'
repl narr with 'closing balance'
if mycb>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(mycb)
repl tran_dt with mdt2
inde on srno to tmp
go top
set print to tmp.txt
set devi to prin
set print on
set console off
set print to tmp.txt
?
if dtoc(mdt1) = dtoc(mdt2)
ms:='accounts of bhambhani enterprise for '+' ' + dtoc(mdt1)
else
ms:='accounts of bhambhani enterprise from '+' ' + dtoc(mdt1) + ' to '+dtoc(mdt2)
endif
?padc(ms,88)
?
? PADR('DATE',10)+' '+padr('narration',40)+' '+padC('amount',30)
? PADR(' ',50)+SPACE(10)+PADR('RECEIVED',10)+PADR('PAID',10)+PADR('CUM.TOTAL',10)
? replicate('-',88)
MYSUM:=0
mysum1:=0
mysum2:=0
m:=reccount()
s:=0
go top
do while ! eof()
s:=s+1
MYSUM:=MYSUM+iif(rp='r',amt,-amt)
if s=m
?replicate('-',88)
?padr('total',56)+str(mysum1,10,2)+str(mysum2,10,2)
?replicate('-',88)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+space(10) //STR(MYSUM,10,2)
else
mysum1:=mysum1+iif(rp='r',amt,0)
mysum2:=mysum2+iif(rp='r',0,amt)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+STR(MYSUM,10,2)
endif
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
run del *.ntx
close all
retu nil
procedure my_od
select 0
use acc alias acc new
inde on srno to acc
inde on dtos(tran_dt) to acc1
set order to 2
retu nil
procedure _se
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
BUTTON KBV;
CAPTION 'REPORT1';
ACTION (MEKBV());
TOOLTIP 'SEE DATA IN DIFFERENT FORMAT'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {100,100,80,100,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
procedure mekbv
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
define window mekbv at 20,800 height 800 width 700 backcolor RNDCOLOR
set order to 3
DEFINE BROWSE Browse_11
ROW 40
COL 50
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {100,100,80,80,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
define button b_0
row 680
col 250
caption 'quit'
action (mekbv.release)
end button
end window
activate window mekbv
retu nil
Procedure Refresh2
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.Refresh
winc.text_3.Refresh
winc.text_6.Refresh
winc.check_1.Refresh
winc.browse_1.value:=recno()
winc.browse_1.refresh
Return
procedure my_add2
winc.check_1.visible:=.f.
winc.label_6.visible:=.f.
winc.text_6.visible:=.f.
dbgobottom()
//
go bott
m3:=val(CRED->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
//
skip 1
refresh2()
winc.text_3.value:=date()
winc.text_1.value:=M1
winc.b_accept.enabled := .t.
winc.b_cancel.enabled:= .t.
winc.toolbar_1.top.enabled:=.f.
winc.toolbar_1.next.enabled:=.f.
winc.toolbar_1.previous.enabled:=.f.
winc.toolbar_1.bottom.enabled:=.f.
winc.toolbar_1.save.enabled:=.f.
winc.toolbar_1.gundo.enabled:=.f.
winc.toolbar_1.delete.enabled:=.f.
winc.toolbar_1.add.enabled:=.f.
winc.toolbar_1.find.enabled:=.f.
retu
procedure se1
winc.text_1.value:=space(8)
winc.text_2.value:=0
winc.edit_1.value:=space(80)
winc.text_3.value:=date
winc.text_3.value:=ctod(' / / ')
winc.check_1.value:=.f.
winc.text_1.setfocus
retu
Procedure my_Refresh2
m:=winc.browse_1.value
go m
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.refresh
winc.text_3.refresh
winc.text_6.refresh
winc.check_1.refresh
Return
procedure my_accept2
winc.check_1.visible:=.t.
winc.label_6.visible:=.t.
winc.text_6.visible:=.t.
if my_valid(winc.text_1.value,"cred")
dbappend()
cred->srno:=winc.text_1.value
cred->tran_dt:=winc.text_3.value
cred->narr:=winc.edit_1.value
cred->amt:=winc.text_2.value
cred->rp:=winc.check_1.value
cred->ret_dt:=winc.text_6.value
else
dbgotop()
endif
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
winc.toolbar_1.find.enabled:=.t.
refresh2()
retu
procedure my_cancel2
winc.check_1.visible:=.t.
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
refresh2()
retu
function gen_dbf1
if !file("cred.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{'ret_dt','d',8,0})
dbcreate("cred",sdbf)
endif
retu nil
function gen_ind1
sele 0
use cred alias cred
if !file("cred.ntx")
inde on srno to cred
endif
if !file("cred1.ntx")
inde on dtoc(tran_dt) to cred1
endif
if !file("cred2.ntx")
inde on if(rp,'1','0')+dtoc(tran_dt) to cred2
endif
set index to cred.NTX,cred1.NTX,cred2.ntx
set order to 1
//select cred
return nil
procedure od1
select cred
set order to 1
retu nil
Procedure Save1
Winc.Text_1.Save
Winc.Text_2.Save
winc.edit_1.save
winc.text_3.save
winc.text_6.save
winc.check_1.save
Return
procedure my_del1
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh2()
endif
retu
procedure bm2
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
procedure my_search2
winc.label_61.visible:= .t.
winc.text_61.visible:= .t.
winc.b_1.visible:= .t.
winc.text_61.setfocus
retu
procedure my_find1
//local rs:=alltrim(lower(winc.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele cred
set filter to alltrim(lower(winc.text_61.value)) $ narr
go top
refresh2()
my_refresh2()
set filter to
sele &save_sel
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
PROCEDURE KBV
LOCAL S1,S2
S1:=THIS.HEIGHT
S2:=THIS.WIDTH
MSGINFO(S1)
MSGINFO(S2)
RETU
procedure cr_rep
run del tmp1.dbf
gen_dbf11()
sele tmp1
appe from cred for rp=.f.
go top
do while ! eof()
msrno=tmp1->srno
mtran_dt=tmp1->tran_dt
mdys=date()-mtran_dt
repl dys with mdys
skip
enddo
gen_ind11()
set console off
set print on
set device to prin
set printer to tmp1.txt
?
ms:='credi reports of bhambhani enterprise'
?padc(ms,85)
?
? padr('date',10)+' '+padr('narration',40)+' '+padr('amount',10)+'pending for dys'
? replicate('-',85)
do while ! eof()
? padr(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+ ' '+str(amt,10,2) + ' '+str(dys,12,2)
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp1.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
close all
run del *.ntx
retu nil
function gen_dbf11
if !file("tmp1.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{ 'dys','n',12,2})
dbcreate("tmp1",sdbf)
endif
sele 0
use tmp1 alias tmp1
retu nil
function gen_ind11
sele tmp1
if !file("tmp1.ntx")
inde on (99999999-dys) to tmp1
endif
set index to tmp1.NTX
set order to 1
//tone(500,20)
return nil
procedure cred_se
define window winpqr at 0, 0 height 600 width 600 title 'hi' on init (odpqr(),se1pqr()) on release cd1pqr() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50,100,100}
HEADERS {'narration ','receipt/paid','amount','dt given','dt returned'}
WORKAREA cred
FIELDS {'cred->narr','cred->rp','cred->amt','cred->tran_dt','cred->ret_dt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
/*
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
*/
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr11(),se1pqr())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr11())
@ 60, 540 button btn_4 caption 'exit ' on click (winpqr.release)
/*
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
winpqr.lb.visible:=.f.
*/
end window
maximize window winpqr
activate window winpqr
retu nil
procedure se1pqr
winpqr.text_1.value:=space(40)
winpqr.text_2.value:=space(40)
//winpqr.text_3.value:='r'
winpqr.text_4.value:=0
winpqr.text_1.setfocus
retu
procedure pqr11()
local m1
local m2 :=date()
go bott
m3:=val(cred->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(winpqr.text_1.value)+' '+alltrim(winpqr.text_2.value)
//repl rp with winpqr.text_3.value
repl amt with winpqr.text_4.value
go top
winpqr.browse_1.refresh
retu nil
procedure odpqr
use cred alias cred new
select cred
retu nil
procedure cd1pqr
use
run del *.ntx
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
procedure credits
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
button kbv;
caption 'report';
action (mekbv());
tooltip 'see data in different format'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {50,100,80,20,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
good evening
total source code is here
# include <hmg.ch>
//REQUEST HB_GT_WIN_DEFAULT
FUNCTION MAIN
set date brit
set century on
set font to "ms san sarif",15
SET TOOLTIPSTYLE BALLOON
# define RNDCOLOR {RANDOM(255),RANDOM(255),RANDOM(255)}
# define my_red {255,0,0}
# define my_green {0,255,0}
DEFINE WINDOW winK AT 138 , 235 WIDTH 1004 HEIGHT 430 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE 'software developedment assisted by kirit b. ved @9869015508/09167551554' ICON NIL NOSIZE CURSOR NIL ON INIT NIL ON RELEASE NIL ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE NIL ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil main
define main menu
define popup 'accounts'
menuitem 'accounts normal hotkey alt+a' action acc_main()
separator
menuitem 'account-speed entry hotkey alt+s' action acc_se()
separator
menuitem 'print ledger hotkey alt+l' action my_print()
end popup
define popup 'credits'
menuitem 'credit hotkey alt+c' action credits()
separator
menuitem 'credit speed entry alt+q' action cred_se()
separator
menuitem 'credit report alt+r' action cr_rep()
end popup
define popup 'quit'
menuitem 'quit program' action (wink.release)
end popup
end menu
DEFINE IMAGE Image_1
ROW 0
COL 0
WIDTH 1606
HEIGHT 137
PICTURE "header.bmp"
HELPID Nil
VISIBLE .T.
STRETCH .T.
ACTION Nil
END IMAGE
on key ALT+A of win action acc_main()
on key ALT+S of win action acc_se()
on key ALT+L of win action my_print()
on key ALT+c of win action credits()
on key ALT+q of win action cred_se()
END WINDOW
maximize window winK
ACTIVATE WINDOW WINK
retu
procedure acc_main
open_win1()
retu nil
function gen_dbf
if !file("acc.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','c',1,0})
dbcreate("acc",sdbf)
endif
retu nil
function gen_ind()
sele 0
use acc alias acc
if !file("acc.ntx")
inde on srno to acc
endif
if !file("acc1.ntx")
inde on dtoc(tran_dt) to acc1
endif
set index to acc.NTX,acc1.NTX
set order to 1
return nil
procedure open_win1
DEFINE WINDOW win1 AT 132 , 235 WIDTH 1200 HEIGHT 800 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm1(),gen_dbf() ,gen_ind()) ON RELEASE CD() ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 70
COL 230
WIDTH 520
HEIGHT 40
VALUE "account data entry form"
FONTNAME "Arial"
FONTSIZE 16
TOOLTIP ""
FONTBOLD .T.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 180
COL 200
WIDTH 120
HEIGHT 24
VALUE "serial number :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 180
COL 390
WIDTH 120
HEIGHT 24
field acc->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 230
COL 200
WIDTH 120
HEIGHT 24
VALUE "transaction date :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 230
COL 390
WIDTH 120
HEIGHT 24
field acc->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 280
COL 200
WIDTH 120
HEIGHT 24
VALUE "narration :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 280
COL 390
WIDTH 200
HEIGHT 100
field acc->narr
VALUE ""
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
MAXLENGTH 100
END EDITBOX
DEFINE LABEL Label_5
ROW 450
COL 200
WIDTH 120
HEIGHT 24
VALUE "amount :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_3
ROW 450
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->amt
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .T.
VALUE Nil
END TEXTBOX
DEFINE TEXTBOX Text_4
ROW 510
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->rp
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS lb()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
tooltip 'enter only r or p for receipt & paid '
END TEXTBOX
DEFINE LABEL Label_6
ROW 510
COL 200
WIDTH 120
HEIGHT 50
VALUE "mode of payment (received or paid)"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
@ 400 ,650 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc()
win1.lb.visible:=.f.
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh1() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh1() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh1() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh1() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( Save() , Refresh1() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh1() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del(),Refresh1() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add1() ) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search1()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept1())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel1())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 650
HEIGHT 800
VALUE 0
WIDTHS {100,100,100,100,400}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA acc
FIELDS {'acc->srno','acc->tran_dt' ,'acc->amt','acc->rp','acc->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE refresh11()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR NIL
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find())
END WINDOW
maximize window win1
activate window win1
retu nil
Procedure Refresh1
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.edit_1.Refresh
win1.Text_3.Refresh
win1.text_4.Refresh
m:=recno()
win1.browse_1.value:=m
win1.browse_1.refresh
Return
Procedure Refresh11
m:= win1.browse_1.value
go m
/*
win1.text_1.value:=acc->srno
win1.text_2.value:=acc->tran_dt
win1.edit_1.value:=acc->narr
win1.text_3.value:=acc->amt
win1.text_4.value:=acc->rp
*/
refresh1()
Return
/*
text_1
edit_1
monthcal_1
text_2
check_1
*/
procedure bm1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure Save
Win1.Text_1.Save
Win1.Text_2.Save
win1.text_3.save
win1.edit_1.save
win1.text_4.save
Return
procedure my_del
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh()
endif
retu
procedure my_add1
dbgobottom()
skip 1
refresh1()
win1.text_2.value:=date()
win1.b_accept.enabled := .t.
win1.b_cancel.enabled:= .t.
win1.toolbar_1.top.enabled:=.f.
win1.toolbar_1.next.enabled:=.f.
win1.toolbar_1.previous.enabled:=.f.
win1.toolbar_1.bottom.enabled:=.f.
win1.toolbar_1.save.enabled:=.f.
win1.toolbar_1.gundo.enabled:=.f.
win1.toolbar_1.delete.enabled:=.f.
win1.toolbar_1.add.enabled:=.f.
win1.toolbar_1.find.enabled:=.f.
retu
procedure my_search1
win1.label_61.visible:= .t.
win1.text_61.visible:= .t.
win1.b_1.visible:= .t.
win1.text_61.setfocus
retu
procedure my_accept1
if my_valid(win1.text_1.value,"acc")
dbappend()
acc->srno:=win1.text_1.value
acc->tran_dt:=win1.text_2.value
acc->narr:=win1.edit_1.value
acc->amt:=win1.text_3.value
acc->rp:=win1.text_4.value
else
dbgotop()
endif
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
win1.toolbar_1.find.enabled:=.t.
refresh1()
retu
procedure my_cancel1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
refresh()
retu
Procedure my_Refresh1
m:=win1.browse_1.value
go m
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.text_3.refresh
win1.edit_1.refresh
win1.text_4.refresh
Return
procedure my_find
//local rs:=alltrim(lower(win1.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele acc
set filter to alltrim(lower(win1.text_61.value)) $ narr
go top
refresh()
my_refresh()
set filter to
sele &save_sel
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure my_Refresh
m:=win1.browse_1.value
go m
Win1.Text_1.Refresh
Win1.Text_2.Refresh
win1.text_3.refresh
win1.text_4.refresh
Return
Procedure Refresh
Win1.Text_1.Refresh
Win1.Text_2.Refresh
Win1.Text_3.Refresh
Win1.Text_4.Refresh
win1.browse_1.value:=recno()
win1.browse_1.refresh
Return
function my_valid(s,als)
local rl:=.f.,rn,save_sel
if len(alltrim(s)) > 0
rl:=.t.
else
msginfo("code can not be blank")
win1.text_1.setfocus
endif
if rl==.t.
save_sel:=alias()
sele &als
seek s
if found()
rl:=.f.
msginfo("code already exists in database")
win1.text_1.setfocus
endif
sele &save_sel
endif
retu rl
function pqr
local rv
select acc
if acc->rp="r"
rv:=1
else
rv:=2
endif
retu rv
procedure qwe
my:={'r','p'}
retu nil
//syntex for the function chk is chk({'flat','shop'},"s")
function chk(a,b)
local r:=0
local p:=0
k:=len(a)
for i=1 to k
r=chk1(a,b)
if r==1
p:=i
exit
endif
next
retu p
function chk1(p,q)
local r:=0
if p == q
r:=1
endif
retu r
procedure lb
if chk({'r','p'}, win1.text_4.value)=0
win1.lb.visible:=.t.
win1.lb.setfocus
endif
retu nil
procedure lbproc
win1.text_4.value:=win1.lb.item(win1.lb.value)
win1.lb.visible:=.f.
retu nil
PROCEDURE CD
CLOSE ALL
RETU
PROCEDURE meri_jaan
run d.exe
RUN DEL *.NTX)
retu
procedure acc_se
define window win2 at 0, 0 height 600 width 600 title 'hi' on init (od(),se()) on release cd1() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50}
HEADERS {'narration ','receipt/paid','amount'}
WORKAREA acc
FIELDS {'acc->narr','acc->rp','acc->amt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr1(),se())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr1())
@ 60, 540 button btn_4 caption 'exit ' on click (win2.release)
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
win2.lb.visible:=.f.
end window
maximize window win2
activate window win2
retu nil
procedure od
use acc alias acc new
select acc
retu nil
procedure cd1
use
run del *.ntx
retu nil
procedure acc_sa
retu
procedure se
win2.text_1.value:=space(40)
win2.text_2.value:=space(40)
win2.text_3.value:='r'
win2.text_4.value:=0
win2.text_1.setfocus
retu
procedure pqr1()
local m1
local m2 :=date()
go bott
m3:=val(acc->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(win2.text_1.value)+' '+alltrim(win2.text_2.value)
repl rp with win2.text_3.value
repl amt with win2.text_4.value
go top
win2.browse_1.refresh
retu nil
procedure lb1
if chk({'r','p'}, win2.text_3.value)=0
MessageBoxTimeout('only r for receipt & p for paid is allowed here','attention',0,3000)
win2.text_3.setfocus
endif
retu nil
procedure lbproc1
msginfo(win2.text_3.value)
retu nil
procedure my_print
set date brit
set century on
DEFINE WINDOW winx AT 138 , 235 WIDTH 808 HEIGHT 494 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil child
DEFINE LABEL Label_1
ROW 60
COL 170
WIDTH 450
HEIGHT 30
VALUE "printing of accounts between two dates"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE MONTHCALENDAR MonthCal_1
ROW 140
COL 140
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter start date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
DEFINE MONTHCALENDAR MonthCal_2
ROW 140
COL 430
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter end date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
/*
define textbox mc_1
row 400
col 140
//autosize .t.
width 100
date .t.
value winx.monthcal_1.value
end textbox
define textbox mc_2
row 400
col 430
width 100
date .t.
value winx.monthcal_2.value
//autosize .t.
end textbox
*/
DEFINE BUTTON Button_1
ROW 350
COL 350
WIDTH 100
HEIGHT 28
ACTION my_pxxx()
CAPTION "get ledger"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
PICTALIGNMENT TOP
END BUTTON
END WINDOW
center window winx
maximize window winx
activate window winx
retu
procedure mc
/*
winx.mc_1.value:=winx.monthcal_1.value
winx.mc_2.value:=winx.monthcal_2.value
*/
retu
procedure my_pxxx
my_od()
/*
set date brit
set century on
*/
go top
m1:=tran_dt
go bott
m2:=tran_dt
mdt1:=winx.monthcal_1.value
mdt2:=winx.monthcal_2.value
/*
if !( (mdt1>=m1 .and. mdt2<=m2 ) .or. (mdt2>=mdt1))
msginfo('dates must be between ' + dtoc(mdt1) +' & '+dtoc(mdt2) )
winx.monthcal_1.setfocus
endif
*/
go top
repl all fl1 with 1 for tran_dt< mdt1
repl all fl1 with 2 for tran_dt>=mdt1 .and. tran_dt<=mdt2
go top
sum(iif(rp='r',amt,-amt)) to myob for fl1=1
sum(iif(rp='r',amt,-amt)) to mycb for fl1=1 .or. fl1=2
if file('tmp.dbf')
run del tmp.dbf
endif
copy to tmp.dbf for fl1=2
use tmp new
appe blank
repl srno with '00000000'
repl narr with 'opening balance'
if myob>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(myob)
repl tran_dt with mdt1
appe blank
repl srno with '99999999'
repl narr with 'closing balance'
if mycb>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(mycb)
repl tran_dt with mdt2
inde on srno to tmp
go top
set print to tmp.txt
set devi to prin
set print on
set console off
set print to tmp.txt
?
if dtoc(mdt1) = dtoc(mdt2)
ms:='accounts of bhambhani enterprise for '+' ' + dtoc(mdt1)
else
ms:='accounts of bhambhani enterprise from '+' ' + dtoc(mdt1) + ' to '+dtoc(mdt2)
endif
?padc(ms,88)
?
? PADR('DATE',10)+' '+padr('narration',40)+' '+padC('amount',30)
? PADR(' ',50)+SPACE(10)+PADR('RECEIVED',10)+PADR('PAID',10)+PADR('CUM.TOTAL',10)
? replicate('-',88)
MYSUM:=0
mysum1:=0
mysum2:=0
m:=reccount()
s:=0
go top
do while ! eof()
s:=s+1
MYSUM:=MYSUM+iif(rp='r',amt,-amt)
if s=m
?replicate('-',88)
?padr('total',56)+str(mysum1,10,2)+str(mysum2,10,2)
?replicate('-',88)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+space(10) //STR(MYSUM,10,2)
else
mysum1:=mysum1+iif(rp='r',amt,0)
mysum2:=mysum2+iif(rp='r',0,amt)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+STR(MYSUM,10,2)
endif
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
run del *.ntx
close all
retu nil
procedure my_od
select 0
use acc alias acc new
inde on srno to acc
inde on dtos(tran_dt) to acc1
set order to 2
retu nil
procedure _se
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
BUTTON KBV;
CAPTION 'REPORT1';
ACTION (MEKBV());
TOOLTIP 'SEE DATA IN DIFFERENT FORMAT'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {100,100,80,100,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
procedure mekbv
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
define window mekbv at 20,800 height 800 width 700 backcolor RNDCOLOR
set order to 3
DEFINE BROWSE Browse_11
ROW 40
COL 50
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {100,100,80,80,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
define button b_0
row 680
col 250
caption 'quit'
action (mekbv.release)
end button
end window
activate window mekbv
retu nil
Procedure Refresh2
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.Refresh
winc.text_3.Refresh
winc.text_6.Refresh
winc.check_1.Refresh
winc.browse_1.value:=recno()
winc.browse_1.refresh
Return
procedure my_add2
winc.check_1.visible:=.f.
winc.label_6.visible:=.f.
winc.text_6.visible:=.f.
dbgobottom()
//
go bott
m3:=val(CRED->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
//
skip 1
refresh2()
winc.text_3.value:=date()
winc.text_1.value:=M1
winc.b_accept.enabled := .t.
winc.b_cancel.enabled:= .t.
winc.toolbar_1.top.enabled:=.f.
winc.toolbar_1.next.enabled:=.f.
winc.toolbar_1.previous.enabled:=.f.
winc.toolbar_1.bottom.enabled:=.f.
winc.toolbar_1.save.enabled:=.f.
winc.toolbar_1.gundo.enabled:=.f.
winc.toolbar_1.delete.enabled:=.f.
winc.toolbar_1.add.enabled:=.f.
winc.toolbar_1.find.enabled:=.f.
retu
procedure se1
winc.text_1.value:=space(8)
winc.text_2.value:=0
winc.edit_1.value:=space(80)
winc.text_3.value:=date
winc.text_3.value:=ctod(' / / ')
winc.check_1.value:=.f.
winc.text_1.setfocus
retu
Procedure my_Refresh2
m:=winc.browse_1.value
go m
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.refresh
winc.text_3.refresh
winc.text_6.refresh
winc.check_1.refresh
Return
procedure my_accept2
winc.check_1.visible:=.t.
winc.label_6.visible:=.t.
winc.text_6.visible:=.t.
if my_valid(winc.text_1.value,"cred")
dbappend()
cred->srno:=winc.text_1.value
cred->tran_dt:=winc.text_3.value
cred->narr:=winc.edit_1.value
cred->amt:=winc.text_2.value
cred->rp:=winc.check_1.value
cred->ret_dt:=winc.text_6.value
else
dbgotop()
endif
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
winc.toolbar_1.find.enabled:=.t.
refresh2()
retu
procedure my_cancel2
winc.check_1.visible:=.t.
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
refresh2()
retu
function gen_dbf1
if !file("cred.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{'ret_dt','d',8,0})
dbcreate("cred",sdbf)
endif
retu nil
function gen_ind1
sele 0
use cred alias cred
if !file("cred.ntx")
inde on srno to cred
endif
if !file("cred1.ntx")
inde on dtoc(tran_dt) to cred1
endif
if !file("cred2.ntx")
inde on if(rp,'1','0')+dtoc(tran_dt) to cred2
endif
set index to cred.NTX,cred1.NTX,cred2.ntx
set order to 1
//select cred
return nil
procedure od1
select cred
set order to 1
retu nil
Procedure Save1
Winc.Text_1.Save
Winc.Text_2.Save
winc.edit_1.save
winc.text_3.save
winc.text_6.save
winc.check_1.save
Return
procedure my_del1
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh2()
endif
retu
procedure bm2
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
procedure my_search2
winc.label_61.visible:= .t.
winc.text_61.visible:= .t.
winc.b_1.visible:= .t.
winc.text_61.setfocus
retu
procedure my_find1
//local rs:=alltrim(lower(winc.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele cred
set filter to alltrim(lower(winc.text_61.value)) $ narr
go top
refresh2()
my_refresh2()
set filter to
sele &save_sel
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
PROCEDURE KBV
LOCAL S1,S2
S1:=THIS.HEIGHT
S2:=THIS.WIDTH
MSGINFO(S1)
MSGINFO(S2)
RETU
procedure cr_rep
run del tmp1.dbf
gen_dbf11()
sele tmp1
appe from cred for rp=.f.
go top
do while ! eof()
msrno=tmp1->srno
mtran_dt=tmp1->tran_dt
mdys=date()-mtran_dt
repl dys with mdys
skip
enddo
gen_ind11()
set console off
set print on
set device to prin
set printer to tmp1.txt
?
ms:='credi reports of bhambhani enterprise'
?padc(ms,85)
?
? padr('date',10)+' '+padr('narration',40)+' '+padr('amount',10)+'pending for dys'
? replicate('-',85)
do while ! eof()
? padr(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+ ' '+str(amt,10,2) + ' '+str(dys,12,2)
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp1.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
close all
run del *.ntx
retu nil
function gen_dbf11
if !file("tmp1.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{ 'dys','n',12,2})
dbcreate("tmp1",sdbf)
endif
sele 0
use tmp1 alias tmp1
retu nil
function gen_ind11
sele tmp1
if !file("tmp1.ntx")
inde on (99999999-dys) to tmp1
endif
set index to tmp1.NTX
set order to 1
//tone(500,20)
return nil
procedure cred_se
define window winpqr at 0, 0 height 600 width 600 title 'hi' on init (odpqr(),se1pqr()) on release cd1pqr() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50,100,100}
HEADERS {'narration ','receipt/paid','amount','dt given','dt returned'}
WORKAREA cred
FIELDS {'cred->narr','cred->rp','cred->amt','cred->tran_dt','cred->ret_dt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
/*
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
*/
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr11(),se1pqr())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr11())
@ 60, 540 button btn_4 caption 'exit ' on click (winpqr.release)
/*
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
winpqr.lb.visible:=.f.
*/
end window
maximize window winpqr
activate window winpqr
retu nil
procedure se1pqr
winpqr.text_1.value:=space(40)
winpqr.text_2.value:=space(40)
//winpqr.text_3.value:='r'
winpqr.text_4.value:=0
winpqr.text_1.setfocus
retu
procedure pqr11()
local m1
local m2 :=date()
go bott
m3:=val(cred->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(winpqr.text_1.value)+' '+alltrim(winpqr.text_2.value)
//repl rp with winpqr.text_3.value
repl amt with winpqr.text_4.value
go top
winpqr.browse_1.refresh
retu nil
procedure odpqr
use cred alias cred new
select cred
retu nil
procedure cd1pqr
use
run del *.ntx
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
procedure credits
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
button kbv;
caption 'report';
action (mekbv());
tooltip 'see data in different format'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {50,100,80,20,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
- serge_girard
- Posts: 3165
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: hmg 3.4.1 error help
Where is MYMAIN?
There is also some error in ther errorsys.prg which causes the recursive call to it.
Serge
There is also some error in ther errorsys.prg which causes the recursive call to it.
Serge
There's nothing you can do that can't be done...
Re: hmg 3.4.1 error help
simple version of above code
#include <hmg.ch>
REQUEST HB_GT_WIN_DEFAULT
function main
set date american
define window m0 at 0,0 height 400 width 400 main on init (my())
end window
activate window m0
retu nil
function my
if my_hi()
test()
endif
retu nil
function test
define window m1 at 50,50 height 300 width 300
end window
activate window m1
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
#include <hmg.ch>
REQUEST HB_GT_WIN_DEFAULT
function main
set date american
define window m0 at 0,0 height 400 width 400 main on init (my())
end window
activate window m0
retu nil
function my
if my_hi()
test()
endif
retu nil
function test
define window m1 at 50,50 height 300 width 300
end window
activate window m1
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
Re: hmg 3.4.1 error help
sorry for posting incomplete code
below is the full code
# include <hmg.ch>
EQUEST HB_GT_WIN_DEFAULT
function main
set date amer
if my_hi()
my_main()
endif
retu nil
FUNCTION my_main
set date brit
set century on
set font to "ms san sarif",15
SET TOOLTIPSTYLE BALLOON
# define RNDCOLOR {RANDOM(255),RANDOM(255),RANDOM(255)}
# define my_red {255,0,0}
# define my_green {0,255,0}
DEFINE WINDOW winK AT 138 , 235 WIDTH 1004 HEIGHT 430 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE 'software developedment assisted by kirit b. ved @9869015508/09167551554' ICON NIL NOSIZE CURSOR NIL ON INIT NIL ON RELEASE NIL ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE NIL ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil main
define main menu
define popup 'accounts'
menuitem 'accounts normal hotkey alt+a' action acc_main()
separator
menuitem 'account-speed entry hotkey alt+s' action acc_se()
separator
menuitem 'print ledger hotkey alt+l' action my_print()
end popup
define popup 'credits'
menuitem 'credit hotkey alt+c' action credits()
separator
menuitem 'credit speed entry alt+q' action cred_se()
separator
menuitem 'credit report alt+r' action cr_rep()
end popup
define popup 'quit'
menuitem 'quit program' action (wink.release)
end popup
end menu
DEFINE IMAGE Image_1
ROW 0
COL 0
WIDTH 1606
HEIGHT 137
PICTURE "header.bmp"
HELPID Nil
VISIBLE .T.
STRETCH .T.
ACTION Nil
END IMAGE
on key ALT+A of win action acc_main()
on key ALT+S of win action acc_se()
on key ALT+L of win action my_print()
on key ALT+c of win action credits()
on key ALT+q of win action cred_se()
END WINDOW
maximize window winK
ACTIVATE WINDOW WINK
retu
procedure acc_main
open_win1()
retu nil
function gen_dbf
if !file("acc.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','c',1,0})
dbcreate("acc",sdbf)
endif
retu nil
function gen_ind()
sele 0
use acc alias acc
if !file("acc.ntx")
inde on srno to acc
endif
if !file("acc1.ntx")
inde on dtoc(tran_dt) to acc1
endif
set index to acc.NTX,acc1.NTX
set order to 1
return nil
procedure open_win1
DEFINE WINDOW win1 AT 132 , 235 WIDTH 1200 HEIGHT 800 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm1(),gen_dbf() ,gen_ind()) ON RELEASE CD() ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 70
COL 230
WIDTH 520
HEIGHT 40
VALUE "account data entry form"
FONTNAME "Arial"
FONTSIZE 16
TOOLTIP ""
FONTBOLD .T.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 180
COL 200
WIDTH 120
HEIGHT 24
VALUE "serial number :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 180
COL 390
WIDTH 120
HEIGHT 24
field acc->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 230
COL 200
WIDTH 120
HEIGHT 24
VALUE "transaction date :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 230
COL 390
WIDTH 120
HEIGHT 24
field acc->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 280
COL 200
WIDTH 120
HEIGHT 24
VALUE "narration :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 280
COL 390
WIDTH 200
HEIGHT 100
field acc->narr
VALUE ""
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
MAXLENGTH 100
END EDITBOX
DEFINE LABEL Label_5
ROW 450
COL 200
WIDTH 120
HEIGHT 24
VALUE "amount :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_3
ROW 450
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->amt
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .T.
VALUE Nil
END TEXTBOX
DEFINE TEXTBOX Text_4
ROW 510
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->rp
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS lb()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
tooltip 'enter only r or p for receipt & paid '
END TEXTBOX
DEFINE LABEL Label_6
ROW 510
COL 200
WIDTH 120
HEIGHT 50
VALUE "mode of payment (received or paid)"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
@ 400 ,650 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc()
win1.lb.visible:=.f.
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh1() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh1() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh1() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh1() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( Save() , Refresh1() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh1() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del(),Refresh1() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add1() ) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search1()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept1())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel1())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 650
HEIGHT 800
VALUE 0
WIDTHS {100,100,100,100,400}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA acc
FIELDS {'acc->srno','acc->tran_dt' ,'acc->amt','acc->rp','acc->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE refresh11()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR NIL
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find())
END WINDOW
maximize window win1
activate window win1
retu nil
Procedure Refresh1
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.edit_1.Refresh
win1.Text_3.Refresh
win1.text_4.Refresh
m:=recno()
win1.browse_1.value:=m
win1.browse_1.refresh
Return
Procedure Refresh11
m:= win1.browse_1.value
go m
/*
win1.text_1.value:=acc->srno
win1.text_2.value:=acc->tran_dt
win1.edit_1.value:=acc->narr
win1.text_3.value:=acc->amt
win1.text_4.value:=acc->rp
*/
refresh1()
Return
/*
text_1
edit_1
monthcal_1
text_2
check_1
*/
procedure bm1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure Save
Win1.Text_1.Save
Win1.Text_2.Save
win1.text_3.save
win1.edit_1.save
win1.text_4.save
Return
procedure my_del
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh()
endif
retu
procedure my_add1
dbgobottom()
skip 1
refresh1()
win1.text_2.value:=date()
win1.b_accept.enabled := .t.
win1.b_cancel.enabled:= .t.
win1.toolbar_1.top.enabled:=.f.
win1.toolbar_1.next.enabled:=.f.
win1.toolbar_1.previous.enabled:=.f.
win1.toolbar_1.bottom.enabled:=.f.
win1.toolbar_1.save.enabled:=.f.
win1.toolbar_1.gundo.enabled:=.f.
win1.toolbar_1.delete.enabled:=.f.
win1.toolbar_1.add.enabled:=.f.
win1.toolbar_1.find.enabled:=.f.
retu
procedure my_search1
win1.label_61.visible:= .t.
win1.text_61.visible:= .t.
win1.b_1.visible:= .t.
win1.text_61.setfocus
retu
procedure my_accept1
if my_valid(win1.text_1.value,"acc")
dbappend()
acc->srno:=win1.text_1.value
acc->tran_dt:=win1.text_2.value
acc->narr:=win1.edit_1.value
acc->amt:=win1.text_3.value
acc->rp:=win1.text_4.value
else
dbgotop()
endif
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
win1.toolbar_1.find.enabled:=.t.
refresh1()
retu
procedure my_cancel1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
refresh()
retu
Procedure my_Refresh1
m:=win1.browse_1.value
go m
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.text_3.refresh
win1.edit_1.refresh
win1.text_4.refresh
Return
procedure my_find
//local rs:=alltrim(lower(win1.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele acc
set filter to alltrim(lower(win1.text_61.value)) $ narr
go top
refresh()
my_refresh()
set filter to
sele &save_sel
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure my_Refresh
m:=win1.browse_1.value
go m
Win1.Text_1.Refresh
Win1.Text_2.Refresh
win1.text_3.refresh
win1.text_4.refresh
Return
Procedure Refresh
Win1.Text_1.Refresh
Win1.Text_2.Refresh
Win1.Text_3.Refresh
Win1.Text_4.Refresh
win1.browse_1.value:=recno()
win1.browse_1.refresh
Return
function my_valid(s,als)
local rl:=.f.,rn,save_sel
if len(alltrim(s)) > 0
rl:=.t.
else
msginfo("code can not be blank")
win1.text_1.setfocus
endif
if rl==.t.
save_sel:=alias()
sele &als
seek s
if found()
rl:=.f.
msginfo("code already exists in database")
win1.text_1.setfocus
endif
sele &save_sel
endif
retu rl
function pqr
local rv
select acc
if acc->rp="r"
rv:=1
else
rv:=2
endif
retu rv
procedure qwe
my:={'r','p'}
retu nil
//syntex for the function chk is chk({'flat','shop'},"s")
function chk(a,b)
local r:=0
local p:=0
k:=len(a)
for i=1 to k
r=chk1(a,b)
if r==1
p:=i
exit
endif
next
retu p
function chk1(p,q)
local r:=0
if p == q
r:=1
endif
retu r
procedure lb
if chk({'r','p'}, win1.text_4.value)=0
win1.lb.visible:=.t.
win1.lb.setfocus
endif
retu nil
procedure lbproc
win1.text_4.value:=win1.lb.item(win1.lb.value)
win1.lb.visible:=.f.
retu nil
PROCEDURE CD
CLOSE ALL
RETU
PROCEDURE meri_jaan
run d.exe
RUN DEL *.NTX)
retu
procedure acc_se
define window win2 at 0, 0 height 600 width 600 title 'hi' on init (od(),se()) on release cd1() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50}
HEADERS {'narration ','receipt/paid','amount'}
WORKAREA acc
FIELDS {'acc->narr','acc->rp','acc->amt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr1(),se())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr1())
@ 60, 540 button btn_4 caption 'exit ' on click (win2.release)
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
win2.lb.visible:=.f.
end window
maximize window win2
activate window win2
retu nil
procedure od
use acc alias acc new
select acc
retu nil
procedure cd1
use
run del *.ntx
retu nil
procedure acc_sa
retu
procedure se
win2.text_1.value:=space(40)
win2.text_2.value:=space(40)
win2.text_3.value:='r'
win2.text_4.value:=0
win2.text_1.setfocus
retu
procedure pqr1()
local m1
local m2 :=date()
go bott
m3:=val(acc->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(win2.text_1.value)+' '+alltrim(win2.text_2.value)
repl rp with win2.text_3.value
repl amt with win2.text_4.value
go top
win2.browse_1.refresh
retu nil
procedure lb1
if chk({'r','p'}, win2.text_3.value)=0
MessageBoxTimeout('only r for receipt & p for paid is allowed here','attention',0,3000)
win2.text_3.setfocus
endif
retu nil
procedure lbproc1
msginfo(win2.text_3.value)
retu nil
procedure my_print
set date brit
set century on
DEFINE WINDOW winx AT 138 , 235 WIDTH 808 HEIGHT 494 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil child
DEFINE LABEL Label_1
ROW 60
COL 170
WIDTH 450
HEIGHT 30
VALUE "printing of accounts between two dates"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE MONTHCALENDAR MonthCal_1
ROW 140
COL 140
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter start date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
DEFINE MONTHCALENDAR MonthCal_2
ROW 140
COL 430
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter end date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
/*
define textbox mc_1
row 400
col 140
//autosize .t.
width 100
date .t.
value winx.monthcal_1.value
end textbox
define textbox mc_2
row 400
col 430
width 100
date .t.
value winx.monthcal_2.value
//autosize .t.
end textbox
*/
DEFINE BUTTON Button_1
ROW 350
COL 350
WIDTH 100
HEIGHT 28
ACTION my_pxxx()
CAPTION "get ledger"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
PICTALIGNMENT TOP
END BUTTON
END WINDOW
center window winx
maximize window winx
activate window winx
retu
procedure mc
/*
winx.mc_1.value:=winx.monthcal_1.value
winx.mc_2.value:=winx.monthcal_2.value
*/
retu
procedure my_pxxx
my_od()
/*
set date brit
set century on
*/
go top
m1:=tran_dt
go bott
m2:=tran_dt
mdt1:=winx.monthcal_1.value
mdt2:=winx.monthcal_2.value
/*
if !( (mdt1>=m1 .and. mdt2<=m2 ) .or. (mdt2>=mdt1))
msginfo('dates must be between ' + dtoc(mdt1) +' & '+dtoc(mdt2) )
winx.monthcal_1.setfocus
endif
*/
go top
repl all fl1 with 1 for tran_dt< mdt1
repl all fl1 with 2 for tran_dt>=mdt1 .and. tran_dt<=mdt2
go top
sum(iif(rp='r',amt,-amt)) to myob for fl1=1
sum(iif(rp='r',amt,-amt)) to mycb for fl1=1 .or. fl1=2
if file('tmp.dbf')
run del tmp.dbf
endif
copy to tmp.dbf for fl1=2
use tmp new
appe blank
repl srno with '00000000'
repl narr with 'opening balance'
if myob>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(myob)
repl tran_dt with mdt1
appe blank
repl srno with '99999999'
repl narr with 'closing balance'
if mycb>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(mycb)
repl tran_dt with mdt2
inde on srno to tmp
go top
set print to tmp.txt
set devi to prin
set print on
set console off
set print to tmp.txt
?
if dtoc(mdt1) = dtoc(mdt2)
ms:='accounts of bhambhani enterprise for '+' ' + dtoc(mdt1)
else
ms:='accounts of bhambhani enterprise from '+' ' + dtoc(mdt1) + ' to '+dtoc(mdt2)
endif
?padc(ms,88)
?
? PADR('DATE',10)+' '+padr('narration',40)+' '+padC('amount',30)
? PADR(' ',50)+SPACE(10)+PADR('RECEIVED',10)+PADR('PAID',10)+PADR('CUM.TOTAL',10)
? replicate('-',88)
MYSUM:=0
mysum1:=0
mysum2:=0
m:=reccount()
s:=0
go top
do while ! eof()
s:=s+1
MYSUM:=MYSUM+iif(rp='r',amt,-amt)
if s=m
?replicate('-',88)
?padr('total',56)+str(mysum1,10,2)+str(mysum2,10,2)
?replicate('-',88)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+space(10) //STR(MYSUM,10,2)
else
mysum1:=mysum1+iif(rp='r',amt,0)
mysum2:=mysum2+iif(rp='r',0,amt)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+STR(MYSUM,10,2)
endif
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
run del *.ntx
close all
retu nil
procedure my_od
select 0
use acc alias acc new
inde on srno to acc
inde on dtos(tran_dt) to acc1
set order to 2
retu nil
procedure _se
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
BUTTON KBV;
CAPTION 'REPORT1';
ACTION (MEKBV());
TOOLTIP 'SEE DATA IN DIFFERENT FORMAT'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {100,100,80,100,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
procedure mekbv
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
define window mekbv at 20,800 height 800 width 700 backcolor RNDCOLOR
set order to 3
DEFINE BROWSE Browse_11
ROW 40
COL 50
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {100,100,80,80,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
define button b_0
row 680
col 250
caption 'quit'
action (mekbv.release)
end button
end window
activate window mekbv
retu nil
Procedure Refresh2
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.Refresh
winc.text_3.Refresh
winc.text_6.Refresh
winc.check_1.Refresh
winc.browse_1.value:=recno()
winc.browse_1.refresh
Return
procedure my_add2
winc.check_1.visible:=.f.
winc.label_6.visible:=.f.
winc.text_6.visible:=.f.
dbgobottom()
//
go bott
m3:=val(CRED->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
//
skip 1
refresh2()
winc.text_3.value:=date()
winc.text_1.value:=M1
winc.b_accept.enabled := .t.
winc.b_cancel.enabled:= .t.
winc.toolbar_1.top.enabled:=.f.
winc.toolbar_1.next.enabled:=.f.
winc.toolbar_1.previous.enabled:=.f.
winc.toolbar_1.bottom.enabled:=.f.
winc.toolbar_1.save.enabled:=.f.
winc.toolbar_1.gundo.enabled:=.f.
winc.toolbar_1.delete.enabled:=.f.
winc.toolbar_1.add.enabled:=.f.
winc.toolbar_1.find.enabled:=.f.
retu
procedure se1
winc.text_1.value:=space(8)
winc.text_2.value:=0
winc.edit_1.value:=space(80)
winc.text_3.value:=date
winc.text_3.value:=ctod(' / / ')
winc.check_1.value:=.f.
winc.text_1.setfocus
retu
Procedure my_Refresh2
m:=winc.browse_1.value
go m
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.refresh
winc.text_3.refresh
winc.text_6.refresh
winc.check_1.refresh
Return
procedure my_accept2
winc.check_1.visible:=.t.
winc.label_6.visible:=.t.
winc.text_6.visible:=.t.
if my_valid(winc.text_1.value,"cred")
dbappend()
cred->srno:=winc.text_1.value
cred->tran_dt:=winc.text_3.value
cred->narr:=winc.edit_1.value
cred->amt:=winc.text_2.value
cred->rp:=winc.check_1.value
cred->ret_dt:=winc.text_6.value
else
dbgotop()
endif
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
winc.toolbar_1.find.enabled:=.t.
refresh2()
retu
procedure my_cancel2
winc.check_1.visible:=.t.
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
refresh2()
retu
function gen_dbf1
if !file("cred.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{'ret_dt','d',8,0})
dbcreate("cred",sdbf)
endif
retu nil
function gen_ind1
sele 0
use cred alias cred
if !file("cred.ntx")
inde on srno to cred
endif
if !file("cred1.ntx")
inde on dtoc(tran_dt) to cred1
endif
if !file("cred2.ntx")
inde on if(rp,'1','0')+dtoc(tran_dt) to cred2
endif
set index to cred.NTX,cred1.NTX,cred2.ntx
set order to 1
//select cred
return nil
procedure od1
select cred
set order to 1
retu nil
Procedure Save1
Winc.Text_1.Save
Winc.Text_2.Save
winc.edit_1.save
winc.text_3.save
winc.text_6.save
winc.check_1.save
Return
procedure my_del1
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh2()
endif
retu
procedure bm2
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
procedure my_search2
winc.label_61.visible:= .t.
winc.text_61.visible:= .t.
winc.b_1.visible:= .t.
winc.text_61.setfocus
retu
procedure my_find1
//local rs:=alltrim(lower(winc.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele cred
set filter to alltrim(lower(winc.text_61.value)) $ narr
go top
refresh2()
my_refresh2()
set filter to
sele &save_sel
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
PROCEDURE KBV
LOCAL S1,S2
S1:=THIS.HEIGHT
S2:=THIS.WIDTH
MSGINFO(S1)
MSGINFO(S2)
RETU
procedure cr_rep
run del tmp1.dbf
gen_dbf11()
sele tmp1
appe from cred for rp=.f.
go top
do while ! eof()
msrno=tmp1->srno
mtran_dt=tmp1->tran_dt
mdys=date()-mtran_dt
repl dys with mdys
skip
enddo
gen_ind11()
set console off
set print on
set device to prin
set printer to tmp1.txt
?
ms:='credi reports of bhambhani enterprise'
?padc(ms,85)
?
? padr('date',10)+' '+padr('narration',40)+' '+padr('amount',10)+'pending for dys'
? replicate('-',85)
do while ! eof()
? padr(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+ ' '+str(amt,10,2) + ' '+str(dys,12,2)
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp1.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
close all
run del *.ntx
retu nil
function gen_dbf11
if !file("tmp1.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{ 'dys','n',12,2})
dbcreate("tmp1",sdbf)
endif
sele 0
use tmp1 alias tmp1
retu nil
function gen_ind11
sele tmp1
if !file("tmp1.ntx")
inde on (99999999-dys) to tmp1
endif
set index to tmp1.NTX
set order to 1
//tone(500,20)
return nil
procedure cred_se
define window winpqr at 0, 0 height 600 width 600 title 'hi' on init (odpqr(),se1pqr()) on release cd1pqr() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50,100,100}
HEADERS {'narration ','receipt/paid','amount','dt given','dt returned'}
WORKAREA cred
FIELDS {'cred->narr','cred->rp','cred->amt','cred->tran_dt','cred->ret_dt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
/*
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
*/
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr11(),se1pqr())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr11())
@ 60, 540 button btn_4 caption 'exit ' on click (winpqr.release)
/*
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
winpqr.lb.visible:=.f.
*/
end window
maximize window winpqr
activate window winpqr
retu nil
procedure se1pqr
winpqr.text_1.value:=space(40)
winpqr.text_2.value:=space(40)
//winpqr.text_3.value:='r'
winpqr.text_4.value:=0
winpqr.text_1.setfocus
retu
procedure pqr11()
local m1
local m2 :=date()
go bott
m3:=val(cred->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(winpqr.text_1.value)+' '+alltrim(winpqr.text_2.value)
//repl rp with winpqr.text_3.value
repl amt with winpqr.text_4.value
go top
winpqr.browse_1.refresh
retu nil
procedure odpqr
use cred alias cred new
select cred
retu nil
procedure cd1pqr
use
run del *.ntx
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
procedure credits
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
button kbv;
caption 'report';
action (mekbv());
tooltip 'see data in different format'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {50,100,80,20,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
below is the full code
# include <hmg.ch>
EQUEST HB_GT_WIN_DEFAULT
function main
set date amer
if my_hi()
my_main()
endif
retu nil
FUNCTION my_main
set date brit
set century on
set font to "ms san sarif",15
SET TOOLTIPSTYLE BALLOON
# define RNDCOLOR {RANDOM(255),RANDOM(255),RANDOM(255)}
# define my_red {255,0,0}
# define my_green {0,255,0}
DEFINE WINDOW winK AT 138 , 235 WIDTH 1004 HEIGHT 430 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE 'software developedment assisted by kirit b. ved @9869015508/09167551554' ICON NIL NOSIZE CURSOR NIL ON INIT NIL ON RELEASE NIL ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE NIL ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil main
define main menu
define popup 'accounts'
menuitem 'accounts normal hotkey alt+a' action acc_main()
separator
menuitem 'account-speed entry hotkey alt+s' action acc_se()
separator
menuitem 'print ledger hotkey alt+l' action my_print()
end popup
define popup 'credits'
menuitem 'credit hotkey alt+c' action credits()
separator
menuitem 'credit speed entry alt+q' action cred_se()
separator
menuitem 'credit report alt+r' action cr_rep()
end popup
define popup 'quit'
menuitem 'quit program' action (wink.release)
end popup
end menu
DEFINE IMAGE Image_1
ROW 0
COL 0
WIDTH 1606
HEIGHT 137
PICTURE "header.bmp"
HELPID Nil
VISIBLE .T.
STRETCH .T.
ACTION Nil
END IMAGE
on key ALT+A of win action acc_main()
on key ALT+S of win action acc_se()
on key ALT+L of win action my_print()
on key ALT+c of win action credits()
on key ALT+q of win action cred_se()
END WINDOW
maximize window winK
ACTIVATE WINDOW WINK
retu
procedure acc_main
open_win1()
retu nil
function gen_dbf
if !file("acc.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','c',1,0})
dbcreate("acc",sdbf)
endif
retu nil
function gen_ind()
sele 0
use acc alias acc
if !file("acc.ntx")
inde on srno to acc
endif
if !file("acc1.ntx")
inde on dtoc(tran_dt) to acc1
endif
set index to acc.NTX,acc1.NTX
set order to 1
return nil
procedure open_win1
DEFINE WINDOW win1 AT 132 , 235 WIDTH 1200 HEIGHT 800 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm1(),gen_dbf() ,gen_ind()) ON RELEASE CD() ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 70
COL 230
WIDTH 520
HEIGHT 40
VALUE "account data entry form"
FONTNAME "Arial"
FONTSIZE 16
TOOLTIP ""
FONTBOLD .T.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 180
COL 200
WIDTH 120
HEIGHT 24
VALUE "serial number :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 180
COL 390
WIDTH 120
HEIGHT 24
field acc->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 230
COL 200
WIDTH 120
HEIGHT 24
VALUE "transaction date :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 230
COL 390
WIDTH 120
HEIGHT 24
field acc->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 280
COL 200
WIDTH 120
HEIGHT 24
VALUE "narration :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 280
COL 390
WIDTH 200
HEIGHT 100
field acc->narr
VALUE ""
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
MAXLENGTH 100
END EDITBOX
DEFINE LABEL Label_5
ROW 450
COL 200
WIDTH 120
HEIGHT 24
VALUE "amount :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_3
ROW 450
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->amt
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .T.
VALUE Nil
END TEXTBOX
DEFINE TEXTBOX Text_4
ROW 510
COL 390
WIDTH 120
HEIGHT 24
FONTNAME "Arial"
FONTSIZE 9
field acc->rp
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS lb()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
NUMERIC .f.
VALUE Nil
tooltip 'enter only r or p for receipt & paid '
END TEXTBOX
DEFINE LABEL Label_6
ROW 510
COL 200
WIDTH 120
HEIGHT 50
VALUE "mode of payment (received or paid)"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
@ 400 ,650 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc()
win1.lb.visible:=.f.
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh1() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh1() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh1() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh1() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( Save() , Refresh1() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh1() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del(),Refresh1() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add1() ) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search1()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept1())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel1())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 650
HEIGHT 800
VALUE 0
WIDTHS {100,100,100,100,400}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA acc
FIELDS {'acc->srno','acc->tran_dt' ,'acc->amt','acc->rp','acc->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE refresh11()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR NIL
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find())
END WINDOW
maximize window win1
activate window win1
retu nil
Procedure Refresh1
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.edit_1.Refresh
win1.Text_3.Refresh
win1.text_4.Refresh
m:=recno()
win1.browse_1.value:=m
win1.browse_1.refresh
Return
Procedure Refresh11
m:= win1.browse_1.value
go m
/*
win1.text_1.value:=acc->srno
win1.text_2.value:=acc->tran_dt
win1.edit_1.value:=acc->narr
win1.text_3.value:=acc->amt
win1.text_4.value:=acc->rp
*/
refresh1()
Return
/*
text_1
edit_1
monthcal_1
text_2
check_1
*/
procedure bm1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure Save
Win1.Text_1.Save
Win1.Text_2.Save
win1.text_3.save
win1.edit_1.save
win1.text_4.save
Return
procedure my_del
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh()
endif
retu
procedure my_add1
dbgobottom()
skip 1
refresh1()
win1.text_2.value:=date()
win1.b_accept.enabled := .t.
win1.b_cancel.enabled:= .t.
win1.toolbar_1.top.enabled:=.f.
win1.toolbar_1.next.enabled:=.f.
win1.toolbar_1.previous.enabled:=.f.
win1.toolbar_1.bottom.enabled:=.f.
win1.toolbar_1.save.enabled:=.f.
win1.toolbar_1.gundo.enabled:=.f.
win1.toolbar_1.delete.enabled:=.f.
win1.toolbar_1.add.enabled:=.f.
win1.toolbar_1.find.enabled:=.f.
retu
procedure my_search1
win1.label_61.visible:= .t.
win1.text_61.visible:= .t.
win1.b_1.visible:= .t.
win1.text_61.setfocus
retu
procedure my_accept1
if my_valid(win1.text_1.value,"acc")
dbappend()
acc->srno:=win1.text_1.value
acc->tran_dt:=win1.text_2.value
acc->narr:=win1.edit_1.value
acc->amt:=win1.text_3.value
acc->rp:=win1.text_4.value
else
dbgotop()
endif
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
win1.toolbar_1.find.enabled:=.t.
refresh1()
retu
procedure my_cancel1
win1.b_accept.enabled := .f.
win1.b_cancel.enabled:= .f.
win1.toolbar_1.top.enabled:=.t.
win1.toolbar_1.next.enabled:=.t.
win1.toolbar_1.previous.enabled:=.t.
win1.toolbar_1.bottom.enabled:=.t.
win1.toolbar_1.save.enabled:=.t.
win1.toolbar_1.gundo.enabled:=.t.
win1.toolbar_1.delete.enabled:=.t.
win1.toolbar_1.add.enabled:=.t.
refresh()
retu
Procedure my_Refresh1
m:=win1.browse_1.value
go m
win1.Text_1.Refresh
win1.Text_2.Refresh
win1.text_3.refresh
win1.edit_1.refresh
win1.text_4.refresh
Return
procedure my_find
//local rs:=alltrim(lower(win1.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele acc
set filter to alltrim(lower(win1.text_61.value)) $ narr
go top
refresh()
my_refresh()
set filter to
sele &save_sel
win1.label_61.visible:= .f.
win1.text_61.visible:= .f.
win1.b_1.visible:= .f.
retu
Procedure my_Refresh
m:=win1.browse_1.value
go m
Win1.Text_1.Refresh
Win1.Text_2.Refresh
win1.text_3.refresh
win1.text_4.refresh
Return
Procedure Refresh
Win1.Text_1.Refresh
Win1.Text_2.Refresh
Win1.Text_3.Refresh
Win1.Text_4.Refresh
win1.browse_1.value:=recno()
win1.browse_1.refresh
Return
function my_valid(s,als)
local rl:=.f.,rn,save_sel
if len(alltrim(s)) > 0
rl:=.t.
else
msginfo("code can not be blank")
win1.text_1.setfocus
endif
if rl==.t.
save_sel:=alias()
sele &als
seek s
if found()
rl:=.f.
msginfo("code already exists in database")
win1.text_1.setfocus
endif
sele &save_sel
endif
retu rl
function pqr
local rv
select acc
if acc->rp="r"
rv:=1
else
rv:=2
endif
retu rv
procedure qwe
my:={'r','p'}
retu nil
//syntex for the function chk is chk({'flat','shop'},"s")
function chk(a,b)
local r:=0
local p:=0
k:=len(a)
for i=1 to k
r=chk1(a,b)
if r==1
p:=i
exit
endif
next
retu p
function chk1(p,q)
local r:=0
if p == q
r:=1
endif
retu r
procedure lb
if chk({'r','p'}, win1.text_4.value)=0
win1.lb.visible:=.t.
win1.lb.setfocus
endif
retu nil
procedure lbproc
win1.text_4.value:=win1.lb.item(win1.lb.value)
win1.lb.visible:=.f.
retu nil
PROCEDURE CD
CLOSE ALL
RETU
PROCEDURE meri_jaan
run d.exe
RUN DEL *.NTX)
retu
procedure acc_se
define window win2 at 0, 0 height 600 width 600 title 'hi' on init (od(),se()) on release cd1() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50}
HEADERS {'narration ','receipt/paid','amount'}
WORKAREA acc
FIELDS {'acc->narr','acc->rp','acc->amt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr1(),se())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr1())
@ 60, 540 button btn_4 caption 'exit ' on click (win2.release)
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
win2.lb.visible:=.f.
end window
maximize window win2
activate window win2
retu nil
procedure od
use acc alias acc new
select acc
retu nil
procedure cd1
use
run del *.ntx
retu nil
procedure acc_sa
retu
procedure se
win2.text_1.value:=space(40)
win2.text_2.value:=space(40)
win2.text_3.value:='r'
win2.text_4.value:=0
win2.text_1.setfocus
retu
procedure pqr1()
local m1
local m2 :=date()
go bott
m3:=val(acc->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(win2.text_1.value)+' '+alltrim(win2.text_2.value)
repl rp with win2.text_3.value
repl amt with win2.text_4.value
go top
win2.browse_1.refresh
retu nil
procedure lb1
if chk({'r','p'}, win2.text_3.value)=0
MessageBoxTimeout('only r for receipt & p for paid is allowed here','attention',0,3000)
win2.text_3.setfocus
endif
retu nil
procedure lbproc1
msginfo(win2.text_3.value)
retu nil
procedure my_print
set date brit
set century on
DEFINE WINDOW winx AT 138 , 235 WIDTH 808 HEIGHT 494 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil child
DEFINE LABEL Label_1
ROW 60
COL 170
WIDTH 450
HEIGHT 30
VALUE "printing of accounts between two dates"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE MONTHCALENDAR MonthCal_1
ROW 140
COL 140
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter start date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
DEFINE MONTHCALENDAR MonthCal_2
ROW 140
COL 430
WIDTH 227
HEIGHT 162
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP "enter end date"
ONCHANGE mc()
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
NOTODAY .F.
NOTODAYCIRCLE .F.
WEEKNUMBERS .F.
END MONTHCALENDAR
/*
define textbox mc_1
row 400
col 140
//autosize .t.
width 100
date .t.
value winx.monthcal_1.value
end textbox
define textbox mc_2
row 400
col 430
width 100
date .t.
value winx.monthcal_2.value
//autosize .t.
end textbox
*/
DEFINE BUTTON Button_1
ROW 350
COL 350
WIDTH 100
HEIGHT 28
ACTION my_pxxx()
CAPTION "get ledger"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
PICTALIGNMENT TOP
END BUTTON
END WINDOW
center window winx
maximize window winx
activate window winx
retu
procedure mc
/*
winx.mc_1.value:=winx.monthcal_1.value
winx.mc_2.value:=winx.monthcal_2.value
*/
retu
procedure my_pxxx
my_od()
/*
set date brit
set century on
*/
go top
m1:=tran_dt
go bott
m2:=tran_dt
mdt1:=winx.monthcal_1.value
mdt2:=winx.monthcal_2.value
/*
if !( (mdt1>=m1 .and. mdt2<=m2 ) .or. (mdt2>=mdt1))
msginfo('dates must be between ' + dtoc(mdt1) +' & '+dtoc(mdt2) )
winx.monthcal_1.setfocus
endif
*/
go top
repl all fl1 with 1 for tran_dt< mdt1
repl all fl1 with 2 for tran_dt>=mdt1 .and. tran_dt<=mdt2
go top
sum(iif(rp='r',amt,-amt)) to myob for fl1=1
sum(iif(rp='r',amt,-amt)) to mycb for fl1=1 .or. fl1=2
if file('tmp.dbf')
run del tmp.dbf
endif
copy to tmp.dbf for fl1=2
use tmp new
appe blank
repl srno with '00000000'
repl narr with 'opening balance'
if myob>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(myob)
repl tran_dt with mdt1
appe blank
repl srno with '99999999'
repl narr with 'closing balance'
if mycb>=0
repl rp with 'r'
else
repl rp with 'p'
endif
repl amt with abs(mycb)
repl tran_dt with mdt2
inde on srno to tmp
go top
set print to tmp.txt
set devi to prin
set print on
set console off
set print to tmp.txt
?
if dtoc(mdt1) = dtoc(mdt2)
ms:='accounts of bhambhani enterprise for '+' ' + dtoc(mdt1)
else
ms:='accounts of bhambhani enterprise from '+' ' + dtoc(mdt1) + ' to '+dtoc(mdt2)
endif
?padc(ms,88)
?
? PADR('DATE',10)+' '+padr('narration',40)+' '+padC('amount',30)
? PADR(' ',50)+SPACE(10)+PADR('RECEIVED',10)+PADR('PAID',10)+PADR('CUM.TOTAL',10)
? replicate('-',88)
MYSUM:=0
mysum1:=0
mysum2:=0
m:=reccount()
s:=0
go top
do while ! eof()
s:=s+1
MYSUM:=MYSUM+iif(rp='r',amt,-amt)
if s=m
?replicate('-',88)
?padr('total',56)+str(mysum1,10,2)+str(mysum2,10,2)
?replicate('-',88)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+space(10) //STR(MYSUM,10,2)
else
mysum1:=mysum1+iif(rp='r',amt,0)
mysum2:=mysum2+iif(rp='r',0,amt)
? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+STR(MYSUM,10,2)
endif
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
run del *.ntx
close all
retu nil
procedure my_od
select 0
use acc alias acc new
inde on srno to acc
inde on dtos(tran_dt) to acc1
set order to 2
retu nil
procedure _se
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
BUTTON KBV;
CAPTION 'REPORT1';
ACTION (MEKBV());
TOOLTIP 'SEE DATA IN DIFFERENT FORMAT'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {100,100,80,100,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
procedure mekbv
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
define window mekbv at 20,800 height 800 width 700 backcolor RNDCOLOR
set order to 3
DEFINE BROWSE Browse_11
ROW 40
COL 50
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {100,100,80,80,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
FONTNAME "Arial"
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
define button b_0
row 680
col 250
caption 'quit'
action (mekbv.release)
end button
end window
activate window mekbv
retu nil
Procedure Refresh2
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.Refresh
winc.text_3.Refresh
winc.text_6.Refresh
winc.check_1.Refresh
winc.browse_1.value:=recno()
winc.browse_1.refresh
Return
procedure my_add2
winc.check_1.visible:=.f.
winc.label_6.visible:=.f.
winc.text_6.visible:=.f.
dbgobottom()
//
go bott
m3:=val(CRED->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
//
skip 1
refresh2()
winc.text_3.value:=date()
winc.text_1.value:=M1
winc.b_accept.enabled := .t.
winc.b_cancel.enabled:= .t.
winc.toolbar_1.top.enabled:=.f.
winc.toolbar_1.next.enabled:=.f.
winc.toolbar_1.previous.enabled:=.f.
winc.toolbar_1.bottom.enabled:=.f.
winc.toolbar_1.save.enabled:=.f.
winc.toolbar_1.gundo.enabled:=.f.
winc.toolbar_1.delete.enabled:=.f.
winc.toolbar_1.add.enabled:=.f.
winc.toolbar_1.find.enabled:=.f.
retu
procedure se1
winc.text_1.value:=space(8)
winc.text_2.value:=0
winc.edit_1.value:=space(80)
winc.text_3.value:=date
winc.text_3.value:=ctod(' / / ')
winc.check_1.value:=.f.
winc.text_1.setfocus
retu
Procedure my_Refresh2
m:=winc.browse_1.value
go m
winc.Text_1.Refresh
winc.Text_2.Refresh
winc.edit_1.refresh
winc.text_3.refresh
winc.text_6.refresh
winc.check_1.refresh
Return
procedure my_accept2
winc.check_1.visible:=.t.
winc.label_6.visible:=.t.
winc.text_6.visible:=.t.
if my_valid(winc.text_1.value,"cred")
dbappend()
cred->srno:=winc.text_1.value
cred->tran_dt:=winc.text_3.value
cred->narr:=winc.edit_1.value
cred->amt:=winc.text_2.value
cred->rp:=winc.check_1.value
cred->ret_dt:=winc.text_6.value
else
dbgotop()
endif
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
winc.toolbar_1.find.enabled:=.t.
refresh2()
retu
procedure my_cancel2
winc.check_1.visible:=.t.
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.toolbar_1.top.enabled:=.t.
winc.toolbar_1.next.enabled:=.t.
winc.toolbar_1.previous.enabled:=.t.
winc.toolbar_1.bottom.enabled:=.t.
winc.toolbar_1.save.enabled:=.t.
winc.toolbar_1.gundo.enabled:=.t.
winc.toolbar_1.delete.enabled:=.t.
winc.toolbar_1.add.enabled:=.t.
refresh2()
retu
function gen_dbf1
if !file("cred.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{'ret_dt','d',8,0})
dbcreate("cred",sdbf)
endif
retu nil
function gen_ind1
sele 0
use cred alias cred
if !file("cred.ntx")
inde on srno to cred
endif
if !file("cred1.ntx")
inde on dtoc(tran_dt) to cred1
endif
if !file("cred2.ntx")
inde on if(rp,'1','0')+dtoc(tran_dt) to cred2
endif
set index to cred.NTX,cred1.NTX,cred2.ntx
set order to 1
//select cred
return nil
procedure od1
select cred
set order to 1
retu nil
Procedure Save1
Winc.Text_1.Save
Winc.Text_2.Save
winc.edit_1.save
winc.text_3.save
winc.text_6.save
winc.check_1.save
Return
procedure my_del1
if msgyesno("are you sure ?","confirm deletion")
dbdelete()
pack
refresh2()
endif
retu
procedure bm2
winc.b_accept.enabled := .f.
winc.b_cancel.enabled:= .f.
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
procedure my_search2
winc.label_61.visible:= .t.
winc.text_61.visible:= .t.
winc.b_1.visible:= .t.
winc.text_61.setfocus
retu
procedure my_find1
//local rs:=alltrim(lower(winc.text_61.value))
//rs:=alltrim(rs)
save_sel:=alias()
sele cred
set filter to alltrim(lower(winc.text_61.value)) $ narr
go top
refresh2()
my_refresh2()
set filter to
sele &save_sel
winc.label_61.visible:= .f.
winc.text_61.visible:= .f.
winc.b_1.visible:= .f.
retu
PROCEDURE KBV
LOCAL S1,S2
S1:=THIS.HEIGHT
S2:=THIS.WIDTH
MSGINFO(S1)
MSGINFO(S2)
RETU
procedure cr_rep
run del tmp1.dbf
gen_dbf11()
sele tmp1
appe from cred for rp=.f.
go top
do while ! eof()
msrno=tmp1->srno
mtran_dt=tmp1->tran_dt
mdys=date()-mtran_dt
repl dys with mdys
skip
enddo
gen_ind11()
set console off
set print on
set device to prin
set printer to tmp1.txt
?
ms:='credi reports of bhambhani enterprise'
?padc(ms,85)
?
? padr('date',10)+' '+padr('narration',40)+' '+padr('amount',10)+'pending for dys'
? replicate('-',85)
do while ! eof()
? padr(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+ ' '+str(amt,10,2) + ' '+str(dys,12,2)
skip
enddo
use
set print to
set device to screen
set print off
set console on
//run ed tmp.txt
run txt2pdf tmp1.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32
run del tmp.*
close all
run del *.ntx
retu nil
function gen_dbf11
if !file("tmp1.dbf")
sdbf := {}
aadd(sdbf,{'srno','c',8,0})
aadd(sdbf,{'tran_dt','d',8,0})
aadd(sdbf,{'narr','c',80,0})
aadd(sdbf,{'amt','n',12,2})
aadd(sdbf,{'rp','l',1,0})
aadd(sdbf,{ 'dys','n',12,2})
dbcreate("tmp1",sdbf)
endif
sele 0
use tmp1 alias tmp1
retu nil
function gen_ind11
sele tmp1
if !file("tmp1.ntx")
inde on (99999999-dys) to tmp1
endif
set index to tmp1.NTX
set order to 1
//tone(500,20)
return nil
procedure cred_se
define window winpqr at 0, 0 height 600 width 600 title 'hi' on init (odpqr(),se1pqr()) on release cd1pqr() BACKCOLOR RNDCOLOR
DEFINE BROWSE Browse_1
ROW 100
COL 0
WIDTH 450
HEIGHT 600
VALUE 0
WIDTHS {200,30,50,100,100}
HEADERS {'narration ','receipt/paid','amount','dt given','dt returned'}
WORKAREA cred
FIELDS {'cred->narr','cred->rp','cred->amt','cred->tran_dt','cred->ret_dt'}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
DYNAMICBACKCOLOR Nil
DYNAMICFORECOLOR Nil
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 5,5 label lbl_1 value 'narration'
@ 25,5 textbox text_1 width 300 height 30
@ 60,5 textbox text_2 width 300 height 30
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
/*
@ 5, 340 label lbl_2 value 'r/p'
@ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1()
@ 5, 380 label lbl_3 value 'amount'
@ 25,380 textbox text_4 width 100 height 30 numeric
*/
@ 60 , 340 button btn_1 caption ' save & continue' on click (pqr11(),se1pqr())
@ 60, 440 button btn_3 caption 'save & exit ' on click (pqr11())
@ 60, 540 button btn_4 caption 'exit ' on click (winpqr.release)
/*
@ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1()
winpqr.lb.visible:=.f.
*/
end window
maximize window winpqr
activate window winpqr
retu nil
procedure se1pqr
winpqr.text_1.value:=space(40)
winpqr.text_2.value:=space(40)
//winpqr.text_3.value:='r'
winpqr.text_4.value:=0
winpqr.text_1.setfocus
retu
procedure pqr11()
local m1
local m2 :=date()
go bott
m3:=val(cred->srno)
m1:=reccount()
m1:=max(m1,m3)+1
m1:=padl(m1,8,'0')
append blank
repl srno with m1
repl tran_dt with m2
repl narr with alltrim(winpqr.text_1.value)+' '+alltrim(winpqr.text_2.value)
//repl rp with winpqr.text_3.value
repl amt with winpqr.text_4.value
go top
winpqr.browse_1.refresh
retu nil
procedure odpqr
use cred alias cred new
select cred
retu nil
procedure cd1pqr
use
run del *.ntx
retu nil
function my_hi
local rl
rl=.f.
if !file("c:\windows\system32\mymem.mem")
rl=.f.
else
restore from "c:\windows\system32\mymem.mem"
mdt1=ctod(enc_str(substr(z4,1,10)))
mdt2=ctod(enc_str(substr(z4,14,10)))
if date()>mdt2
rl=.f.
else
rl=.t.
endif
endif
retu rl
function enc_chr(s)
local rs
rs=chr(255-asc(s))
retu rs
function enc_str(s)
local rs,l
l=len(s)
rs=""
for i=1 to l
ks=substr(s,i,1)
rs=rs+enc_chr(ks)
next
retu rs
procedure credits
LOCAL bColor := { || if(!cred->rp,my_red,my_green) }
DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil
DEFINE LABEL Label_1
ROW 60
COL 190
WIDTH 450
HEIGHT 30
VALUE "credit module of bhambhani enterprise"
FONTNAME "Arial"
FONTSIZE 18
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
CENTERALIGN .T.
END LABEL
DEFINE LABEL Label_2
ROW 150
COL 80
WIDTH 120
HEIGHT 24
VALUE "sr. no.:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_1
ROW 150
COL 250
WIDTH 120
HEIGHT 24
field cred->srno
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .f.
RIGHTALIGN .F.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
END TEXTBOX
DEFINE LABEL Label_3
ROW 210
COL 80
WIDTH 120
HEIGHT 24
VALUE "narration"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE EDITBOX Edit_1
ROW 210
COL 250
WIDTH 350
HEIGHT 120
VALUE ""
field cred->narr
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
HSCROLLBAR .T.
VSCROLLBAR .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
BACKCOLOR Nil
FONTCOLOR Nil
END EDITBOX
DEFINE TEXTBOX Text_3
ROW 360
COL 250
WIDTH 120
HEIGHT 24
field cred->tran_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
DATE .T.
VALUE Nil
END TEXTBOX
DEFINE LABEL Label_4
ROW 360
COL 80
WIDTH 120
HEIGHT 24
VALUE "date given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE LABEL Label_5
ROW 420
COL 80
WIDTH 120
HEIGHT 24
VALUE "amount given:-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_2
ROW 420
COL 250
WIDTH 120
HEIGHT 24
field cred->amt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
numeric .t.
END TEXTBOX
DEFINE CHECKBOX Check_1
ROW 480
COL 80
WIDTH 100
HEIGHT 28
CAPTION "returned ?"
VALUE .F.
field cred->rp
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
BACKCOLOR Nil
FONTCOLOR Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
END CHECKBOX
DEFINE LABEL Label_6
ROW 480
COL 200
WIDTH 120
HEIGHT 24
VALUE "date returned :-"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
HELPID Nil
VISIBLE .T.
TRANSPARENT .F.
ACTION Nil
AUTOSIZE .F.
BACKCOLOR Nil
FONTCOLOR Nil
END LABEL
DEFINE TEXTBOX Text_6
ROW 480
COL 350
WIDTH 120
HEIGHT 24
field cred->ret_dt
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE Nil
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONENTER Nil
HELPID Nil
TABSTOP .T.
VISIBLE .T.
READONLY .F.
RIGHTALIGN .T.
DISABLEDBACKCOLOR Nil
DISABLEDFONTCOLOR Nil
CASECONVERT NONE
BACKCOLOR Nil
FONTCOLOR Nil
INPUTMASK Nil
FORMAT Nil
date .t.
END TEXTBOX
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD
BUTTON TOP ;
CAPTION '&Top' ;
PICTURE 'primero.bmp' ;
tooltip "go to the top of the file " ;
ACTION ( DbGoTop() , Refresh2() )
BUTTON NEXT ;
CAPTION '&Next';
PICTURE 'siguiente.bmp' ;
ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() )
tooltip "go to next record of the file"
BUTTON PREVIOUS ;
CAPTION '&Previous';
PICTURE 'anterior.bmp' ;
tooltip "go to previous record of the file";
ACTION ( DbSkip(-1) , Refresh2() )
BUTTON BOTTOM ;
CAPTION '&Bottom' ;
PICTURE 'ultimo.bmp' ;
ACTION ( DbGoBottom() , Refresh2() );
tooltip "go to the last record of the file"
BUTTON SAVE ;
CAPTION '&Save' ;
PICTURE 'guardar.bmp' ;
ACTION ( save1() , Refresh2() );
tooltip "save changes in the file"
BUTTON gUNDO ;
CAPTION '&Undo' ;
PICTURE 'deshacer.bmp' ;
ACTION ( Refresh2() );
tooltip "discard changes made"
BUTTON delete ;
CAPTION '&delete' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_del1(),Refresh2() );
tooltip "delete current record of the file"
BUTTON add ;
CAPTION '&add' ;
PICTURE 'deshacer.bmp' ;
ACTION ( my_add2() ) ;
tooltip "add new record to the file"
BUTTON edit ;
CAPTION '&edit' ;
PICTURE 'deshacer.bmp' ;
ACTION ( save1(),refresh2()) ;
tooltip "add new record to the file"
//separator
BUTTON find ;
CAPTION '&find' ;
PICTURE 'deshacer.bmp' ;
ACTION (my_search2()) // my_find() );
tooltip "search record of the file"
BUTTON exit ;
CAPTION '&exit' ;
PICTURE 'deshacer.bmp' ;
ACTION (thiswindow.release) // my_find() );
tooltip "close this window"
button kbv;
caption 'report';
action (mekbv());
tooltip 'see data in different format'
END TOOLBAR
@ 600,80 button b_accept ;
caption 'accept' ;
action ( my_accept2())
@ 600,200 button b_cancel ;
caption 'cancel' ;
action (my_cancel2())
DEFINE STATUSBAR FONT "Arial" SIZE 9
STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com"
DATE
CLOCK
STATUSITEM date()
END STATUSBAR
DEFINE BROWSE Browse_1
ROW 80+100
COL 650
WIDTH 450
HEIGHT 800
VALUE 0
WIDTHS {50,100,80,20,200}
HEADERS {'srno','date','amt','r/p','narr'}
WORKAREA cred
FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'}
dynamicbackcolor {bColor,bColor,bColor,bColor,bColor}
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
ONCHANGE my_refresh2()
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
FONTBOLD .t.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONDBLCLICK Nil
ALLOWEDIT .f.
ALLOWAPPEND .f.
ONHEADCLICK Nil
ALLOWDELETE .F.
HELPID Nil
VALID Nil
VALIDMESSAGES Nil
LOCK .F.
VSCROLLBAR .T.
INPUTMASK Nil
FORMAT Nil
WHEN Nil
INPUTITEMS Nil
DISPLAYITEMS Nil
BACKCOLOR {0,255,0}
FONTCOLOR Nil
IMAGE Nil
JUSTIFY Nil
NOLINES .F.
READONLYFIELDS Nil
HEADERIMAGES Nil
END BROWSE
@ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150
@ 150,830 textbox text_61 width 50
@ 150,900 button b_1 caption 'search' action (my_find1())
END WINDOW
center window winc
maximize window winc
activate window winc
retu nil
- serge_girard
- Posts: 3165
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: hmg 3.4.1 error help
Kiritved,
Could you please send code + database files in a ZIP file. Now is very hard to copy/paste coding from the webbrowser...
Serge
Could you please send code + database files in a ZIP file. Now is very hard to copy/paste coding from the webbrowser...
Serge
There's nothing you can do that can't be done...
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: hmg 3.4.1 error help
Hi Kiritved :
if you use the full version editor to write a new topic or reply to a post Use the button pointed to there within add your source code as it is tedious to go all the publication ..
Thanks for participating in HMGforum
[attachment=0]editor.jpg[/attachment]
if you use the full version editor to write a new topic or reply to a post Use the button pointed to there within add your source code as it is tedious to go all the publication ..
Thanks for participating in HMGforum
[attachment=0]editor.jpg[/attachment]
- Attachments
-
- editor.jpg (34.79 KiB) Viewed 7260 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Re: hmg 3.4.1 error help
kiritved wrote:sorry for posting incomplete code
below is the full codeCode: Select all
# include <hmg.ch> EQUEST HB_GT_WIN_DEFAULT function main set date amer if my_hi() my_main() endif retu nil FUNCTION my_main set date brit set century on set font to "ms san sarif",15 SET TOOLTIPSTYLE BALLOON # define RNDCOLOR {RANDOM(255),RANDOM(255),RANDOM(255)} # define my_red {255,0,0} # define my_green {0,255,0} DEFINE WINDOW winK AT 138 , 235 WIDTH 1004 HEIGHT 430 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE 'software developedment assisted by kirit b. ved @9869015508/09167551554' ICON NIL NOSIZE CURSOR NIL ON INIT NIL ON RELEASE NIL ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE NIL ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil main define main menu define popup 'accounts' menuitem 'accounts normal hotkey alt+a' action acc_main() separator menuitem 'account-speed entry hotkey alt+s' action acc_se() separator menuitem 'print ledger hotkey alt+l' action my_print() end popup define popup 'credits' menuitem 'credit hotkey alt+c' action credits() separator menuitem 'credit speed entry alt+q' action cred_se() separator menuitem 'credit report alt+r' action cr_rep() end popup define popup 'quit' menuitem 'quit program' action (wink.release) end popup end menu DEFINE IMAGE Image_1 ROW 0 COL 0 WIDTH 1606 HEIGHT 137 PICTURE "header.bmp" HELPID Nil VISIBLE .T. STRETCH .T. ACTION Nil END IMAGE on key ALT+A of win action acc_main() on key ALT+S of win action acc_se() on key ALT+L of win action my_print() on key ALT+c of win action credits() on key ALT+q of win action cred_se() END WINDOW maximize window winK ACTIVATE WINDOW WINK retu procedure acc_main open_win1() retu nil function gen_dbf if !file("acc.dbf") sdbf := {} aadd(sdbf,{'srno','c',8,0}) aadd(sdbf,{'tran_dt','d',8,0}) aadd(sdbf,{'narr','c',80,0}) aadd(sdbf,{'amt','n',12,2}) aadd(sdbf,{'rp','c',1,0}) dbcreate("acc",sdbf) endif retu nil function gen_ind() sele 0 use acc alias acc if !file("acc.ntx") inde on srno to acc endif if !file("acc1.ntx") inde on dtoc(tran_dt) to acc1 endif set index to acc.NTX,acc1.NTX set order to 1 return nil procedure open_win1 DEFINE WINDOW win1 AT 132 , 235 WIDTH 1200 HEIGHT 800 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm1(),gen_dbf() ,gen_ind()) ON RELEASE CD() ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil DEFINE LABEL Label_1 ROW 70 COL 230 WIDTH 520 HEIGHT 40 VALUE "account data entry form" FONTNAME "Arial" FONTSIZE 16 TOOLTIP "" FONTBOLD .T. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil CENTERALIGN .T. END LABEL DEFINE LABEL Label_2 ROW 180 COL 200 WIDTH 120 HEIGHT 24 VALUE "serial number :-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_1 ROW 180 COL 390 WIDTH 120 HEIGHT 24 field acc->srno FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .f. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil NUMERIC .f. VALUE Nil END TEXTBOX DEFINE LABEL Label_3 ROW 230 COL 200 WIDTH 120 HEIGHT 24 VALUE "transaction date :-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_2 ROW 230 COL 390 WIDTH 120 HEIGHT 24 field acc->tran_dt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .F. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil DATE .T. VALUE Nil END TEXTBOX DEFINE LABEL Label_4 ROW 280 COL 200 WIDTH 120 HEIGHT 24 VALUE "narration :-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE EDITBOX Edit_1 ROW 280 COL 390 WIDTH 200 HEIGHT 100 field acc->narr VALUE "" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. HSCROLLBAR .T. VSCROLLBAR .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil BACKCOLOR Nil FONTCOLOR Nil MAXLENGTH 100 END EDITBOX DEFINE LABEL Label_5 ROW 450 COL 200 WIDTH 120 HEIGHT 24 VALUE "amount :-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_3 ROW 450 COL 390 WIDTH 120 HEIGHT 24 FONTNAME "Arial" FONTSIZE 9 field acc->amt TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .F. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil NUMERIC .T. VALUE Nil END TEXTBOX DEFINE TEXTBOX Text_4 ROW 510 COL 390 WIDTH 120 HEIGHT 24 FONTNAME "Arial" FONTSIZE 9 field acc->rp TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS lb() FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .F. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil NUMERIC .f. VALUE Nil tooltip 'enter only r or p for receipt & paid ' END TEXTBOX DEFINE LABEL Label_6 ROW 510 COL 200 WIDTH 120 HEIGHT 50 VALUE "mode of payment (received or paid)" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL @ 400 ,650 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc() win1.lb.visible:=.f. DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD BUTTON TOP ; CAPTION '&Top' ; PICTURE 'primero.bmp' ; tooltip "go to the top of the file " ; ACTION ( DbGoTop() , Refresh1() ) BUTTON NEXT ; CAPTION '&Next'; PICTURE 'siguiente.bmp' ; ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh1() ) tooltip "go to next record of the file" BUTTON PREVIOUS ; CAPTION '&Previous'; PICTURE 'anterior.bmp' ; tooltip "go to previous record of the file"; ACTION ( DbSkip(-1) , Refresh1() ) BUTTON BOTTOM ; CAPTION '&Bottom' ; PICTURE 'ultimo.bmp' ; ACTION ( DbGoBottom() , Refresh1() ); tooltip "go to the last record of the file" BUTTON SAVE ; CAPTION '&Save' ; PICTURE 'guardar.bmp' ; ACTION ( Save() , Refresh1() ); tooltip "save changes in the file" BUTTON gUNDO ; CAPTION '&Undo' ; PICTURE 'deshacer.bmp' ; ACTION ( Refresh1() ); tooltip "discard changes made" BUTTON delete ; CAPTION '&delete' ; PICTURE 'deshacer.bmp' ; ACTION ( my_del(),Refresh1() ); tooltip "delete current record of the file" BUTTON add ; CAPTION '&add' ; PICTURE 'deshacer.bmp' ; ACTION ( my_add1() ) ; tooltip "add new record to the file" //separator BUTTON find ; CAPTION '&find' ; PICTURE 'deshacer.bmp' ; ACTION (my_search1()) // my_find() ); tooltip "search record of the file" BUTTON exit ; CAPTION '&exit' ; PICTURE 'deshacer.bmp' ; ACTION (thiswindow.release) // my_find() ); tooltip "close this window" END TOOLBAR @ 600,80 button b_accept ; caption 'accept' ; action ( my_accept1()) @ 600,200 button b_cancel ; caption 'cancel' ; action (my_cancel1()) DEFINE STATUSBAR FONT "Arial" SIZE 9 STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com" DATE CLOCK STATUSITEM date() END STATUSBAR DEFINE BROWSE Browse_1 ROW 80+100 COL 650 WIDTH 650 HEIGHT 800 VALUE 0 WIDTHS {100,100,100,100,400} HEADERS {'srno','date','amt','r/p','narr'} WORKAREA acc FIELDS {'acc->srno','acc->tran_dt' ,'acc->amt','acc->rp','acc->narr'} FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE refresh11() ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .t. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONDBLCLICK Nil ALLOWEDIT .f. ALLOWAPPEND .f. ONHEADCLICK Nil ALLOWDELETE .F. HELPID Nil VALID Nil VALIDMESSAGES Nil LOCK .F. VSCROLLBAR .T. INPUTMASK Nil FORMAT Nil WHEN Nil INPUTITEMS Nil DISPLAYITEMS Nil BACKCOLOR NIL FONTCOLOR Nil IMAGE Nil JUSTIFY Nil NOLINES .F. READONLYFIELDS Nil HEADERIMAGES Nil END BROWSE @ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150 @ 150,830 textbox text_61 width 50 @ 150,900 button b_1 caption 'search' action (my_find()) END WINDOW maximize window win1 activate window win1 retu nil Procedure Refresh1 win1.Text_1.Refresh win1.Text_2.Refresh win1.edit_1.Refresh win1.Text_3.Refresh win1.text_4.Refresh m:=recno() win1.browse_1.value:=m win1.browse_1.refresh Return Procedure Refresh11 m:= win1.browse_1.value go m /* win1.text_1.value:=acc->srno win1.text_2.value:=acc->tran_dt win1.edit_1.value:=acc->narr win1.text_3.value:=acc->amt win1.text_4.value:=acc->rp */ refresh1() Return /* text_1 edit_1 monthcal_1 text_2 check_1 */ procedure bm1 win1.b_accept.enabled := .f. win1.b_cancel.enabled:= .f. win1.label_61.visible:= .f. win1.text_61.visible:= .f. win1.b_1.visible:= .f. retu Procedure Save Win1.Text_1.Save Win1.Text_2.Save win1.text_3.save win1.edit_1.save win1.text_4.save Return procedure my_del if msgyesno("are you sure ?","confirm deletion") dbdelete() pack refresh() endif retu procedure my_add1 dbgobottom() skip 1 refresh1() win1.text_2.value:=date() win1.b_accept.enabled := .t. win1.b_cancel.enabled:= .t. win1.toolbar_1.top.enabled:=.f. win1.toolbar_1.next.enabled:=.f. win1.toolbar_1.previous.enabled:=.f. win1.toolbar_1.bottom.enabled:=.f. win1.toolbar_1.save.enabled:=.f. win1.toolbar_1.gundo.enabled:=.f. win1.toolbar_1.delete.enabled:=.f. win1.toolbar_1.add.enabled:=.f. win1.toolbar_1.find.enabled:=.f. retu procedure my_search1 win1.label_61.visible:= .t. win1.text_61.visible:= .t. win1.b_1.visible:= .t. win1.text_61.setfocus retu procedure my_accept1 if my_valid(win1.text_1.value,"acc") dbappend() acc->srno:=win1.text_1.value acc->tran_dt:=win1.text_2.value acc->narr:=win1.edit_1.value acc->amt:=win1.text_3.value acc->rp:=win1.text_4.value else dbgotop() endif win1.b_accept.enabled := .f. win1.b_cancel.enabled:= .f. win1.toolbar_1.top.enabled:=.t. win1.toolbar_1.next.enabled:=.t. win1.toolbar_1.previous.enabled:=.t. win1.toolbar_1.bottom.enabled:=.t. win1.toolbar_1.save.enabled:=.t. win1.toolbar_1.gundo.enabled:=.t. win1.toolbar_1.delete.enabled:=.t. win1.toolbar_1.add.enabled:=.t. win1.toolbar_1.find.enabled:=.t. refresh1() retu procedure my_cancel1 win1.b_accept.enabled := .f. win1.b_cancel.enabled:= .f. win1.toolbar_1.top.enabled:=.t. win1.toolbar_1.next.enabled:=.t. win1.toolbar_1.previous.enabled:=.t. win1.toolbar_1.bottom.enabled:=.t. win1.toolbar_1.save.enabled:=.t. win1.toolbar_1.gundo.enabled:=.t. win1.toolbar_1.delete.enabled:=.t. win1.toolbar_1.add.enabled:=.t. refresh() retu Procedure my_Refresh1 m:=win1.browse_1.value go m win1.Text_1.Refresh win1.Text_2.Refresh win1.text_3.refresh win1.edit_1.refresh win1.text_4.refresh Return procedure my_find //local rs:=alltrim(lower(win1.text_61.value)) //rs:=alltrim(rs) save_sel:=alias() sele acc set filter to alltrim(lower(win1.text_61.value)) $ narr go top refresh() my_refresh() set filter to sele &save_sel win1.label_61.visible:= .f. win1.text_61.visible:= .f. win1.b_1.visible:= .f. retu Procedure my_Refresh m:=win1.browse_1.value go m Win1.Text_1.Refresh Win1.Text_2.Refresh win1.text_3.refresh win1.text_4.refresh Return Procedure Refresh Win1.Text_1.Refresh Win1.Text_2.Refresh Win1.Text_3.Refresh Win1.Text_4.Refresh win1.browse_1.value:=recno() win1.browse_1.refresh Return function my_valid(s,als) local rl:=.f.,rn,save_sel if len(alltrim(s)) > 0 rl:=.t. else msginfo("code can not be blank") win1.text_1.setfocus endif if rl==.t. save_sel:=alias() sele &als seek s if found() rl:=.f. msginfo("code already exists in database") win1.text_1.setfocus endif sele &save_sel endif retu rl function pqr local rv select acc if acc->rp="r" rv:=1 else rv:=2 endif retu rv procedure qwe my:={'r','p'} retu nil //syntex for the function chk is chk({'flat','shop'},"s") function chk(a,b) local r:=0 local p:=0 k:=len(a) for i=1 to k r=chk1(a[i],b) if r==1 p:=i exit endif next retu p function chk1(p,q) local r:=0 if p == q r:=1 endif retu r procedure lb if chk({'r','p'}, win1.text_4.value)=0 win1.lb.visible:=.t. win1.lb.setfocus endif retu nil procedure lbproc win1.text_4.value:=win1.lb.item(win1.lb.value) win1.lb.visible:=.f. retu nil PROCEDURE CD CLOSE ALL RETU PROCEDURE meri_jaan run d.exe RUN DEL *.NTX) retu procedure acc_se define window win2 at 0, 0 height 600 width 600 title 'hi' on init (od(),se()) on release cd1() BACKCOLOR RNDCOLOR DEFINE BROWSE Browse_1 ROW 100 COL 0 WIDTH 450 HEIGHT 600 VALUE 0 WIDTHS {200,30,50} HEADERS {'narration ','receipt/paid','amount'} WORKAREA acc FIELDS {'acc->narr','acc->rp','acc->amt'} FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .t. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONDBLCLICK Nil ALLOWEDIT .f. ALLOWAPPEND .f. ONHEADCLICK Nil ALLOWDELETE .F. HELPID Nil VALID Nil VALIDMESSAGES Nil LOCK .F. VSCROLLBAR .T. DYNAMICBACKCOLOR Nil DYNAMICFORECOLOR Nil INPUTMASK Nil FORMAT Nil WHEN Nil INPUTITEMS Nil DISPLAYITEMS Nil BACKCOLOR {0,255,0} FONTCOLOR Nil IMAGE Nil JUSTIFY Nil NOLINES .F. READONLYFIELDS Nil HEADERIMAGES Nil END BROWSE @ 5,5 label lbl_1 value 'narration' @ 25,5 textbox text_1 width 300 height 30 @ 60,5 textbox text_2 width 300 height 30 @ 5, 340 label lbl_2 value 'r/p' @ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1() @ 5, 380 label lbl_3 value 'amount' @ 25,380 textbox text_4 width 100 height 30 numeric @ 60 , 340 button btn_1 caption ' save & continue' on click (pqr1(),se()) @ 60, 440 button btn_3 caption 'save & exit ' on click (pqr1()) @ 60, 540 button btn_4 caption 'exit ' on click (win2.release) @ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1() win2.lb.visible:=.f. end window maximize window win2 activate window win2 retu nil procedure od use acc alias acc new select acc retu nil procedure cd1 use run del *.ntx retu nil procedure acc_sa retu procedure se win2.text_1.value:=space(40) win2.text_2.value:=space(40) win2.text_3.value:='r' win2.text_4.value:=0 win2.text_1.setfocus retu procedure pqr1() local m1 local m2 :=date() go bott m3:=val(acc->srno) m1:=reccount() m1:=max(m1,m3)+1 m1:=padl(m1,8,'0') append blank repl srno with m1 repl tran_dt with m2 repl narr with alltrim(win2.text_1.value)+' '+alltrim(win2.text_2.value) repl rp with win2.text_3.value repl amt with win2.text_4.value go top win2.browse_1.refresh retu nil procedure lb1 if chk({'r','p'}, win2.text_3.value)=0 MessageBoxTimeout('only r for receipt & p for paid is allowed here','attention',0,3000) win2.text_3.setfocus endif retu nil procedure lbproc1 msginfo(win2.text_3.value) retu nil procedure my_print set date brit set century on DEFINE WINDOW winx AT 138 , 235 WIDTH 808 HEIGHT 494 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil child DEFINE LABEL Label_1 ROW 60 COL 170 WIDTH 450 HEIGHT 30 VALUE "printing of accounts between two dates" FONTNAME "Arial" FONTSIZE 18 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil CENTERALIGN .T. END LABEL DEFINE MONTHCALENDAR MonthCal_1 ROW 140 COL 140 WIDTH 227 HEIGHT 162 FONTNAME "Arial" FONTSIZE 9 TOOLTIP "enter start date" ONCHANGE mc() FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil TABSTOP .T. VISIBLE .T. NOTODAY .F. NOTODAYCIRCLE .F. WEEKNUMBERS .F. END MONTHCALENDAR DEFINE MONTHCALENDAR MonthCal_2 ROW 140 COL 430 WIDTH 227 HEIGHT 162 FONTNAME "Arial" FONTSIZE 9 TOOLTIP "enter end date" ONCHANGE mc() FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil TABSTOP .T. VISIBLE .T. NOTODAY .F. NOTODAYCIRCLE .F. WEEKNUMBERS .F. END MONTHCALENDAR /* define textbox mc_1 row 400 col 140 //autosize .t. width 100 date .t. value winx.monthcal_1.value end textbox define textbox mc_2 row 400 col 430 width 100 date .t. value winx.monthcal_2.value //autosize .t. end textbox */ DEFINE BUTTON Button_1 ROW 350 COL 350 WIDTH 100 HEIGHT 28 ACTION my_pxxx() CAPTION "get ledger" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONGOTFOCUS Nil ONLOSTFOCUS Nil HELPID Nil FLAT .F. TABSTOP .T. VISIBLE .T. TRANSPARENT .F. MULTILINE .F. PICTURE Nil PICTALIGNMENT TOP END BUTTON END WINDOW center window winx maximize window winx activate window winx retu procedure mc /* winx.mc_1.value:=winx.monthcal_1.value winx.mc_2.value:=winx.monthcal_2.value */ retu procedure my_pxxx my_od() /* set date brit set century on */ go top m1:=tran_dt go bott m2:=tran_dt mdt1:=winx.monthcal_1.value mdt2:=winx.monthcal_2.value /* if !( (mdt1>=m1 .and. mdt2<=m2 ) .or. (mdt2>=mdt1)) msginfo('dates must be between ' + dtoc(mdt1) +' & '+dtoc(mdt2) ) winx.monthcal_1.setfocus endif */ go top repl all fl1 with 1 for tran_dt< mdt1 repl all fl1 with 2 for tran_dt>=mdt1 .and. tran_dt<=mdt2 go top sum(iif(rp='r',amt,-amt)) to myob for fl1=1 sum(iif(rp='r',amt,-amt)) to mycb for fl1=1 .or. fl1=2 if file('tmp.dbf') run del tmp.dbf endif copy to tmp.dbf for fl1=2 use tmp new appe blank repl srno with '00000000' repl narr with 'opening balance' if myob>=0 repl rp with 'r' else repl rp with 'p' endif repl amt with abs(myob) repl tran_dt with mdt1 appe blank repl srno with '99999999' repl narr with 'closing balance' if mycb>=0 repl rp with 'r' else repl rp with 'p' endif repl amt with abs(mycb) repl tran_dt with mdt2 inde on srno to tmp go top set print to tmp.txt set devi to prin set print on set console off set print to tmp.txt ? if dtoc(mdt1) = dtoc(mdt2) ms:='accounts of bhambhani enterprise for '+' ' + dtoc(mdt1) else ms:='accounts of bhambhani enterprise from '+' ' + dtoc(mdt1) + ' to '+dtoc(mdt2) endif ?padc(ms,88) ? ? PADR('DATE',10)+' '+padr('narration',40)+' '+padC('amount',30) ? PADR(' ',50)+SPACE(10)+PADR('RECEIVED',10)+PADR('PAID',10)+PADR('CUM.TOTAL',10) ? replicate('-',88) MYSUM:=0 mysum1:=0 mysum2:=0 m:=reccount() s:=0 go top do while ! eof() s:=s+1 MYSUM:=MYSUM+iif(rp='r',amt,-amt) if s=m ?replicate('-',88) ?padr('total',56)+str(mysum1,10,2)+str(mysum2,10,2) ?replicate('-',88) ? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+space(10) //STR(MYSUM,10,2) else mysum1:=mysum1+iif(rp='r',amt,0) mysum2:=mysum2+iif(rp='r',0,amt) ? PADR(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+' '+iif(rp='r',str(amt,10,2)+space(10),space(10)+str(amt,10,2)) +' '+STR(MYSUM,10,2) endif skip enddo use set print to set device to screen set print off set console on //run ed tmp.txt run txt2pdf tmp.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32 run del tmp.* run del *.ntx close all retu nil procedure my_od select 0 use acc alias acc new inde on srno to acc inde on dtos(tran_dt) to acc1 set order to 2 retu nil procedure _se DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil DEFINE LABEL Label_1 ROW 60 COL 190 WIDTH 450 HEIGHT 30 VALUE "credit module of bhambhani enterprise" FONTNAME "Arial" FONTSIZE 18 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil CENTERALIGN .T. END LABEL DEFINE LABEL Label_2 ROW 150 COL 80 WIDTH 120 HEIGHT 24 VALUE "sr. no.:-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_1 ROW 150 COL 250 WIDTH 120 HEIGHT 24 field cred->srno FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .f. RIGHTALIGN .F. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil END TEXTBOX DEFINE LABEL Label_3 ROW 210 COL 80 WIDTH 120 HEIGHT 24 VALUE "narration" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE EDITBOX Edit_1 ROW 210 COL 250 WIDTH 350 HEIGHT 120 VALUE "" field cred->narr FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. HSCROLLBAR .T. VSCROLLBAR .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil BACKCOLOR Nil FONTCOLOR Nil END EDITBOX DEFINE TEXTBOX Text_3 ROW 360 COL 250 WIDTH 120 HEIGHT 24 field cred->tran_dt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil DATE .T. VALUE Nil END TEXTBOX DEFINE LABEL Label_4 ROW 360 COL 80 WIDTH 120 HEIGHT 24 VALUE "date given:-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE LABEL Label_5 ROW 420 COL 80 WIDTH 120 HEIGHT 24 VALUE "amount given:-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_2 ROW 420 COL 250 WIDTH 120 HEIGHT 24 field cred->amt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil numeric .t. END TEXTBOX DEFINE CHECKBOX Check_1 ROW 480 COL 80 WIDTH 100 HEIGHT 28 CAPTION "returned ?" VALUE .F. field cred->rp FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. BACKCOLOR Nil FONTCOLOR Nil HELPID Nil TABSTOP .T. VISIBLE .T. TRANSPARENT .F. END CHECKBOX DEFINE LABEL Label_6 ROW 480 COL 200 WIDTH 120 HEIGHT 24 VALUE "date returned :-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_6 ROW 480 COL 350 WIDTH 120 HEIGHT 24 field cred->ret_dt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil date .t. END TEXTBOX DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD BUTTON TOP ; CAPTION '&Top' ; PICTURE 'primero.bmp' ; tooltip "go to the top of the file " ; ACTION ( DbGoTop() , Refresh2() ) BUTTON NEXT ; CAPTION '&Next'; PICTURE 'siguiente.bmp' ; ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() ) tooltip "go to next record of the file" BUTTON PREVIOUS ; CAPTION '&Previous'; PICTURE 'anterior.bmp' ; tooltip "go to previous record of the file"; ACTION ( DbSkip(-1) , Refresh2() ) BUTTON BOTTOM ; CAPTION '&Bottom' ; PICTURE 'ultimo.bmp' ; ACTION ( DbGoBottom() , Refresh2() ); tooltip "go to the last record of the file" BUTTON SAVE ; CAPTION '&Save' ; PICTURE 'guardar.bmp' ; ACTION ( save1() , Refresh2() ); tooltip "save changes in the file" BUTTON gUNDO ; CAPTION '&Undo' ; PICTURE 'deshacer.bmp' ; ACTION ( Refresh2() ); tooltip "discard changes made" BUTTON delete ; CAPTION '&delete' ; PICTURE 'deshacer.bmp' ; ACTION ( my_del1(),Refresh2() ); tooltip "delete current record of the file" BUTTON add ; CAPTION '&add' ; PICTURE 'deshacer.bmp' ; ACTION ( my_add2() ) ; tooltip "add new record to the file" BUTTON edit ; CAPTION '&edit' ; PICTURE 'deshacer.bmp' ; ACTION ( save1(),refresh2()) ; tooltip "add new record to the file" //separator BUTTON find ; CAPTION '&find' ; PICTURE 'deshacer.bmp' ; ACTION (my_search2()) // my_find() ); tooltip "search record of the file" BUTTON exit ; CAPTION '&exit' ; PICTURE 'deshacer.bmp' ; ACTION (thiswindow.release) // my_find() ); tooltip "close this window" BUTTON KBV; CAPTION 'REPORT1'; ACTION (MEKBV()); TOOLTIP 'SEE DATA IN DIFFERENT FORMAT' END TOOLBAR @ 600,80 button b_accept ; caption 'accept' ; action ( my_accept2()) @ 600,200 button b_cancel ; caption 'cancel' ; action (my_cancel2()) DEFINE STATUSBAR FONT "Arial" SIZE 9 STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com" DATE CLOCK STATUSITEM date() END STATUSBAR DEFINE BROWSE Browse_1 ROW 80+100 COL 650 WIDTH 450 HEIGHT 800 VALUE 0 WIDTHS {100,100,80,100,200} HEADERS {'srno','date','amt','r/p','narr'} WORKAREA cred FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'} FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE my_refresh2() ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .t. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONDBLCLICK Nil ALLOWEDIT .f. ALLOWAPPEND .f. ONHEADCLICK Nil ALLOWDELETE .F. HELPID Nil VALID Nil VALIDMESSAGES Nil LOCK .F. VSCROLLBAR .T. DYNAMICBACKCOLOR Nil DYNAMICFORECOLOR Nil INPUTMASK Nil FORMAT Nil WHEN Nil INPUTITEMS Nil DISPLAYITEMS Nil BACKCOLOR {0,255,0} FONTCOLOR Nil IMAGE Nil JUSTIFY Nil NOLINES .F. READONLYFIELDS Nil HEADERIMAGES Nil END BROWSE @ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150 @ 150,830 textbox text_61 width 50 @ 150,900 button b_1 caption 'search' action (my_find1()) END WINDOW center window winc maximize window winc activate window winc retu nil procedure mekbv LOCAL bColor := { || if(!cred->rp,my_red,my_green) } define window mekbv at 20,800 height 800 width 700 backcolor RNDCOLOR set order to 3 DEFINE BROWSE Browse_11 ROW 40 COL 50 WIDTH 450 HEIGHT 600 VALUE 0 WIDTHS {100,100,80,80,200} HEADERS {'srno','date','amt','r/p','narr'} WORKAREA cred FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'} FONTNAME "Arial" dynamicbackcolor {bColor,bColor,bColor,bColor,bColor} FONTSIZE 9 TOOLTIP "" ONCHANGE nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .t. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONDBLCLICK Nil ALLOWEDIT .f. ALLOWAPPEND .f. ONHEADCLICK Nil ALLOWDELETE .F. HELPID Nil VALID Nil VALIDMESSAGES Nil LOCK .F. VSCROLLBAR .T. DYNAMICBACKCOLOR Nil DYNAMICFORECOLOR Nil INPUTMASK Nil FORMAT Nil WHEN Nil INPUTITEMS Nil DISPLAYITEMS Nil BACKCOLOR {0,255,0} FONTCOLOR Nil IMAGE Nil JUSTIFY Nil NOLINES .F. READONLYFIELDS Nil HEADERIMAGES Nil END BROWSE define button b_0 row 680 col 250 caption 'quit' action (mekbv.release) end button end window activate window mekbv retu nil Procedure Refresh2 winc.Text_1.Refresh winc.Text_2.Refresh winc.edit_1.Refresh winc.text_3.Refresh winc.text_6.Refresh winc.check_1.Refresh winc.browse_1.value:=recno() winc.browse_1.refresh Return procedure my_add2 winc.check_1.visible:=.f. winc.label_6.visible:=.f. winc.text_6.visible:=.f. dbgobottom() // go bott m3:=val(CRED->srno) m1:=reccount() m1:=max(m1,m3)+1 m1:=padl(m1,8,'0') // skip 1 refresh2() winc.text_3.value:=date() winc.text_1.value:=M1 winc.b_accept.enabled := .t. winc.b_cancel.enabled:= .t. winc.toolbar_1.top.enabled:=.f. winc.toolbar_1.next.enabled:=.f. winc.toolbar_1.previous.enabled:=.f. winc.toolbar_1.bottom.enabled:=.f. winc.toolbar_1.save.enabled:=.f. winc.toolbar_1.gundo.enabled:=.f. winc.toolbar_1.delete.enabled:=.f. winc.toolbar_1.add.enabled:=.f. winc.toolbar_1.find.enabled:=.f. retu procedure se1 winc.text_1.value:=space(8) winc.text_2.value:=0 winc.edit_1.value:=space(80) winc.text_3.value:=date winc.text_3.value:=ctod(' / / ') winc.check_1.value:=.f. winc.text_1.setfocus retu Procedure my_Refresh2 m:=winc.browse_1.value go m winc.Text_1.Refresh winc.Text_2.Refresh winc.edit_1.refresh winc.text_3.refresh winc.text_6.refresh winc.check_1.refresh Return procedure my_accept2 winc.check_1.visible:=.t. winc.label_6.visible:=.t. winc.text_6.visible:=.t. if my_valid(winc.text_1.value,"cred") dbappend() cred->srno:=winc.text_1.value cred->tran_dt:=winc.text_3.value cred->narr:=winc.edit_1.value cred->amt:=winc.text_2.value cred->rp:=winc.check_1.value cred->ret_dt:=winc.text_6.value else dbgotop() endif winc.b_accept.enabled := .f. winc.b_cancel.enabled:= .f. winc.toolbar_1.top.enabled:=.t. winc.toolbar_1.next.enabled:=.t. winc.toolbar_1.previous.enabled:=.t. winc.toolbar_1.bottom.enabled:=.t. winc.toolbar_1.save.enabled:=.t. winc.toolbar_1.gundo.enabled:=.t. winc.toolbar_1.delete.enabled:=.t. winc.toolbar_1.add.enabled:=.t. winc.toolbar_1.find.enabled:=.t. refresh2() retu procedure my_cancel2 winc.check_1.visible:=.t. winc.b_accept.enabled := .f. winc.b_cancel.enabled:= .f. winc.toolbar_1.top.enabled:=.t. winc.toolbar_1.next.enabled:=.t. winc.toolbar_1.previous.enabled:=.t. winc.toolbar_1.bottom.enabled:=.t. winc.toolbar_1.save.enabled:=.t. winc.toolbar_1.gundo.enabled:=.t. winc.toolbar_1.delete.enabled:=.t. winc.toolbar_1.add.enabled:=.t. refresh2() retu function gen_dbf1 if !file("cred.dbf") sdbf := {} aadd(sdbf,{'srno','c',8,0}) aadd(sdbf,{'tran_dt','d',8,0}) aadd(sdbf,{'narr','c',80,0}) aadd(sdbf,{'amt','n',12,2}) aadd(sdbf,{'rp','l',1,0}) aadd(sdbf,{'ret_dt','d',8,0}) dbcreate("cred",sdbf) endif retu nil function gen_ind1 sele 0 use cred alias cred if !file("cred.ntx") inde on srno to cred endif if !file("cred1.ntx") inde on dtoc(tran_dt) to cred1 endif if !file("cred2.ntx") inde on if(rp,'1','0')+dtoc(tran_dt) to cred2 endif set index to cred.NTX,cred1.NTX,cred2.ntx set order to 1 //select cred return nil procedure od1 select cred set order to 1 retu nil Procedure Save1 Winc.Text_1.Save Winc.Text_2.Save winc.edit_1.save winc.text_3.save winc.text_6.save winc.check_1.save Return procedure my_del1 if msgyesno("are you sure ?","confirm deletion") dbdelete() pack refresh2() endif retu procedure bm2 winc.b_accept.enabled := .f. winc.b_cancel.enabled:= .f. winc.label_61.visible:= .f. winc.text_61.visible:= .f. winc.b_1.visible:= .f. retu procedure my_search2 winc.label_61.visible:= .t. winc.text_61.visible:= .t. winc.b_1.visible:= .t. winc.text_61.setfocus retu procedure my_find1 //local rs:=alltrim(lower(winc.text_61.value)) //rs:=alltrim(rs) save_sel:=alias() sele cred set filter to alltrim(lower(winc.text_61.value)) $ narr go top refresh2() my_refresh2() set filter to sele &save_sel winc.label_61.visible:= .f. winc.text_61.visible:= .f. winc.b_1.visible:= .f. retu PROCEDURE KBV LOCAL S1,S2 S1:=THIS.HEIGHT S2:=THIS.WIDTH MSGINFO(S1) MSGINFO(S2) RETU procedure cr_rep run del tmp1.dbf gen_dbf11() sele tmp1 appe from cred for rp=.f. go top do while ! eof() msrno=tmp1->srno mtran_dt=tmp1->tran_dt mdys=date()-mtran_dt repl dys with mdys skip enddo gen_ind11() set console off set print on set device to prin set printer to tmp1.txt ? ms:='credi reports of bhambhani enterprise' ?padc(ms,85) ? ? padr('date',10)+' '+padr('narration',40)+' '+padr('amount',10)+'pending for dys' ? replicate('-',85) do while ! eof() ? padr(dtoc(tran_dt),10)+' '+padr(narr,40)+' '+ ' '+str(amt,10,2) + ' '+str(dys,12,2) skip enddo use set print to set device to screen set print off set console on //run ed tmp.txt run txt2pdf tmp1.txt acc.pdf -pfs10 -oao -ptc2 -pfn201 -pps7 -pwa -plm32 -prm32 run del tmp.* close all run del *.ntx retu nil function gen_dbf11 if !file("tmp1.dbf") sdbf := {} aadd(sdbf,{'srno','c',8,0}) aadd(sdbf,{'tran_dt','d',8,0}) aadd(sdbf,{'narr','c',80,0}) aadd(sdbf,{'amt','n',12,2}) aadd(sdbf,{'rp','l',1,0}) aadd(sdbf,{ 'dys','n',12,2}) dbcreate("tmp1",sdbf) endif sele 0 use tmp1 alias tmp1 retu nil function gen_ind11 sele tmp1 if !file("tmp1.ntx") inde on (99999999-dys) to tmp1 endif set index to tmp1.NTX set order to 1 //tone(500,20) return nil procedure cred_se define window winpqr at 0, 0 height 600 width 600 title 'hi' on init (odpqr(),se1pqr()) on release cd1pqr() BACKCOLOR RNDCOLOR DEFINE BROWSE Browse_1 ROW 100 COL 0 WIDTH 450 HEIGHT 600 VALUE 0 WIDTHS {200,30,50,100,100} HEADERS {'narration ','receipt/paid','amount','dt given','dt returned'} WORKAREA cred FIELDS {'cred->narr','cred->rp','cred->amt','cred->tran_dt','cred->ret_dt'} FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .t. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONDBLCLICK Nil ALLOWEDIT .f. ALLOWAPPEND .f. ONHEADCLICK Nil ALLOWDELETE .F. HELPID Nil VALID Nil VALIDMESSAGES Nil LOCK .F. VSCROLLBAR .T. DYNAMICBACKCOLOR Nil DYNAMICFORECOLOR Nil INPUTMASK Nil FORMAT Nil WHEN Nil INPUTITEMS Nil DISPLAYITEMS Nil BACKCOLOR {0,255,0} FONTCOLOR Nil IMAGE Nil JUSTIFY Nil NOLINES .F. READONLYFIELDS Nil HEADERIMAGES Nil END BROWSE @ 5,5 label lbl_1 value 'narration' @ 25,5 textbox text_1 width 300 height 30 @ 60,5 textbox text_2 width 300 height 30 @ 5, 380 label lbl_3 value 'amount' @ 25,380 textbox text_4 width 100 height 30 numeric /* @ 5, 340 label lbl_2 value 'r/p' @ 25 ,340 textbox text_3 width 30 height 30 tooltip 'enter only r->receipt and p->paid here' on lostfocus lb1() @ 5, 380 label lbl_3 value 'amount' @ 25,380 textbox text_4 width 100 height 30 numeric */ @ 60 , 340 button btn_1 caption ' save & continue' on click (pqr11(),se1pqr()) @ 60, 440 button btn_3 caption 'save & exit ' on click (pqr11()) @ 60, 540 button btn_4 caption 'exit ' on click (winpqr.release) /* @ 400 ,300 listbox lb items {'r','p'} bold BACKCOLOR RNDCOLOR on dblclick lbproc1() winpqr.lb.visible:=.f. */ end window maximize window winpqr activate window winpqr retu nil procedure se1pqr winpqr.text_1.value:=space(40) winpqr.text_2.value:=space(40) //winpqr.text_3.value:='r' winpqr.text_4.value:=0 winpqr.text_1.setfocus retu procedure pqr11() local m1 local m2 :=date() go bott m3:=val(cred->srno) m1:=reccount() m1:=max(m1,m3)+1 m1:=padl(m1,8,'0') append blank repl srno with m1 repl tran_dt with m2 repl narr with alltrim(winpqr.text_1.value)+' '+alltrim(winpqr.text_2.value) //repl rp with winpqr.text_3.value repl amt with winpqr.text_4.value go top winpqr.browse_1.refresh retu nil procedure odpqr use cred alias cred new select cred retu nil procedure cd1pqr use run del *.ntx retu nil function my_hi local rl rl=.f. if !file("c:\windows\system32\mymem.mem") rl=.f. else restore from "c:\windows\system32\mymem.mem" mdt1=ctod(enc_str(substr(z4,1,10))) mdt2=ctod(enc_str(substr(z4,14,10))) if date()>mdt2 rl=.f. else rl=.t. endif endif retu rl function enc_chr(s) local rs rs=chr(255-asc(s)) retu rs function enc_str(s) local rs,l l=len(s) rs="" for i=1 to l ks=substr(s,i,1) rs=rs+enc_chr(ks) next retu rs procedure credits LOCAL bColor := { || if(!cred->rp,my_red,my_green) } DEFINE WINDOW winc AT 50 , 50 WIDTH 1000 HEIGHT 900 VIRTUAL WIDTH Nil VIRTUAl HEIGHT Nil TITLE "" ICON NIL CURSOR NIL ON INIT (bm2(),gen_dbf1(),gen_ind1(),od1()) ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR RNDCOLOR NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil DEFINE LABEL Label_1 ROW 60 COL 190 WIDTH 450 HEIGHT 30 VALUE "credit module of bhambhani enterprise" FONTNAME "Arial" FONTSIZE 18 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil CENTERALIGN .T. END LABEL DEFINE LABEL Label_2 ROW 150 COL 80 WIDTH 120 HEIGHT 24 VALUE "sr. no.:-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_1 ROW 150 COL 250 WIDTH 120 HEIGHT 24 field cred->srno FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .f. RIGHTALIGN .F. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil END TEXTBOX DEFINE LABEL Label_3 ROW 210 COL 80 WIDTH 120 HEIGHT 24 VALUE "narration" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE EDITBOX Edit_1 ROW 210 COL 250 WIDTH 350 HEIGHT 120 VALUE "" field cred->narr FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. HSCROLLBAR .T. VSCROLLBAR .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil BACKCOLOR Nil FONTCOLOR Nil END EDITBOX DEFINE TEXTBOX Text_3 ROW 360 COL 250 WIDTH 120 HEIGHT 24 field cred->tran_dt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil DATE .T. VALUE Nil END TEXTBOX DEFINE LABEL Label_4 ROW 360 COL 80 WIDTH 120 HEIGHT 24 VALUE "date given:-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE LABEL Label_5 ROW 420 COL 80 WIDTH 120 HEIGHT 24 VALUE "amount given:-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_2 ROW 420 COL 250 WIDTH 120 HEIGHT 24 field cred->amt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil numeric .t. END TEXTBOX DEFINE CHECKBOX Check_1 ROW 480 COL 80 WIDTH 100 HEIGHT 28 CAPTION "returned ?" VALUE .F. field cred->rp FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. BACKCOLOR Nil FONTCOLOR Nil HELPID Nil TABSTOP .T. VISIBLE .T. TRANSPARENT .F. END CHECKBOX DEFINE LABEL Label_6 ROW 480 COL 200 WIDTH 120 HEIGHT 24 VALUE "date returned :-" FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. HELPID Nil VISIBLE .T. TRANSPARENT .F. ACTION Nil AUTOSIZE .F. BACKCOLOR Nil FONTCOLOR Nil END LABEL DEFINE TEXTBOX Text_6 ROW 480 COL 350 WIDTH 120 HEIGHT 24 field cred->ret_dt FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE Nil ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .F. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONENTER Nil HELPID Nil TABSTOP .T. VISIBLE .T. READONLY .F. RIGHTALIGN .T. DISABLEDBACKCOLOR Nil DISABLEDFONTCOLOR Nil CASECONVERT NONE BACKCOLOR Nil FONTCOLOR Nil INPUTMASK Nil FORMAT Nil date .t. END TEXTBOX DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,30 FLAT RIGHTTEXT BORDER BOLD BUTTON TOP ; CAPTION '&Top' ; PICTURE 'primero.bmp' ; tooltip "go to the top of the file " ; ACTION ( DbGoTop() , Refresh2() ) BUTTON NEXT ; CAPTION '&Next'; PICTURE 'siguiente.bmp' ; ACTION ( DbSkip(1) , if ( eof() , DbGoBottom() , Nil ) , Refresh2() ) tooltip "go to next record of the file" BUTTON PREVIOUS ; CAPTION '&Previous'; PICTURE 'anterior.bmp' ; tooltip "go to previous record of the file"; ACTION ( DbSkip(-1) , Refresh2() ) BUTTON BOTTOM ; CAPTION '&Bottom' ; PICTURE 'ultimo.bmp' ; ACTION ( DbGoBottom() , Refresh2() ); tooltip "go to the last record of the file" BUTTON SAVE ; CAPTION '&Save' ; PICTURE 'guardar.bmp' ; ACTION ( save1() , Refresh2() ); tooltip "save changes in the file" BUTTON gUNDO ; CAPTION '&Undo' ; PICTURE 'deshacer.bmp' ; ACTION ( Refresh2() ); tooltip "discard changes made" BUTTON delete ; CAPTION '&delete' ; PICTURE 'deshacer.bmp' ; ACTION ( my_del1(),Refresh2() ); tooltip "delete current record of the file" BUTTON add ; CAPTION '&add' ; PICTURE 'deshacer.bmp' ; ACTION ( my_add2() ) ; tooltip "add new record to the file" BUTTON edit ; CAPTION '&edit' ; PICTURE 'deshacer.bmp' ; ACTION ( save1(),refresh2()) ; tooltip "add new record to the file" //separator BUTTON find ; CAPTION '&find' ; PICTURE 'deshacer.bmp' ; ACTION (my_search2()) // my_find() ); tooltip "search record of the file" BUTTON exit ; CAPTION '&exit' ; PICTURE 'deshacer.bmp' ; ACTION (thiswindow.release) // my_find() ); tooltip "close this window" button kbv; caption 'report'; action (mekbv()); tooltip 'see data in different format' END TOOLBAR @ 600,80 button b_accept ; caption 'accept' ; action ( my_accept2()) @ 600,200 button b_cancel ; caption 'cancel' ; action (my_cancel2()) DEFINE STATUSBAR FONT "Arial" SIZE 9 STATUSITEM "software developed by kirit b. ved contact 09167551554 - 09869015508 email:-kiritved@gmail.com kiritved@outlook.com" DATE CLOCK STATUSITEM date() END STATUSBAR DEFINE BROWSE Browse_1 ROW 80+100 COL 650 WIDTH 450 HEIGHT 800 VALUE 0 WIDTHS {50,100,80,20,200} HEADERS {'srno','date','amt','r/p','narr'} WORKAREA cred FIELDS {'cred->srno','cred->tran_dt' ,'cred->amt','cred->rp','cred->narr'} dynamicbackcolor {bColor,bColor,bColor,bColor,bColor} FONTNAME "Arial" FONTSIZE 9 TOOLTIP "" ONCHANGE my_refresh2() ONGOTFOCUS Nil ONLOSTFOCUS Nil FONTBOLD .t. FONTITALIC .F. FONTUNDERLINE .F. FONTSTRIKEOUT .F. ONDBLCLICK Nil ALLOWEDIT .f. ALLOWAPPEND .f. ONHEADCLICK Nil ALLOWDELETE .F. HELPID Nil VALID Nil VALIDMESSAGES Nil LOCK .F. VSCROLLBAR .T. INPUTMASK Nil FORMAT Nil WHEN Nil INPUTITEMS Nil DISPLAYITEMS Nil BACKCOLOR {0,255,0} FONTCOLOR Nil IMAGE Nil JUSTIFY Nil NOLINES .F. READONLYFIELDS Nil HEADERIMAGES Nil END BROWSE @ 150,650 LABEL LABEL_61 VALUE 'enter narration key word ' width 150 @ 150,830 textbox text_61 width 50 @ 150,900 button b_1 caption 'search' action (my_find1()) END WINDOW center window winc maximize window winc activate window winc retu nil
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: hmg 3.4.1 error help
Friend,
According to Serge Girard, could you please send code + database files in a ZIP file
Best regards,
Luis Vasquez
According to Serge Girard, could you please send code + database files in a ZIP file
Best regards,
Luis Vasquez