Jurnal Piutang Dagang

Tampilan hasil coding dengan minigui extended:

Lampiran coding untuk tampilan yang diatas ;
Smoga Bermanfaat bagi kita semua , amiin

Define window pitent ;
at 30,40 ;
Width 960 ;
Height 550 ;
title ”;
on init (bukawpitent(),ar2()); &&,arpiu2());
child ;
nosysmenu ;
nomaximize;
NOMINIMIZE;
backcolor warnawpitent

DEFINE TOOLBAR TOOLBAR_1 BUTTONSIZE 85,40 FLAT BORDER

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

BUTTON SEARCH ;
picture ‘E:\soalgui\bmp\cari.bmp’;
CAPTION ‘&search’;
tooltip ‘Tombol ini berfungsi untuk cari database ‘;
action { playbeep(),cariar(),arpiu2() }

BUTTON HAPUS ;
picture ‘E:\soalgui\bmp\HAPUS.bmp’;
CAPTION ‘&Delete’;
tooltip ‘Tombol ini berfungsi untuk menghapus database ‘;
action hapusar()

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

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

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

END TOOLBAR

@ 68,15 frame pitent_frm;
caption “Nomer Jurnal Hutang Dagang”;
BACKCOLOR WARNAwpitent ;
width 950 ;
height 100

@ 180,15 frame pitent2_frm;
caption “Data Transaksi Hutang”;
BACKCOLOR WARNAwpitent ;
width 950 ;
height 510

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

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

@ 90,495 LABEL Sjenis_lbl Value ‘Type Payment’;
font “arial narrow” size 12 bold ;
backcolor warnawpitent

@ 90,750 LABEL sTanggal_lbl VALUE ‘Tanggal ‘;
font “arial narrow” size 12 bold;
backcolor warnawpitent

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

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

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

Define combobox kd_wil
row 90
col 120
Item {“Accounting”,”Aktiva”,”Finished Goods”,”Raw Material”,”Produksi”,”Packing”,”Lain-lain”}
value 1
end combobox

@ 90,350 textbox snotran_txt font “Time new roman” size 12 ;
WIDTH 120;
inputmask ‘!!-99.99999′

Define combobox jenispay
row 90
col 610
Item {“U m u m”,”Pajak 10% “}
value 1
end combobox

define datepicker stanggal1
row 90
col 820
backcolor {197,255,197}

end datepicker

@ 125,120 textbox sketerng_txt ;
font “Time new roman ” size 11 ;
width 650 ;
on lostfocus {simpanpiutang1()}

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

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

@ 560,670 frame pitent3_frm;
BACKCOLOR WARNAwpitent ;
width 260 ;
height 90

Define browse wpitent_browse
row 200
col 50
width 880
height 350
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’,’glmas->nmrek’,’gltran2->tptran’,’transform(gltran2->jumlah,”9,999,999,999,999.99″)’,’gltran2->keterng1′}
image { ’03.bmp’,’02.bmp’ }
on dblclick barupitent()
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}

lock .T.
allowdelete .t.

END BROWSE

end window
maximize window pitent
activate window pitent

Endif

return nil

PROCEDURE BUKAwpitent

LOCAL SFLAG := “P”
LOCAL SMUTASI := “D”
local skd_wil := “10″

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

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

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

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

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

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

IF OPENTABLES(cDRV+”PIMAS”,.F.)
SET INDEX TO (cDRV+”PIMAS4″),(cDRV+”PIMAS3″),(cDRV+”PIMAS2″),(cDRV+”PIMAS1″),(cDRV+”PIMAS”),(cDRV+”PIMAS5″),(cDRV+”PIMAS8″),(cdrv+”oraiso”)
&& 1 2 3 4 5 6 7 8
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

pitent.snotran_txt.enabled := .F.
pitent.kd_wil.enabled := .F.
pitent.stanggal1.enabled := .F.
pitent.sketerng_txt.enabled := .F.

RETURN

procedure newpiutang1

pitent.snotran_txt.enabled := .T.
pitent.kd_wil.enabled := .T.
pitent.stanggal1.enabled := .T.
pitent.sketerng_txt.enabled := .T.

pitent.kd_wil.value := 1
pitent.snotran_txt.value := “”
pitent.stanggal1.value := date()
pitent.sketerng_txt.value := “”

pitent.wpitent_browse.refresh
pitent.sdebet_txt.value := 0
pitent.skredit_txt.value := 0

pitent.snotran_txt.setfocus

return

procedure simpanpiutang1

Local sflag := “P”
Local skd_wil := “10″
Local Sdata := “A”
Local snotran := pitent.snotran_txt.value

If MsgYesNo ( ‘Yakin mau disimpan ‘,’Konfirmasi Simpan Data ‘)

IF sdata == “A”
SELECT GLTRAN1
SEEK SFLAG+SKD_WIL+SNOTRAN
IF FOUND()
MSGINFO(“Kode Sudah Ada”)
pitent.snotran_txt.setfocus
return
ELSE
GLTRAN1->(DbAppend())
ENDIF

ENDIF
rrlock()
REPLACE GLTRAN1->FLAG WITH SFLAG
REPLACE GLTRAN1->KD_WIL WITH SKD_WIL
REPLACE GLTRAN1->NOTRAN WITH pitent.snotran_txt.value
REPLACE GLTRAN1->TANGGAL WITH pitent.stanggal1.value
REPLACE GLTRAN1->KETERNG1 WITH pitent.sketerng_txt.value
DbCommit()
DbUnlock()

pitent.snotran_txt.enabled := .F.
pitent.kd_wil.enabled := .F.
pitent.stanggal1.enabled := .F.
pitent.sketerng_txt.enabled := .F.
pitent.wpitent_browse.refresh

barupitent()

else
pitent.snotran_txt.setfocus

EndIf

procedure keluarpitent

LocaL SDEBET := 0
Local SKREDIT := 0

SKREDIT := pitent.SDEBET_TXT.VALUE
SDEBET := pitent.SKREDIT_TXT.VALUE

IF INT(SDEBET-SKREDIT) == 0
tblwmas->(dbclosearea())
pidet->(dbclosearea())
glmas->(dbclosearea())
tblcmas->(dbclosearea())
bankmas->(dbclosearea())
pimas->(dbclosearea())
gltran2->(dbclosearea())
gltran1->(dbclosearea())
release window pitent
else
msginfo(“Posisi Nilai DEBET dan KREDIT tidak sama”,”Konfirmasi persamaan”)
endif

return

Function kunciar()

Local RetVal

If gltran2->(RLock())
RetVal := .t.
Else
MsgExclamation (‘Data Tidak dapat dihapus’,’Konfirmasi Data Dikunci’)
RetVal := .f.
EndIf

Return RetVal

procedure hapusar

If MsgYesNo ( ‘Yakin dihapus ‘,’Konfirmasi Jawaban’)

If kunciar()
gltran2->(dbdelete())
pitent.wpitent_browse.refresh

EndIf
EndIf

return

function namaar(norek)

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

procedure cariar
do while .t.
findcodear1(“pitent”,”snotran_txt”)
exit
enddo
return

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

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

Return

Static Function showcodear(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 ==”P”

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

DEFINE WINDOW gl_12;
AT 0,0 ;
WIDTH 300 HEIGHT 440 ;
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 {tranpiutang()};
on enter {tranpiutang()}

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,pitent.snotran_txt.value:=gltran1->notran,ThisWindow.Release)
DYNAMICBACKCOLOR { cColor, cColor }
TOOLTIP “Pilihlah No Bukti Yang anda inginkan “
END BROWSE

END WINDOW

CENTER WINDOW gl_12

ACTIVATE WINDOW gl_12

Return cReg

function tranpiutang
local cReg:= “”, nReg := 1
local sflag := “P”
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 ar2

Local SFLAG := “P”
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

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

pitent.sketerng_txt.value := sketerng1

SELECT GLTRAN2
DbSeek(SFLAG+SKD_WIL+SNOTRAN)
set relation to norek into glmas
set filter to ((gltran2->flag)+(gltran2->kd_wil)+(gltran2->notran)) = (“P”+”10″+pitent.snotran_txt.value)
pitent.wpitent_browse.value := recno()
pitent.wpitent_browse.refresh
pitent.wpitent_browse.setfocus

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
pitent.sdebet_txt.value := sjumdebet
pitent.skredit_txt.value := sjumkredit

select GLTRAN1

Return

procedure arpiu2

Local sflag := “P”
Local skd_wil := “10″
Local stptran := ” “
Local sjumlah := 0

pitent.snotran_txt.enabled := .F.
pitent.kd_wil.enabled := .F.
pitent.stanggal1.enabled := .F.
pitent.sketerng_txt.enabled := .F.

select gltran1
DBSETORDER(1)
SDEBET := SKREDIT := 0
dbseek(sflag+skd_wil+pitent.snotran_txt.value)
pitent.sketerng_txt.value := gltran1->keterng1
pitent.stanggal1.value := gltran1->tanggal

SELECT GLTRAN2
dbsetorder(1)
DbSeek(SFLAG+SKD_WIL+pitent.snotran_txt.value)
set relation to norek into glmas
set filter to ((gltran2->flag)+(gltran2->kd_wil)+(gltran2->notran)) = (“P”+”10″+pitent.snotran_txt.value)
pitent.wpitent_browse.value := recno()
pitent.wpitent_browse.refresh
pitent.wpitent_browse.setfocus

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

STPTRAN := GLTRAN2->TPTRAN
SJUMLAH := GLTRAN2->JUMLAH

IF STPTRAN == “D”
SDEBET := SDEBET + SJUMLAH &&GLTRAN2->JUMLAH

ELSE
SKREDIT := skredit + SJUMLAH && GLTRAN2->JUMLAH

ENDIF

SKIP

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

select gltran1

return

procedure printpiutang

Local nday := Day(pitent.stanggal1.value)
Local nmonth := Month(pitent.stanggal1.value)
Local nyear := Year(pitent.stanggal1.value)
Local sflag := “P”
Local skd_wil := “10″

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

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

sbln := strzero(nmonth,2)
snotran1 := (alltrim(pitent.snotran_txt.value))
snotran2 := (alltrim(pitent.snotran_txt.value))
xtanggal1 := pitent.stanggal1.value
xtanggal2 := pitent.stanggal1.value

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

cPrinter := GetPrinter()
If Empty (cPrinter)
Return
EndIf
SELECT PRINTER cPrinter ;
ORIENTATION PRINTER_ORIENT_PORTRAIT ;
PAPERSIZE PRINTER_PAPER_USER ;
PAPERLENGTH 140;
PAPERWIDTH 210;
COPIES nCOPIES ;
QUALITY PRINTER_RES_HIGH;
PREVIEW

START PRINTDOC NAME “Cash Payment Voucher”
START PRINTPAGE

SELECT GLTRAN2
SET ORDER TO 3
SET SOFTSEEK ON
SEEK DTOS(xTANGGAL1)
SET SOFTSEEK OFF

mPageNo:=0
kpageno := 0

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

baris +=30
@ baris,160 PRINT “Dilanjutkan ke Halaman: “+LTRIM(STR(mPageNo)) size 10 bold Underline

baris := 40
mkolom := 40

END PRINTPAGE
START PRINTPAGE

ENDIF
kpageno := (kpageno/mpageno)

@ 03,10 PRINT “PT.TAYOH SARANA SUKSES ” FONT “COURIER NEW” SIZE 13 bold Underline
@ 03,180 PRINT “Page: “+LTRIM(STR(mPageNo))
@ 09,10 PRINT “Telekomunikasi & Accesories” FONT “COURIER NEW” SIZE 8 bold
@ 12,10 PRINT “OFFICE : Jl.Raya Narogong KM 13,5 Pangkalan IV Bekasi ” size 8
@ 15,10 print “Telp : (021) 826-10092″ size 8
@ 18,10 print “Fax : (021) 826-05681″ size 8
@ 125,130 print “Tanggal C P V :”
@ 125,160 print xtanggal1 bold

@ 09,125 print RECTANGLE ;
TO 23,200 ;
penwidth 0.1 ;
COLOR {197,197,255};
FILLED;
ROUNDED
@ 12,128 print “CASH PAYMENT VOUCHER” FONT “COURIER NEW” SIZE 16 BOLD
@ 18,143 print “NO. “+SNOTRAN1 FONT “COURIER NEW” SIZE 12 BOLD

@ 27,04 print RECTANGLE;
TO 37,200 ;
penwidth 0.1;
COLOR {197,197,255};
FILLED;
ROUNDED
@ 39,04 print RECTANGLE TO 95,200 penwidth 0.1 ROUNDED

@ 28,05 print ” NO.” FONT “COURIER NEW” SIZE 10 BOLD
@ 28,15 print ” NOMER REKENING” FONT “COURIER NEW” SIZE 10 BOLD
@ 28,60 print ” NAMA TRANSAKSI ” FONT “COURIER NEW” SIZE 10 BOLD
@ 28,125 print ” DEBET ” FONT “COURIER NEW” SIZE 10 BOLD
@ 28,170 print ” KREDIT” FONT “COURIER NEW” SIZE 10 BOLD

&& cetak garis vertical
@ 27, 15 PRINT LINE TO 95,15 PENWIDTH 0.1
@ 27, 55 PRINT LINE TO 95,55 PENWIDTH 0.1
@ 27,120 PRINT LINE TO 95,120 PENWIDTH 0.1
@ 27,160 PRINT LINE TO 95,160 PENWIDTH 0.1

ENDIF

@ 100,04 print RECTANGLE TO 130,120 penwidth 0.1 ROUNDED
@ 123,04 PRINT LINE TO 123,120 PENWIDTH 0.1
@ 125,06 PRINT ” Prepared By, Check By, Accounting By, Approved By,”
@ 100,130 print RECTANGLE ;
TO 120,200 ;
penwidth 0.1;
COLOR {192,192,192};
FILLED;
ROUNDED
@ 110,130 PRINT LINE TO 110,200 PENWIDTH 0.1
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 nourut
baruar.snorek2_txt.value := gltran2->norek
select glmas

dbsetorder(1)
DBSEEK(baruar.snorek2_txt.value)
snmrek := nmrek
baruar.snmrek_txt.value := snmrek

select gltran2
baruar.snonota_txt.value := gltran2->nonota
baruar.stanggal_txt.value := gltran2->(dtoc(tanggal))
skd_pt := kd_pt
skd_wil := “10″
SNMPT := TBLCMAS->(DBSEEK(“L”+SKD_WIL+SKD_PT),TBLCMAS->NM_PT)
baruar.snmpt_txt.value := snmpt
baruar.snilai_txt.value := gltran2->jumlah

STPTRAN := gltran2->tptran
DO CASE
CASE STPTRAN == “D”
baruar.typemutasi.value := 1
CASE STPTRAN == “K”
baruar.typemutasi.value := 2
END CASE

baruar.sjumlah_txt.value := gltran2->jumlah
baruar.sketer_txt.value := gltran2->keterng1

@ 450,30 buttonex Add;
caption ‘&Add Data ‘;
picture ‘E:\soalgui\bmp\baru.bmp’;
height 40 ;
width 100 ;
backcolor {197,255,197};
action PIUBAR()

@ 450,170 buttonex Simpan;
caption ‘&Simpan’;
picture ‘E:\soalgui\bmp\save.bmp’;
height 40 ;
width 100 ;
backcolor {197,255,197};
action simpanwpitent()

@ 450,310 buttonex keluar ;
caption ‘E &x i t’ ;
picture ‘E:\soalgui\bmp\exit.bmp’;
tooltip ‘tekan tombol ini jika Ingin Keluar’;
height 40 ;
width 100 ;
backcolor {197,255,197};
ACTION EXITENTRY()

END WINDOW

// CENTER WINDOW baruar

ACTIVATE WINDOW baruar

Return

Procedure norekar

if empty(baruar.snorek2_txt.value)
msginfo(“Nomer rekening tidak boleh kosong”,”Konfirmasi Nomer Rekening”)
baruar.newpitent.setfocus
return
endif

procedure showpiutang

snorek := baruar.snorek2_txt.value
select glmas
set order to 1
dbseek(snorek)
snmrek := nmrek
baruar.snmrek_txt.value := snmrek
baruar.snmrek_txt.enabled := .F.
baruar.snmrek_txt.setfocus
select gltran2

return

procedure caripitent
do while .t.
weduscar(“baruar”,”snorek2_txt”)
exit
enddo
return

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

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

Return

Function ARCAR(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 formpitent;
AT 0,130 ;
WIDTH 500 HEIGHT 480 ;
MODAL NOSIZE NOSYSMENU

@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_PIUTANG() };
on enter {SEARCH_PIUTANG() }

@ 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,baruar.snorek2_txt.value :=creg,ThisWindow.release) ;
TOOLTIP “Pilihlah Chart Of Account yang anda inginkan “

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW formpitent

ACTIVATE WINDOW formpitent

Return cReg

function SEARCH_PIUTANG

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

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

If found()

If glmas->(DbSeek(cCari))
formpitent.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

Procedure PIUBAR

Local sflag := “P”
Local skd_wil := “10″
Local stptran := ” “
Local sjumlah := 0
Local sdata := “A”
Local sbal := 0
baruar.sdata_txt.value := “A”

baruar.snorek2_txt.enabled := .T.
baruar.snmrek_txt.enabled := .T.
baruar.sjumlah_txt.enabled := .T.
baruar.typemutasi.enabled := .T.
baruar.sketer_txt.enabled := .T.
baruar.newpitent.enabled := .T.

IF baruar.sdata_txt.value = “A”

SELECT GLTRAN2
dbsetorder(1)
gltran2->(dbgobottom())
baruar.simpan.enabled := .T.

STPTRAN := TPTRAN
KNOURUT := nourut

baruar.snorek2_txt.value := “”
baruar.snmrek_txt.value := “”
baruar.sjumlah_txt.value := 0
baruar.typemutasi.value := 1
baruar.sketer_txt.value := “”

KNOURUT := STR(VAL(KNOURUT)+1,2,0)

baruar.snorut2_txt.value := VARIABLE(kNourut,2,”0″)

SNORUT := baruar.snorut2_txt.value
baruar.snorek2_txt.setfocus
else

SJUMLAH1 := baruar.sjumlah_txt.value
SNOREK1 := baruar.snorek2_txt.value

ENDIF

return

PROCEDURE SIMPANwpitent

Local sflag := “P”
Local skd_wil := “10″

Local snotran := baruar.snotran_txt.value
Local snourut := baruar.snorut2_txt.value

if empty(baruar.snorek2_txt.value)
msginfo(“Nomer rekening tidak boleh kosong”,”Informasi rekening kosong”)
return
endif

IF baruar.sdata_txt.value = “A”

SELECT GLTRAN2
SEEK SFLAG+SKD_WIL+SNOTRAN+SNOURUT
IF Found()
msginfo (“Kode Sudah Ada”)
baruar.snotran_txt.setfocus
return && tambahan
ELSE
GLTRAN2->(DbAppend())
ENDIF
ENDIF

rrlock()
REPLACE GLTRAN2->FLAG WITH SFLAG
REPLACE GLTRAN2->KD_WIL WITH SKD_WIL
REPLACE GLTRAN2->NOTRAN WITH baruar.snotran_txt.value
REPLACE GLTRAN2->TANGGAL WITH baruar.stanggal1.value
REPLACE GLTRAN2->JUMLAH WITH baruar.sjumlah_txt.value

if baruar.typemutasi.value == 1
stptran := “D”
replace gltran2->tptran with stptran

else
stptran := “K”
replace gltran2->tptran with stptran

endif

REPLACE GLTRAN2->NOREK WITH baruar.snorek2_txt.value
REPLACE GLTRAN2->NOURUT WITH baruar.snorut2_txt.value
REPLACE GLTRAN2->KETERNG1 WITH baruar.sketer_txt.value

DbCommit()
DbUnlock()

baruar.simpan.enabled := .F.
baruar.snorek2_txt.enabled := .F.
baruar.snmrek_txt.enabled := .F.
baruar.sjumlah_txt.enabled := .F.
baruar.typemutasi.enabled := .F.
baruar.sketer_txt.enabled := .F.
baruar.newpitent.enabled := .F.

pitent.wpitent_browse.refresh
baruar.add.setfocus

IF baruar.sdata_txt.value = “A”
if stptran == “D”
pitent.sdebet_txt.value := pitent.sdebet_txt.value + baruar.sjumlah_txt.value
else
pitent.skredit_txt.value := pitent.skredit_txt.value + baruar.sjumlah_txt.value

endif
else

SJUMLAH1 := GLTRAN2->JUMLAH
SNOREK1 := baruar.snorek2_txt.value

if stptran == “D”
pitent.sdebet_txt.value := (pitent.sdebet_txt.value – sjumlah1) + baruar.sjumlah_txt.value
else
pitent.skredit_txt.value := (pitent.skredit_txt.value – sjumlah1) + baruar.sjumlah_txt.value

endif

endif

RETURN

PROCEDURE EXITENTRY

lOCAL SDEBET := 0
Local SKREDIT := 0

SKREDIT := pitent.SDEBET_TXT.VALUE
SDEBET := pitent.SKREDIT_TXT.VALUE

IF INT(SDEBET-SKREDIT) == 0
release window baruar
else
msginfo(“Posisi Nilai DEBET dan KREDIT tidak sama”,”Konfirmasi persamaan”)
endif

Return

&& data nomer piutang

procedure snopiutang
do while .t.
codewpiten2(“baruar”,”snonota_txt”)
exit
enddo
return

Function codewpiten2(cForm, cTextBtn)

Local cfaktur := “”

cfaktur := Getcodewpiten2(Getproperty(cForm,cTextBtn,”Value”))
If !empty(cfaktur)
Setproperty(cForm,cTextBtn,”Value”,cfaktur)
EndIf

Return

Function Getcodewpiten2(nValue)
Local Sflag := “P”
Local Stype := “F”
Local cfaktur:= “”,nReg := 1
SELECT PIMAS
SET ORDER TO 8
DBSEEK(“PF”)
set filter to ((pimas->flag)+(pimas->type)) = (“PF”)

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

DEFINE WINDOW Form_Faktur;
AT 0,0 ;
WIDTH 480 HEIGHT 460 ;
TITLE ‘DAFTAR FAKTUR PIUTANG’ ;
MODAL NOSIZE

@300,5 frame pilih_artent ;
width 380 ;
height 100

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

@ 350,10 textbox cnonotafak_txt;
width 350 ;
on change {search_wpiten2() };
on enter {search_wpiten2() }

@ 5,5 BROWSE Browse_Faktur ;
WIDTH 380 ;
HEIGHT 290 ;
HEADERS { ‘kode’ , ‘Nomer Faktur’,’Tanggal’,’Type’ } ;
WIDTHS { 50 ,140,100,50 } ;
WORKAREA PIMAS ;
FIELDS { ‘PIMAS->flag’,’PIMAS->nonota’,’PIMAS->tanggal’,’PIMAS->type’} ;
VALUE nReg ;
READONLY {.t.,.t.,.t.} ;
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT} ;
ON DBLCLICK ( cfaktur:=PIMAS->NONOTA,baruar.snonota_txt.value:=cfaktur,ThisWindow.Release ) ;
TOOLTIP “Pilihlah Nomer Faktur yang anda inginkan “

ON KEY ESCAPE ACTION ThisWindow.Release
select gltran2
END WINDOW

CENTER WINDOW Form_faktur

ACTIVATE WINDOW Form_faktur

Return cfaktur

function search_wpiten2

Local sflag := “P”
Local skode := baruar.typemutasi.value
Local skd_wil := “10″
Local snonota := alltrim(form_faktur.cnonotafak_txt.value)

local cCarifak:= (“P”+”F”+skd_wil+snonota)
local nPanjang := len(cCarifak)

select PIMAS
set order to 1
dbseek(cCarifak)

If found()

If PIMAS->(DbSeek(cCarifak))
form_faktur.browse_faktur.value := PIMAS->(recno())
Else
MsgExclamation(‘Nomer Faktur Piutang tidak ada’)
EndIf
else
msginfo(“nomer yg anda cari bukan Faktur Piutang”,”Konfirmasi bukan nomer Faktur”)

EndIf
Return

///#include “wpitent2.prg”

Berikan Balasan

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.

%d blogger menyukai ini: