Exsport PDF

Dokument  dalam bentuk PDF merupakan hal yang lazim dan merupakan kebutuhan sebuah pelaporan , terlampir kami informasikan coding untuk export ke FORMAT PDF

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

procedure bkap()

if !iswindowactive (bkap)

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

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

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

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

DRAW PANEL   ;
IN WINDOW bkap ;
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 SUPLIER1_LBL   VALUE ‘Kode Suplier  ‘;
font “arial” size 10 ;
backcolor {192,192,192};
transparent

@ 110,170 LABEL SUPLIER2_LBL  VALUE ‘Nama Suplier  ‘;
font “arial” size 10 ;
width 250 ;
backcolor {192,192,192};
transparent

@ 140,170 LABEL SUPLIER3_LBL ;
font “arial” size 10 ;
width 265 ;
transparent

@ 180,170 LABEL SUPLIER4_LBL ;
font “arial” size 10 ;
width 265 ;
transparent

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

@ 140,55 btntextbox SUPLIER1_txt ;
font “arial” size 12 ;
width 100 ;
action (playbeep(),caribkap())

@ 180,55 btntextbox SUPLIER2_txt ;
font “arial” size 12 ;
width 100

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

@ 310,155 LABEL PROGRES_LBL  VALUE ‘Proses Exsport ‘;
font “arial” size 10 ;
backcolor {192,192,192};
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 { printpdf() }
END IMAGE

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

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

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

end window

bkap.progress_1.value := 0

center window bkap
activate window bkap

Endif
return nil

PROCEDURE bukabkap

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

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

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

IF opentables(cDRV+”HAMAS”,.F.)
SET INDEX TO (cDRV+”HAMAS2″),(cDRV+”HAMAS”),(cDRV+”HAMAS3″),(cDRV+”HAMAS5″),(cDRV+”HAMAS1″),(cDRV+”HAMAS4″)
ELSE
RETURN
ENDIF

RETURN

procedure caribkap
do while .t.
findbkap(“bkap”,”SUPLIER1_txt”)
bkap.suplier2_txt.value := bkap.suplier1_txt.value
exit
enddo
return

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

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

Return

Function getbkap(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_bkap ;
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_bkap() };
on enter {search_bkap() }

@ 5,5 BROWSE Browse_bkap   ;
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,bkap.suplier3_lbl.value:=suplier->nm_wil,bkap.suplier4_lbl.value:=suplier->nm_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_bkap

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_bkap.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 bkap2()

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

Local SKD_WIL := ”  ”

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

SKD_PT1   :=(alltrim(bkap.SUPLIER1_txt.value))
SKD_PT2   :=(alltrim(bkap.SUPLIER2_txt.value))
xtanggal1 := bkap.stanggal1.value
sbl := substr(dtos(xtanggal1),5,2)
sth := substr(dtos(xtanggal1),1,4)

nCOPIES :=1
baris := 50
shal  := 0
mkolom  := 48  &&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 “bukuAP”+SKD_PT1
START PRINTPAGE

SALDOII:=SDEBET:=SKREDIT:=0

SELECT HAMAS
SET SOFTSEEK ON
DBSEEK (SFLAG+SKD_WIL+SKD_PT1)
SET SOFTSEEK OFF
mPageNo := 0
kpageno := 0

DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL == FLAG+KD_WIL .AND. SKD_PT1 >= KD_PT .AND. SKD_PT2 <= KD_PT

IF baris>=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  && awal nomer
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1  && akhir nomer
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1   && akhir kode suplier
@ baris,72 PRINT LINE TO mkolom,72 penwidth  0.1 && invoice akhir
@ baris,130  PRINT LINE TO mkolom,130  PENWIDTH 0.1 && akhir keterangan
@ baris,165 PRINT LINE TO mkolom,165 PENWIDTH 0.1     &&kurs
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1       &&debet
@ baris,225 PRINT LINE TO mkolom,225 PENWIDTH 0.1       && kurs kredit
@ baris,255 PRINT LINE TO mkolom,255 PENWIDTH 0.1   && n<30 kredit
@ baris,290 PRINT LINE TO mkolom,290 PENWIDTH 0.1   && n<30 saldo
@ baris,317 PRINT LINE TO mkolom,317 PENWIDTH 0.1   && n<30 buki bayar
@ baris,343 PRINT LINE TO mkolom,343 PENWIDTH 0.1   && n<30 tgl bayar

@ baris,03 print line to baris,343 penwidth 0.1
baris += 5
@ baris,55 PRINT “Lanjut ke Halaman: “+LTRIM(STR(mPageNo))
baris := 50
mkolom := 48

END PRINTPAGE
START PRINTPAGE

ENDIF
kpageno := (kpageno/mpageno)

@ 08,270 PRINT “Tanggal Cetak : “+dtoc(DATE())
@ 13,270 PRINT “Page: “+LTRIM(STR(mPageNo))    //+” of “+ltrim(str(kpageno))     //RIGHT
@ 17,160 print “LAPORAN BUKU HUTANG” FONT “COURIER NEW” SIZE 18 BOLD CENTER
@ 25,160 print  skd_pt1 FONT “COURIER NEW” SIZE 18 BOLD CENTER
@ 32,135 print “For Periode : “+dtoc(xtanggal1)
@ 38,04  print line to 38,343 penwidth 0.2
@ 40,05  print ” NO.”
@ 40,15  print ” Kode Suplier ”
@ 40,45  print ” No. Invoice  ”
@ 40,73  print ” K e t e r a n g a n ”
@ 40,140 print ” Kurs Debet”
@ 40,175 print ” D E B E T  ”
@ 40,200 print ” Kurs Kredit”
@ 40,230 print ” K R E D I T”
@ 40,260 print ” S A L D O  ”
@ 40,290 print ” No. Payment”
@ 40,320 print ” Tgl. Payment”
@ 48,04  print line to 48,343 penwidth 0.2

&& cetak garis vertical u/ HEADER

@ 38,03 PRINT LINE TO 48,03 PENWIDTH 0.1             && 1
@ 38,13 PRINT LINE TO 48,13 PENWIDTH 0.1             && 2
@ 38,39 PRINT LINE TO 48,39 PENWIDTH 0.1             && 4
@ 38,72 PRINT LINE TO 48,72  PENWIDTH 0.1           && 5   && ending mana
@ 38,130 PRINT LINE TO 48,130 PENWIDTH 0.1           && 6    &&ending nama
@ 38,165 PRINT LINE TO 48,165 PENWIDTH 0.1           && 6    &&ending nama
@ 38,195 PRINT LINE TO 48,195 PENWIDTH 0.1
@ 38,225 PRINT LINE TO 48,225 PENWIDTH 0.1           && 7
@ 38,255 PRINT LINE TO 48,255 PENWIDTH 0.1           && 7
@ 38,290 PRINT LINE TO 48,290 PENWIDTH 0.1           && 7
@ 38,317 PRINT LINE TO 48,317 PENWIDTH 0.1           && 7
@ 38,343 PRINT LINE TO 48,343 PENWIDTH 0.1           && 7
&& 8 ENDING

ENDIF

SKD_PT := KD_PT
FL     := 0

SELECT SUPLIER
SEEK “S”+SKD_PT
SNM_PT := NM_WIL

SELECT HAMAS

DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL+SKD_PT == FLAG+KD_WIL+KD_PT .AND. BARIS <= 189

IF TANGGAL <= XTANGGAL1
TYNM = “”
DO CASE
CASE TYPE = “K”
TYNM = “NOTA KREDIT”
CASE TYPE = “D”
TYNM = “Money Intransit ( Temporary )”
CASE TYPE = “F” .AND. TPTRAN = “K”
TYNM = “FAKTUR”
CASE TYPE = “G”
TYNM = “PEMBAYARAN GIRO”
CASE TYPE = “F” .AND. TPTRAN = “D”
TYNM = “RETUR”
CASE TYPE = “C”
TYNM = “PEMBAYARAN CASH     ”
CASE TYPE = “B”
TYNM = “PEMBAYARAN VIA BANK ”
ENDCASE

STGL      := TANGGAL
SKETERNG  := TYNM+SPACE(30-LEN(TYNM))

SELECT HAMAS
SNONOTA   := NONOTA
STPTRAN   := TPTRAN
STYPE     := TYPE
SMATA     := MATA
SKURS     := KURS
STAMOUNT  := JUMLAH +(PPN/100*JUMLAH)
KALI      := 0

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

IF TPTRAN  == “D”
SALDODB := STAMOUNT
SALDOKR := 0
SALDOII := SALDOII-(SALDODB*KALI)
SDEBET  := SDEBET+STAMOUNT
ELSE
SALDOKR := STAMOUNT
SALDODB := 0
SALDOII := SALDOII+(SALDOKR*KALI)
SKREDIT := SKREDIT+STAMOUNT
ENDIF

HIDET->(DBSEEK(SFLAG+STYPE+SKD_WIL+SKD_PT+SNONOTA))

SNOTRAN   := HIDET->NOTRAN
STGLBAYAR := HIDET->TANGGAL

SELECT HAMAS

shal := shal + 1
@ BARIS,05   PRINT Transform(shal,”9999″) SIZE 9
@ baris,18   print dtoc(stgl)
@ baris,45   print SUBSTR(snonota,1,30)
@ BARIS,75   PRINT SKETERNG
// @ BARIS,150  PRINT IF(SALDODB==0,” “,IIF(SMATA==”U”,”USD”,”Rp.”)) size 9 right
@ BARIS,160  PRINT IF(SALDODB==0,” “,TRANS(SKURS,”999,999.99″)) size 9 right
@ baris,190  print IF(SALDODB==0,SPACE(13)+”-“,TRANSFORM(SALDODB,”999,999,999.99″)) SIZE 9 RIGHT
// @ BARIS,210  PRINT IF(SALDOKR==0,” “,IIF(SMATA==”U”,”USD”,”Rp.”)) size 9 right
@ BARIS,220  PRINT IF(SALDOKR==0,” “,TRANS(SKURS,”999,999.99″)) size 9 right
@ BARIS,250  PRINT IF(SALDOKR==0,SPACE(13)+”-“,TRANSFORM(SALDOKR,”999,999,999.99″)) SIZE 9 RIGHT
@ BARIS,285  PRINT IF(SALDOII==0,SPACE(15)+”-“,TRANSFORM(SALDOII,”9,999,999,999.99″)) SIZE 9 RIGHT
@ BARIS,295  PRINT SNOTRAN SIZE 9
@ BARIS,320  PRINT DTOC(STGLBAYAR)

@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1  && awal nomer
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1  && akhir nomer
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1   && akhir kode suplier
@ baris,72 PRINT LINE TO mkolom,72 penwidth  0.1 && invoice akhir
@ baris,130  PRINT LINE TO mkolom,130  PENWIDTH 0.1 && akhir keterangan
@ baris,165 PRINT LINE TO mkolom,165 PENWIDTH 0.1     &&kurs
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1       &&debet
@ baris,225 PRINT LINE TO mkolom,225 PENWIDTH 0.1       && kurs kredit
@ baris,255 PRINT LINE TO mkolom,255 PENWIDTH 0.1   && n<30 kredit
@ baris,290 PRINT LINE TO mkolom,290 PENWIDTH 0.1   && n<30 saldo
@ baris,317 PRINT LINE TO mkolom,317 PENWIDTH 0.1   && n<30 buki bayar
@ baris,343 PRINT LINE TO mkolom,343 PENWIDTH 0.1   && n<30 tgl bayar
select hamas
baris := baris +5
ENDIF
SELECT HAMAS
SKIP
ENDDO
SELECT HAMAS
IF  EOF() .OR. .NOT. (SFLAG+SKD_WIL== FLAG+KD_WIL .AND. KD_PT >= SKD_PT1 .AND. KD_PT <= SKD_PT2)
@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1  && awal nomer
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1  && akhir nomer
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1   && akhir kode suplier
@ baris,72 PRINT LINE TO mkolom,72 penwidth  0.1 && invoice akhir
@ baris,130  PRINT LINE TO mkolom,130  PENWIDTH 0.1 && akhir keterangan
@ baris,165 PRINT LINE TO mkolom,165 PENWIDTH 0.1     &&kurs
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1       &&debet
@ baris,225 PRINT LINE TO mkolom,225 PENWIDTH 0.1       && kurs kredit
@ baris,255 PRINT LINE TO mkolom,255 PENWIDTH 0.1   && n<30 kredit
@ baris,290 PRINT LINE TO mkolom,290 PENWIDTH 0.1   && n<30 saldo
@ baris,317 PRINT LINE TO mkolom,317 PENWIDTH 0.1   && n<30 buki bayar
@ baris,343 PRINT LINE TO mkolom,343 PENWIDTH 0.1   && n<30 tgl bayar

@ baris,04  print line to baris,343 penwidth 0.2
BARIS := BARIS + 5
@ BARIS, 20 PRINT ” DATA HABIS”
ENDIF

ENDDO
END PRINTPAGE
END PRINTDOC

RETURN Nil

*——————————————————————————*
Procedure Printpdf()
*——————————————————————————*
Local i

oPDFC  := CreateObject( “PDFCreator.clsPDFCreator” )
oPDFC:cVisible = .F.
If oPDFC:cStart(“/NoProcessingAtStartup”) = .f.
If oPDFC:cStart(“/NoProcessingAtStartup”, .t.) = .f.
msginfo(“no se pudo iniciar la impresion”)
return nil
EndIf
EndIf
oPDFC:cOption(‘UseAutosave’,1) &&= 1
oPDFC:cOption(‘UseAutosaveDirectory’,1) && = 1
oPDFC:cOption(“AutosaveFormat”,0) &&= 0                                    &&; 0 = PDF format
DefaultPrinter = oPDFC:cDefaultprinter
oPDFC:cDefaultprinter = “PDFCreator”
oPDFC:cClearCache()
oPDFC:cOption(‘AutosaveFilename’,”prueba”) &&= “MIPRUEBA”
oPDFC:cOption(‘AutosaveDirectory’,”C:\”) &&= “C:\”

SELECT PRINTER DEFAULT ;
ORIENTATION PRINTER_ORIENT_LANDSCAPE ;
PAPERSIZE   PRINTER_PAPER_LEGAL ;
QUALITY     PRINTER_RES_HIGH;

bkap32()

oPDFC:cPrinterStop = .f.
oPDFC:cClearcache()
oPDFC:cDefaultprinter = DefaultPrinter
oPDFC:cClose()

Return

function bkap32()

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

Local SKD_WIL := ”  ”

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

SKD_PT1   :=(alltrim(bkap.SUPLIER1_txt.value))
SKD_PT2   :=(alltrim(bkap.SUPLIER2_txt.value))
xtanggal1 := bkap.stanggal1.value
sbl := substr(dtos(xtanggal1),5,2)
sth := substr(dtos(xtanggal1),1,4)

nCOPIES :=1
baris := 50
shal  := 0
mkolom  := 48  &&45

START PRINTDOC  name “bukuAP-“+skd_pt1
START PRINTPAGE

SALDOII:=SDEBET:=SKREDIT:=0

SELECT HAMAS
SET SOFTSEEK ON
DBSEEK (SFLAG+SKD_WIL+SKD_PT1)
SET SOFTSEEK OFF
mPageNo := 0
kpageno := 0

DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL == FLAG+KD_WIL .AND. SKD_PT1 >= KD_PT .AND. SKD_PT2 <= KD_PT

IF baris>=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  && awal nomer
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1  && akhir nomer
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1   && akhir kode suplier
@ baris,72 PRINT LINE TO mkolom,72 penwidth  0.1 && invoice akhir
@ baris,130  PRINT LINE TO mkolom,130  PENWIDTH 0.1 && akhir keterangan
@ baris,165 PRINT LINE TO mkolom,165 PENWIDTH 0.1     &&kurs
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1       &&debet
@ baris,225 PRINT LINE TO mkolom,225 PENWIDTH 0.1       && kurs kredit
@ baris,255 PRINT LINE TO mkolom,255 PENWIDTH 0.1   && n<30 kredit
@ baris,290 PRINT LINE TO mkolom,290 PENWIDTH 0.1   && n<30 saldo
@ baris,317 PRINT LINE TO mkolom,317 PENWIDTH 0.1   && n<30 buki bayar
@ baris,343 PRINT LINE TO mkolom,343 PENWIDTH 0.1   && n<30 tgl bayar

@ baris,03 print line to baris,343 penwidth 0.1
baris += 5
@ baris,55 PRINT “Lanjut ke Halaman: “+LTRIM(STR(mPageNo))
baris := 50
mkolom := 48

END PRINTPAGE
START PRINTPAGE

ENDIF
kpageno := (kpageno/mpageno)

@ 08,280 PRINT “Tanggal Cetak : “+dtoc(DATE())
@ 15,280 PRINT “Page: “+LTRIM(STR(mPageNo))    //+” of “+ltrim(str(kpageno))     //RIGHT
@ 20,150 print “LAPORAN BUKU HUTANG” FONT “COURIER NEW” SIZE 18 BOLD CENTER
@ 30,135 print “For Periode : “+dtoc(xtanggal1)
@ 38,04  print line to 38,343 penwidth 0.2
@ 40,05  print ” NO.”
@ 40,15  print ” Kode Suplier ”
@ 40,45  print ” No. Invoice  ”
@ 40,73  print ” K e t e r a n g a n ”
@ 40,140 print ” Kurs Debet”
@ 40,175 print ” D E B E T  ”
@ 40,200 print ” Kurs Kredit”
@ 40,230 print ” K R E D I T”
@ 40,260 print ” S A L D O  ”
@ 40,290 print ” No. Payment”
@ 40,320 print ” Tgl. Payment”
@ 48,04  print line to 48,343 penwidth 0.2

&& cetak garis vertical u/ HEADER

@ 38,03 PRINT LINE TO 48,03 PENWIDTH 0.1             && 1
@ 38,13 PRINT LINE TO 48,13 PENWIDTH 0.1             && 2
@ 38,39 PRINT LINE TO 48,39 PENWIDTH 0.1             && 4
@ 38,72 PRINT LINE TO 48,72  PENWIDTH 0.1           && 5   && ending mana
@ 38,130 PRINT LINE TO 48,130 PENWIDTH 0.1           && 6    &&ending nama
@ 38,165 PRINT LINE TO 48,165 PENWIDTH 0.1           && 6    &&ending nama
@ 38,195 PRINT LINE TO 48,195 PENWIDTH 0.1
@ 38,225 PRINT LINE TO 48,225 PENWIDTH 0.1           && 7
@ 38,255 PRINT LINE TO 48,255 PENWIDTH 0.1           && 7
@ 38,290 PRINT LINE TO 48,290 PENWIDTH 0.1           && 7
@ 38,317 PRINT LINE TO 48,317 PENWIDTH 0.1           && 7
@ 38,343 PRINT LINE TO 48,343 PENWIDTH 0.1           && 7
&& 8 ENDING

ENDIF

SKD_PT := KD_PT
FL     := 0

SELECT SUPLIER
SEEK “S”+SKD_PT
SNM_PT := NM_WIL

SELECT HAMAS

DO WHILE .NOT. EOF() .AND. SFLAG+SKD_WIL+SKD_PT == FLAG+KD_WIL+KD_PT .AND. BARIS <= 189

IF TANGGAL <= XTANGGAL1
TYNM = “”
DO CASE
CASE TYPE = “K”
TYNM = “NOTA KREDIT”
CASE TYPE = “D”
TYNM = “Money Intransit ( Temporary )”
CASE TYPE = “F” .AND. TPTRAN = “K”
TYNM = “FAKTUR”
CASE TYPE = “G”
TYNM = “PEMBAYARAN GIRO”
CASE TYPE = “F” .AND. TPTRAN = “D”
TYNM = “RETUR”
CASE TYPE = “C”
TYNM = “PEMBAYARAN CASH     ”
CASE TYPE = “B”
TYNM = “PEMBAYARAN VIA BANK ”
ENDCASE

STGL      := TANGGAL
SKETERNG  := TYNM+SPACE(30-LEN(TYNM))

SELECT HAMAS
SNONOTA   := NONOTA
STPTRAN   := TPTRAN
STYPE     := TYPE
SMATA     := MATA
SKURS     := KURS
STAMOUNT  := JUMLAH +(PPN/100*JUMLAH)
KALI      := 0

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

IF TPTRAN  == “D”
SALDODB := STAMOUNT
SALDOKR := 0
SALDOII := SALDOII-(SALDODB*KALI)
SDEBET  := SDEBET+STAMOUNT
ELSE
SALDOKR := STAMOUNT
SALDODB := 0
SALDOII := SALDOII+(SALDOKR*KALI)
SKREDIT := SKREDIT+STAMOUNT
ENDIF

HIDET->(DBSEEK(SFLAG+STYPE+SKD_WIL+SKD_PT+SNONOTA))

SNOTRAN   := HIDET->NOTRAN
STGLBAYAR := HIDET->TANGGAL

SELECT HAMAS

shal := shal + 1
@ BARIS,05   PRINT Transform(shal,”9999″) SIZE 9
@ baris,18   print dtoc(stgl)
@ baris,45   print SUBSTR(snonota,1,30)
@ BARIS,75   PRINT SKETERNG
// @ BARIS,150  PRINT IF(SALDODB==0,” “,IIF(SMATA==”U”,”USD”,”Rp.”)) size 9 right
@ BARIS,160  PRINT IF(SALDODB==0,” “,TRANS(SKURS,”999,999.99″)) size 9 right
@ baris,190  print IF(SALDODB==0,SPACE(13)+”-“,TRANSFORM(SALDODB,”999,999,999.99″)) SIZE 9 RIGHT
// @ BARIS,210  PRINT IF(SALDOKR==0,” “,IIF(SMATA==”U”,”USD”,”Rp.”)) size 9 right
@ BARIS,220  PRINT IF(SALDOKR==0,” “,TRANS(SKURS,”999,999.99″)) size 9 right
@ BARIS,250  PRINT IF(SALDOKR==0,SPACE(13)+”-“,TRANSFORM(SALDOKR,”999,999,999.99″)) SIZE 9 RIGHT
@ BARIS,285  PRINT IF(SALDOII==0,SPACE(15)+”-“,TRANSFORM(SALDOII,”9,999,999,999.99″)) SIZE 9 RIGHT
@ BARIS,295  PRINT SNOTRAN SIZE 9
@ BARIS,320  PRINT DTOC(STGLBAYAR)

@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1  && awal nomer
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1  && akhir nomer
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1   && akhir kode suplier
@ baris,72 PRINT LINE TO mkolom,72 penwidth  0.1 && invoice akhir
@ baris,130  PRINT LINE TO mkolom,130  PENWIDTH 0.1 && akhir keterangan
@ baris,165 PRINT LINE TO mkolom,165 PENWIDTH 0.1     &&kurs
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1       &&debet
@ baris,225 PRINT LINE TO mkolom,225 PENWIDTH 0.1       && kurs kredit
@ baris,255 PRINT LINE TO mkolom,255 PENWIDTH 0.1   && n<30 kredit
@ baris,290 PRINT LINE TO mkolom,290 PENWIDTH 0.1   && n<30 saldo
@ baris,317 PRINT LINE TO mkolom,317 PENWIDTH 0.1   && n<30 buki bayar
@ baris,343 PRINT LINE TO mkolom,343 PENWIDTH 0.1   && n<30 tgl bayar
select hamas
baris := baris +5
ENDIF
SELECT HAMAS
SKIP
ENDDO
SELECT HAMAS
IF  EOF() .OR. .NOT. (SFLAG+SKD_WIL== FLAG+KD_WIL .AND. KD_PT >= SKD_PT1 .AND. KD_PT <= SKD_PT2)
@ baris,03 PRINT LINE TO mkolom,03 PENWIDTH 0.1  && awal nomer
@ baris,13 PRINT LINE TO mkolom,13 PENWIDTH 0.1  && akhir nomer
@ baris,39 PRINT LINE TO mkolom,39 PENWIDTH 0.1   && akhir kode suplier
@ baris,72 PRINT LINE TO mkolom,72 penwidth  0.1 && invoice akhir
@ baris,130  PRINT LINE TO mkolom,130  PENWIDTH 0.1 && akhir keterangan
@ baris,165 PRINT LINE TO mkolom,165 PENWIDTH 0.1     &&kurs
@ baris,195 PRINT LINE TO mkolom,195 PENWIDTH 0.1       &&debet
@ baris,225 PRINT LINE TO mkolom,225 PENWIDTH 0.1       && kurs kredit
@ baris,255 PRINT LINE TO mkolom,255 PENWIDTH 0.1   && n<30 kredit
@ baris,290 PRINT LINE TO mkolom,290 PENWIDTH 0.1   && n<30 saldo
@ baris,317 PRINT LINE TO mkolom,317 PENWIDTH 0.1   && n<30 buki bayar
@ baris,343 PRINT LINE TO mkolom,343 PENWIDTH 0.1   && n<30 tgl bayar

@ baris,04  print line to baris,343 penwidth 0.2
BARIS := BARIS + 5
@ BARIS, 20 PRINT ” DATA HABIS”
ENDIF

ENDDO
END PRINTPAGE
END PRINTDOC

RETURN Nil

 

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: