Delivery Order

SCREEN SHOOT DELIVERY ORDER

 

Coding yang digunakan untuk menghasilkan Delivery order <<<<<<<< seperti di atas adalah >>>>>>>>>>>>

 

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

procedure doprn

if !iswindowactive (doprn)

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

Define window doprn         ;
at 45,60                    ;
width 420                    ;
height 370                   ;
icon ‘d:\soalgui\bmp\demo.ico’;
title ‘PT.YOKATTA INDONESIA ‘ ;
on init openfiledoprn();
on release closefiledoprn();
child;
nomaximize;
NOMINIMIZE

DEFINE BKGBRUSH newBrush SOLID IN doprn COLOR BLUE

@ 30,30 frame bingkai1doprn ;
caption ‘Form cetak Delivery Order ‘ ;
width 350 ;
transparent ;
fontcolor {0,255,197};
height 250

@ 60,50 label snodo1_lbl  value  “No.DO      “;
font ” arial” size 12;
transparent ;
fontcolor { 0,255,197 }

@ 120,50 label snodo2_lbl  value  “No.DO      “;
font ” arial” size 12;
transparent ;
fontcolor { 0,255,197 };

@  60,150 btntextbox snodo1_txt font “arial” size 12;
width 150 ;
maxlength 15;
action snodo1();
on enter {snodo1()}

@ 120,150 btntextbox snodo2_txt font “arial” size 12;
width 150 ;
maxlength 15;
action snodo2();
on enter snodo2()

DEFINE IMAGE KUNCI1
ROW 230
COL 320
WIDTH 20
HEIGHT 30
PICTURE ‘D:\YOKATA\ICO\PRINT.ICO’
WHITEBACKGROUND .F.
ON CLICK { PRINTDOPRN() }
END IMAGE

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

end window
center window doprn
activate window doprn

endif

Return

PROCEDURE openfiledoprn

local skode      := “SJ”
local stptran    := “”

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

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+”INVTBL”,.F.)
SET INDEX TO (cDRV+”INVTBL”)
ELSE
RETURN
ENDIF

IF opentables(cDRV+”INTRAN2″,.F.)
SET INDEX TO (cDRV+”INTRAN2″),(cDRV+”INTRAN21″),(cDRV+”INTRAN23″),(cDRV+”INTRAN22″)
ELSE
RETURN
ENDIF

IF opentables(cDRV+”INTRAN1″,.F.)
SET INDEX TO (cDRV+”INTRAN1″),(cDRV+”INTRAN11″),(cDRV+”INTRAN12″),(cDRV+”INTRAN1R”),(cDRV+”INTRAN17″),(cDRV+”INTRAN13″),(cDRV+”INTRAN15″),(cDRV+”INTRAN1A”)
ELSE
RETURN
ENDIF

select intran1
intran1->(dbsetorder(1))
dbseek(skode)
RETURN

PROCEDURE closefiledoprn
close tblwmas
close tblcmas
close intran1
close intran2
close invtbl
dbcloseall()

RETURN

PROCEDURE metu_doprn

release window doprn

RETURN

procedure snodo1
do while .t.
codedo(“doprn”,”snodo1_txt”)
exit
enddo
return

procedure snodo2
do while .t.
codedo(“doprn”,”snodo2_txt”)
exit
enddo
return

Function codedo(cForm, cTextBtn)

Local cdo := “”

cdo := Getcodedo(Getproperty(cForm,cTextBtn,”Value”))
If !empty(cdo)
Setproperty(cForm,cTextBtn,”Value”,cdo)
EndIf

Return

Function Getcodedo(nValue)

Local cdo:= “”,nReg := 1
intran1->(dbsetorder(1))
set filter to intran1->kode == “SJ”

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 DELIVERY ORDER’ ;
MODAL NOSIZE

@300,5 frame pilih_doprn ;
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_doprn() };
on enter  {search_doprn() }

@ 5,5 BROWSE Browse_Faktur   ;
WIDTH 380               ;
HEIGHT 290              ;
HEADERS { ‘kode’ , ‘Nomer Faktur’,’Tanggal’,’Mata’ } ;
WIDTHS { 50 ,140,100,50 } ;
WORKAREA intran1 ;
FIELDS { ‘intran1->kode’,’intran1->nonota’,’intran1->tanggal’,’intran1->mata’} ;
VALUE nReg ;
READONLY {.t.,.t.,.t.} ;
Justify {BROWSE_JTFY_LEFT , BROWSE_JTFY_CENTER} ;
ON DBLCLICK ( cdo:=intran1->NONOTA,ThisWindow.Release ) ;
TOOLTIP “Pilihlah Nomer Faktur yang anda inginkan ”

ON KEY ESCAPE ACTION ThisWindow.Release
END WINDOW

CENTER WINDOW Form_faktur

ACTIVATE WINDOW Form_faktur

Return cdo

function  search_doprn

local cCarifak:= (“SJ”+AllTrim(form_faktur.cnonotafak_txt.value))
local nPanjang := len(cCarifak)

select intran1
set order to 1
dbselectarea(“intran1”)
dbseek(cCarifak)

If found()

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

EndIf
Return

Function PRINTDOPRN()

Local SKODE    := “SJ”
Local CSETUJU :=”   ”
Local CJABATAN:=” D i r e k t u r  ”
Local snodo1 := doprn.snodo1_txt.value
Local snodo2 := doprn.snodo2_txt.value
Local HAL:=KEYPRESS:=TSLDEBET:=TSLKREDIT:=TMTDEBET:=TMTKREDIT:=TBLDEBET:=TBLKREDIT:=0
Local MTDEBET:=MTKREDIT:=SLDEBET:=SLKREDIT:=BLDEBET:=BLKREDIT:=0
Local tnrk:=tnrd:=trlk:=trld:=tsld:=tslk:=0
Local i, nCOPIES, lijn, periode, shal,mPageNo , sjumlah
Local cPrinter, bladnum

GTOT         := 0
gtotbetaald  := 0
gtotopen     := 0
sjumlah      := 0
baris := 54
shal  := 0
nCOPIES :=1
mkolom  := 54

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 “FPRN”
START PRINTPAGE

SELECT INTRAN1
SET SOFTSEEK ON
SEEK SKODE+snodo1
SET SOFTSEEK OFF
//  PAPERSIZE   PRINTER_PAPER_LETTER ;

mPageNo:=0
kpageno := 0

do while .not. eof()  .and. skode == kode .and. ;
nonota >= snodo1 .and. nonota <= snodo2

SELECT INTRAN1
SNONOTA    := NONOTA
SORDER     := ORDER
SMATA      := MATA
SKURS      := KURS
STGL_ORDER := TGL_ORDER
SSRJLN     := SRJLN
SKD_WIL    := KD_WIL
STGL_SRJLN := TGL_SRJLN
STANGGAL   := TANGGAL
STHN   := SUBSTR(DTOS(STANGGAL),1,4)
SBULAN := SUBSTR(DTOS(STANGGAL),5,2)
STGL   := SUBSTR(DTOS(STANGGAL),7,2)
SKD_PT     := KD_PT
SPOCUST    := POCUST

SELECT TBLCMAS
DBSEEK(“L”+SKD_WIL+SKD_PT)
SKETERNG   := TBLCMAS->NM_PT  && NAMA PERUSAHAAN
SKETERNG1  := TBLCMAS->ALAMAT1
SKETERNG2  := TBLCMAS->ALAMAT2
SKETERNG3  := TBLCMAS->ALAMAT3  && NAMA ATAU ATTN
SKETERNG4  := TBLCMAS->ALAMAT4
SKETERNG5  := TBLCMAS->ALAMAT5
SALAMATL   := TBLCMAS->ALAMATL  && PHONE
SSUB_MAP   := TBLCMAS->SUB_MAP
SNPWP      := TBLCMAS->NPWP

SELECT INTRAN1
STERM      := TERM
SSALES     := SALES
SJTEMPO    := JTEMPO
SDISC      := DISC
STIME      := TIME()
SDATE      := DATE()
SPPN       := PPN

SELECT TBLWMAS
SEEK  “W”+SKD_WIL
SNM_WIL := NM_WIL

SEEK “M”+SSALES
SNMSALES := NM_WIL

IF SPPN = 10

@ 03,10  PRINT “PT.YOKATTA INDONESIA ” FONT “COURIER NEW” SIZE 15 bold Underline
@ 09,10  PRINT “RUBBER PARTMANUFACTURING ” FONT “COURIER NEW” SIZE 8 bold
@ 12,10  PRINT “OFFICE : Jl. Industri Selatan XI Blok EE No. 10i Jababeka II” size 8
@ 15,10  print “Telp   : (021) 898-41411” size 8
@ 18,10  print “Fax    : (021) 898-41412″ size 8
@ 09,133 print RECTANGLE TO  23,192  penwidth 0.1 ROUNDED
@ 12,135 print ” DELIVERY ORDER ” FONT “COURIER NEW” SIZE 16 BOLD
@ 18,144 print  SNONOTA  FONT “COURIER NEW” SIZE 12 BOLD

@ 27,10 print RECTANGLE TO  45,90   penwidth 0.1 ROUNDED
@ 30,12 print “Company Name : ”  FONT “COURIER NEW” SIZE 8
@ 30,37 print sketerng  FONT “COURIER NEW” SIZE 8
@ 36,12 print “Attn         : ”  FONT “COURIER NEW” SIZE 8
@ 36,37 print sketerng3 FONT “COURIER NEW” SIZE 8

&& Tampilan Order

@ 27,120 print RECTANGLE TO  45,200  penwidth 0.1 ROUNDED
@ 30,122 print “Order Nomer      : ”  FONT “COURIER NEW” SIZE 8
@ 30,155 print sorder  FONT “COURIER NEW” SIZE 8
@ 33,122 print “Order Date       : ” FONT “COURIER NEW” SIZE 8
@ 33,155 print stgl_order FONT “COURIER NEW” SIZE 8
@ 36,122 print “Term of Payment  :” FONT “COURIER NEW” SIZE 8
@ 36,153 print trans(sterm,”999″)+” Hari” FONT “COURIER NEW” SIZE 8
@ 39,122 print “Tanggal Delivery :” FONT “COURIER NEW” SIZE 8
@ 39,155 print stanggal FONT “COURIER NEW” SIZE 8

&& Judul Halaman
@ 48,10 print RECTANGLE TO 56,200  penwidth 0.1 ROUNDED
@ 57,10 print RECTANGLE TO  85,200  penwidth 0.1 ROUNDED

@ 49,12  print ” NO.” FONT “COURIER NEW” SIZE 8
@ 49,20  print ” D E S C R I P T I O N ” FONT “COURIER NEW” SIZE 8
@ 49,80  print ” PRODUCT  NO  ” FONT “COURIER NEW” SIZE 8
@ 49,110 print ” QUANTITY ” FONT “COURIER NEW” SIZE 8
@ 49,130 print ” S A T U A N “FONT “COURIER NEW” SIZE 8
@ 49,170 print ” KETERANGAN  “FONT “COURIER NEW” SIZE 8

&& cetak garis vertical
@ 48, 18 PRINT LINE TO  85,18 PENWIDTH 0.1
@ 48, 78 PRINT LINE TO  85,78 PENWIDTH 0.1
@ 48,108 PRINT LINE TO  85,108 PENWIDTH 0.1
@ 48,128 PRINT LINE TO  85,128 PENWIDTH 0.1
@ 48,158 PRINT LINE TO  85,158 PENWIDTH 0.1
ELSE
@ 03,10  PRINT “PT.  Y.  K.  I. ” FONT “COURIER NEW” SIZE 15 bold Underline
@ 09,133 print RECTANGLE TO  23,192  penwidth 0.1 ROUNDED
@ 12,135 print ” DELIVERY ORDER ” FONT “COURIER NEW” SIZE 16 BOLD
@ 18,144 print  SNONOTA  FONT “COURIER NEW” SIZE 12 BOLD

@ 27,10 print RECTANGLE TO  45,90   penwidth 0.1 ROUNDED
@ 30,12 print “Company Name : ”  FONT “COURIER NEW” SIZE 8
@ 30,37 print sketerng  FONT “COURIER NEW” SIZE 8
@ 36,12 print “Attn         : ”  FONT “COURIER NEW” SIZE 8
@ 36,37 print sketerng3 FONT “COURIER NEW” SIZE 8

&& Tampilan Order

@ 27,120 print RECTANGLE TO  45,200  penwidth 0.1 ROUNDED
@ 30,122 print “Order Nomer      : ”  FONT “COURIER NEW” SIZE 8
@ 30,155 print sorder  FONT “COURIER NEW” SIZE 8
@ 33,122 print “Order Date       : ” FONT “COURIER NEW” SIZE 8
@ 33,155 print stgl_order FONT “COURIER NEW” SIZE 8
@ 36,122 print “Term of Payment  :” FONT “COURIER NEW” SIZE 8
@ 36,153 print trans(sterm,”999″)+” Hari” FONT “COURIER NEW” SIZE 8
@ 39,122 print “Tanggal Delivery :” FONT “COURIER NEW” SIZE 8
@ 39,155 print stanggal FONT “COURIER NEW” SIZE 8

&& Judul Halaman
@ 48,10 print RECTANGLE TO 56,200  penwidth 0.1 ROUNDED
@ 57,10 print RECTANGLE TO  85,200  penwidth 0.1 ROUNDED

@ 49,12  print ” NO.” FONT “COURIER NEW” SIZE 8
@ 49,20  print ” D E S C R I P T I O N ” FONT “COURIER NEW” SIZE 8
@ 49,80  print ” PRODUCT  NO  ” FONT “COURIER NEW” SIZE 8
@ 49,110 print ” QUANTITY ” FONT “COURIER NEW” SIZE 8
@ 49,130 print ” S A T U A N “FONT “COURIER NEW” SIZE 8
@ 49,170 print ” KETERANGAN  “FONT “COURIER NEW” SIZE 8

&& cetak garis vertical
@ 48, 18 PRINT LINE TO  85,18 PENWIDTH 0.1
@ 48, 78 PRINT LINE TO  85,78 PENWIDTH 0.1
@ 48,108 PRINT LINE TO  85,108 PENWIDTH 0.1
@ 48,128 PRINT LINE TO  85,128 PENWIDTH 0.1
@ 48,158 PRINT LINE TO  85,158 PENWIDTH 0.1

ENDIF

SELECT INTRAN2
SEEK SKODE+SNONOTA
DO WHILE .NOT. EOF() .AND. SKODE+SNONOTA == KODE+NONOTA
SKDBRG  := KDBRG
SHARGA  := STR(HARGA,14,4)
IF VAL(SHARGA) == 0
SBONUS := ” Bonus Penjualan”
ELSE
SBONUS := ”                ”
ENDIF

SQUANTK := QUANTK-QUANTKR
SQUANTP := QUANTP-QUANTPR
SLOT    := SUBSTR(LOT,1,10)
SKORT   := KORT   // IIF(KORT>100,HARGA/KORT,KORT)
XKORT   := IIF(KORT>100,KORT,VAL(SHARGA)*(KORT/100))
SELECT INVTBL
SEEK SKDBRG
SNMBRG    := NMBRG
SSATUAN   := SATUAN
SKEMASAN  := KEMASAN
SPACK2    := PACK2
SNOPROD   := NOPROD

SELECT INTRAN2
SQTY    := SQUANTK*SPACK2+SQUANTP
XHARGA  := VAL(SHARGA)-KORT
STOTAL  := XHARGA*SQTY
SJUMLAH := SJUMLAH + STOTAL

shal := shal + 1
BARIS := BARIS + 4
LTEM := .F.

IF BARIS >= 84 .AND. SKODE+SNONOTA == KODE+NONOTA
LTEM := .T.
BARIS := 54
@ 03,10  PRINT “PT.YOKATTA INDONESIA ” FONT “COURIER NEW” SIZE 15 bold Underline
@ 09,10  PRINT “RUBBER PARTMANUFACTURING ” FONT “COURIER NEW” SIZE 8 bold
@ 12,10  PRINT “OFFICE : Jl. Industri Selatan XI Blok EE No. 10i Jababeka II” size 8
@ 15,10  print “Telp   : (021) 898-41411” size 8
@ 18,10  print “Fax    : (021) 898-41412″ size 8
@ 09,133 print RECTANGLE TO  23,192  penwidth 0.1 ROUNDED
@ 12,135 print ” DELIVERY ORDER ” FONT “COURIER NEW” SIZE 16 BOLD
@ 18,144 print  SNONOTA  FONT “COURIER NEW” SIZE 12 BOLD

@ 27,10 print RECTANGLE TO  45,90   penwidth 0.1 ROUNDED
@ 30,12 print “Company Name : ”  FONT “COURIER NEW” SIZE 8
@ 30,37 print sketerng  FONT “COURIER NEW” SIZE 8
@ 36,12 print “Attn         : ”  FONT “COURIER NEW” SIZE 8
@ 36,37 print sketerng3 FONT “COURIER NEW” SIZE 8

&& Tampilan Order

@ 27,120 print RECTANGLE TO  45,200  penwidth 0.1 ROUNDED
@ 30,122 print “Order Nomer      : ”  FONT “COURIER NEW” SIZE 8
@ 30,155 print sorder  FONT “COURIER NEW” SIZE 8
@ 33,122 print “Order Date       : ” FONT “COURIER NEW” SIZE 8
@ 33,155 print stgl_order FONT “COURIER NEW” SIZE 8
@ 36,122 print “Term of Payment  :” FONT “COURIER NEW” SIZE 8
@ 36,153 print trans(sterm,”999″)+” Hari” FONT “COURIER NEW” SIZE 8
@ 39,122 print “Tanggal Delivery :” FONT “COURIER NEW” SIZE 8
@ 39,155 print stanggal FONT “COURIER NEW” SIZE 8

&& Judul Halaman
@ 48,10 print RECTANGLE TO 56,200  penwidth 0.1 ROUNDED
@ 57,10 print RECTANGLE TO  85,200  penwidth 0.1 ROUNDED

@ 49,12  print ” NO.” FONT “COURIER NEW” SIZE 8
@ 49,20  print ” D E S C R I P T I O N ” FONT “COURIER NEW” SIZE 8
@ 49,80  print ” PRODUCT  NO  ” FONT “COURIER NEW” SIZE 8
@ 49,110 print ” QUANTITY ” FONT “COURIER NEW” SIZE 8
@ 49,130 print ” S A T U A N “FONT “COURIER NEW” SIZE 8
@ 49,170 print ” KETERANGAN  “FONT “COURIER NEW” SIZE 8

ENDIF

@ BARIS,12  PRINT LTRIM(STR(SHAL)) FONT “COURIER NEW” SIZE 8
@ baris,20  print snmbrg   FONT “COURIER NEW” SIZE 8
@ baris,82  print snoprod  FONT “COURIER NEW” SIZE 8
@ baris,105 print Transform(sqty,”9,999,999″) FONT “COURIER NEW” SIZE 8
@ baris,140 print ssatuan  FONT “COURIER NEW” SIZE 8
@ baris,170 print slot  FONT “COURIER NEW” SIZE 8

SELECT INTRAN2
DbSkip()
ENDDO

XST := SJUMLAH-SDISC
XPPN:= (SPPN/100)*XST
XTTL:= XST+XPPN
DO WHILE BARIS < 88   &&153
@ BARIS,1 PRINT “”
baris++
ENDDO
MKOLOM := 106
@ baris,128 print line to baris,190 penwidth 0.1
@ baris, 20 print ”   Diterima        ”   FONT “COURIER NEW” SIZE 8
@ baris,128 print  ”   Diketahui           Dibuat oleh    ”  FONT “COURIER NEW” SIZE 8
@ baris,128 PRINT LINE TO mkolom,128 PENWIDTH 0.1
@ baris,158 PRINT LINE TO mkolom,158 PENWIDTH 0.1
@ baris,190 PRINT LINE TO mkolom,190 PENWIDTH 0.1
baris := baris + 15
@ baris, 20 print ” { …………. } ”   FONT “COURIER NEW” SIZE 8
@BARIS, 128 PRINT ”   Toni Y.P             Dessy P. S     ”  FONT “COURIER NEW” SIZE 8
baris := baris + 3
@ baris,128 print line to baris,190 penwidth 0.1

IF SKODE+SNONOTA <> KODE+NONOTA
BARIS   := 55
SHAL    :=  0
SJUMLAH :=  0
END PRINTPAGE
START PRINTPAGE
ENDIF

SELECT INTRAN1
DbSkip()
ENDDO

END PRINTPAGE
END PRINTDOC

RETURN Nil

2 Tanggapan

  1. Mas Supriadi yang ganteng,

    utk cetak header, informasi perusahaan masukin array aja, contoh:

    if sppn=10
    aCompanyInfo:={namapt,alamat,telpon, dstt……}
    else
    aCompanyInfo:={namapt,alamat,telpon, dstt……}
    endif
    && cetak header
    @ ….. PRINT aCompanyInfo[1] FONT dst……

    && tampilan order
    @ ….. PRINT ……dst…..

    jadi codingnya akan lebih pendek dan lebih mudah ditelusuri jika perlu perubahan……

    kalau bisa, hindari pemakaian text yg berulang2,
    misalnya pada statement:
    @ 49,12 print ” NO.” FONT “COURIER NEW” SIZE 8
    bisa ngak diganti dengan:
    cFontName:=”COURIER NEW”
    nFontSize:=8
    @ 49,12 PRINT ” NO.” FONT cFontName SIZE nFontSize
    @ 49,20 PRINT …… FONT cFontName dst…….

    gunanya apa donk? kalau mau ganti font kan jadi gampang, tinggal ubah di cFontName/nFontSize aja.

    • Suhu JD Liang

      Makasih banyak ko , sengaja saya upload biar ada koreksi dari para suhu
      Iya ko , harus disimpan dalam satu variabel untuk jenis font dan size fontnya supaya pada waktu ada perubahan gampang dan array yg ko liang sarankan segera saya LAKSANAKAAANNN !!! , Makasih ko dan jangan2 malu malu untuk transfer ilmu ke saya ya ko😀

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: