Jurnal Umum

Screen Shoot

This is code with minigui extended

#include “minigui.ch”
#include “inkey.ch”
#include “miniprint.ch”

#define program “GENERAL LEDGER ”

procedure wgljent()

local hurufwgljent := { 255,255,255 }
//local warnawgljent := {128,255,128 } //hijau muda
local warnawgljent := {255,255,255 }
Local bColor := { || iif( recno()/2 == int( recno()/2 ) , { 255,255,255 } , { 197,240,240 } ) }
Local cimage := { || iif( recno()/2 == int( recno()/2 ) , ’01.bmp’,’02.bmp’ ) }

if !iswindowactive (gljent)
set delete on
set browsesync on
set century on
set navigation extended
set date italia

Define window gljent ;
at 30,40 ;
Width 960 ;
Height 660 ;
title ‘program Jurnal Umum PT.Aristek Highpolymer ‘;
on init (bukawgljent(),gl2(),glcar2());
on release tutupwgljent();
child ;
backcolor warnawgljent

DEFINE TOOLBAR TOOLBAR_4 BUTTONSIZE 75,40 bottom

BUTTON NEW;
picture ‘d:\soalgui\bmp\new.bmp’;
CAPTION ‘&Add Data’;
tooltip ‘Penambahan Data baru ‘;
ACTION baruwgljent()

BUTTON EDIT ;
picture ‘d:\soalgui\bmp\EDIT.bmp’;
CAPTION ‘E D I &I T’;
tooltip ‘Tombol ini berfungsi untuk modifikasi/edit database ‘;
ACTION if(key(),aktif(),nil)

BUTTON SEARCH ;
picture ‘d:\soalgui\bmp\cari.bmp’;
CAPTION ‘&search’;
tooltip ‘Tombol ini berfungsi untuk cari database ‘;
ACTION CARICPV()

BUTTON HAPUS ;
picture ‘d:\soalgui\bmp\HAPUS.bmp’;
CAPTION ‘&Delete’;
tooltip ‘Tombol ini berfungsi untuk menghapus database ‘;
ACTION delete1()

BUTTON printer;
picture ‘d:\soalgui\bmp\printer.bmp’;
TOOLTIP ‘Pilihan anda untuk cetak data’ ;
CAPTION ‘&CetakData’;
ACTION printgl()

BUTTON save;
picture ‘d:\soalgui\bmp\simpan.bmp’;
TOOLTIP ‘Pilihan untuk simpan data anda’ ;
CAPTION ‘&Simpan’;
ACTION printgl()

BUTTON batal;
picture ‘d:\soalgui\bmp\cancel.bmp’;
TOOLTIP ‘Pilihan data anda dibatalkan’ ;
CAPTION ‘&Batal’ ;
ACTION batalwgljent()

BUTTON Keluar;
picture ‘d:\soalgui\bmp\exit.bmp’;
TOOLTIP ‘Pilihan data anda dibatalkan’ ;
CAPTION ‘Kelua&r’ ;
ACTION keluargljent()

END TOOLBAR

@ 8,15 frame GLJENT_frm;
caption “Nomer Jurnal Umum Harian”;
BACKCOLOR WARNAWGLJENT ;
width 950 ;
height 100

@ 120,15 frame GLJENT2_frm;
caption “Data Transaksi”;
BACKCOLOR WARNAWGLJENT ;
width 950 ;
height 520

@ 30,20 LABEL sKdwil_lbl VALUE ‘Kode Wilayah ‘;
font “arial narrow” size 12 bold;
backcolor warnawgljent

@ 30,250 LABEL sNotran_LBL VALUE ‘Nomer Jurnal ‘;
font “arial narrow” size 12 bold ;
backcolor warnawgljent

@ 30,680 LABEL sTanggal_lbl VALUE ‘Tanggal ‘;
font “arial narrow” size 12 bold;
backcolor warnawgljent

@ 65,20 label sketer_lbl Value ‘Keterangan ‘;
font “arial narrow” size 12 bold ;
backcolor warnawgljent

@ 380,680 LABEL sdebet_lbl VALUE ‘DEBET’;
font “arial narrow” size 13 ;
width 100 ;
backcolor warnawgljent ;
bold

@ 410,680 LABEL skredit_lbl VALUE ‘KREDIT’;
font “arial narrow” size 13 ;
width 100 ;
backcolor warnawgljent ;
bold

Define combobox kd_wil

row 30
col 120
Item {“Accounting”,”Aktiva”,”Finished Goods”,”Raw Material”,”Produksi”,”Packing”,”Lain-lain”}
value 1

end combobox

@ 65,120 textbox sketerng_txt ;
font “Time new roman ” size 11 ;
readonly ;
width 650

@ 30,350 textbox snotran_txt font “Time new roman” size 12 ;
WIDTH 120;
inputmask ‘!!-99.999999999’

DEFINE IMAGE gljent
ROW 30
COL 480
WIDTH 20
HEIGHT 30
picture ‘d:\soalgui\bmp\cari.bmp’
on click { playbeep(),caricpv(),glcar2() }
END IMAGE

define datepicker stanggal1
row 30
col 750
backcolor {197,255,197}

end datepicker

@ 380,750 textbox sDebet_txt ;
width 150 ;
font “Time New Roman” size 12 ;
readonly ;
numeric inputmask “9,999,999,999.99”

@ 410,750 textbox sKredit_txt ;
width 150 ;
font “Time New Roman” size 12 ;
readonly ;
numeric inputmask “9,999,999,999.99”

@ 360,670 frame GLJENT3_frm;
BACKCOLOR WARNAWGLJENT ;
width 260 ;
height 90

@ 140,50 browse wgljent_browse;
width 880;
height 210;
headers {”,’Bukti Transaksi’,’Nomer’,’Nomer Rekening’,’Nama Rekening’,’Group ‘,’Jumlah’,’Keterangan’};
widths {40,110,40,110,230,60,130,280};
workarea gltran2;
fields{‘gltran2->post’,’gltran2->notran’,’gltran2->nourut’,’gltran2->norek’,’if(gltran2->norek==glmas->norek,glmas->nmrek,””)’,’gltran2->tptran’,’transform(gltran2->jumlah,”9,999,999,999,999.99″)’,’gltran2->keterng1′};
image { ’03.bmp’,’02.bmp’ } ;
DYNAMICBACKCOLOR { bcolor,bColor, bcolor, bColor, bColor, bColor, bColor, bColor } ;
JUSTIFY { BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT,BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT, BROWSE_JTFY_CENTER,BROWSE_JTFY_RIGHT,BROWSE_JTFY_LEFT}
allowedit .f.
allowappend .f.

&& entry Gltran2

@ 400, 50 label Norut_lbl value ‘No.Urut ‘;
font “arial ” size 11 bold ;
backcolor warnawgljent

@ 430, 50 label Noper_lbl value ‘No.Perkiraan ‘;
font “arial ” size 11 bold ;
backcolor warnawgljent

@ 490, 50 label Type_lbl value ‘Type Mutasi ‘;
font “arial ” size 11 bold ;
backcolor warnawgljent

@ 520, 50 label jumlah_lbl value ‘Jumlah ‘;
font “arial ” size 11 bold ;
backcolor warnawgljent

@ 550, 50 label keter_lbl value ‘Keterangan ‘;
font “arial ” size 11 bold ;
backcolor warnawgljent

@ 400,250 textbox snorut_txt ;
width 80 ;
font “Time New Roman” size 11

@ 430,250 btntextbox norek1_txt ;
font “arial” size 11 ;
width 180 ;
action (playbeep(),carigljent())

@ 460,250 textbox snmrek_txt ;
width 280;
font “Time New Roman” size 11

Define combobox typemutasi

row 490
col 250
Item {“D E B E T”,”K R E D I T”}
value 1

end combobox

@ 520,250 textbox sjumlah_txt ;
width 150 ;
font “Time New Roman” size 11 ;
numeric inputmask “9,999,999,999.99”

@ 550,250 textbox sketer_txt ;
width 280;
font “Time New Roman” size 11

end window
maximize window gljent
activate window gljent

Endif

return nil

PROCEDURE BUKAWGLJENT

LOCAL SFLAG := “U”
LOCAL SMUTASI := “K”
local skd_wil := “10”

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

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

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

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

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

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

RETURN

procedure tutupwgljent

intran1->(dbclosearea())
glmas->(dbclosearea())
tblwmas->(dbclosearea())
gltran2->(dbclosearea())
gltran1->(dbclosearea())
dbcloseall()

return

procedure keluargljent

release window gljent
return

PROCEDURE baruwgljent

// tambah data baru

//ESA.NEW.VALUE := .T.
gljent.sKdwil_txt.value := ”
gljent.snotran_txt.value := ”
gljent.sdebet_txt.value := 0
gljent.skredit_txt.value := 0
Aktifwgljent()

RETURN

PROCEDURE batalwgljent()
nonaktifwgljent()
unlock
RETURN

FUNCTION NONAKTIFwgljent

gljent.sKdwil_txt.enabled := .F.
gljent.snotran_txt.enabled := .F.
gljent.stanggal1.enabled := .F.
gljent.sDebet_txt.enabled := .F.
gljent.sKredit_txt.enabled := .F.
gljent.ToolBar_4.Enabled := .T.

RETURN

STATIC FUNCTION AKTIFwgljent

select gltran1
dbsetorder(1)
dbgotop()

gljent.sKdwil_txt.enabled := .T.
gljent.snotran_txt.enabled := .T.
gljent.stanggal1.enabled := .T.
gljent.sDebet_txt.enabled := .F.
gljent.sKredit_txt.enabled := .F.

gljent.ToolBar_4.Enabled := .T.

gljent.sKdwil_txt.setfocus

RETURN

procedure delwgljent

If MsgYesNo ( ‘Yakin dihapus ‘)

If key()
select gltran1
set order to 1
gltran1->(dbdelete())
//esa.glment_browse.value := glmas->(recno())
//esa.glment_browse.refresh

EndIf
EndIf

return

Function keywgljent()

Local keygl

If gltran1->(RLock())
keywgljent := .t.
Else
MsgExclamation (‘Data Tidak dapat dihapus’,’Kunci kontak’)
keywgljent := .f.
EndIf

Return keywgljent

function nama(nnorek)

select gltran2
snorek := gltran2->norek

dbsetorder(1)
dbseek(sflag+skd_wil+snorek)
set relation to norek into glmas

if snorek = glmas->norek
snmrek := glmas->nmrek
else
msginfo(“Nama Chart Of Account Tak ada”,”Konfirmasi COA”)
endif

return

function bawah

LOCAL SFLAG := “U”

select gltran1
dbsetorder(1)
// dbseek(“U”+”10″+notran)

DBseek(SFLAG)

SKD_WIL := gltran1->KD_WIL
SNOTRAN := gltran1->NOTRAN
STANGGAL := gltran1->TANGGAL
SJUMDEBET := SJUMKREDIT := SW:=0
cha := SFLAG+SKD_WIL+SNOTRAN

gljent.skdwil_txt.value := skd_wil
gljent.snotran_txt.value := snotran
gljent.stanggal1.value := stanggal

SELECT TBLWMAS
SEEK “W”+SKD_WIL
SNM_WIL := NM_WIL
gljent.snmwil_txt.value := snm_wil

SELECT GLTRAN2
DbSeek(SFLAG+SKD_WIL+SNOTRAN)
DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL+SNOTRAN == FLAG+KD_WIL+NOTRAN
SNOURUT := NOURUT
SNOREK := NOREK
STPTRAN := TPTRAN
SJUMLAH := JUMLAH
SKETERNG1 := KETERNG1
SKET := KET
SNONOTA := NONOTA
SPOST := POST

IF TPTRAN == “D”
SJUMDEBET := SJUMDEBET + JUMLAH
ELSE
SJUMKREDIT := SJUMKREDIT + JUMLAH
ENDIF
SKIP
ENDDO

gljent.sdebet_txt.value := sjumdebet
gljent.skredit_txt.value := sjumkredit

select gltran1
NOREK := RECNO()
TAMPILGLJENT()

return

function TAMPILGLJENT

LOCAL SFLAG := “U”
//local cCari:= (“U”+alltrim(gljent.skdwil_txt.value)+alltrim(gljent.snotran_txt.value))
// local cCari:= (“U”+”10″+gljent.snotran_txt.value)

SELECT GLTRAN2
// if gltran2->(dbseek(cCari))
if gltran2->(dbseek(“U”+”10″+NOTRAN))
gljent.wgljent_browse.value := gltran2->(recno())
gljent.wgljent_browse.setfocus
gljent.wgljent_browse.refresh

endif

RETURN

procedure caricpv
do while .t.
FindCodebkbesar(“gljent”,”snotran_txt”)
exit
enddo
return

Function FindCodebkbesar(cForm, cTextBtn)
Local cReg := “”

cReg := showcodegl(Getproperty(cForm,cTextBtn,”Value”))
If !empty(cReg)
Setproperty(cForm,cTextBtn,”Value”,cReg)
EndIf

Return

Static Function showcodegl(nValue)

Local cColor := { || iif( recno()/2 == int( recno()/2 ) , { 255,197,255 } , { 255,197,255 } ) }
Local cReg:= “”, nReg := 1
select gltran1
set filter to gltran1->flag ==”U”

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

DEFINE WINDOW gl_12;
AT 0,0 ;
WIDTH 350 HEIGHT 460 ;
TITLE ‘List Bukti Transaksi Bank’ ;
MODAL NOSIZE

@300,5 frame pilih_gl ;
width 300 ;
height 100

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

@ 350,10 textbox cnonotagl_txt;
width 350 ;
on change {trancar()};
on enter {trancar()}

DEFINE BROWSE BROWSE_1
COL 5
ROW 5
WIDTH 280
HEIGHT 290
HEADERIMAGES {’01.BMP’,’02.BMP’}
HEADERS { ‘Nomer Transaksi’,’Tanggal’ }
WIDTHS { 130,120 }
WORKAREA gltran1
FIELDS { ‘gltran1->notran’,’gltran1->tanggal’}
VALUE nReg
READONLY {.t.,.t.}
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT}
ON DBLCLICK ( cReg:=gltran1->notran,gljent.snotran_txt.value:=cReg,ThisWindow.Release)
DYNAMICBACKCOLOR { cColor, cColor }
TOOLTIP “Pilihlah No Bukti Yang anda inginkan ”
END BROWSE

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW gl_12

ACTIVATE WINDOW gl_12

Return cReg

function trancar
local cReg:= “”, nReg := 1
local sflag := “U”
local skd_wil := “10”
local cCari:= (sflag+skd_wil+gl_12.cnonotagl_txt.value)
local nPanjang := len(ccari)

select gltran1
dbsetorder(1)
dbseek(cCari)

If found()

If gltran1->(DbSeek(cCari))
gl_12.browse_1.value := gltran1->(recno())
Else
MsgExclamation(‘Nomer Transaksi Jurnal Umum Tidak ada’)
EndIf

else
msginfo(“Nomer Cash Payment Voucher yg di cari “,”Konfirmasi bukan nomer CPV BANK”)
gl_12.cnonotagl_txt.value :=””

EndIf

Return

procedure gl2

Local SFLAG := “U”
Local skd_wil := “10”
select gltran1
DBSEEK(SFLAG)

SKD_WIL := KD_WIL
SNOTRAN := NOTRAN
STANGGAL := TANGGAL
SKETERNG1 := KETERNG1
SKETERNG2 := KETERNG2
SKETERNG3 := KETERNG3
SJUMDEBET := SJUMKREDIT := 0

gljent.kd_wil.value := 1
gljent.snotran_txt.value := snotran
gljent.stanggal1.value := stanggal

gljent.sketerng_txt.value := sketerng1

SELECT GLTRAN2
DbSeek(SFLAG+SKD_WIL+SNOTRAN)
DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL+SNOTRAN == FLAG+KD_WIL+NOTRAN
IF TPTRAN == “D”
SJUMDEBET := SJUMDEBET + JUMLAH
ELSE
SJUMKREDIT := SJUMKREDIT + JUMLAH
ENDIF
SKIP
ENDDO
gljent.sdebet_txt.value := sjumdebet
gljent.skredit_txt.value := sjumkredit

select intran1

Return

procedure glcar2

Local sflag := “U”
Local skd_wil := “10”

select gltran1
DBSETORDER(1)
dbseek(sflag+skd_wil+gljent.snotran_txt.value)
gljent.sketerng_txt.value := gltran1->keterng1

SELECT GLTRAN2

SDEBET := SKREDIT := 0
DbSeek(SFLAG+SKD_WIL+gljent.snotran_txt.value)
set relation to norek into glmas
set filter to ((gltran2->flag)+(gltran2->kd_wil)+(gltran2->notran)) = (“U”+”10″+gljent.snotran_txt.value)
gljent.wgljent_browse.refresh
gljent.wgljent_browse.value := recno()

DO WHILE .NOT. EOF() .AND. (SFLAG+SKD_WIL+gljent.snotran_txt.value) == ( FLAG+KD_WIL+NOTRAN)

IF TPTRAN == “D”
SDEBET := SDEBET + JUMLAH
ELSE
SKREDIT := skredit + JUMLAH

ENDIF
SKIP

ENDDO
gljent.sdebet_txt.value := sdebet
gljent.skredit_txt.value := skredit

select gltran1

return

procedure rubahgl2

Local sflag := “U”
Local skd_wil := “10”
Local snotran := (alltrim(gljent.snotran_txt.value))

SELECT GLTRAN1
SJUMDEBET := SJUMKREDIT := SW:=0

SELECT GLTRAN2
DbSeek(SFLAG+SKD_WIL+SNOTRAN)
DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL+SNOTRAN == FLAG+KD_WIL+NOTRAN
IF TPTRAN == “D”
SJUMDEBET := SJUMDEBET + JUMLAH
ELSE
SJUMKREDIT := SJUMKREDIT + JUMLAH
ENDIF
SKIP
ENDDO

gljent.skredit_txt.value := sjumkredit
gljent.sdebet_txt.value := sjumdebet

return

procedure carigljent
do while .t.
weduscar(“gljent”,”norek1_txt”)
exit
enddo
return

static function weduscar(cForm, cTextBtn)
Local cReg := “”

cReg := glcar(Getproperty(cForm,cTextBtn,”Value”))
If !empty(cReg)
Setproperty(cForm,cTextBtn,”Value”,cReg)
EndIf

Return

Function glcar(nValue)
Local wColor := { || iif( recno()/2 == int( recno()/2 ) , { 197,197,255 } , { 201,197,255 } ) }
Local cReg:= “”, nReg := 1
private cvarnonota := “norek”
glmas->(dbsetorder(1))

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

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

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

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

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

@ 5,5 BROWSE Browse_bkbesar ;
WIDTH 480 ;
HEIGHT 290 ;
HEADERS { ‘Nomer Rekening’ , ‘Nama Perkiraan’,’Tanggal’ } ;
WIDTHS { 170 ,350,100 } ;
WORKAREA glmas ;
FIELDS { ‘glmas->norek’,’glmas->nmrek’} ;
VALUE nReg ;
READONLY {.t.,.t.,.t.} ;
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT} ;
ON DBLCLICK ( cReg:=glmas->norek,ThisWindow.release) ;
TOOLTIP “Pilihlah Chart Of Account yang anda inginkan ”

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW formgljent

ACTIVATE WINDOW formgljent

Return cReg

function search_norek

local cCari:= (formgljent.cnonota_txt.value)
local nPanjang := len(ccari)

select glmas
set order to 1
dbselectarea(“glmas”)
dbseek(cCari)

If found()

If glmas->(DbSeek(cCari))
formgljent.browse_bkbesar.value := glmas->(recno())
Else
MsgExclamation(‘Nomer Rekening Perkiraan 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: