Outstanding Order

Oustanding order Report merupakan informasi yg sangat diperlukan bagian Customer Support dan PPIC ( Planing Product Inventory Control )
Screen Shoot dan coding minigui dibawah ini:

Dan CODINGNYA ADALAH :

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

procedure orsal()

if !iswindowactive (orsal)

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

Define window orsal ;
at 30,30 ;
Width 650 ;
Height 460 ;
on init bukaorsal();
ON RELEASE dbcloseall();
child ;
nomaximize;
NOMINIMIZE

@ 20,30 frame rptgl1;
caption “Outstanding Order Report “;
width 570 ;
height 370 ;
transparent

DEFINE IMAGE jos
ROW 60
COL 15
WIDTH 200
HEIGHT 480
PICTURE ‘D:\ani-free.gif’
END IMAGE

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

@ 140,50 label stgl2_lbl Value ‘Tanggal ‘;
font “arial” size 12 ;
width 250 ;
height 30 ;
transparent

define datepicker stanggal1
row 100
col 200

end datepicker

define datepicker stanggal2
row 140
col 200

end datepicker

@ 220,400 frame orsal;
caption “pilihan proses cetak”;
width 160 ;
height 150 ;
transparent

DEFINE IMAGE orsal1
ROW 250
COL 420
WIDTH 20
HEIGHT 30
PICTURE ‘D:\YOKATA\ICO\PRINT.ICO’
WHITEBACKGROUND .F.
ON CLICK { orsalcetak() }
END IMAGE

DEFINE IMAGE orsal2
ROW 300
COL 420
WIDTH 20
HEIGHT 30
PICTURE ‘D:\YOKATA\ICO\EXCEL16.BMP’
WHITEBACKGROUND .t.

END IMAGE

@ 250,460 buttonex KUNCI;
caption ‘Ceta&k Data ‘;
height 30 ;
width 80 ;
BACKCOLOR {128,255,0};
on click { orsalcetak() }

@ 300,460 buttonex CETAK;
caption ‘Exsport &XLS ‘;
height 30 ;
BACKCOLOR {128,128,0};
width 80

end window

center window orsal
activate window orsal

Endif
return nil

PROCEDURE bukaorsal

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

IF opentables(cDRV+”GLTBL”,.F.)
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”)
ELSE
RETURN
ENDIF

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

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

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

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

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

RETURN

function orsalcetak()

Local nday := Day(orsal.stanggal1.value)
Local nmonth := Month(orsal.stanggal1.value)
Local nyear := Year(orsal.stanggal1.value)

Local SKODE := “OP”
Local SKD_WIL := “10”
Local SFLAG := “L”

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

Local cNamapt := gltbl->Namapt
Local cAlamat1 := gltbl->Alamat1
Local cAlamat2 := gltbl->Alamat2
Local cHeader := “OUTSTANDING ORDER REPORT”

sbln := strzero(nmonth,2)
xtanggal1 := orsal.stanggal1.value
xtanggal2 := orsal.stanggal2.value

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

cPrinter := GetPrinter()
If Empty (cPrinter)
Return
EndIf

SELECT PRINTER cPrinter ;
ORIENTATION PRINTER_ORIENT_LANDSCAPE ;
PAPERSIZE PRINTER_PAPER_A4 ;
COPIES nCOPIES ;
QUALITY PRINTER_RES_HIGH;
PREVIEW

START PRINTDOC NAME “orsal”
START PRINTPAGE

TSKIRIMK:=TSKIRIMP:=SW:=TJUMLAH:=XJUMLAH:=SSAT1:=SSAT2:=SSAT3:=SSAT4:=I:=0

SELECT INTRAN1
SET SOFTSEEK ON
SEEK SKODE+SKD_WIL+DTOS(xTANGGAL1)
SET SOFTSEEK OFF

mPageNo := 0
kpageno := 0

DO WHILE .NOT. EOF() .AND. SKODE+SKD_WIL == KODE+KD_WIL .AND. TANGGAL >= XTANGGAL1 .AND. TANGGAL =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,58 PRINT LINE TO mkolom,58 PENWIDTH 0.1 &&nonota
@ baris,115 PRINT LINE TO mkolom,115 PENWIDTH 0.1 &&term
@ baris,175 PRINT LINE TO mkolom,175 PENWIDTH 0.1 &&tanggal
@ baris,200 PRINT LINE TO mkolom,200 PENWIDTH 0.1 &&AWAL ENDING
@ baris,230 PRINT LINE TO mkolom,230 PENWIDTH 0.1 &&AWAL ENDING
@ baris,260 PRINT LINE TO mkolom,260 PENWIDTH 0.1 &&AWAL ENDING

//Baris +=5
@ baris,03 print line to baris,260 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,240 PRINT “Tanggal Cetak : “+dtoc(DATE())
@ 15,240 PRINT “Page: “+LTRIM(STR(mPageNo)) //+” of “+ltrim(str(kpageno)) //RIGHT
@ 10,15 PRINT cNamapt size 8 Bold
@ 15,15 PRINT cAlamat1 size 6
@ 18,15 PRINT cAlamat2 size 6
@ 25,90 print cHeader FONT “COURIER NEW” SIZE 18 BOLD
@ 35,100 print “For Periode : “+dtoc(xtanggal1)+” S/D “+ DTOC(XTANGGAL2)

&& Header Judul

@ 42,04 print line to 42,260 penwidth 0.2

@ 45,05 print ” NO.”
@ 45,15 print ” Nomer Order”
@ 45,40 print ” Tanggal ”
@ 50,40 print ” P O ”
@ 45,70 print ” Nama Customer”
@ 45,120 print ” Nama Barang ”
@ 45,180 print ” Jumlah ”
@ 50,180 print ” Order ”
@ 45,210 Print ” Jumlah ”
@ 50,210 print ” Kirim ”
@ 45,240 Print ” Saldo ”
@ 50,240 Print ” Order ”

@ 54,04 print line to 54,260 penwidth 0.2

&& cetak garis vertical u/ HEADER

@ 42,03 PRINT LINE TO 54,03 PENWIDTH 0.1 && 1 && awal
@ 42,13 PRINT LINE TO 54,13 PENWIDTH 0.1 && 2 && akhir nomer
@ 42,39 PRINT LINE TO 54,39 PENWIDTH 0.1 && 3 && akhir lpb
@ 42,58 PRINT LINE TO 54,58 PENWIDTH 0.1 && 4 && akhir tgl
@ 42,115 PRINT LINE TO 54,115 PENWIDTH 0.1 && customer5 && ending PO
@ 42,175 PRINT LINE TO 54,175 PENWIDTH 0.1 && 6 && ending nama suplier
@ 42,200 PRINT LINE TO 54,200 PENWIDTH 0.1 && 6 && ending nama suplier
@ 42,230 PRINT LINE TO 54,230 PENWIDTH 0.1 && 6 && ending nama suplier
@ 42,260 PRINT LINE TO 54,260 PENWIDTH 0.1 && 6 && ending nama suplier
&& 8 ENDING

ENDIF

FL1 := 0
// BARIS := 55

DO WHILE !EOF() .AND. SKODE+SKD_WIL == KODE+KD_WIL .AND. BARIS = XTANGGAL1 .AND. TANGGAL (DBSEEK(“L”+SKD_WIL+SKD_PT)),TBLCMAS->NM_PT),1,25)
SNMSALES := SUBSTR((TBLWMAS->(DBSEEK(“M”+SSALES)),TBLWMAS->NM_WIL),1,10)

FL :=0

SELECT INTRAN2
IF SW == 0
SEEK SKODE+SNONOTA
ENDIF

DO WHILE .NOT. EOF() .AND. SKODE+SNONOTA == KODE+NONOTA // .AND. BARIS (DBSEEK(SKDBRG),INVTBL->NMBRG)
SKEMASAN := INVTBL->(DBSEEK(SKDBRG),INVTBL->KEMASAN)
SSATUAN := INVTBL->(DBSEEK(SKDBRG),INVTBL->SATUAN)
SPACK2 := INVTBL->(DBSEEK(SKDBRG),INVTBL->PACK2)
SQUANTK := QUANTK
SQUANTP := QUANTP
SHARGA := HARGA
SMATA := MATA
SJENIS := JENIS
NHARGA := INTRAN2->HARGA

IF SMATA “I”

STGLKU := TANGGAL
SBUL := SUBSTR(DTOS(STGLKU),5,2)
STAH := SUBSTR(DTOS(STGLKU),1,4)
sHR := VAL(substr(dtos(STGLKU),7,2))
SELECT KURS
DBSEEK(SBUL+STAH)
IF !FOUND()
ALERT(“KURS TIDAK ADA DI TABEL!”)
LOOP
//CLOSE ALL
//RETURN
ENDIF
NKURSX := 0

DO CASE
CASE STGLKU>=KURS->TGL1A .AND. STGLKUTGL1B
NKURSX := KURS->mINGGU1
CASE STGLKU>=KURS->TGL2A .AND. STGLKUTGL2B
NKURSX := KURS->mINGGU2
CASE STGLKU>=KURS->TGL2A .AND. STGLKUTGL3B
NKURSX := KURS->mINGGU3
CASE STGLKU>=KURS->TGL4A .AND. STGLKUTGL4B
NKURSX := KURS->mINGGU4
CASE STGLKU>=KURS->TGL5A .AND. STGLKUTGL5B
NKURSX := KURS->mINGGU5
ENDCASE

XHARGA := IIF(SMATA==”U”,NHARGA*NKURSX,NHARGA)

IF SJENIS = 1
SJUMLAH := (SQUANTK*XHARGA)+(SQUANTP *(XHARGA/SPACK2))
ELSE
SJUMLAH := (SQUANTK*SPACK2*XHARGA)+(SQUANTP *XHARGA)
ENDIF

DDISC := IIF((SDISC)<100,((SDISC)*SJUMLAH/100),(SDISC))
DPPN := (SJUMLAH-DDISC)*((SPPN/100))
SJUMLAH := SJUMLAH-DDISC+DPPN

XJUMLAH := XJUMLAH + SJUMLAH
TJUMLAH := TJUMLAH + SJUMLAH

ELSE

XHARGA := NHARGA
IF JENIS == 1
SJUMLAH := (SQUANTK*XHARGA)+(SQUANTP *(XHARGA/SPACK2))
ELSE
SJUMLAH := (SQUANTK*SPACK2*XHARGA)+(SQUANTP *XHARGA)
ENDIF

DDISC := IIF((SDISC) 1
SJUMLAH := TJUMLAH
BARIS := BARIS + 5
// @ baris,308 print line to baris,348 penwidth 0.1
//@ BARIS, 285 PRINT “SUBTOTAL ”
// @ baris, 340 print IF(SJUMLAH==0,SPACE(13)+”-“,TRANSFORM(SJUMLAH,”99,999,999,999.99”)) SIZE 7 RIGHT
// BARIS := BARIS + 5
// @ baris,308 print line to baris,348 penwidth 0.1
ENDIF
SW :=I:=TJUMLAH:= 0
SELECT INTRAN1
DbSkip()
ENDIF
SELECT INTRAN1
ENDDO
SELECT INTRAN1
IF EOF() .OR. .NOT. (SKODE+SKD_WIL== KODE+KD_WIL .AND. TANGGAL>= xTANGGAL1 .AND. TANGGAL<= xTANGGAL2)

@ 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,58 PRINT LINE TO mkolom,58 PENWIDTH 0.1 &&nonota
@ baris,88 PRINT LINE TO mkolom,88 PENWIDTH 0.1 &&term
@ baris,138 PRINT LINE TO mkolom,138 PENWIDTH 0.1 &&tanggal
@ baris,190 PRINT LINE TO mkolom,190 PENWIDTH 0.1 &&AWAL ENDING
@ baris,215 PRINT LINE TO mkolom,215 PENWIDTH 0.1 && n<30 AWAL
@ baris,245 PRINT LINE TO mkolom,245 PENWIDTH 0.1 && n<30 AWAL
@ baris,273 PRINT LINE TO mkolom,273 PENWIDTH 0.1 && n<30 AWAL
@ baris,308 PRINT LINE TO mkolom,308 PENWIDTH 0.1 && n<30 AWAL
@ baris,348 PRINT LINE TO mkolom,348 PENWIDTH 0.1 && n<30 AWAL

@ Baris,04 print line to baris,348 penwidth 0.2

IF .NOT. XJUMLAH == 0
SJUMLAH := XJUMLAH
//@ baris,308 print line to baris,348 penwidth 0.1
//@ baris,308 PRINT LINE TO mkolom,308 PENWIDTH 0.1 && n<30 AWAL
//@ baris,348 PRINT LINE TO mkolom,348 PENWIDTH 0.1 && n<30 AWAL
//BARIS := baris + 5
//@ BARIS, 285 PRINT "T O T A L "
//@ baris, 340 print IF(SJUMLAH==0,SPACE(13)+"-",TRANSFORM(SJUMLAH,"99,999,999,999.99")) SIZE 7 RIGHT
//BARIS := baris + 5
//@ baris,308 print line to baris,348 penwidth 0.1
ENDIF
ENDIF
ENDDO

END PRINTPAGE
END PRINTDOC

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: