1
BAGIAN I Tujuan : 1. 2. 3.
Membuat Project File Membuat menu program Menguji Menu Program
A.
BAHAN PRAKTEK I
1.1
Membuat Project File SKA 1. Buka Program Microsoft Visual FoxPro 9.0 2. Klik Menu File pada Menu Bar 3. Pilih New pada Sub Menu File
4. 5.
Pilih Type File Project Klik Tombol New File
6.
Pada kotak dialog Save in Pindahkan folder ke Forder PRG di Folder Anda, Jika belum ada silahkan anda buatkan dulu: O:\SKA\KARB\NamaAnda\PRG Isi baris Enter Project File dengan SKA (Nama File Project) Klik tombol Save
7. 8. 1.2
Membuat Menu Program 1. Klik Page Other pada Project File SKA 2. Pilih Menu 3. Klik tombol New
4.
Klik Tombol Menu
AMIK Al Ma’soem
2
1.3
Membuat Menu Bar
Ketik Menu Bar di atas seperti berikut ini :
1.4
Sub Menu File
1. 2. 3.
Klik pada prompt File Pilih Result Submenu, kemudian Klik tombol Create sebelah kanan Submenu Ketik submenu berikut :
4.
Untuk memasukan perintah CTRL+W, klik pada tombol Option, kemudian klik pada textbox (press the key) tekan CTRL+W. Lalu tekan tombol Ok untuk mengakhiri. Pada prompt Logout, ganti result dengan Procedure, kemudian ketik prosedur berikut :
5.
IF TYPE("MENULOGIN")#"0" DO O:\ska\MINR\NAMA\prg\MENULOGIN.MPR ENDIF
1.5
Sub Menu Master
1. 2. 3.
Pindahkan Menu Level ke Menu Bar Klik Prompt Master Pilih Result Submenu, kemudian klik tombol Create sebelah kanan Submenu
AMIK Al Ma’soem
3
4.
Ketik submenu berikut :
1.6
Sub Menu Laporan Buatkan lagi submenu Laporan berikut dengan cara seperti membuat submenu Master.
1.7
Sub Menu BackUp Lakukan perintan yang sama untuk membuat submenu Backup berikut :
1.8
Sub Menu Utility Lakukan pula perintah seperti di atas untuk membuat submenu Utility berikut :
1.9
Menyimpan Menu Program 1. Klik Menu File pada Menu Bar 2. Pilih Save
3. 4. 1.10
Pada kotak dialog Save in, pindahkan ke folder PRG di folder Anda Ketik nama file MenuAdmin pada baris Save Menu As, kemudian Klik tombol Save
Menguji Menu Program 1. Klik tanda + di sebelah kiri Menus pada page Other 2. Klik File Menutama, kemudian Klik tombol Run
AMIK Al Ma’soem
4
B.
LATIHAN I
Buatkan Menu Program Beikut, dan simpan dengan nama MenuUser : 1. Sub menu File
2.
Sub menu Master
3.
Sub menu Laporan
4.
Sub menu BackUp
5.
Sub menu Utility
C.
TUGAS I
Buatkan Menu Program berikut, dan simpan dengen nama MenAdmin : 1. Sub menu File, Jurnal Umum, Laporan dan BackUp sama dengan MenuUser
AMIK Al Ma’soem
5
2.
Sub menu Master adalah sbb :
3.
Sub menu Utility adalah sbb :
AMIK Al Ma’soem
6
BAGIAN II Tujuan : 1. 2. 3. 4. 5. 6.
A.
Membuat Database DATASKA Membuat Tabel USER Membuat Free Table TMPUSER Membuat Form Login Connection File Form Menguji Form dan Menu Program
BAHAN PRAKTEK II
2.1 Membuat Database DATASKA dan Tabel USER, serta Free Tabel TMPUSER 1. Buatkan Database DATASKA pada folder DATA di folder Anda (O:\SKA\DATA) 2. Buatkan Tabel USER pada database DATASKA dengan struktur sbb :
3. 4. 5.
Berikan Primary Key pada field NMID Simpan dengan nama file USER Buatkan lagi Tabel TMPUSER pada Free Tabel dengan struktur file yang sama dengan Tabel USER Simpan di O:\SKA\NAMA\DATA
2.2 Membuat Form LOGIN 1. Buatkan Form Login sbb :
2.
Isikan Procedure berikut pada form Login a. Object Form1 Procedure ACTIVATE set exact on SET EXCLUSIVE OFF SET MULTILOCKS ON CLOSE DATABASES set defa to O:\SKA\DATA OPEN DATABASE DATASKA SHARED IF ! used('user')
AMIK Al Ma’soem
7
use user IN 0 SHARED ENDIF if used('tmpuser') use in tmpuser endif SELECT 9 USE o:\SKA\ceps\data\tmpuser EXCLUSIVE *Mengosongkan inputan thisform.nmid.value="" thisform.pswd.value="" RETURN
b. Object Form1 Procedure UNLOAD close databases RETURN
c.
Object LOGIN Procedure CLICK
IF EMPTY(thisform.nmid.value) messagebox("User Id tidak boleh kosong...!",0,"Perhatian...") thisform.nmid.setfocus RETURN ELSE IF EMPTY(thisform.PSWD.value) messagebox("Password tidak boleh kosong...!",0,"Perhatian...") thisform.pswd.setfocus RETURN else select user set order to tag nmid LOCATE FOR nmid=TRIM(thisform.nmid.value) if ! found() messagebox("Maaf User Id Anda Belum Terdaftar...!",0,"Perhatian...") thisform.nmid.setfocus() retu else set order to tag pswd LOCATE for nmid=TRIM(thisform.nmid.value) .and. pswd=TRIM(thisform.pswd.value)
if ! found() messagebox("Maaf Password Tidak Dikenal...!",0,"Perhatian...") thisform.pswd.setfocus() retu ELSE SELECT tmpuser DELETE ALL SET DELETED OFF PACK APPEND FROM USER FOR NMID=TRIM(thisform.nmid.value) IF user.jabat=1 DO o:\ska\ceps\prg\MENUUSER.MPR ELSE IF user.jabat=2 DO o:\ska\ceps\prg\MENUADMIN.MPR ENDIF ENDIF thisform.release endif endif ENDIF
AMIK Al Ma’soem
8
ENDIF
d. Object BATAL Procedure CLICK thisform.release retu 2.3 1. 2. 3. 4. 5. 6.
7. 8.
Connection Form LOGIN ke MenuLogin Buka Menu Program Menutama1 Klik Prompt File pada Menu Level MenuBar Pilih Result Submenu, kemudian Klik Edit Klik Prompt Login pada Submenu File Pilih Result Procedure, kemudian klik Create Isikan procedure berikut : IF TYPE("FORMLOGIN")#"0" DO FORM o:\ska\ceps\ prg\FormLogin.SCX ENDIF Simpan MenuLogin Klik Tombol RUN, untuk menguji MenuLogin
B. LATIHAN II 1.
Buatkan Form Kelola Data USER dengan LayOut sbb :
2.
Procedure Form Kelola Data USER : a. Object Form1 Procedure LOAD SET EXCLUSIVE OFF SET MULTILOCKS ON close data set exact on set defa to o:\ska\data OPEN DATABASE DATASKA SHARED IF ! USED("USER") USE USER IN 0 SHARED ENDIF
if used('tmpuser') use in tmpuser endif SELECT 9 USE o:\SKA\ceps\data\tmpuser EXCLUSIVE
AMIK Al Ma’soem
9
RETURN
b. Object Form1 Procedure UNLOAD CLOSE DATABASES USE IN TMPUSER RETURN
c.
Object Form1 Procedure Aktifkan
PARAMETERS x thisform.namauser.Enabled=x thisform.pswd.Enabled=x thisform.jabat.Enabled=x RETURN
d. Object Form1 Procedure Kendali PARAMETERS y thisform.pertama.Enabled=y thisform.sebelumnya.Enabled=y thisform.berikutnya.Enabled=y thisform.terakhir.Enabled=y RETURN
e.
Object Form1 Procedure Kosongkan
thisform.pswd.value="" thisform.namauser.value="” thisform.jabat.value=0 retu
f.
Object Form1 Procedure Tampilkan
thisform.namauser.value=tmpuser.nmid thisform.nmid.value=tmpuser.nmid thisform.pswd.value=tmpuser.pswd thisform.jabat.value=tmpuser.jabat retu
g.
Object Form1 Procedure Activate
SELECT TMPUSER SET DELETE ON DELETE ALL APPEND FROM USER thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.t.) thisform.baru.enabled=.t. thisform.keluar.enabled=.t. thisform.hapus.enabled=.f. thisform.simpan.enabled=.f. thisform.batal.enabled=.f. thisform.perbaiki.enabled=.f. thisform.ud.enabled=.f. thisform.kosongkan thisform.baru.setfocus thisform.grid1.readonly=.t. thisform.grid1.enabled=.t. return
h.
Object NMID Procedure LOSTFOCUS
if empty(thisform.nmid.value) messagebox("Nama Id Harus Diisi !",0,"Perhatian...!") thisform.nmid.setfocus() return endif IF len(trim(thisform.nmid.Value))<4 messagebox("User Id tidak boleh kurang dari 5 digit !",; 0,"Perhatian...")
thisform.nmid.setfocus
AMIK Al Ma’soem
10
RETURN ENDIF SELECT user SET ORDER TO TAG nmid SET EXACT ON if seek(thisform.nmid.value) thisform.grid1.setfocus() thisform.refresh() MESSAGEBOX("Data tersebut sudah ada..",; 0+48,"Perhatian...") else thisform.perbaiki.enabled=.f. thisform.ud.enabled=.f. thisform.batal.enabled=.t. thisform.baru.enabled=.f. thisform.simpan.enabled=.t. thisform.keluar.enabled=.f. thisform.hapus.enabled=.f. thisform.nmid.enabled=.f. thisform.aktifkan(.t.) thisform.kendali(.f.) thisform.kosongkan thisform.namauser.setfocus thisform.grid1.readonly=.t. thisform.grid1.enabled=.f. endif return
i. Oject PSWD Procedure LOSTFOCUS IF len(trim(thisform.pswd.Value))<4 messagebox("Password tidak boleh kurang dari 5 digit !",; 0,"Perhatian...")
thisform.pswd.setfocus RETURN ENDIF
j. Oject CARI Procedure CLICK if empty(thisform.nmid.value) messagebox("User Id Harus Diisi !",0,"Perhatian...!") thisform.nmid.setfocus() return endif SELECT user SET ORDER TO TAG nmid SET EXACT OFF LOCATE FOR nmid=TRIM(thisform.nmid.value) if FOUND() thisform.grid1.setfocus thisform.refresh ELSE MESSAGEBOX("Data tidak ditemukan...",0,"Perhatian...") thisform.perbaiki.enabled=.f. thisform.ud.enabled=.f. thisform.batal.enabled=.t. thisform.baru.enabled=.f. thisform.simpan.enabled=.f. thisform.keluar.enabled=.f. thisform.hapus.enabled=.f.
AMIK Al Ma’soem
11
thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.f.) thisform.kosongkan thisform.pswd.enabled=.t. thisform.nmid.value="" thisform.namauser.setfocus thisform.grid1.readonly=.t. thisform.grid1.enabled=.f. endif return
k.
Oject CARI Procedure RIGHTCLICK
thisform.nmid.Enabled=.t. thisform.nmid.setfocus return
l.
Oject BARU Procedure CLICK thisform.nmid.enabled=.t. thisform.aktifkan(.f.) thisform.kendali(.f.) thisform.baru.enabled=.f. thisform.keluar.enabled=.f. thisform.hapus.enabled=.f. thisform.simpan.enabled=.f. thisform.batal.enabled=.t. thisform.perbaiki.enabled=.f. thisform.ud.enabled=.f. thisform.grid1.readonly=.t. thisform.grid1.enabled=.f. thisform.kosongkan thisform.nmid.setfocus return
m. Oject SIMPAN Procedure CLICK IF EMPTY(thisform.nmid.value) messagebox("Isi dulu User Id-nya !",0,"Perhatian...") thisform.nmid.setfocus RETURN ELSE IF EMPTY(thisform.pswd.value) messagebox("Isi dulu Password-nya !",0,"Perhatian...") thisform.pswd.setfocus RETURN ELSE IF EMPTY(thisform.jabat.value) messagebox("Isi dulu Jabatannya-nya !",0,"Perhatian...") thisform.jabat.setfocus RETURN ELSE IF len(thisform.NMID.value)<4 messagebox("User Id minimal 4 Character...!",0,"Perhatian...") thisform.nmid.setfocus RETURN ELSE IF len(thisform.PSWD.value)<4 messagebox("Password minimal 4 Character...!",0,"Perhatian...") thisform.pswd.setfocus
AMIK Al Ma’soem
12
RETURN ELSE SELECT user locate for nmid=trim(thisform.nmid.value) if found() messagebox("User Id ada yang sama !",0,; "Penyimpanan tidak bisa dilakukan") thisform.nmid.setfocus RETURN endif locate for pswd=trim(thisform.pswd.value) if found() messagebox("Password ada yang sama !",0,; "Penyimpanan tidak bisa dilakukan") thisform.pswd.setfocus return ENDIF IF ! EMPTY(thisform.jabat.Value) locate for nmid=space(14) if ! found() append blank endif WITH THISFORM REPLACE USER.nmid with .nmid.value,USER.pswd with .pswd.value,; USER.namauser with .namauser.value,USER.jabat with .jabat.value IN [USER] ENDWITH SELECT TMPUSER APPEND BLANK WITH THISFORM REPLACE tmpuser.nmid with .nmid.value,TMPUSER.pswd with .pswd.value,; TMPUSER.namauser with .namauser.value,TMPUSER.jabat with .jabat.value IN [USER] ENDWITH thisform.Refresh messagebox("Penyimpanan data sudah dilakukan !",0,"Perhatian...") thisform.perbaiki.enabled=.t. thisform.ud.enabled=.f. thisform.batal.enabled=.f. thisform.baru.enabled=.t. thisform.simpan.enabled=.f. thisform.keluar.enabled=.t. thisform.hapus.enabled=.t. thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.t.) thisform.grid1.readonly=.t. thisform.grid1.enabled=.t. return ELSE messagebox("Isi dulu Jabatannya !",0,"Perhatian...") ENDIF ENDIF ENDIF ENDIF ENDIF Endif
AMIK Al Ma’soem
13
n. Oject BATAL Procedure CLICK thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.t.) thisform.baru.enabled=.t. thisform.keluar.enabled=.t. thisform.hapus.enabled=.f. thisform.simpan.enabled=.f. thisform.batal.enabled=.f. thisform.perbaiki.enabled=.f. thisform.ud.enabled=.f. thisform.grid1.readonly=.t. thisform.grid1.enabled=.t. thisform.kosongkan thisform.nmid.setfocus return
o. Oject HAPUS Procedure CLICK SELECT user LOCATE FOR nmid=TRIM(THISFORM.nmid.Value) ln=RECNO() ljawab=messagebox("Anda Yakin ?",4+32+256,"Record ini mau dihapus !") if ljawab=6 DELETE FOR nmid=TRIM(THISFORM.nmid.Value) set dele on select tmpuser DELETE FOR nmid=TRIM(THISFORM.nmid.Value) ENDIF goto ln thisform.grid1.setfocus thisform.refresh thisform.perbaiki.enabled=.t. thisform.ud.enabled=.f. thisform.batal.enabled=.f. thisform.baru.enabled=.t. thisform.simpan.enabled=.f. thisform.keluar.enabled=.t. thisform.hapus.enabled=.t. thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.t.) thisform.grid1.readonly=.t. thisform.grid1.enabled=.t. return
p. Oject KELUAR Procedure CLICK SET EXCLUSIVE ON SET DELETED OFF SELECT TMPUSER PACK SET DELETED ON SET EXCLUSIVE OFF thisform.release return
q. Oject PERBAIKI Procedure CLICK thisform.perbaiki.enabled=.f. thisform.ud.enabled=.t.
AMIK Al Ma’soem
14
thisform.batal.enabled=.t. thisform.baru.enabled=.f. thisform.simpan.enabled=.f. thisform.keluar.enabled=.f. thisform.hapus.enabled=.f. thisform.aktifkan(.t.) thisform.kendali(.f.) thisform.nmid.enabled=.f. thisform.pswd.setfocus thisform.grid1.readonly=.t. thisform.grid1.enabled=.f. return
r.
Oject UD Procedure CLICK
local jawab,ln ln=recno() jawab=messagebox("Mau Memperbaiki Data Sebelumnya ?",4+32,"Perhatian...!") if jawab=6 SELECT user goto ln WITH THISFORM REPLACE USER.nmid with .nmid.value,USER.pswd with .pswd.value,; USER.namauser with .namauser.value,USER.jabat with .jabat.value IN [USER] ENDWITH SELECT TMPUSER WITH THISFORM REPLACE TMPUSER.nmid with .nmid.value,TMPUSER.pswd with .pswd.value,; TMPUSER.namauser with .namauser.value,TMPUSER.jabat with .jabat.value IN [USER] ENDWITH thisform.refresh endif thisform.perbaiki.enabled=.t. thisform.ud.enabled=.f. thisform.batal.enabled=.f. thisform.baru.enabled=.t. thisform.simpan.enabled=.f. thisform.keluar.enabled=.t. thisform.hapus.enabled=.t. thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.t.) thisform.pswd.setfocus() thisform.grid1.readonly=.t. thisform.grid1.enabled=.t. return
s.
Oject PERTAMA Procedure CLICK
SELECT TMPUSER go top if eof() messagebox("Tidak ada record...",0,"Perhatian...!") return ENDIF thisform.grid1.setfocus thisform.refresh return
t.
Oject SEBELUMNYA Procedure CLICK
SELECT TMPUSER skip -1 if bof() go top ENDIF
AMIK Al Ma’soem
15
thisform.grid1.setfocus thisform.refresh return
u. Oject BERIKUTNYA Procedure CLICK SELECT TMPUSER skip if bof() go bottom ENDIF thisform.grid1.setfocus thisform.refresh return
v.
Oject TERAKHIR Procedure CLICK
SELECT TMPUSER go bottom if eof() messagebox("Tidak ada record...",0,"Perhatian...!") return ENDIF thisform.grid1.setfocus thisform.refresh return
w. Oject GRID1 Procedure AfterRowColChange LPARAMETERS nColIndex thisform.perbaiki.enabled=.t. thisform.hapus.enabled=.t. thisform.batal.enabled=.f. thisform.nmid.enabled=.f. thisform.aktifkan(.f.) thisform.kendali(.t.) thisform.baru.enabled=.t. thisform.simpan.enabled=.f. thisform.keluar.enabled=.t. thisform.grid1.enabled=.t. thisform.grid1.readonly=.t. thisform.tampilkan retu
C. TUGAS II Buatkan Form Mengganti Password dengan LayOut sbb :
AMIK Al Ma’soem
16
BAGIAN III Tujuan : 1. 2. 3.
Membuat Table Perkiraan Membuat Table Jurnal Membuat Form untuk mengelola data Perkiraan
A.
BAHAN PRAKTEK III
3.1
Table Perkiraan Nama Table Primary Key
: Perkiraan : Noper
Table Jurnal Nama Table Primary Key
: Jurnal :-
3.2
AMIK Al Ma’soem
17
3.3
3.4
Table Miror Perkiraan Nama Table Primary Key
: TMPPERN :-
Form Kelola Data Perkiraan Nama Form : Perkiraan
AMIK Al Ma’soem
18
3.5
Procedure Program
*Object FORM1 Procedure LOAD CLOSE DATABASES SET EXCLUSIVE OFF SET MULTILOCKS ON SET DEFAULT TO O:\SKA\DATA OPEN DATABASE DATASKA SHARED IF ! USED("PERKIRAAN") USE PERKIRAAN IN 0 SHARED ENDIF IF ! USED("JURNAL") USE JURNAL IN 0 SHARED ENDIF IF USED("TMPPERN") USE IN TMPPERN ENDIF SELECT 10 USE O:\SKA\CEPS\DATA\TMPPERN EXCLUSIVE RETURN
*Object FORM1 Procedure UNLOAD USE IN TMPPERN CLOSE DATABASES RETURN
*Object FORM1 Procedure AKTIFKAN PARAMETERS X THISFORM.noac.Enabled=X THISFORM.namaac.Enabled=X THISFORM.saldoa.Enabled=X RETURN
*Object FORM1 Procedure KENDALI PARAMETERS Y THISFORM.PERTAMA.Enabled=Y THISFORM.SEBELUMNYA.Enabled=Y THISFORM.BERIKUTNYA.Enabled=Y THISFORM.TERAKHIR.Enabled=Y RETU
*Object FORM1 Procedure KOSONGKAN THISFORM.noac.Value="" THISFORM.namaac.Value="" THISFORM.saldoa.Value=0 RETU
*Object FORM1 Procedure TAMPILKAN THISFORM.no.Value=LEFT(TMPPERN.noac,1)+"-" THISFORM.noac.Value=RIGHT(TMPPERN.NOAC,4) THISFORM.namaac.Value=TMPPERN.NAMAAC THISFORM.saldoa.Value=TMPPERN.SALDOJ RETURN
AMIK Al Ma’soem
19
*Object FORM1 Procedure ACTIVATE SELECT TMPPERN DELETE ALL SET DELETED ON APPEND FROM PERKIRAAN thisform.perkiraan.ActivePage =1 SELECT perkiraan SET FILTER TO LEFT(NOAC,1)="1" thisform.refresh THISFORM.KOSONGKAN THISFORM.KENDALI(.T.) THISFORM.AKTIFKAN(.F.) THISFORM.tambah.Enabled=.T. THISFORM.batal.Enabled=.f. THISFORM.simpan.Enabled=.f. THISFORM.hapus.Enabled=.f. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.f. THISFORM.keluar.Enabled=.T. RETU
*Object PERKIRAAN Procedure CLICK SELECT TMPPERN IF thisform.perkiraan.activepage=1 thisform.kosongkan thisform.no.value="1-" SET FILTER TO LEFT(TMPPERN.noac,1)="1" thisform.refresh else IF thisform.perkiraan.activepage=2 thisform.kosongkan thisform.no.value="2-" SET FILTER TO LEFT(TMPPERN.noac,1)="2" thisform.refresh else IF thisform.perkiraan.activepage=3 thisform.kosongkan thisform.no.value="3-" SET FILTER TO LEFT(TMPPERN.noac,1)="3" thisform.refresh ELSE IF thisform.perkiraan.activepage=4 thisform.kosongkan thisform.no.value="4-" SET FILTER TO LEFT(TMPPERN.noac,1)="4" thisform.refresh ELSE IF thisform.perkiraan.activepage=5 thisform.kosongkan thisform.no.value="5-" SET FILTER TO LEFT(TMPPERN.noac,1)="5" thisform.refresh ELSE thisform.kosongkan thisform.no.value="6-" SET FILTER TO LEFT(TMPPERN.noac,1)="6" thisform.refresh endif
AMIK Al Ma’soem
20
endif ENDIF endif endif
*Object TAMBAH Procedure CLICK IF EMPTY(thisform.no.Value) MESSAGEBOX("Pilih dulu Account yang akan diisi...",0,"Perhatian...!") RETURN ENDIF THISFORM.KOSONGKAN THISFORM.KENDALI(.f.) THISFORM.AKTIFKAN(.t.) THISFORM.tambah.Enabled=.f. THISFORM.simpan.Enabled=.t. THISFORM.batal.Enabled=.T. THISFORM.hapus.Enabled=.f. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.f. THISFORM.cetak.Enabled=.f. THISFORM.keluar.Enabled=.f. thisform.noac.setfocus RETU
*Object SIMPAN Procedure CLICK IF EMPTY(thisform.noac.Value) .or. EMPTY(thisform.namaac.Value) MESSAGEBOX("Nomor & Nama Perkiraan harus diisi !",0,"perhatian..!") thisform.noper.SetFocus RETURN ENDIF SELECT perkiraan LOCATE FOR NOAC=TRIM(thisform.no.Value)+thisform.noac.Value IF FOUND() thisform.grid1.setfocus() thisform.refresh() messagebox("Perkiraan tsb sudah tercatat...!",0,"Perhatian...") THISFORM.KENDALI(.t.) THISFORM.AKTIFKAN(.f.) THISFORM.tambah.Enabled=.t. THISFORM.batal.Enabled=.f. THISFORM.simpan.Enabled=.f. THISFORM.hapus.Enabled=.f. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.f. THISFORM.keluar.Enabled=.t. return ENDIF SET FILTER TO LOCATE FOR perkiraan.noac=SPACE(6) IF .not. FOUND() APPEND BLANK ENDIF vnoac=TRIM(thisform.no.Value)+thisform.noac.Value WITH THISFORM REPLACE PERKIRAAN.Noac WITH vNoac,PERKIRAAN.namaac WITH .namaac.Value,; PERKIRAAN.saldoa WITH .saldoa.Value,PERKIRAAN.saldoj WITH .saldoa.Value IN [PERKIRAAN] ENDWITH
AMIK Al Ma’soem
21
SELECT TMPPERN APPEND BLANK WITH THISFORM REPLACE TMPPERN.Noac WITH vNoac,TMPPERN.namaac WITH .namaac.Value,; TMPPERN.saldoa WITH .saldoa.Value,TMPPERN.saldoj WITH .saldoa.Value IN [TMPPERN] ENDWITH SET FILTER TO noac=LEFT(Thisform.no.Value,1) thisform.Refresh THISFORM.KENDALI(.t.) THISFORM.AKTIFKAN(.f.) THISFORM.tambah.Enabled=.t. THISFORM.batal.Enabled=.f. THISFORM.simpan.Enabled=.f. THISFORM.hapus.Enabled=.f. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.f. THISFORM.keluar.Enabled=.t. thisform.tambah.SetFocus RETURN
*Object BATAL Procedure CLICK THISFORM.KOSONGKAN THISFORM.KENDALI(.t.) THISFORM.AKTIFKAN(.f.) THISFORM.tambah.Enabled=.t. THISFORM.batal.Enabled=.f. THISFORM.simpan.Enabled=.f. THISFORM.hapus.Enabled=.f. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.f. THISFORM.keluar.Enabled=.t. RETU
*Object HAPUS Procedure CLICK vnoac=TRIM(thisform.no.Value)+thisform.noac.Value SELECT jurnal LOCATE FOR noac=vnoac IF FOUND() MESSAGEBOX("Maaf nomor perkiraan ini tidak bisa dihapus..."+; CHR(13)+"karena sudah digunakan dalam transaksi...",0,"Perhatian...") thisform.Refresh() RETURN ENDIF SELECT perkiraan LOCATE FOR noac=vnoac jawab=MESSAGEBOX("Anda Yakin Record ini mau dihapus...?",; 4+32+256,"Pehatian...") IF jawab=6 DELETE &&FOR noac=vnoac SET DELETED ON SELECT TMPPERN DELETE thisform.refresh ENDIF
AMIK Al Ma’soem
22
*Object KELUAR Procedure CLICK SET EXCLUSIVE ON SET DELETED OFF SELECT TMPPERN DELETE ALL PACK SET DELETED ON SET EXCLUSIVE OFF thisform.Release RETURN
*Object CETAK Procedure CLICK SELECT perkiraan SET FILTER TO REPORT FORM O:\SKA\CEPS\PRG\perkiraan preview Return
*Object PERBAIKI Procedure CLICK vnoac=TRIM(thisform.no.Value)+thisform.noac.Value SELECT jurnal LOCATE FOR noac=vnoac IF FOUND() MESSAGEBOX("Maaf Perkiraan tersebut tidak bisa diperbaiki"+; CHR(13)+"karena sudah digunakan dalam transaksi...",0,"Perhatian...") thisform.Refresh() RETURN ENDIF THISFORM.KENDALI(.f.) THISFORM.AKTIFKAN(.t.) THISFORM.tambah.Enabled=.f. THISFORM.simpan.Enabled=.f. THISFORM.batal.Enabled=.T. THISFORM.hapus.Enabled=.f. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.t. THISFORM.cetak.Enabled=.f. THISFORM.keluar.Enabled=.f. thisform.namaac.setfocus return
*Object UD Procedure CLICK vnoac=TRIM(thisform.no.Value)+thisform.noac.Value jawab=MESSAGEBOX("Anda Yakin Mau Memperbaiki data Sebelumnya ?",4+32+512,"Perhatian...") IF jawab=6 SELECT PERKIRAAN WITH THISFORM REPLACE PERKIRAAN.noac WITH vnoac,PERKIRAAN.namaac WITH .namaac.Value,; PERKIRAAN.saldoa WITH .saldoa.Value,PERKIRAAN.saldoj WITH .saldoa.Value IN [PERKIRAAN] ENDWITH SELECT TMPPERN WITH THISFORM REPLACE TMPPERN.Noac WITH vNoac,TMPPERN.namaac WITH .namaac.Value,; TMPPERN.saldoa WITH .saldoa.Value,TMPPERN.saldoj WITH .saldoa.Value IN [TMPPERN] ENDWITH ENDIF thisform.grid1.SetFocus thisform.refresh THISFORM.KENDALI(.t.) THISFORM.AKTIFKAN(.f.) THISFORM.tambah.Enabled=.t. THISFORM.simpan.Enabled=.f. THISFORM.batal.Enabled=.f. THISFORM.hapus.Enabled=.t. THISFORM.perbaiki.Enabled=.f. THISFORM.ud.Enabled=.f. THISFORM.keluar.Enabled=.t.
AMIK Al Ma’soem
23
thisform.namaac.setfocus return
*Object PERTAMA Procedure CLICK SELECT TMPPERN GO top IF EOF() MESSAGEBOX("Tidak ada data...",0,"Perhatian...") RETURN ENDIF thisform.grid1.SetFocus thisform.Refresh RETURN
*Object SEBELUMNYA Procedure CLICK SELECT TMPPERN SKIP -1 IF EOF() GO top ENDIF thisform.grid1.SetFocus thisform.Refresh RETURN
*Object BERIKUTNYA Procedure CLICK SELECT TMPPERN SKIP 1 IF EOF() GO bottom ENDIF thisform.grid1.SetFocus() thisform.Refresh() RETURN
*Object TERAKHIR Procedure CLICK SELECT TMPPERN GO bottom IF EOF() MESSAGEBOX("Tidak ada data...",0,"Perhatian...") RETURN ENDIF thisform.grid1.SetFocus() thisform.Refresh() RETURN
*Object GRID1 Procedure AfterRowCollChenge LPARAMETERS nColIndex SELECT TMPPERN IF thisform.perkiraan.activepage=1 thisform.kosongkan thisform.no.value="1-" SET FILTER TO LEFT(TMPPERN.noac,1)="1" thisform.refresh else IF thisform.perkiraan.activepage=2 thisform.kosongkan thisform.no.value="2-" SET FILTER TO LEFT(TMPPERN.noac,1)="2" thisform.refresh else IF thisform.perkiraan.activepage=3 thisform.kosongkan
AMIK Al Ma’soem
24
thisform.no.value="3-" SET FILTER TO LEFT(TMPPERN.noac,1)="3" thisform.refresh ELSE IF thisform.perkiraan.activepage=4 thisform.kosongkan thisform.no.value="4-" SET FILTER TO LEFT(TMPPERN.noac,1)="4" thisform.refresh ELSE IF thisform.perkiraan.activepage=5 thisform.kosongkan thisform.no.value="5-" SET FILTER TO LEFT(TMPPERN.noac,1)="5" thisform.refresh ELSE thisform.kosongkan thisform.no.value="6-" SET FILTER TO LEFT(TMPPERN.noac,1)="6" thisform.refresh endif endif ENDIF endif ENDIF thisform.tampilkan THISFORM.KENDALI(.t.) THISFORM.AKTIFKAN(.f.) THISFORM.tambah.Enabled=.t. THISFORM.simpan.Enabled=.f. THISFORM.batal.Enabled=.f. THISFORM.hapus.Enabled=.t. THISFORM.perbaiki.Enabled=.t. THISFORM.ud.Enabled=.f. THISFORM.keluar.Enabled=.t. thisform.namaac.setfocus return
B. TUGAS III : 1.
2.
Lakukan survey ke perusahaan UKM, untuk mengetahui : Harta Kekayaan Perusahaan (Kas, Perlengkapan, Peralatan, dll), Utang, Modal, Jenis-jenis pendapatan, dan Biaya-biaya (beban) yang dikeluarkan perusahaan. Buat Form perkiraannya.
AMIK Al Ma’soem
25
BAGIAN IV Tujuan : 1. 2. 3.
Membuat Report Saldo Perkiraan Filter Grouping
A. BAHAN PRAKTEK IV
Formula : Per : cmonth(date())+" "+str(year(date()),4) Nomor Perkiraan : Perkiraan.noper Nama Perkiraan : Perkiraan.namaper Saldo Berjalan : Perkiraan.saldoj (Format Exp : 999,999,999,999 ; Alignment : Right ) Total : iif(Perkiraan.noac="1","Aktiva",iif(Perkiraan.noac="2","Utang",iif(Perkiraan.noac="3","Modal", iif(perkiraan.noac="4","Pendapatan",iif(Perkiraan.noac="5","Harga Pokok",iif(perkiraan.noac="6", ”Biaya”, iif(Perkiraan.noac="7","Pend.Jasa",""))))))) Perkiraan.saldoj (Format exp : 999,999,999,999 ; Alignment : Right ; Calculate type : Sum & Reset based on : Group Perkiraan.noac)
B. TUGAS IV Buatkan Report Daftar/Saldo Perkiraan dari Tugas III di atas.
AMIK Al Ma’soem
26
BAGIAN V Tujuan : 1. 2. 3.
Transaksi Jurnal Umum Link File Relasi File
A. BAHAN PRAKTEK V: 5.1
Free Table Temporary Jurnal Nama Free Table : TMPJURNAL Primary Key :-
5.2
Free Table Temporary Total Jurnal Nama Free Table : TMPJ Primary Key :-
5.3
Form Jurnal
AMIK Al Ma’soem
27
* Object FORM1 Procedure LOAD SET EXCLUSIVE OFF SET MULTILOCKS ON CLOSE DATABASES SET DATE BRITISH SET EXACT ON SET DEFAULT TO O:\ska\data OPEN DATABASE DATASKA SHARED IF ! USED("perkiraan") USE perkiraan IN 0 SHARED ENDIF IF ! USED("jurnal") USE jurnal IN 0 SHARED ENDIF IF USED("tmpjurnal") USE IN tmpjurnal ENDIF IF USED("tmpj") USE IN tmpj ENDIF SELECT 9 USE O:\SKA\CEPS\DATA\TMPJ EXCLUSIVE SELECT 10 USE O:\SKA\CEPS\DATA\tmpjurnal EXCLUSIVE SET ORDER TO TAG NoBukti RETURN
* Object FORM1 Procedure UNLOAD CLOSE DATABASES USE IN TMPJURNAL USE IN TMPJ RETURN
* Object FORM1 Procedure AKTIFKAN PARAMETERS x thisform.tgltran.enabled=x thisform.catatan.enabled=x thisform.noac.enabled=x thisform.namaac.enabled=x thisform.debet.enabled=x thisform.kredit.enabled=x RETURN
* Object FORM1 Procedure KENDALI PARAMETERS Y thisform.pertama.Enabled=Y thisform.berikutnya.Enabled=Y thisform.sebelumnya.Enabled=Y thisform.terakhir.Enabled=Y RETURN
* Object FORM1 Procedure KOSONGKAN thisform.noac.Value="" thisform.debet.Value=0 thisform.kredit.Value=0 thisform.namaac.Value="" RETURN
* Object FORM1 Procedure TAMPIL thisform.namaac.value=tmpjurnal.namaac thisform.noac.value=tmpjurnal.noac thisform.debet.value=tmpjurnal.debet thisform.kredit.value=tmpjurnal.kredit RETURN
AMIK Al Ma’soem
28
* Object FORM1 Procedure TAMPILKAN SELECT jurnal thisform.nobukti.value=jurnal.noBukti thisform.tgltran.value=jurnal.tgltran thisform.catatan.value=jurnal.catatan thisform.noac.value=jurnal.noac thisform.debet.value=jurnal.debet thisform.kredit.value=jurnal.kredit SELECT perkiraan LOCATE FOR NOAC=TRIM(thisform.noac.Value) thisform.namaac.Value=perkiraan.namaac SELECT tmpjurnal DELETE ALL SET DELETED ON APPEND FROM jurnal FOR NoBukti=TRIM(thisform.nobukti.Value) GO top vjd=0 vjk=0 DO WHILE ! EOF() SELECT perkiraan LOCATE FOR noac=tmpjurnal.noac IF FOUND() vnamaac=perkiraan.namaac ELSE vnamaac="" ENDIF SELECT tmpjurnal REPLACE namaac WITH vnamaac vjd=vjd+tmpjurnal.debet vjk=vjk+tmpjurnal.kredit skip ENDDO SELECT tmpj GO bottom REPLACE NoBukti WITH thisform.nobukti.Value REPLACE Jdebet WITH vJD REPLACE Jkredit WITH vJK SELECT tmpjurnal GO top thisform.lihat.enabled=.t. thisform.grid1.SetFocus thisform.Refresh RETURN
* Object FORM1 Procedure ACTIVATE SELECT tmpj DELETE ALL SET DELETED OFF pack thisform.aktifkan(.f.) thisform.nobukti.Value="" thisform.kosongkan thisform.tgltran.Value=DATE() thisform.kendali(.t.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.t. thisform.tambah.setfocus RETURN
* Object Form1 Procedure DoubleClick thisform.keluar.enabled=.t.
* Object TAMBAH Procedure CLICK SELECT tmpj
AMIK Al Ma’soem
29
SET FILTER TO NoBUkti=thisform.nobukti.value IF jdebet<>Jkredit MESSAGEBOX("Soory Transaksi tidak bisa diproses"+CHR(13)+; "Periksa lagi sisi Debet dan Kreditnya...",0,"Perhatian...") RETURN ELSE thisform.noac.Value="" thisform.kosongkan SELECT tmpjurnal SET DELETED ON DELETE ALL SELECT tmpj DELETE ALL PACK thisform.refresh thisform.aktifkan(.t.) hh=LEFT(time(),2) mm=SUBSTR(time(),4,2) ss=RIGHT(time(),2) d=day(date()) m=month(date()) y=year(date()) IF d<10 tgl="0"+STR(d,1) ELSE tgl=STR(d,2) ENDIF IF m<10 bln="0"+STR(m,1) ELSE bln=STR(m,2) ENDIF th=RIGHT(STR(y,4),2) thisform.nobukti.Value=tgl+bln+th+hh+mm+ss thisform.tgltran.Value=DATE() thisform.kendali(.f.) thisform.ok.enabled=.t. thisform.tambah.enabled=.f. thisform.batal.enabled=.t. thisform.keluar.enabled=.f. thisform.lihat.enabled=.f. thisform.tgltran.setfocus endif RETURN
* Object NAMAAC Procedure InteractiveChange SELECT Perkiraan LOCATE FOR namaAC=thisform.namaAC.Value thisform.noAC.Value=NoAC thisform.debet.Value=0 thisform.kredit.Value=0 thisform.ok.Enabled=.t. RETURN
* Object NOAC Procedure LOSTFOCUS SELECT perkiraan LOCATE FOR NOAC=TRIM(thisform.noac.Value) IF FOUND() thisform.namaAC.Value=perkiraan.namaAC ELSE thisform.namaAC.Value="" ENDIF thisform.ok.Enabled=.t. RETURN
* Object NOAC Procedure Click
AMIK Al Ma’soem
30
SELECT Perkiraan LOCATE FOR noAC=thisform.noAC.Value thisform.namaAC.Value=NamaAC thisform.debet.Value=0 thisform.kredit.Value=0 thisform.ok.Enabled=.t. RETURN
* Object KREDIT Procedure Click SELECT tmpjurnal thisform.kredit.Value=tmpj.jdebet-tmpj.jkredit RETURN
* Object OK Procedure Click IF thisform.debet.Value=thisform.kredit.Value MESSAGEBOX("Lakukan proses jurnal dengan benar...",0,"Perhatian...") thisform.kredit.SetFocus RETURN ENDIF SELECT tmpjurnal LOCATE FOR noac=thisform.noac.Value IF FOUND() MESSAGEBOX("Nomor perkiraan yang anda masukan duplikasi..."+CHR(13)+; "Coba anda periksa lagi jurnalnya...!",0,"Perhatian...") thisform.noac.SetFocus RETURN ENDIF SELECT perkiraan LOCATE FOR noac=thisform.noac.Value IF thisform.kredit.Value>0 IF perkiraan.saldoj
AMIK Al Ma’soem
31
ENDIF REPLACE NoBukti WITH thisform.nobukti.value REPLACE jdebet WITH jdebet+thisform.debet.Value REPLACE jkredit WITH jkredit+thisform.kredit.Value thisform.grid1.setfocus thisform.refresh thisform.kendali(.f.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.T. RETURN
* Object LIHAT Procedure Click SELECT perkiraan SET ORDER TO TAG NOAC SELECT Jurnal SET RELATION TO noac INTO Perkiraan SET FILTER TO MONTH(tgltran)=MONTH(thisform.tgltran.Value) REPORT FORM o:\ska\ceps\prg\Jurnal PREVIEW RETURN
* Object BATAL Procedure Click SELECT perkiraan LOCATE FOR noac=TRIM(thisform.noac.Value) IF noac="1" .or. noac="6" IF thisform.debet.Value>0 REPLACE perkiraan.saldoj WITH perkiraan.saldoj - thisform.debet.Value REPLACE tmpj.jdebet WITH tmpj.jdebet-thisform.debet.Value ELSE IF thisform.kredit.Value>0 REPLACE perkiraan.saldoj WITH perkiraan.saldoj + thisform.kredit.Value REPLACE tmpj.jkredit WITH tmpj.jkredit-thisform.kredit.Value ENDIF ENDIF ELSE IF thisform.debet.Value>0 REPLACE perkiraan.saldoj WITH perkiraan.saldoj + thisform.debet.Value REPLACE tmpj.jdebet WITH tmpj.jdebet-thisform.debet.Value ELSE IF thisform.kredit.Value>0 REPLACE perkiraan.saldoj WITH perkiraan.saldoj - thisform.kredit.Value REPLACE tmpj.jkredit WITH tmpj.jkredit-thisform.kredit.Value ENDIF ENDIF ENDIF SELECT jurnal DELETE FOR noac=TRIM(thisform.noac.Value) .and. ; NoBukti=TRIM(thisform.nobukti.Value) thisform.aktifkan(.f.) SELECT TMPJURNAL DELETE FOR noac=TRIM(thisform.noac.Value) .and. ; NoBukti=TRIM(thisform.nobukti.Value) SET DELETED ON thisform.refresh thisform.noac.Value="" thisform.kosongkan thisform.tgltran.Value=DATE() thisform.kendali(.t.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.t. thisform.tambah.setfocus RETURN
AMIK Al Ma’soem
32
* Object PERTAMA Procedure Click SELECT jurnal GO top IF EOF() MESSAGEBOX("Record Kosong...",0,"Perhatian...") RETURN ENDIF thisform.tampilkan thisform.kendali(.t.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.t. thisform.grid1.SetFocus() thisform.Refresh RETURN
* Object SEBELUMNYA Procedure Click SELECT jurnal SKIP -1 IF EOF() GO bottom ENDIF thisform.tampilkan thisform.kendali(.t.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.t. thisform.grid1.SetFocus() thisform.Refresh RETURN
* Object BERIKUTNYA Procedure Click SELECT jurnal SKIP IF EOF() GO bottom ENDIF thisform.tampilkan thisform.kendali(.t.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.t. thisform.grid1.SetFocus() thisform.Refresh RETURN
* Object TERAKHIR Procedure Click SELECT jurnal GO Bottom IF EOF() MESSAGEBOX("Record Kosong...",0,"Perhatian...") RETURN ENDIF thisform.tampilkan thisform.kendali(.t.) thisform.ok.enabled=.f. thisform.tambah.enabled=.t. thisform.batal.enabled=.f. thisform.keluar.enabled=.t. thisform.grid1.SetFocus() thisform.Refresh RETURN
AMIK Al Ma’soem
33
* Object GRID1 Procedure AfterRowCollChenge LPARAMETERS nColIndex thisform.tampil thisform.batal.enabled=.t. RETURN
* Object GRID1 Procedure RightClick thisform.batal.Enabled=.t.
* Object KELUAR Procedure Click SELECT tmpj SET FILTER TO NoBUkti=thisform.nobukti.value IF jdebet<>Jkredit MESSAGEBOX("Soory Transaksi belum selesai"+CHR(13)+; "Periksa lagi sisi Debet dan Kreditnya...",0,"Perhatian...") RETURN ELSE SET EXCLUSIVE ON SELECT tmpjurnal SET DELETED OFF PACK SET EXCLUSIVE OFF thisform.Release ENDIF RETURN
B. TUGAS V: Buatkan Form Jurnal dari Tugas III di atas.
AMIK Al Ma’soem
34
BAGIAN VI Tujuan : 1. 2.
Membuat Report Jurnal Umum Grouping
A. BAHAN PRAKTEK VI 6.1 Membuat Report Laporan Jurnal
Formula : Data Grouping : Jurnal.nobukti Nomor Bukti : Jurnal.NoBukti Tanggal Transaksi : Jurnal.tanggal Nomor Perkiraan : Jurnal.noper Nama Perkiraan : Perkiraan.namaper Debet : Jurnal.debet Kredit : Jurnal.kredit
AMIK Al Ma’soem
35
6.2
Membuat Form Laporan Jurnal
* Object FORM1 Procedure LOAD CLOSE DATABASES SET EXCLUSIVE OFF SET MULTILOCKS ON SET DATE BRITISH SET EXACT ON SET DEFAULT TO E:\SKA\data OPEN DATABASE DATASKA SHARED IF ! USED("perkiraan") USE perkiraan IN 0 SHARED ENDIF IF ! USED("jurnal") USE jurnal IN 0 SHARED ENDIF RETURN
* Object FORM1 Procedure UNLOAD CLOSE DATABASES Return
* Object FORM1 Procedure ACTIVATE thisform.t1.year=YEAR(DATE()) thisform.t2.day=day(DATE()) thisform.t2.month=month(DATE()) thisform.t2.year=YEAR(DATE()) return
* Object CETAK Procedure CLICK SELECT perkiraan SET ORDER TO TAG NOAC ta=thisform.t1.day ma=thisform.t1.month ya=thisform.t1.year tb=thisform.t2.day mb=thisform.t2.month yb=thisform.t2.year tgl1=STR(ta)+"/"+STR(ma)+"/"+STR(ya) tgl2=STR(tb)+"/"+STR(mb)+"/"+STR(yb) SELECT jurnal SET RELATION TO noac INTO perkiraan SET FILTER TO tgltran>=CTOD(tgl1) .and.; tgltran<=CTOD(tgl2) REPORT FORM o:\SKA\ceps\prg\jurnal preview RETURN
AMIK Al Ma’soem
36
* Object KELUAR Procedure CLICK thisform.release RETURN
B. TUGAS VI Buatkan Laporan Jurnal untuk Tugas V di atas.
AMIK Al Ma’soem
37
BAGIAN VII Tujuan : 1. 2.
Membuat Report Neraca Saldo Penggunaan File Mirror
A. BAHAN PRAKTEK VII 7.1
Report Neraca Saldo
Formula : Per : cmonth(tmppern.tanggal)+" "+str(year(tmppern.tanggal),4) Header : IIF( Tmppern.noac="1","AKTIVA",IIF( Tmppern.noac="2","UTANG","MODAL")) Nama Perkiraan : tmppern.namaper Saldo : tmppern.saldoj (Format exp : 999,999,999,999 ; alignment : right) Total : iif(left(tmppern.noper,1)="1","Aktiva",iif(left(tmppern.noper,1)="2","Utang","Modal")) Tmppern.saldoj (Format exp : 999,999,999,999 ; alignment : right ; calculation type : sum ; reset based on : Group tmpper.noac) Laba berjalan : tmppern.laba Selisih : tmppern.selisih Total Pasiva : tmppern.pasiva
AMIK Al Ma’soem
38
7.2
Form Laporan Neraca Saldo
* Object FORM1 Procedure LOAD SET TALK OFF SET DATE BRITISH SET CENTURY ON CLOSE DATABASES SET EXCLUSIVE OFF SET MULTILOCKS ON SET DEFAULT TO o:\ska\data OPEN DATABASE DATASKA SHARED IF ! USED("Perkiraan") USE perkiraan IN 0 SHARED ENDIF IF USED("TMPPERn") USE IN tmppern ENDIF SELECT 9 USE o:\ska\ceps\data\tmppern EXCLUSIVE SET ORDER TO TAG NOAC RETURN
* Object FORM1 Procedure UNLOAD CLOSE DATABASES USE IN TMPPERN return
* Object FORM1 Procedure ACTIVATE thisform.tgl.day=DAY(DATE()) thisform.tgl.month=month(DATE()) thisform.tgl.year=year(DATE()) return
* Object CETAK Procedure CLICK d=thisform.tgl.day m=thisform.tgl.month y=thisform.tgl.year tgl1=STR(d,2)+"/"+STR(m,2)+"/"+STR(y,4) tgl=CTOD(tgl1) Vaktiva=0 Vutang=0 Vmodal=0 Vpend=0 Vhp=0 Vjasa=0 Vbiaya=0 Vpasiva=0 vselisih=0 vlaba=0
AMIK Al Ma’soem
39
vp=0 SELECT tmppern SET DELETED OFF DELETE ALL PACK APPEND FROM perkiraan FOR LEFT(noac,1)="1" .or. LEFT(noac,1)="2" .or. LEFT(noac,1)="3" SELECT perkiraan SUM saldoj FOR LEFT(noac,1)="1" TO vaktiva SUM saldoj FOR LEFT(noac,1)="2" TO vutang SUM saldoj FOR LEFT(noac,1)="3" TO vmodal SUM saldoj FOR LEFT(noac,1)="4" TO vpend SUM saldoj FOR LEFT(noac,1)="6" TO vbiaya SUM saldoj FOR LEFT(noac,1)="5" TO vhp SELECT TMPPERn DELETE ALL FOR saldoj=0 PACK GO bottom REPLACE Aktiva WITH vaktiva REPLACE UTANG WITH vUTANG REPLACE modal WITH vmodal REPLACE pend WITH vpend REPLACE biaya WITH vbiaya REPLACE hp WITH vhp vlaba=vpend-vhp-vbiaya vp=vmodal+vutang+vlaba vselisih=vaktiva-vp vpasiva=vmodal+vutang+vselisih+vlaba REPLACE LABA WITH vlaba REPLACE selisih WITH vselisih REPLACE pasiva WITH vpasiva REPLACE ALL TGLTRAN WITH TGL REPORT FORM O:\SKA\CEPS\PRG\NERACA PREVIEW RETURN
* Object KELUAR Procedure CLICK
B. TUGAS VII Buatkan Neraca Saldo untuk Tugas IV dan V. Buatkan Menu Program untuk kasus pada Tugas III di atas, dan buatkan procedure seperti pada praktek VII untuk menampilkan Neraca Saldo pada Tugas VII.
AMIK Al Ma’soem
40
BAGIAN VIII Tujuan : 1. 2.
Membuat Report Buku Besar Form Untuk MemFilter Report
A. BAHAN PRAKTEK VIII 8.1
Report Laporan Buku Besar Nama Report : BukuBesar “
Formula : Nama Perkiraan : Tmpjurnal.namaper Saldo Awal : Perkiraan.saldoa (Format exp. : 999,999,999,999 ; Alignment : Right) Tanggal Transaksi : Tmpjurnal.tanggal Catatan : Tmpjurnal.catatan Debet : Tmpjurnal.debet (Format exp. : 999,999,999,999 ; Alignment : Right) Kredit : Tmpjurnal.kredit (Format exp. : 999,999,999,999 ; Alignment : Right) Jumlah Debet : Tmpjurnal.debet (Format exp. : 999,999,999,999 ; Alignment : Right ; Calculate Type : Sum ; Reset Based On : Report) Jumlah Kredit : Tmpjurnal.kredit (Format exp. : 999,999,999,999 ; Alignment : Right ; Calculate Type : Sum ; Reset Based On : Report) Saldo Akhir : Perkiraan.saldoj (Format exp. : 999,999,999,999 ; Alignment : Right)
8.2
Form Laporan Buku Besar Nama Form : BukuBesar
AMIK Al Ma’soem
41
* Object FORM1 Procedure LOAD SET talk OFF SET EXCLUSIVE OFF SET MULTILOCKS ON CLOSE DATABASES SET DEFAULT TO o:\SKA\DATA OPEN DATABASE DATASKA SHARED IF ! USED("PERKIRAAN") USE PERKIRAAN IN 0 SHARED ENDIF IF ! USED("JURNAL") USE JURNAL IN 0 SHARED ENDIF IF USED("TMPJURNAL") USE IN TMPJURNAL ENDIF SELECT 10 USE o:\SKA\CEPS\DATA\TMPJURNAL EXCLUSIVE RETURN
* Object FORM1 Procedure UNLOAD CLOSE DATABASES USE IN TMPJURNAL RETURN
* Object FORM1 Procedure ACTIVATE THISFORM.T.DAY=DAY(DATE()) THISFORM.T.MONTH=MONTH(DATE()) THISFORM.T.YEAR=YEAR(DATE())
* Object CETAK Procedure CLICK M=THISFORM.T.MONTH Y=THISFORM.T.YEAR SELECT TMPJURNAL DELETE ALL SET DELETED OFF PACK APPEND FROM JURNAL FOR MONTH(TGLTRAN)<=M .AND.; YEAR(TGLTRAN)=Y .AND. NOAC=TRIM(THISFORM.NOAC.VALUE) SELECT PERKIRAAN LOCATE FOR NOAC=TRIM(THISFORM.NOAC.Value) IF FOUND() VSALDOA=PERKIRAAN.SALDOA VSALDOJ=PERKIRAAN.SALDOJ VNAMAAC=PERKIRAAN.NAMAAC ELSE VSALDOA=0 VSALDOJ=0 VNAMAAC=""
AMIK Al Ma’soem
42
ENDIF SELECT TMPJURNAL GO TOP SUM DEBET TO DB SUM KREDIT TO KR SELISIH=DB-KR VSALDOJ=VSALDOA+SELISIH REPLACE ALL SALDOA WITH VSALDOA REPLACE ALL SALDOJ WITH VSALDOJ REPLACE ALL NAMAAC WITH VNAMAAC GO BOTTOM IF EOF() SELECT TMPJURNAL APPEND BLANK REPLACE SALDOA WITH VSALDOA REPLACE SALDOJ WITH VSALDOJ REPLACE NAMAAC WITH VNAMAAC ENDIF REPORT FORM E:\SKA\CEPS\PRG\BUKUBESAR PREVIEW RETURN
* Object KELUAR Procedure CLICK THISFORM.Release RETURN
* Object COMBO1 Procedure InteractiveChange THISFORM.NOAC.Value=PERKIRAAN.NOAC
B. TUGAS VIII Buatkan Form dan Report untuk menampilkan Buku Besar dari hasil transaksi pada tugas sebelumnya.
AMIK Al Ma’soem
43
BAGIAN IX Tujuan : 1. 2.
Membuat Report Laba Rugi Form Untuk MemFilter Report
A. BAHAN PRAKTEK IX 9.1
Report Laporan Laba Rugi Nama Report : LabaRugi
Formula : Per Bulan : cmonth(tmpper.tgltran)+" "+str(year(tmpper.tgltran),4) NamaPerkiraan : tmpper.namaper SaldoJ pada Group Noper : tmpper.saldoj (Format exp. : 999,999,999 ; Alignment : Right; Calculate Type : Sum ; Reset Based On : Group TmpPer.Noper) Total : "Total "+iif(left(noper,1)="4","Pendapatan",iif(left(noper,1)="5", "HPP Penjualan",iif(left(noper,1)="6","Biaya",""))) SaldoJ pada Group Left(tmpper.noper,1) : tmpper.saldoj (Format exp. : 999,999,999 ; Alignment : Right; Calculate Type : Sum ; Reset Based On : Group left(TmpPer.Noper,1)) Laba/Rugi : iif(tmpper.laba>0,"Laba ","Rugi ") Jumlah Laba/Rugi : tmpper.laba (Format exp. : 999,999,999 ; Alignment : Right)
AMIK Al Ma’soem
44
9.2
Form Laporan Laba Rugi Nama Form : LabaRugi
* Object FORM1 Procedure LOAD SET TALK OFF CLOSE DATABASES SET EXCLUSIVE OFF SET MULTILOCKS ON SET DEFAULT TO e:\ska\data OPEN DATABASE DATASKA SHARED IF ! USED("jurnal") USE jurnal IN 0 SHARED ENDIF IF ! USED("PERKIRAAN") USE PERKIRAAN IN 0 SHARED ENDIF IF USED("TMPJURNAL") USE IN tmpjurnal ENDIF IF USED("tmpperN") USE IN tmpperN ENDIF SELECT 9 USE e:\ska\ceps\data\tmpperN EXCLUSIVE SET ORDER TO TAG noac SELECT 10 USE e:\ska\ceps\data\tmpjurnal EXCLUSIVE SET ORDER TO TAG noac RETURN
* Object FORM1 Procedure ACTIVATE USE IN TMPJURNAL USE IN TMPPERN CLOSE DATABASES RETURN
* Object FORM1 Procedure ACTIVATE thisform.tgl.day=DAY(DATE()) thisform.tgl.month=month(DATE()) thisform.tgl.year=year(DATE()) return
* Object CETAK Procedure CLICK SET DATE BRITISH SET CENTURY ON m=thisform.tgl.month y=thisform.tgl.year SELECT tmpjurnal SET DELETED OFF DELETE ALL PACK APPEND FROM jurnal FOR MONTH(tgltran)=m .and. YEAR(tgltran)=y DELETE FOR LEFT(tmpjurnal.noac,1)="1"
AMIK Al Ma’soem
45
DELETE FOR LEFT(tmpjurnal.noac,1)="2" DELETE FOR LEFT(tmpjurnal.noac,1)="3" pack GO top DO WHILE ! EOF() SELECT perkiraan LOCATE FOR noac=tmpjurnal.noac IF FOUND() vNAMAAC=perkiraan.NAMAAC ELSE vNAMAAC="" ENDIF SELECT tmpjurnal REPLACE NAMAAC WITH vNAMAAC SKIP ENDDO SELECT tmpjurnal GO top DO WHILE ! EOF() IF LEFT(noac,1)="4" REPLACE saldoj WITH kredit-debet ELSE IF LEFT(noac,1)="5" REPLACE saldoj WITH debet-kredit ELSE IF LEFT(noac,1)="6" REPLACE saldoj WITH debet-kredit ENDIF ENDIF ENDIF SKIP enddo Vpend=0 Vjasa=0 Vbiaya=0 vlaba=0 vhp=0 SELECT tmpperN SET DELETED OFF DELETE ALL PACK APPEND FROM E:\SKA\CEPS\DATA\TMPJURNAL SELECT TMPPERN SUM saldoj FOR LEFT(noac,1)="4" TO vpend SUM saldoj FOR LEFT(noac,1)="5" TO vhp SUM saldoj FOR LEFT(noac,1)="6" TO vbiaya SELECT tmpperN GO bottom REPLACE pend WITH vpend REPLACE hp WITH vhp REPLACE biaya WITH vbiaya vlaba=vpend-vbiaya-vhp REPLACE LABA WITH vlaba SET ORDER TO TAG noac IF EOF() MESSAGEBOX("Laporan Laba Rugi tidak bisa ditampilkan"+; CHR(13)+"Karena belum ada transaksi penerimaan dan Pengeluaran",; 0,"Mohon Maaf...") RETURN else REPORT FORM E:\SKA\CEPS\PRG\LABARUGI PREVIEW endif RETURN
* Object KELUAR Procedure CLICK THISFORM.Release RETURN
AMIK Al Ma’soem
46
B. TUGAS IX Buatkan Report dan Form untuk menampilkan Laporan Laba/Rugi Perusahaan
AMIK Al Ma’soem
47
BAGIAN X Tujuan : 1. 2.
Membuat Program Compiler File Mengcopiler file menjadi file EXE
A. BAHAN PRAKTEK X : 1.
Buatkan file Program pada Page Code, sbb : CLOSE ALL SET TALK OFF SET STAT OFF SET AUTOSAVE ON SET CENTURY ON SET DATE BRITISH SET DEFA TO e:\SKA\DATA PUSH MENU _MSYSMENU MODI WINDOWS SCREEN TITLE 'SISTEM INFORMASI GENERAL LEDGER TREE UTAMA MODIFICATION' WITH _SCREEN .VISIBLE=.T. .WINDOWSTATE=2 .picture='e:\SKA\Gb\LATAR1.JPG' ENDWITH RELEASE ALL DO e:\SKA\ceps\prg\menulogin.mpr READ EVENTS QUIT
2. 3.
Simpan dengan nama SKA.PRG Klik kanan File SKA.PRG tersebut, kemudian pilih Set Main
4. 5. 6.
Klik Build Pilih Win32 executable / COM server (exe) Pada kolom Option klik kota CheckBox Recompile All Files dan Display Errors
AMIK Al Ma’soem
48
6.
Klik tombol OK
B. TUGAS X Buatkan Program Compiler untuk tugas anda seperti pada praktek ke XIII dan lakukan compiler pada tugas anda.
AMIK Al Ma’soem
49
BAGIAN XI Tujuan : Membackup File
11.1. Membuat Program Backup File Jurnal 1. Membuat Form BackUpJurnal
2.
Procedure : * Object FORM1 Procedure LOAD SET DATE BRITISH CLOSE DATABASES SET EXCLUSIVE OFF SET MULTILOCKS ON set defa to O:\SKA\DATA OPEN DATABASE DATASKA SHARED if ! used("jurnal") use jurnal IN 0 SHARED endif RETURN
* Object FORM1 Procedure ACTIVATE a=date() b=alltrim(left(cmont(a),3)) t=alltrim(right(str(year(a),4),2)) ext=".DBF" e="JUR" f=e+b+t+ext thisform.NamaFile.value=f retu
* Object FORM1 Procedure UNLOAD CLOSE DATABASES RETURN
* Object PROSES Procedure CLICK thisform.proses.Enabled= .F. nfp=alltrim(thisform.NamaFile.value) select jurnal copy to O:\SKA\backup\&nfp MESSAGEBOX("File Jurnal Sudah di BackUP",0,"Perhatian...") thisform.release retu
* Object KELUAR Procedure CLICK thisform.release retu
AMIK Al Ma’soem
50
11.2.
Membuat Program Backup File PERKIRAAN
1.
Membuat Form BackUp Perkiraan
2.
Procedure : * Object FORM1 Procedure LOAD CLOSE DATABASES SET EXCLUSIVE OFF SET MULTILOCKS ON SET DATE BRITISH SET CENTURY ON set defa to O:\SKA\DATA OPEN DATABASE DATASKA SHARED if ! used("perkiraan") use perkiraan IN 0 SHARED endif RETURN
* Object FORM1 Procedure ACTIVATE a=date() b=alltrim(left(cmont(a),3)) t=alltrim(right(str(year(a),4),2)) ext=".DBF" fp="PERK" g=fp+b+t+ext thisform.NamaFile.value=g RETURN
* Object FORM1 Procedure UNLOAD CLOSE DATABASES RETURN
* Object PROSES Procedure CLICK thisform.backup.Enabled=.f. nfp=alltrim(thisform.NamaFile.value) select perkiraan copy to O:\SKA\Backup\&nfp MESSAGEBOX("File Perkiraan sudah di BackUp",0,"Perhatian...") RETURN
* Object KELUAR Procedure CLICK thisform.release RETURN
AMIK Al Ma’soem
51
III. BAGIAN XII Tujuan : 1. 2.
Membuat Program Tutup Buku Membuat Program Pemindah Bukuan
12.1. Membuat Program Tutup Buku 1. Buka Menutama 2. Buka submenu Utility 3. Pilih prompt Tutup Buku 4. Ganti Result submenu menjadi Procedure 5. Ketik prosedur berikut : jawab=messagebox("Anda sudah membackup semua file ?",4+32+512,"Perhatian...!") if jawab=6 ljwb=messagebox("Anda yakin mau mengosongkan semua file ?",4+32+256,"Perhatian...!") if ljwb=6 close data SET EXCLUSIVE ON set dele off if used("jurnal") use in jurnal endif SET DEFAULT TO E:\ska\data *Mengosongkan File Jurnal use jurnal EXCLUSIVE dele all PACK USE Messagebox("File jurnal sudah dikosongkan...",0,"Perhatian...") ENDIF ENDIF SET EXCLUSIVE OFF retur
12.2. Membuat Program Pemindah bukuan 1. Pilih prompt Pemidah Bukuan 2. Ganti Result submenu menjadi Procedure 3. Ketik prosedur berikut : jawab=messagebox("Anda sudah membackup semua file ?",4+32+512,"Perhatian...!") if jawab=6 ljwb=messagebox("Anda yakin mau memindah bukukan ?",4+32+256,"Perhatian...!") if ljwb=6 close data set exclusive off set dele off IF USED("PERKIRAAN") USE IN PERKIRAAN ENDIF SET DEFAULT TO o:\ska\data USE perkiraan GO top DO WHILE ! EOF() REPLACE saldos WITH saldoa REPLACE saldoa WITH saldoj SKIP enddo endif ENDIF MESSAGEBOX("Pemindahbukuan sudah dilakukan",0,"Perhatian...") retur
AMIK Al Ma’soem
52
12.3. Membuat Program Restore File 1. Pilih prompt Restore File 2. Ganti Result submenu menjadi Procedure 3. Ketik prosedur berikut : SET DEFAULT TO o:\ska\data jawab=messagebox("Anda sudah membackup semua file ?",4+32+512,"Perhatian...!") if jawab=6 CLOSE DATABASES SET DELETED OFF SET EXCLUSIVE ON if used("jurnal") use in jurnal endif if used("PERKIRAAN") use in PERKIRAAN ENDIF use jurnal EXCLUSIVE DELETE ALL PACK USE IN jurnal USE PERKIRAAN EXCLUSIVE DELETE ALL PACK USE IN perkiraan do form o:\ska\ceps\prg\restfile.scx ENDIF RETURN
4.
Buatkan Form RestFile sbb :
5.
Procedure : * Object FORM1 Procedure LOAD IF USED("PERKIRAAN") USE IN PERKIRAAN ENDIF IF USED("JURNAL") USE IN JURNAL ENDIF
* Object FORM1 Procedure ACTIVATE set defa to o:\ska\data thisform.tgl.day=DAY(DATE()) thisform.tgl.month=MONTH(DATE()) thisform.tgl.year=year(DATE())
* Object FORM1 Procedure UNLOAD CLOSE DATABASES RETURN
* Object PROSES Procedure CLICK tgl =thisform.tgl.day bulan=thisform.tgl.month tahun=thisform.tgl.year do case case bulan=1 bln="Jan"
AMIK Al Ma’soem
53
case bulan=2 bln="Feb" case bulan=3 bln="Mar" case bulan=4 bln="Apr" case bulan=5 bln="May" case bulan=6 bln="Jun" case bulan=7 bln="Jul" case bulan=8 bln="Aug" case bulan=9 bln="Sep" case bulan=10 bln="Oct" case bulan=11 bln="Nov" othe bln="Dec" endc thn=right(STR(tahun,4),2) ext=".DBF" jur="JUR" perk="PERK" ju =jur +bln+thn+ext per =perk+bln+thn+ext USE jurnal EXCLUSIVE APPEND FROM o:\ska\backup\&ju USE IN JURNAL USE perkiraan EXCLUSIVE APPEND FROM o:\SKA\backup\&per USE IN PERKIRAAN MESSAGEBOX("Pengisian File Jurnal sudah dilakukan",0,"Perhatian...") thisform.release SET EXCLUSIVE OFF RETURN
* Object KELUAR Procedure CLICK thisform.release retu
AMIK Al Ma’soem
54
DAFTAR PUSTAKA Al Haryono Jusup, Drs., M.B.A., Ak. (1991). Dasar-dasar Akuntansi. Yogyakarta : Liberti. Aryanto, S.E., Ak. (2003). “Tip dan Trik Pemrograman Profesional Microsoft Visual FoxPro 6.0”. PT. Elex Media Komputindo. Jakarta. Aryanto, S.E., Ak. (2002). “Pengolahan Database dengan Microsoft Visual FoxPro 6.0”. PT. Elex Media Komputindo. Jakarta. Asroel Kamal. (2009). “Panduan Laporan Keuangan dengan MYOB”. Media Kita. Inge Martina, Ir. (2001). “Visual FoxPro 6.0 ; 36 Jam Belajar Komputer”. PT. Elex Media Komputindo. Jakarta. James Martin, Carma McClure. (1985). Structure Techniques : The Basis for CASE. New Jersey : Prentice Knuth, Donald, E. (1973). The Art of Computer Programmeing Volume 1. Inc. : Addison-Wesley Company. Sugiri – Eni Munarsih. (2008). “Akuntansi & Aplikasinya pada MYOB Accounting”. Graha Ilmu. Wahana Komputer. (2007). “Pengembangan Sistem Akuntansi bagi Usaha Perdagangan Ritel dengan MYOB” Salemba Empat.
AMIK Al Ma’soem