Jurnal Transaction Report



This coding with minigui exstended
#include “minigui.ch”
#include “inkey.ch”
#include “miniprint.ch”

procedure wjurnal()

if !iswindowactive (wjurnal)

SET DATE ITALIA
set browsesync on
set century on
set navigation extended

Define window wjurnal ;
at 30,30 ;
Width 650 ;
Height 460 ;
on init bukawjurnal();
ON RELEASE dbcloseall();
child ;
nomaximize;
NOMINIMIZE

DRAW GRADIENT IN WINDOW wjurnal AT 0,0 TO 55,650;
VERTICAL BORDER BOX ;
BEGINCOLOR {0,0,0} ;
ENDCOLOR {128,255,255}

DRAW TEXT IN WINDOW wjurnal AT 15,130 ;
VALUE “TRANSACTION JURNAL REPORT” ;
FONT “Verdana” SIZE 15 BOLD ;
FONTCOLOR {197,197,0};
TRANSPARENT

@ 70,30 frame rptgl1;
caption “Transaksi jurnal harian “;
width 570 ;
height 330 ;
transparent

@ 100,50 LABEL Kode_LBL VALUE ‘Kode Transaksi ‘;
font “arial” size 12 ;
transparent

@ 140,50 LABEL Nonota1_LBL VALUE ‘Nomer Transaksi ‘;
font “arial” size 12 ;
transparent

@ 180,50 LABEL Nonota2_LBL VALUE ‘Nomer Transaksi ‘;
font “arial” size 12 ;
transparent

@ 220,50 label stgl1_lbl Value ‘Tanggal ‘;
font “arial” size 12 ;
width 250 ;
height 30 ;
transparent

@ 260,50 label stgl2_lbl Value ‘Tanggal ‘;
font “arial” size 12 ;
width 250 ;
height 30 ;
transparent

Define combobox kode

row 100
col 200
Item {“Umum”,”Inventory”,”Piutang Dagang”,”Hutang Dagang”,”Aktiva”,”Lain-lain”}
value 1

end combobox

@ 140,200 btntextbox nonota1_txt ;
font “arial” size 12 ;
width 180 ;
ON ENTER CARIwjurnal1();
action cariwjurnal1()

@ 180,200 btntextbox nonota2_txt ;
font “arial” size 12 ;
width 180 ;
action cariwjurnal2()

define datepicker stanggal1
row 220
col 200

end datepicker

define datepicker stanggal2
row 260
col 200

end datepicker

@ 300,60 frame wjurnal;
caption “pilihan proses cetak”;
width 550 ;
height 70 ;
transparent

DEFINE IMAGE wjurnal1
ROW 320
COL 80
WIDTH 20
HEIGHT 30

WHITEBACKGROUND .F.
ON CLICK { wjurnalcetak() }
END IMAGE

DEFINE IMAGE wjurnal2
ROW 320
COL 250
WIDTH 20
HEIGHT 30

WHITEBACKGROUND .t.

END IMAGE

DEFINE IMAGE BK33
ROW 320
COL 420
WIDTH 20
HEIGHT 30

WHITEBACKGROUND .F.

END IMAGE

@ 320,110 buttonex KUNCI;
caption ‘Cetak &Printer ‘;
height 30 ;
width 80 ;
BACKCOLOR {128,255,0};
on click { wjurnalcetak() }

@ 320,280 buttonex CETAK;
caption ‘Exsport &XLS ‘;
height 30 ;
BACKCOLOR {128,128,0};
width 80

@ 320,450 buttonex BK5;
caption ‘Cetak &PDF ‘;
height 30 ;
width 80 ;
BACKCOLOR {128,255,0};
//on click { playbeep(),salbar2() }

/*

@ 245,30 progressbar progress_1;
range 1,100;
width 270 height 26

@ 278,135 textbox textbox_1;
value ” 0 % ” width 60 maxlength 5

*/

end window

center window wjurnal
activate window wjurnal

Endif
return nil

PROCEDURE bukawjurnal

RddSetDefault(“DBFNTX”) //standar clipper-harbour
request dbfntx

IF OPENTABLES(cDRV+”GLMAS”,.F.)
SET INDEX TO (cDRV+”GLMAS”),(cDRV+”GLMAS1″)
ELSE
RETURN
ENDIF

IF OPENTABLES(cDRV+”GLTBL1″,.F.)
SET INDEX TO ( cDRV+”GLTBL1″)
ELSE
RETURN
ENDIF

IF OPENTABLES(cDRV+”GLTRAN1″,.F.)
SET INDEX TO (cDRV+”GLTRAN1″),(cDRV+”GLTRAN11″),(cDRV+”GLTRAN12″)
ELSE
RETURN
ENDIF

IF OPENTABLES(cDRV+”GLTRAN2″,.F.)
SET INDEX TO (cDRV+”GLTRAN22″)
ELSE
RETURN
ENDIF

RETURN

function wjurnalcetak()

Local nday := Day(wjurnal.stanggal1.value)
Local nmonth := Month(wjurnal.stanggal1.value)
Local nyear := Year(wjurnal.stanggal1.value)

Local sHAL:=KEYPRESS:=TDEBET:=TKREDIT:=I:=XKRD:=XDBT:=0

Local skd_wil
Local i, nCOPIES, lijn, periode
Local cPrinter, bladnum

sbln := strzero(nmonth,2)
snotran1 :=(alltrim(wjurnal.nonota1_txt.value))
snotran2 :=(alltrim(wjurnal.nonota2_txt.value))
xtanggal1 := wjurnal.stanggal1.value
xtanggal2 := wjurnal.stanggal2.value
yFlag := str(wjurnal.kode.value)
xflag := alltrim(yFlag)
skd_wil := “10”

nCOPIES := 1
baris := 45
shal := 0
mkolom := 45

cPrinter := GetPrinter()
If Empty (cPrinter)
Return
EndIf
SELECT PRINTER cPrinter ;
ORIENTATION PRINTER_ORIENT_LANDSCAPE ;
PAPERSIZE PRINTER_PAPER_LEGAL ;
COPIES nCOPIES ;
QUALITY PRINTER_RES_HIGH;
PREVIEW

START PRINTDOC NAME “JURNAL”
START PRINTPAGE

SELECT GLTRAN2
SET ORDER TO 1
SET SOFTSEEK ON
SEEK DTOS(xTANGGAL1)
SET SOFTSEEK OFF
mPageNo:=0
kpageno := 0

DO WHILE .NOT. EOF() .AND. TANGGAL >= xTANGGAL1 .AND. TANGGAL =190 .OR. mPageNo=0
mPageNo++
kpageno = kpageno + mpageno
IF mPageNo>1

@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1
@ baris,38 PRINT LINE TO mkolom,38 PENWIDTH 0.1
@ baris,68 PRINT LINE TO mkolom,68 PENWIDTH 0.1
@ baris,97 PRINT LINE TO mkolom,97 PENWIDTH 0.1
@ baris,155 PRINT LINE TO mkolom,155 PENWIDTH 0.1
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1
@ baris,235 PRINT LINE TO mkolom,235 PENWIDTH 0.1
@ baris,320 PRINT LINE TO mkolom,320 PENWIDTH 0.1

baris += 5

@ baris,03 print line to baris,307 penwidth 0.1

@ baris,55 PRINT “Lanjut ke Halaman: “+LTRIM(STR(mPageNo))

baris := 45
mkolom := 45

END PRINTPAGE
START PRINTPAGE

ENDIF
kpageno := (kpageno/mpageno)

@ 05,280 PRINT “Tanggal Cetak : “+dtoc(DATE())
@ 15,280 PRINT “Page: “+LTRIM(STR(mPageNo)) //+” of “+ltrim(str(kpageno)) //RIGHT
@ 05,15 PRINT “PT.YOKATTA INDONESIA ” Underline
@ 15,15 PRINT “Jl.Jababeka No. Cikarang Bekasi ”
@ 20,145 print “LAPORAN TRANSAKSI JURNAL HARIAN” FONT “COURIER NEW” SIZE 18 BOLD CENTER
@ 30,110 print “Periode Laporan : “+dtoc(xtanggal1)+” sd “+dtoc(xtanggal2)
@ 38,05 print line to 38,320 penwidth 0.5
@ 40,05 print ” NO.”
@ 40,15 print ” TANGGAL”
@ 40,40 print ” BUKTI ”
@ 45,40 print ” TRANSAKSI”
@ 40,73 print ” NOMER”
@ 45,73 print ” REKENING ”
@ 40,110 print ” NAMA TRANSAKSI ”
@ 40,175 print ” DEBET ”
@ 40,210 print ” KREDIT”
@ 40,250 print ” KETERANGAN”

&& cetak garis vertical
@ 38,03 PRINT LINE TO 50,03 PENWIDTH 0.1 && 1
@ 38,13 PRINT LINE TO 50,13 PENWIDTH 0.1 && 2
@ 38,38 PRINT LINE TO 50,38 PENWIDTH 0.1 && 3
@ 38,68 PRINT LINE TO 50,68 PENWIDTH 0.1 && 4
@ 38,97 PRINT LINE TO 50,97 PENWIDTH 0.1 && 5
@ 38,155 PRINT LINE TO 50,155 PENWIDTH 0.1 && 6
@ 38,195 PRINT LINE TO 50,195 PENWIDTH 0.1 && 7
@ 38,235 PRINT LINE TO 50,235 PENWIDTH 0.1 && 8
@ 38,320 PRINT LINE TO 50,320 PENWIDTH 0.1 && 8

ENDIF

SELECT GLTRAN2
IF SKD_WIL == KD_WIL .AND. NOTRAN >= SNOTRAN1 .AND. NOTRAN <= SNOTRAN2 .AND. FLAG == SFLAG .AND. SUBSTR(NOTRAN,1,2)#"20"

SNOTRAN := NOTRAN
STGL := TANGGAL
I := 0
FL := 0

SELECT GLTRAN2
DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL+DTOS(STGL)+SNOTRAN == FLAG+KD_WIL+DTOS(TANGGAL)+NOTRAN .AND. BARIS (dbsetorder(1))

if !empty(nValue)
nValue := recno()
Seek Alltrim(str(nValue))
if !eof()
nReg := Recno()
endif
endif

DEFINE WINDOW Form_xwjurnal;
AT 0,0 ;
WIDTH 500 HEIGHT 480 ;
MODAL NOSIZE

@300,5 frame pilih_wjurnal ;
width 450 ;
height 100

@ 320,10 label cnonota_lbl value ‘ Masukan Nomer Trasnsaksi yg dicari’;
font “arial” size 16 ;
width 500;
transparent blink;
fontcolor{0,255,0}

@ 350,10 textbox cnonota_txt;
width 350 ;
on change {search_wjurnal() };
on enter {search_wjurnal() }

@ 5,5 BROWSE Browse_wjurnal ;
WIDTH 480 ;
HEIGHT 290 ;
HEADERS { ‘Nomer Transaksi’,’Tanggal’ } ;
WIDTHS { 170 ,100 } ;
WORKAREA gltran1 ;
FIELDS { ‘gltran1->notran’,’gltran1->tanggal’} ;
VALUE nReg ;
READONLY {.t.,.t.,.t.} ;
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT} ;
ON DBLCLICK ( cReg:=gltran1->notran,ThisWindow.release) ;
TOOLTIP “Pilihlah nomer transaksi yang anda inginkan ”

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW Form_xwjurnal

ACTIVATE WINDOW Form_xwjurnal

Return cReg

function search_wjurnal

local cCari := (ALLTRIM(UPPER(form_xwjurnal.cnonota_txt.value)))
local nPanjang := len(ccari)
yFlag := str(wjurnal.kode.value)
xflag := alltrim(yFlag)
skd_wil := “10”

do case
case xFlag == “1”
sflag := “U”

case xFlag == “2”
sflag := “I”

case xFlag == “3”
sFlag := “P”

case xFlag == “4”
sFlag := “H”
end case

select gltran1
set order to 1
dbselectarea(“gltran1”)
dbseek(sFlag+sKd_wil+cCari)

If found()

If gltran1->(DbSeek(sFlag+sKd_wil+cCari))
form_xwjurnal.browse_wjurnal.value := gltran1->(recno())
Else
MsgExclamation(‘Nomer Transaksi tidak ada’)
EndIf
else
msginfo(“nomer yg anda cari bukan Rekening Perkiraan”,”Konfirmasi bukan nomer Rekening”)

EndIf
Return

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: