Statemen Of Account ( AR )

Statement of account piutang merupakan data yg diperlukan guna mengcontrol posisi account receivable yang ada di pelanggan .

Terlampir screen shoot dan coding yang saya kembangkan dengan minigui exstended :

This is coding minigui exstended :

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

procedure balar()

if !iswindowactive (balar)

SET DATE ITALIA
SET DELETE ON
set browsesync on
set century on
set navigation extended

Define window balar ;
at 30,30 ;
Width 650 ;
Height 460 ;
on init bukabalar();
ON RELEASE dbcloseall();
child ;
nomaximize;
NOMINIMIZE;
backcolor {192,192,192}

@ 17,130 LABEL TBL_LBL Value “LAPORAN SALDO PIUTANG DAGANG”;
FONT “ARIAL NARROW” SIZE 18 ;
fontcolor {255,0,0} ;
backcolor {192,192,192} ;
WIDTH 500

DRAW PANEL ;
IN WINDOW balar ;
AT 10,30 ;
TO 50,615

DRAW PANEL ;
IN WINDOW balar ;
AT 60,30 ;
TO 400,615

@ 70,440 frame kata_frm ;
caption “Jenis Laporan”;
width 145 ;
height 150 ;
backcolor {192,192,192}

@ 70,40 frame kata_frm2 ;
caption “Data Posting laporan”;
width 385 ;
height 300 ;
backcolor {192,192,192}

@ 110,55 LABEL customer1_LBL VALUE ‘Nama Customer ‘;
font “arial” size 12 ;
transparent

@ 150,55 LABEL customer2_LBL VALUE ‘Nama Customer ‘;
font “arial” size 12 ;
transparent ;
action caribalar2()

@ 210,55 label stgl1_lbl Value ‘Tanggal ‘;
font “arial” size 12 ;
width 250 ;
height 30 ;
transparent

@ 110,210 btntextbox customer1_txt ;
font “arial” size 12 ;
width 180 ;
action (playbeep(),caribalar())

@ 150,210 btntextbox customer2_txt ;
font “arial” size 12 ;
width 180 ;
action (playbeep(),caribalar2())

define datepicker stanggal1
row 210
col 210
action playbeep()
end datepicker

@ 310,155 LABEL PROGRES_LBL VALUE ‘Proses Exsport ‘;
font “arial” size 10 ;
transparent

@ 330,55 progressbar progress_1;
range 1,100;
width 350 height 26

DEFINE IMAGE BK1
ROW 110
COL 455
WIDTH 20
HEIGHT 30
PICTURE ‘D:\YOKATA\ICO\EXCEL16.BMP’
WHITEBACKGROUND .t.
// ON CLICK { balarxls(),DBFbalar()}
END IMAGE

DEFINE IMAGE BK2
ROW 160
COL 455
WIDTH 20
HEIGHT 30
PICTURE ‘D:\YOKATA\ICO\PRINT.ICO’
WHITEBACKGROUND .F.
ON CLICK { balar2() }
END IMAGE

@ 110,495 buttonex BK3;
caption ‘Exsport &XLS ‘;
height 30 ;
width 80 ;
BACKCOLOR {128,255,0};
// on click { balarxls(),DBFbalar()}

@ 160,495 buttonex BK4;
caption ‘Ke &Printer’;
height 30 ;
width 80 ;
BACKCOLOR {128,255,0};
on click { playbeep(),balar2() }

end window

balar.progress_1.value := 0

center window balar
activate window balar

Endif
return nil

PROCEDURE bukabalar

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

IF opentables(cDRV+”GLTBL”,.F.)
ELSE
RETURN
ENDIF

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

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

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

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

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

RETURN

procedure caribalar
do while .t.
findbalar(“balar”,”customer1_txt”)
exit
enddo
return

procedure caribalar2
do while .t.
findbalar(“balar”,”customer2_txt”)
exit
enddo
return

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

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

Return

Function getbalar(nValue)
Local cReg:= “”, nReg := 1
private cvarnonota := “kd_wil”
tblcmas->(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_balar ;
width 680 ;
height 80

@ 320,70 label cnonota_lbl value ‘ Masukan Kode Customer 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_balar() };
on enter {search_balar() }

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

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW Form_11

ACTIVATE WINDOW Form_11

Return cReg

function search_balar

local cCari:= (“L”+”10″+form_11.cnonota_txt.value)
local nPanjang := len(ccari)

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

If found()

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

EndIf
Return

function balar2()

Local SFLAG := “P”
Local SFLAG1 := “L”
LOCAL STYPE := “F”
LOCAL SMUTASI := “D”

Local SKD_WIL := “10”
Local nday := Day(balar.stanggal1.value)
Local nmonth := Month(balar.stanggal1.value)
Local nyear := Year(balar.stanggal1.value)

Local cNamapt := gltbl->Namapt
Local cAlamat1 := gltbl->Alamat1
Local cAlamat2 := gltbl->Alamat2

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

sbln := strzero(nmonth,2)
scustomer1 :=(alltrim(balar.customer1_txt.value))
scustomer2 :=(alltrim(balar.customer2_txt.value))
xtanggal1 := balar.stanggal1.value
sbl := substr(dtos(xtanggal1),5,2)
sth := substr(dtos(xtanggal1),1,4)

nCOPIES :=1
baris := 55
shal := 0
mkolom := 54 &&45

cPrinter := GetPrinter()
If Empty (cPrinter)
Return
EndIf
SELECT PRINTER cPrinter ;
ORIENTATION PRINTER_ORIENT_LANDSCAPE ;
PAPERSIZE PRINTER_PAPER_LEGAL ;
COPIES nCOPIES ;
QUALITY PRINTER_RES_HIGH;
PREVIEW

START PRINTDOC name “balarutang”
START PRINTPAGE

TTSALDOUS:=TTSALDO1:=TTSALDO:=0

SELECT TBLCMAS
SET SOFTSEEK ON
SEEK SFLAG1+SKD_WIL+SCUSTOMER1
SET SOFTSEEK OFF

mPageNo:=0
kpageno := 0

DO WHILE .NOT. EOF() .AND. SFLAG1+SKD_WIL == FLAG+KD_WIL .AND. KD_PT >= SCUSTOMER1 .AND. KD_PT =190 .OR. mPageNo=0
mPageNo++
kpageno = kpageno + mpageno
IF mPageNo>1
&& cetak garis vertical halaman

@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1 &&noorder
@ baris,110 PRINT LINE TO mkolom,110 PENWIDTH 0.1 &&nonota
@ baris,155 PRINT LINE TO mkolom,155 PENWIDTH 0.1 &&term
@ baris,185 PRINT LINE TO mkolom,185 PENWIDTH 0.1 &&tanggal
@ baris,230 PRINT LINE TO mkolom,230 PENWIDTH 0.1 &&AWAL ENDING
@ baris,280 PRINT LINE TO mkolom,280 PENWIDTH 0.1 && n<30 AWAL

@ baris,03 print line to baris,280 penwidth 0.1
baris += 5
@ baris,55 PRINT "Lanjut ke Halaman: "+LTRIM(STR(mPageNo))
baris := 55
mkolom := 54

END PRINTPAGE
START PRINTPAGE

ENDIF
kpageno := (kpageno/mpageno)

@ 10,210 PRINT "Tanggal Cetak : "+dtoc(DATE())
@ 15,210 PRINT "Page: "+LTRIM(STR(mPageNo)) //+" of "+ltrim(str(kpageno)) //RIGHT
@ 10,15 PRINT cNamapt Underline
@ 15,15 PRINT cAlamat1
@ 20,150 print "LAPORAN SALDO PIUTANG" FONT "COURIER NEW" SIZE 18 BOLD CENTER
@ 30,135 print "For Periode : "+dtoc(xtanggal1)

@ 38,04 print line to 38,280 penwidth 0.2
@ 40,05 print " NO."
@ 40,15 print " Kode "
@ 45,15 print " Customer "
@ 40,65 print " Nama Customer"
@ 40,130 print " P i u t a n g D a g a n g "
@ 45,110 print line to 45,230 penwidth 0.3
@ 48,132 print "(Rp.)"
@ 48,162 print "(USD)"

@ 40,190 print " P i u t a n g G i r o "
@ 48,212 print " (Rp.)"

@ 40,245 PRINT " Total Piutang"
@ 45,245 Print " Dalam Rp. "

@ 53,04 print line to 53,280 penwidth 0.2

&& cetak garis vertical u/ HEADER

@ 38,03 PRINT LINE TO 54,03 PENWIDTH 0.1 && 1
@ 38,13 PRINT LINE TO 54,13 PENWIDTH 0.1 && 2
@ 38,39 PRINT LINE TO 54,39 PENWIDTH 0.1 && 4
@ 38,110 PRINT LINE TO 54,110 PENWIDTH 0.1 && 5 && ending mana
@ 45,155 PRINT LINE TO 54,155 PENWIDTH 0.1 && 6 &&ending nama
@ 45,185 PRINT LINE TO 54,185 PENWIDTH 0.1 && 6 &&ending nama
@ 38,230 PRINT LINE TO 54,230 PENWIDTH 0.1
@ 38,280 PRINT LINE TO 54,280 PENWIDTH 0.1 && 7
&& 8 ENDING

ENDIF

DO WHILE .NOT. EOF() .AND. BARIS = SCUSTOMER1 .AND. KD_PT <= SCUSTOMER2

TSALDOUS:=TSALDO:=TSALDO1:=0

FKDPT := KD_PT
SNM_PT := SUBSTR(NM_PT,1,30)

SELECT PIMAS
SEEK SFLAG+STYPE+SKD_WIL+FKDPT
DO WHILE .NOT. EOF() .AND. BARIS <= 189 .AND. FLAG+TYPE+KD_WIL+KD_PT == SFLAG+STYPE+SKD_WIL+FKDPT

IF TANGGAL <= XTANGGAL1
SNOGIRO := NONOTA
SMATA := MATA
SBAYAR := 0
SELECT PIDET
SEEK SFLAG+STYPE+SKD_WIL+FKDPT+SNOGIRO
DO WHILE .NOT. EOF() .AND.SFLAG+STYPE+SKD_WIL+FKDPT+SNOGIRO == FLAG+TYPE+KD_WIL+KD_PT+NONOTA
IF TANGGAL <= XTANGGAL1
IF EMPTY(SMATA)
IF EMPTY(SKURS)
SMATA := "I"
KALI := 1
ELSE
SMATA := "U"
KALI := KURS
ENDIF
ELSE
IF SMATA=="U"
KALI := KURS
ELSE
KALI := 1
ENDIF
ENDIF
SJUMLAH := JUMLAH
// SJUMLAH := (JUMLAH * KALI )
SBAYAR = SBAYAR + SJUMLAH
ENDIF
SKIP
ENDDO

SELECT PIMAS
SMATA := MATA
SKURS := KURS
SJUMLAH := JUMLAH

IF SMATA “I”
XJUMLAH := SJUMLAH * SKURS
SNET := (((1-((DISC)/100))+((1-((DISC)/100))*((PPN)/100)))*((JUMLAH*KURS)))+(MATERAI)
YNET := (((1-((DISC)/100))+((1-((DISC)/100))*((PPN)/100)))*(JUMLAH))+(MATERAI)

ELSE
SNET := (((1-((DISC)/100))+((1-((DISC)/100))*((PPN)/100)))*(JUMLAH))+(MATERAI)
YNET := 0
ENDIF

IF SMATA “I”
STAMOUNT := SNET – ( SBAYAR * SKURS )
STAMOUNTUS := YNET – SBAYAR
ELSE
STAMOUNT := SNET – SBAYAR
STAMOUNTUS := 0
ENDIF

IF SFLAG = “P”
TSALDO = IIF(TPTRAN==”D”,TSALDO+STAMOUNT,TSALDO-STAMOUNT)
TSALDOUS = IIF(TPTRAN==”D”,TSALDOUS+STAMOUNTUS,TSALDOUS-STAMOUNTUS)
ELSE
TSALDO = IIF(TPTRAN==”D”,TSALDO-STAMOUNT,TSALDO+STAMOUNT)
ENDIF
ENDIF
SELECT PIMAS
SKIP
ENDDO

SELECT BANKMAS
SEEK SMUTASI+SKD_WIL+FKDPT
DO WHILE .NOT. EOF() .AND. SMUTASI+SKD_WIL+FKDPT == TPTRAN+KD_WIL+KD_PT
IF TANGGAL <= XTANGGAL1
MSALDO := 0
IF .NOT. EMPTY(TGL_SETOR)
IF TGL_SETOR <= XTANGGAL1
MSALDO := JUMLAH
ENDIF
ENDIF
TSALDO1 := TSALDO1 + (JUMLAH-MSALDO)
ENDIF
SKIP
ENDDO

TSALDO0 := TSALDO+TSALDO1

IF TSALDO0 # 0
SHAL := SHAL + 1

FF := { || TRANSFORM(NO,"999.")+" "+FKDPT+" "+SNM_PT+" " }
GG := { || IIF(TSALDO ==0,SPACE(18)+"-",TRANSFORM(TSALDO ,"9,999,999,999.99"))+" "+;
IIF(TSALDOUS==0,SPACE(15)+"-",TRANSFORM(TSALDOUS ,"9,999,999,999.99"))+" "+;
IIF(TSALDO1==0,SPACE(18)+"-",TRANSFORM(TSALDO1,"9,999,999,999.99"))+" "+;
IIF(TSALDO0==0,SPACE(15)+"-",TRANSFORM(TSALDO0,"999,999,999,999.99")) }

@ BARIS,05 PRINT Transform(shal,"9999") SIZE 9
@ baris,20 print FKDPT SIZE 9
@ baris,42 print SUBSTR(SNM_PT,1,35) SIZE 9
@ baris,149 print IF(TSALDO ==0,SPACE(15)+"-",TRANSFORM(TSALDO ,"9,999,999,999.99")) SIZE 9 RIGHT
@ baris,180 print IF(TSALDOUS==0,SPACE(15)+"-",TRANSFORM(TSALDOUS ,"9,999,999,999.99")) SIZE 9 RIGHT
@ baris,222 print IF(TSALDO1==0,SPACE(15)+"-",TRANSFORM(TSALDO1,"9,999,999,999.99")) SIZE 9 RIGHT
@ baris,272 print IF(TSALDO0==0,SPACE(15)+"-",TRANSFORM(TSALDO0,"999,999,999,999.99")) SIZE 9 RIGHT

@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1 &&noorder
@ baris,110 PRINT LINE TO mkolom,110 PENWIDTH 0.1 &&nonota
@ baris,155 PRINT LINE TO mkolom,155 PENWIDTH 0.1 &&term
@ baris,185 PRINT LINE TO mkolom,185 PENWIDTH 0.1 &&tanggal
@ baris,230 PRINT LINE TO mkolom,230 PENWIDTH 0.1 &&AWAL ENDING
@ baris,280 PRINT LINE TO mkolom,280 PENWIDTH 0.1 && n=SCUSTOMER1.AND.KD_PT<=SCUSTOMER2)

TSALDO := TTSALDO
TSALDO1 := TTSALDO1
TSALDO0 := TSALDO+TSALDO1
TSALDOUS := TTSALDOUS

@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1 &&noorder
@ baris,110 PRINT LINE TO mkolom,110 PENWIDTH 0.1 &&nonota
@ baris,155 PRINT LINE TO mkolom,155 PENWIDTH 0.1 &&term
@ baris,185 PRINT LINE TO mkolom,185 PENWIDTH 0.1 &&tanggal
@ baris,230 PRINT LINE TO mkolom,230 PENWIDTH 0.1 &&AWAL ENDING
@ baris,280 PRINT LINE TO mkolom,280 PENWIDTH 0.1 && n<30 AWAL

@ baris,03 print line to baris,280 penwidth 0.2
baris := baris +5

@ baris,149 print IF(TSALDO ==0,SPACE(17)+"-",TRANSFORM(TSALDO ,"9,999,999,999.99")) SIZE 9 RIGHT
@ baris,180 print IF(TSALDOUS==0,SPACE(15)+"-",TRANSFORM(TSALDOUS ,"9,999,999,999.99")) SIZE 9 RIGHT
@ baris,222 print IF(TSALDO1==0,SPACE(17)+"-",TRANSFORM(TSALDO1,"9,999,999,999.99")) SIZE 9 RIGHT
@ baris,272 print IF(TSALDO0==0,SPACE(15)+"-",TRANSFORM(TSALDO0,"999,999,999,999.99")) SIZE 9 RIGHT
@ baris, 48 print "<>”
BARIS := BARIS + 5
@ baris,03 print line to baris,280 penwidth 0.2

ENDIF
SELECT TBLCMAS
ENDDO

END PRINTPAGE
END PRINTDOC

RETURN Nil

Iklan

2 thoughts on “Statemen Of Account ( AR )

    1. jcsn Penulis Tulisan

      Thank you so much, I made this blog 2 weeks and I hope this blog is useful for the programmers who want to learn clipper and programing

      I hope you are willing to share experiences about the program

      Salam
      JCSN

      Balas

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 )

Foto Google+

You are commenting using your Google+ 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 )

Connecting to %s