Chart of Account

Coding atau script untuk membuat tampilan diatas adalah seperti yang dibawah dng minigui exsteded program

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

#define program “GENERAL LEDGER ”

procedure gl()

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

Define window esa ;
at 30,40 ;
Width 960 ;
Height 660 ;
title ‘program menu general ledger PT.Aristek Highpolymer ‘;
on init (bukamahesa(),nonaktifw(),rubahesa(),cbulan());
on release tutupmahesa();
child ;
NOCAPTION ;
nosysmenu ;
backcolor {197,255,197}

DEFINE TOOLBAR TOOLBAR_1 BUTTONSIZE 75,40 FLAT BORDER

BUTTON TOP;
CAPTION ‘&atas’;
TOOLTIP ‘Jika anda ingin lihat data paling atas ‘;
picture ‘d:\soalgui\bmp\atas.bmp’;
ACTION(DBGOTOP(),esa.glment_browse.value :=recno())

BUTTON BAWAH ;
CAPTION ‘&bawah’;
TOOLTIP ‘Jika anda ingin lihat data paling bawah’;
picture ‘d:\soalgui\bmp\bawah.bmp’;
ACTION(DbGoBottom(),esa.glment_browse.value :=recno())

BUTTON SEBELUM ;
CAPTION ‘&sebelum’;
TOOLTIP ‘Jika anda lihat data sebelumnya’;
picture ‘d:\soalgui\bmp\back.bmp’;
ACTION(DBskip(-1),esa.glment_browse.value :=recno())

BUTTON NEXT;
CAPTION ‘&sesudah’;
TOOLTIP ‘Jika anda lihat data sesudahnya’;
picture ‘d:\soalgui\bmp\down.bmp’;
ACTION(DBSKIP(1),if(eof(),DbGoBottom(),Nil),esa.glment_browse.value := recno())

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

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

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

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 printer;
picture ‘d:\soalgui\bmp\printer.bmp’;
TOOLTIP ‘Pilihan anda untuk cetak data’ ;
CAPTION ‘&CetakData’;
ACTION printgl()

BUTTON Keluar;
picture ‘d:\soalgui\bmp\cancel.bmp’;
TOOLTIP ‘Pilihan anda untuk cetak data’ ;
CAPTION ‘&Keluar’ ;
ACTION keluaresa()

END TOOLBAR

DRAW PANEL   ;
IN WINDOW ESA ;
AT 80,400  ;
TO 530,930

DRAW PANEL   ;
IN WINDOW ESA ;
AT 550,400  ;
TO 630,930

@ 100,550 label stgl_lbl ;
font “arial” size 15 ;
width 250  ;
height 30 ;
transparent blink;
backcolor {197,255,197} ;
fontcolor { 197,20,197 };

define datepicker stanggal1
row 100
col 750
on change (cbulan(),rubahesa())
//on enter esa.glment_browse.setfocus

end datepicker

@ 150,450 LABEL NOREK_LBL   VALUE ‘Nomer Rekening  ‘;
font “arial” size 12 ;
backcolor {197,255,197}

@ 180,450 LABEL NMREK_LBL   VALUE ‘Nama Rekening   ‘;
font “arial” size 12 ;
backcolor {197,255,197}

@ 210,450 LABEL TYPE_LBL    VALUE ‘Type Rekening   ‘;
font “arial” size 12 ;
backcolor {197,255,197}

@ 240,450 LABEL Group_lbl   VALUE ‘Group Rekening  ‘;
font “arial” size 12 ;
backcolor {197,255,197}

@ 390,450 label Saldo_lbl   value ‘Saldo Awal      ‘;
font “Time new roman” size 18 ;
backcolor {197,255,197}

@ 420,450 label Debet_lbl   value ‘Debet           ‘;
font “arial” size 12 ;
backcolor {197,255,197}

@ 450,450 label Kredit_Lbl  value ‘Kredit          ‘;
font “arial narrow” size 15 ;
backcolor {197,255,197}

@ 480,450 label Balance_lbl value ‘Balance         ‘;
font “arial” size 12 ;
backcolor {197,255,197}

@ 150,610 textbox norek_txt;
width 150;
font “arial” size 12  ;
BACKCOLOR { 255,255,255 };
inputmask ‘999.99.99.99.9’;
on lostfocus { datakembar() }

@ 180,610 textbox nmrek_txt;
width 290;
font “arial” size 12 ;
BACKCOLOR { 255,255,255 };
maxlength 40 ;
uppercase    ;
on enter {|| esa.radio_group1.setfocus }

DEFINE RADIOGROUP Radio_group1
ROW    210
COL    610
width 80
OPTIONS {“DEBET”,”KREDIT”}
spacing 5
FONTNAME “Arial”
FONTSIZE 9
backcolor {197,255,197}
HORIZONTAL .T.
END RADIOGROUP

DEFINE RADIOGROUP Radio_group2
ROW    265
COL    610
height 220
WIDTH 220
OPTIONS {“AKTIVA”,”LIABILITIES(Hutang)”,”CAPITAL(Modal)”,”REVENUE(Pendapatan)”,”EXPENSE(Biaya)”}
spacing 22
FONTNAME “Arial”
FONTSIZE 9
backcolor {197,255,197}
END RADIOGROUP

@ 240,600 frame radio_frm;
caption “Kelompok Chart Of Account”;
width 300         ;
backcolor {197,255,197};
height 140

@ 390,610 textbox saldo_txt ;
width 200;
font “arial” size 12 ;
BACKCOLOR { 255,255,255 };
numeric inputmask “9,999,999,999,999.99”;
ON ENTER {ITUNG()}

@ 420,610 textbox debet_txt ;
width 200;
font “arial” size 12 ;
BACKCOLOR { 255,255,255 };
numeric inputmask “9,999,999,999,999.99”;
ON ENTER { ITUNG() }

@ 450,610 textbox kredit_txt ;
width 200;
font “arial” size 12 ;
BACKCOLOR { 255,255,255 };
numeric inputmask “9,999,999,999,999.99”;
on enter { itung() }

@ 480,610 textbox balance_txt ;
width 200;
font “arial” size 12 ;
BACKCOLOR { 255,255,255 };
numeric inputmask “9,999,999,999,999.99”

@ 56,15 browse glment_browse;
width 380;
height 530;
headers {‘Nomer Rekening’,’Nama Rekening’,’Type rekening’,’Group Rekening’};
widths {130,320,80,120,120};
workarea glmas;
fields{‘glmas->norek’,’glmas->nmrek’,’if(glmas->tprek=”D”,”DEBET”,”KREDIT”)’,’glmas->grrek’};
font “arial narrow” size 12 ;
BACKCOLOR { 255,128,164 };
on change rubahesa()
allowedit .f.
allowappend .f.

@ 570,450  buttonex  simpan2;
caption ‘&S i m p a n’;
picture ‘d:\soalgui\bmp\simpan.bmp’;
height 40      ;
width  110   ;
action savewglment ()

@ 570,780  buttonex cancel2 ;
caption ‘&B a t a l’  ;
picture ‘d:\soalgui\bmp\batal.bmp’;
tooltip ‘tekan tombol ini jika batal menyimpan’;
height 40 ;
width 110 ;
action cancel2()

end window
esa.glment_browse.setfocus
activate window  esa

Endif
return nil

PROCEDURE BUKAMAHESA

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

IF .NOT. OPENTABLES(“GLTBL”,.F.)
RETURN
ENDIF

IF OPENTABLES(“GLTRAN2”,.F.)
SET INDEX TO GLTRAN21
ELSE
RETURN
ENDIF

IF OPENTABLES(“GLMAS”,.F.)
SET INDEX TO GLMAS,GLMAS1,GLMAS2,GLMAS3,GLMAS4
ELSE
RETURN
ENDIF

SELECT GLMAS
dbsetorder(1)
dbgotop()

esa.glment_browse.value := glmas->(recno())

RETURN

procedure tutupmahesa

gltbl->(dbclosearea())
gltran2->(dbclosearea())
glmas->(dbclosearea())
dbcloseall()
return

procedure keluaresa

release window esa
return

PROCEDURE baru

// tambah data baru

ESA.NEW.VALUE := .T.
esa.norek_txt.value            := ”
esa.nmrek_txt.value            := ”
esa.radio_group1.value         := 0
esa.radio_group2.value         := 0
esa.saldo_txt.value            := 0
esa.debet_txt.value            := 0
esa.kredit_txt.value           := 0
esa.balance_txt.value          := 0
Aktif()

RETURN

PROCEDURE Cancel2()
nonaktifw()
rubahesa()
unlock
esa.new.value := .F.
RETURN

FUNCTION NONAKTIFW

esa.glment_browse.Enabled      := .T.
esa.norek_txt.enabled          := .F.
esa.nmrek_txt.enabled          := .F.
esa.radio_group1.enabled       := .F.
esa.radio_group2.enabled       := .F.
esa.saldo_txt.enabled          := .F.
esa.debet_txt.enabled          := .F.
esa.kredit_txt.enabled         := .F.
esa.balance_txt.enabled        := .F.
esa.simpan2.Enabled            := .F.
esa.cancel2.Enabled            := .F.

esa.ToolBar_1.Enabled          := .T.

esa.glment_browse.SetFocus

RETURN

STATIC FUNCTION AKTIF

esa.glment_browse.Enabled      := .F.
esa.norek_txt.enabled          := .T.
esa.nmrek_txt.enabled          := .T.
esa.radio_group1.enabled       := .T.
esa.radio_group2.enabled       := .T.
esa.saldo_txt.enabled          := .T.
esa.debet_txt.enabled          := .F.
esa.kredit_txt.enabled         := .F.
esa.balance_txt.enabled        := .F.
ESA.simpan2.enabled            := .T.
ESA.cancel2.enabled            := .T.

esa.ToolBar_1.Enabled          := .F.

esa.norek_txt.setfocus

RETURN

function savewglment
Local nday    := Day(esa.stanggal1.value)
Local nmonth  := Month(esa.stanggal1.value)
Local nyear   := Year(esa.stanggal1.value)
Local sdebet  := 0
Local skredit := 0
LOCAL SBALANCE := 0

select gltbl
dbGotop()
stglproses := tglproses
cbln := strzero(nmonth,2)
select glmas
snorek:= glmas->norek
snorek1 := snorek
dbsetorder(1)
datakembar()

if  esa.new.value == .T.
glmas->(dbappend())
esa.new.value := .F.
else
seek snorek1
endif
flock()
glmas->norek       := esa.norek_txt.value
glmas->nmrek       := esa.nmrek_txt.value
glmas->tprek       := iif(esa.radio_group1.value==1,”D”,”K”)
glmas->grrek       := alltrim(str(esa.radio_group2.value))
glmas->saldo&cbln  := esa.saldo_txt.value
dbcommit()
dbunlock()

esa.glment_Browse.Refresh

If esa.NEW.VALUE == .T.
esa.glment_Browse.Value := glmas->(RecNo())
EndIf

nonaktifw()

return nil

procedure  delete1

If MsgYesNo ( ‘Yakin dihapus ‘)

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

EndIf
EndIf

return

Function key()

Local keygl

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

Return keygl

static function  datakembar

if lastkey() = 27
return
endif

kjol := ‘   .  .  .  . ‘

//       999.99.99.99.9
if esa.norek_txt.value == kjol
msginfo (‘Data ini harus diisi’,’Konfirmation Norek Kosong’)
esa.norek_txt.setfocus
return
else
esa.nmrek_txt.setfocus
endif

do case
case esa.new.value == .T.
select glmas
snorek := esa.norek_txt.value
dbsetorder(1)
dbseek(snorek)
if .not. found()
esa.nmrek_txt.enabled          := .T.
esa.radio_group1.enabled       := .T.
esa.radio_group2.enabled       := .T.
esa.saldo_txt.enabled          := .T.
esa.debet_txt.enabled          := .T.
esa.kredit_txt.enabled         := .T.
esa.balance_txt.enabled        := .T.
esa.simpan2.enabled            := .T.
esa.cancel2.enabled            := .T.

esa.ToolBar_1.Enabled          := .F.

else
msginfo(‘Data yang anda masukan sudah ada ‘,’Data Kembar dari data baru’)
esa.norek_txt.setfocus
endif

case esa.edit.value == .T.

select glmas
dbsetorder(1)
snorek := ESA.NOREK_TXT.VALUE
snorek1 := snorek

dbseek(snorek1)
if .NOT. EOF() .AND. SNOREK1 <> SNOREK
msginfo(‘Data yang anda masukan sudah ada ‘,’Data Kembar proses edit’)
esa.norek_txt.setfocus
endif

esa.nmrek_txt.enabled          := .T.
esa.radio_group1.enabled       := .T.
esa.radio_group2.enabled       := .T.
esa.saldo_txt.enabled          := .T.
esa.debet_txt.enabled          := .T.
esa.kredit_txt.enabled         := .T.
esa.balance_txt.enabled        := .T.
esa.simpan2.enabled            := .T.
esa.cancel2.enabled            := .T.

esa.ToolBar_1.Enabled          := .F.

endcase

Return

procedure itung

esa.balance_txt.value := (esa.saldo_txt.value+esa.debet_txt.value)-esa.kredit_txt.value
esa.balance_txt.enabled := .T.

return

procedure search2

Local carimas

select glmas
set order to 1

carimas := upper(AllTrim(InputBox(‘Masukan Nama Barang yg anda cari:’ , ‘cari nama barang’ ) ) )

If .Not. Empty(carimas)

If GLMAS->(DbSeek(carimas))
esa.glment_browse.value := glmas->(recno())
Else
MsgExclamation(‘Nama barang tidak diketemukan’)
EndIf

EndIf
set order to 1

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: