Entry Hutang Dagang

Menu ini hanya satu kali dipakai pada saat permulaan sebuah system di mulai dan untuk selanjutnya hutang dagang otomatis timbul dari proses pembelian .

SCREEN SHOOT APLIKASI

THIS IS CODING A MINIGUI EXSTENDED

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

procedure whuap()
Local csuplier :=””
Local data :=space(1)
cwarna := {192,192,192}

if !iswindowactive (whuap)
SET DATE ITALIA
SET DELETE ON
set browsesync on
set century on
set navigation extended

Define window whuap ;
at 30,30 ;
Width 880 ;
Height 700 ;
on init (bukawhuap(),whubro());
ON RELEASE dbcloseall();
child ;
nomaximize;
NOMINIMIZE;
backcolor cwarna

DRAW GRADIENT IN WINDOW whuap AT 0,30 TO 55,850;
VERTICAL BORDER BOX ;
BEGINCOLOR {0,0,0} ;
ENDCOLOR {128,255,255}

DRAW TEXT IN WINDOW whuap AT 15,170 ;
VALUE “DAFTAR HUTANG DAGANG PER SUPLIER” ;
FONT “Verdana” SIZE 15 BOLD ;
FONTCOLOR {197,197,0};
TRANSPARENT

DRAW PANEL ;
IN WINDOW whuap ;
AT 05,30 ;
TO 50,850

DRAW PANEL ;
IN WINDOW whuap ;
AT 60,30 ;
TO 650,850

@ 70,40 frame kata_frm2 ;
caption “Data Posting Suplier”;
width 800 ;
height 60 ;
backcolor {192,192,192}

@ 130,710 frame kata_frm4 ;
caption “Autorisasi Data”;
width 128 ;
height 235 ;
backcolor {192,192,192}

@ 370,40 frame kata_frm3 ;
caption “Entry Data Hutang Suplier”;
width 800 ;
height 215 ;
backcolor {192,192,192}

@ 90,55 LABEL SUPLIER1_LBL VALUE ‘Nama Suplier ‘;
font “arial” size 12 ;
transparent

@ 90,330 label NAMA_lbl ;
font “arial” size 15 ;
BOLD ;
width 500 ;
height 100;
fontcolor {255,0,0} ;
transparent

@ 400,50 label NOLPB_LBL VALUE “No. LPB “;
font “arial” size 10 ;
width 150;
transparent

@ 400,430 label TGLPB_LBL VALUE “Tgl Invoice “;
font “arial” size 10 ;
width 150;
transparent

@ 430,430 label TGLPO_LBL VALUE “Tgl JT-Tempo”;
font “arial” size 10 ;
width 150;
transparent

@ 430,50 label NOPO_LBL VALUE “No. PO “;
font “arial” size 10 ;
width 150;
transparent

@ 460,50 label mutasi_lbl VALUE “Mutasi ” ;
font “arial” size 10 ;
width 150;
transparent

@ 460,430 label mata_lbl VALUE “Mata Uang ” ;
font “arial” size 10 ;
width 100;
transparent

@ 445,680 label pajak_lbl VALUE “Pajak(VAT) ” ;
font “arial” size 10 ;
bold;
fontcolor {255,0,0} ;
width 100;
transparent

@ 490,50 label discount_lbl VALUE “Discount ” ;
font “arial” size 10 ;
width 150;
transparent

@ 490,430 label Kurs_lbl VALUE “Kurs Uang ” ;
font “arial” size 10 ;
width 150;
transparent

@ 520,50 label jumlah_lbl VALUE “Nilai Invoice “;
font “arial” size 10 ;
width 150;
transparent

@ 520,430 label ppn_lbl VALUE “Nilai PPN “;
font “arial” size 10 ;
width 150;
transparent

@ 550,50 label Total_lbl VALUE “Total Invoice “;
font “arial” size 10 ;
width 150;
transparent

@ 550,430 label bayar_lbl VALUE “Di Bayar “;
font “arial” size 10 ;
width 150;
transparent ;

@ 600,330 label saldo_lbl VALUE “Saldo Hutang “;
font “arial” size 20 ;
BOLD;
width 250;
height 40;
transparent

@ 600,50 label voucher_lbl VALUE “Voucher Payment no “;
font “arial” size 10 ;
bold ;
width 150;
transparent

@ 620,50 label voucher2_lbl ; &&620
font “arial” size 15 ;
width 150;
fontcolor {255,0,0} ;
transparent blink

&&& data texbox

@ 90,210 btntextbox SUPLIER1_txt ;
font “arial” size 12 ;
width 90 ;
action (playbeep(),cariwhuap(),WHUAP2())

@ 400,160 textbox nolpb_txt ;
font “arial” size 10;
maxlength 15 ;
width 210

@ 430,160 textbox nopo_txt ;
font “arial” size 10;
maxlength 15;
width 210

define datepicker stanggal1
row 400
col 550
end datepicker

define datepicker stanggal2
row 430
col 550
end datepicker

Define combobox mutasi

row 460
col 160
Item {“Debet”,”Kredit”}
value 1

end combobox

Define combobox mata

row 460
col 550
Item {“Rupiah”,”Dollar”,”Euro”,”Yen”}
value 1
on change (IIF(whuap.mata.value==1,whuap.kurs_txt.enabled := .F. ,whuap.kurs_txt.enabled :=.T.))
on enter (IIF(whuap.mata.value==1,whuap.kurs_txt.enabled := .F. ,whuap.kurs_txt.enabled :=.T.))

end combobox

Define combobox pajak

row 460
col 680
Item {“PPN 10% “,”EPTE 0%”,”BEBASKAN”}
value 1

end combobox

@ 490,160 textbox discount_txt ;
font “arial” size 10;
width 50 ;
numeric inputmask “999.99”

@ 490,550 textbox Kurs_txt ;
font “arial” size 10;
width 130 ;
numeric inputmask “99,999.999”

@ 520,160 textbox Nilai_txt ;
font “arial” size 10;
width 210;
numeric inputmask “9,999,999,999.99” ;
on enter sppn();
on change sppn()

@ 520,550 textbox ppn_txt ;
font “arial” size 10;
width 210;
numeric inputmask “9,999,999,999.99”

@ 550,160 textbox total_txt ;
font “arial” size 10;
width 210 ;
numeric inputmask “9,999,999,999.99” ;

@ 550,550 textbox bayar_txt ;
font “arial” size 10;
width 210 ;
numeric inputmask “9,999,999,999.99”

@ 600,550 textbox saldo_txt ;
font “arial” size 20;
bold ;
fontcolor { 255,0,0 };
width 210 ;
HEIGHT 40 ;
numeric inputmask “9,999,999,999.99”

@ 140,40 BROWSE Browse_ap ;
WIDTH 650 ;
HEIGHT 210 ;
HEADERS { ‘Kode Suplier’ ,’Nomer Nota ‘,’Nomer Order’,’Tanggal’,’JT Tempo’,’Mata Uang’,’K u r s ‘,’J u m l a h’,’PPN 10%’,’Jenis’ } ;
WIDTHS { 70,150,150,80,80,50,100,100,100,100 } ;
WORKAREA HAMAS ;
FIELDS { ‘hamas->kd_pt’,’hamas->nonota’,’hamas->noorder’,’hamas->tanggal’,’hamas->jtempo’,’hamas->mata’,’hamas->kurs’,’hamas->jumlah’,’hamas->ppn’,’hamas->tptran’};
READONLY {.t.,.t.,.t.,.t.,.t.,.t.,.t.,.t.,.t.,.t.} ;
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT} ;
on change rubahap();
ON DBLCLICK ( cSuplier:=hamas->kd_pt,whuap.suplier1_txt.value:=cSuplier);
TOOLTIP “Data account payable”

@ 160,725 buttonex new;
caption ‘&Add Data ‘;
picture ‘d:\soalgui\bmp\baru.bmp’;
height 40 ;
width 100 ;
backcolor {197,255,197};
action tambah ()

@ 210,725 buttonex Edit;
caption ‘&Edit Data ‘;
picture ‘d:\soalgui\bmp\edit.bmp’;
height 40 ;
width 100 ;
backcolor {197,255,197};
action edit ()

@ 260,725 buttonex simpan;
caption ‘&Simpan’;
picture ‘d:\soalgui\bmp\save.bmp’;
height 40 ;
width 100 ;
backcolor {197,255,197};
action save ()

@ 310,725 buttonex cancel ;
caption ‘&Cancel’ ;
picture ‘d:\soalgui\bmp\cancel.bmp’;
tooltip ‘tekan tombol ini jika batal menyimpan’;
height 40 ;
width 100 ;
backcolor {197,255,197};
action batal()

end window
center window whuap
activate window whuap

Endif
return nil

PROCEDURE bukawhuap

Local SFLAG := “H”
Local SFLAG1 := “S”
LOCAL STYPE := “F”

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

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

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

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

return

static procedure whubro
select hamas
DBSETORDER(1)
go top
whuap.suplier1_txt.value := hamas->kd_pt
set filter to ((hamas->flag)+(hamas->type)+(hamas->kd_wil)+(hamas->kd_pt))==(“HF”+” “+whuap.suplier1_txt.value)
whuap.browse_ap.refresh
whuap.browse_ap.setfocus
whuap.browse_ap.value := recno()
whuap.cancel.enabled := .F.
whuap.simpan.enabled := .F.

skd_pt := alltrim(whuap.suplier1_txt.value)
select suplier
SEEK “S”+SKD_PT
SNM_PT := NM_WIL
whuap.nama_lbl.value := snm_pt
NONAKTIF()
rubahap()
return

procedure cariwhuap
do while .t.
FINDAP(“whuap”,”SUPLIER1_txt”)
exit
enddo
return

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

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

Return

Function GETAP(nValue)
Local cReg:= “”, nReg := 1
private cvarnonota := “kd_wil”
suplier->(dbsetorder(1))

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

DEFINE WINDOW Form_11;
AT 0,0 ;
WIDTH 700 HEIGHT 440 ;
MODAL NOSIZE

@310,5 frame pilih_whuap ;
width 680 ;
height 80

@ 320,70 label cnonota_lbl value ‘ Masukan Kode Supplier yg dicari’;
font “arial” size 16 BOLD;
width 500;
transparent blink;
fontcolor{197,197,255}

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

@ 5,5 BROWSE Browse_whuap ;
WIDTH 670 ;
HEIGHT 300 ;
HEADERS { ‘Kode Suplier’ , ‘Nama Suplier’,’Alamat Suplier’,’Atention’ } ;
WIDTHS { 70,250,210,150 } ;
WORKAREA SUPLIER ;
FIELDS { ‘suplier->kd_wil’,’suplier->nm_wil’,’suplier->alamat1′,’suplier->alamat3′} ;
VALUE nReg ;
READONLY {.t.,.t.,.t.} ;
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT , BROWSE_JTFY_LEFT} ;
ON DBLCLICK ( cReg:=suplier->kd_wil,ThisWindow.release) ;
TOOLTIP “Pilihlah Kode Suplier yang anda inginkan ”

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW Form_11

ACTIVATE WINDOW Form_11

Return cReg

function search_whuap

Local cReg:= “”, nReg := 1
local cCari:= (“S”+form_11.cnonota_txt.value)
local nPanjang := len(ccari)

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

If found()

If suplier->(DbSeek(cCari))
form_11.browse_whuap.value := suplier->(recno())
Else
MsgExclamation(‘Kode Suplier tidak ada’)
EndIf
else
msginfo(“Kode suplier yg anda cari bukan kode suplier”,”Konfirmasi bukan kode suplier”)
form_11.cnonota_txt.value := “”

EndIf
Return

function whuap2()

local cCaries:= (“H”+”F”+” “+whuap.suplier1_txt.value)
local nPanjang := len(ccaries)
skd_pt := alltrim(whuap.suplier1_txt.value)
select suplier
SEEK “S”+SKD_PT
SNM_PT := NM_WIL
whuap.nama_lbl.value := snm_pt

select hamas
set order to 1
dbselectarea(“hamas”)
dbseek(cCaries)
If found()
If hamas->(DbSeek(cCaries))
set filter to ((hamas->flag)+(hamas->type)+(hamas->kd_wil)+(hamas->kd_pt))==(“HF”+” “+whuap.suplier1_txt.value)
whuap.browse_ap.value := recno()
whuap.browse_ap.refresh

Else
whuap.browse_ap.value := recno()
whuap.browse_ap.refresh

MsgExclamation(‘Data kosong alias tidak ada’)
EndIf
else
whuap.browse_ap.value := recno()
whuap.browse_ap.refresh
msginfo(“Suplier yang anda maksud saldo hutang kosong”,”Konfirmasi Hutang Suplier “)

EndIf

RETURN Nil

PROCEDURE RUBAHAP

local cCaries:= (“H”+”F”+” “+whuap.suplier1_txt.value)

select hamas
set order to 1
SKD_WIL := KD_WIL
SKD_PT := KD_PT
SNONOTA := NONOTA
SNOORDER := NOORDER
STANGGAL := TANGGAL
SJTEMPO := JTEMPO
STPTRAN := TPTRAN

IF STPTRAN == “D”
whuap.mutasi.value := 1
ELSE

whuap.mutasi.value := 2

EndIF

SMATA := MATA

IF SMATA == “I”
whuap.mata.value := 1
elseif SMATA == “U”
whuap.mata.value := 2
elseif SMATA == “E”
whuap.mata.value := 3
elseif SMATA == “Y”
whuap.mata.value := 4
ENDIF

SKURS := KURS // STR(KURS,10,2)
SDISC := DISC // STR(DISC,5,2)
SPPN := PPN // STR(PPN,5,2)
SMATERAI := MATERAI // STR(MATERAI,4,0)
SJUMLAH := JUMLAH // STR(JUMLAH,12,0)
SDIBAYAR := 0
whuap.nolpb_txt.value := snonota
whuap.nopo_txt.value := snoorder
whuap.stanggal1.value := stanggal
whuap.stanggal2.value := sjtempo

whuap.kurs_txt.value := skurs
whuap.discount_txt.value := sdisc
whuap.nilai_txt.value := sjumlah
whuap.ppn_txt.value := ((sppn/100) * sjumlah)
whuap.total_txt.value := (whuap.nilai_txt.value + whuap.ppn_txt.value)

SELECT HIDET
dbseek(“H”+”F”+skd_wil+whuap.suplier1_txt.value+snonota)
DO WHILE .NOT. EOF() .AND. “H”+”F”+skd_wil+whuap.suplier1_txt.value+snonota == FLAG+TYPE+KD_WIL+KD_PT+NONOTA
SDIBAYAR := SDIBAYAR+JUMLAH
snotran := notran
whuap.voucher2_lbl.value := snotran

DbSkip()
ENDDO

if sdibayar = 0
snotran := space(15)
whuap.voucher2_lbl.value := snotran
endif

select hamas
whuap.bayar_txt.value := sdibayar
whuap.saldo_txt.value := (whuap.total_txt.value-whuap.bayar_txt.value)

Return

Static Function tambah
&& Tambah Data Hutang Baru

AKTIF()
whuap.nolpb_txt.value := ”
whuap.nopo_txt.value := ”
whuap.stanggal1.value := ctod(” / / “)
whuap.stanggal2.value := ctod(” / / “)

whuap.kurs_txt.value := 0
whuap.discount_txt.value := 0
whuap.nilai_txt.value := 0
whuap.ppn_txt.value := 0
whuap.total_txt.value := 0
whuap.browse_ap.enabled := .F.
whuap.edit.enabled := .F.
whuap.simpan.enabled := .T.
whuap.cancel.enabled := .T.

whuap.nolpb_txt.setfocus

return

static function nonaktif

whuap.nolpb_txt.enabled := .F.
whuap.nopo_txt.enabled := .F.
whuap.stanggal1.enabled := .F.
whuap.stanggal2.enabled := .F.
whuap.kurs_txt.enabled := .F.
whuap.discount_txt.enabled := .F.
whuap.nilai_txt.enabled := .F.
whuap.ppn_txt.enabled := .F.
whuap.pajak.enabled := .F.
whuap.total_txt.enabled := .F.
whuap.mutasi.enabled := .F.
whuap.mata.enabled := .F.

return

static function aktif

whuap.nolpb_txt.enabled := .T.
whuap.nopo_txt.enabled := .T.
whuap.stanggal1.enabled := .T.
whuap.stanggal2.enabled := .T.

whuap.mata.enabled := .T.
If whuap.mata.value == 1

whuap.kurs_txt.enabled := .F.
else
whuap.kurs_txt.enabled := .T.

endif
whuap.discount_txt.enabled := .T.
whuap.nilai_txt.enabled := .T.
whuap.mutasi.enabled := .T.
whuap.pajak.enabled := .T.

return

static function batal

nonaktif()
whuap.browse_ap.enabled := .T.
whuap.simpan.enabled := .F.
whuap.edit.enabled := .T.
whuap.new.enabled := .T.
whuap.cancel.enabled := .F.
whuap.browse_ap.setfocus
whuap.browse_ap.refresh
whuap.browse_ap.value := recno()

return

static function save

IF whuap.new.value == .T.
whuap.edit.value := .F.
data := “A”

hamas->(DbAppend())

else
whuap.edit.value := .T.
whuap.new.value := .F.

data := “E”
skd_pt1 := hamas->KD_PT
SNONOTA1 := hamas->NONOTA
DBSEEK(“H”+”F”+space(2)+skd_pt1+snonota1)

EndIf

rrlock()
HAMAS->FLAG := “H”
HAMAS->TYPE := “F”
HAMAS->KD_PT := alltrim(whuap.suplier1_txt.value)
HAMAS->KD_WIL := space(2)
HAMAS->NONOTA := whuap.nolpb_txt.value
HAMAS->NOORDER := whuap.nopo_txt.value
HAMAS->TANGGAL := whuap.stanggal1.value
HAMAS->JTEMPO := whuap.stanggal2.value

IF whuap.mutasi.value == 1

HAMAS->TPTRAN := “D”

else

HAMAS->TPTRAN := “K”

Endif

IF whuap.mata.value == 1
hamas->MATA := “I”
elseif whuap.mata.value == 2
hamas->mata :=”U”
elseif whuap.mata.value == 3
hamas->mata :=”E”
elseif whuap.mata.value == 4
hamas->mata :=”Y”
endif

hamas->KURS := whuap.kurs_txt.value
hamas->DISC := whuap.discount_txt.value
hamas->JUMLAH := whuap.nilai_txt.value
hamas->ppn := IIF(whuap.pajak.value == 1,10,0)
dbcommit()
dbunlock()

whuap.browse_ap.enabled := .T.
whuap.browse_ap.refresh

whuap.browse_ap.value := recno()
nonaktif()

whuap.new.enabled := .T.
whuap.simpan.enabled := .F.
whuap.cancel.enabled := .F.
whuap.edit.enabled := .T.

return

static function edit
aktif()
whuap.new.enabled := .F.
whuap.simpan.enabled := .T.
whuap.cancel.enabled := .T.
whuap.nolpb_txt.setfocus

return

static function sppn

if whuap.pajak.value == 1
sppn := 10
else
sppn := 0
endif

whuap.ppn_txt.value := ((sppn/100) * whuap.nilai_txt.value)
whuap.total_txt.value := (whuap.nilai_txt.value + whuap.ppn_txt.value)

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: