Transaksi One To Many

750 views

Published on

Materi Transaksi One To Many Foxpro 9.0

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
750
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
45
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transaksi One To Many

  1. 1. FOXPRO VSC/SHN TRANSAKSI2 ONE TO MANY Buat Tabel : Transaksi2 NAME TYPE WIDTH KET NO_FAKTUR C 10 PRIMARY TGL DATE 8 JCUS C 30 KD_PLG C 5 REGULAR TOTALJUMBEL N 10 TOTALJUMHA N 10 Buat Tabel : Sementara NAME TYPE WIDTH KET KD_BRG C 5 NM_BRG C 30 HRG_BRG N 10 JUMBEL N 10 JUMHA N 10 DESAIN FORM 1
  2. 2. FOXPRO VSC/SHN LISTING PROGRAM Form_______________________load CLOSE ALL SET DEFAULT TO quot;c:/LAB SORE/120123456quot; *sesuaikan path penyimpanan SELECT 1 USE barang SET ORDER TO tag kd_brg SELECT 2 USE pelanggan SET ORDER to tag kd_plg SELECT 3 USE transaksi2 SET ORDER TO tag no_faktur *menset index di tabel transaksi2 SET RELATION TO kd_plg INTO pelanggan additive *additive digunakan utk membaca lebih dari satu tabel SELECT 4 USE sementara SELECT 4 DELETE ALL PACK PUBLIC totalk, total as Currency PUBLIC jbk,jb as numeric totalk=0 jbk=0 *bersifat umum dapat digunakan dibeberapa sub form______________________aktif thisform.no_faktur.Enabled = .T. thisform.optiongroup1.option1.Enabled = .T. thisform.optiongroup1.option2.Enabled = .T. thisform.kd_plg.Enabled = .T. thisform.nm_plg.Enabled = .T. thisform.alamat.Enabled = .T. thisform.tel.Enabled= .T. thisform.kd_brg.Enabled = .T. thisform.jumbel.Enabled = .T. 2
  3. 3. FOXPRO VSC/SHN form_________________________nonaktif thisform.no_faktur.Enabled = .f. thisform.tgl.Enabled = .F. thisform.optiongroup1.option1.Enabled = .f. thisform.optiongroup1.option2.Enabled = .f. thisform.kd_plg.Enabled = .f. thisform.nm_plg.Enabled = .f. thisform.alamat.Enabled = .f. thisform.tel.Enabled= .f. thisform.kd_brg.Enabled = .f. thisform.nm_brg.Enabled = .f. thisform.hrg_brg.Enabled = .f. thisform.jumbel.Enabled = .f. thisform.jumha.Enabled = .F. thisform.toba.Enabled = .F. form___________________________bersih thisform.no_faktur.Value=quot;quot; thisform.optiongroup1.option1.Value =0 thisform.optiongroup1.option2.Value =0 thisform.kd_plg.Value=quot;quot; thisform.nm_plg.Value=quot;quot; thisform.alamat.Value=quot;quot; thisform.tel.Value=quot;quot; thisform.kd_brg.Value=quot;quot; thisform.nm_brg.Value=quot;quot; thisform.hrg_brg.Value=quot;quot; thisform.jumbel.Value=quot;quot; thisform.jumha.Value=quot;quot; thisform.totaljuMBEL.Value=quot;quot; thisform.totaljumhar.Value=quot;quot; thisform.toba.Value=quot;quot; form______________________________activate thisform.bersih thisform.nonaktif thisform.cmdadd.SetFocus () SET DATE TO british SET CENTURY on SELECT 4 DELETE ALL PACK thisform.grid1.Refresh thisform.grid1.RecordSource=quot;sementaraquot; 3
  4. 4. FOXPRO VSC/SHN option1_______________________click thisform.optiongroup1.option2.Enabled = .F. THISFORM.kd_plg.SetFocus Option2_______________________click thisform.optiongroup1.option1.Enabled = .F. thisform.kd_plg.Enabled = .F. thisform.nm_plg.Enabled = .F. thisform.alamat.Enabled= .F. thisform.tel.Enabled = .F. thisform.kd_brg.SetFocus kd_plg_________________________keypress LPARAMETERS nKeyCode, nShiftAltCtrl SELECT 2 SET ORDER to tag kd_plg IF NKEYCODE=13 THEN IF SEEK(TRIM(thisform.kd_plg.Value)) thisform.nm_plg.Value=nm_plg thisform.alamat.Value=alamat thisform.tel.Value=telepon thisform.nm_plg.Enabled = .F. thisform.alamat.Enabled= .F. thisform.tel.Enabled = .F. thisform.kd_brg.SetFocus() ELSE MESSAGEBOX(quot;Kode Tidak Adaquot;,64,quot;Pesanquot;) thisform.kd_plg.Value=quot;quot; thisform.kd_plg.SetFocus() thisform.nm_plg.Enabled = .F. thisform.alamat.Enabled= .F. thisform.tel.Enabled = .F. ENDIF ENDIF Kd_brg_________________________Click SELECT 1 IF SEEK(ALLTRIM(thisform.kd_brg.Value))then thisform.nm_brg.Value=nm_brg thisform.hrg_brg.Value=hrg_satuan thisform.jumbel.SetFocus ENDIF 4
  5. 5. FOXPRO VSC/SHN Jumbel_____________________________keypress LPARAMETERS nKeyCode, nShiftAltCtrl IF NKEYCODE=13 THEN b=thisform.hrg_brg.Value c=VAL(thisform.jumbel.Value) total=ROUND(b*c,0) thisform.jumha.Value=total total=thisform.jumha.Value totalk=totalk+total thisform.totaljumhar.Value =totalk thisform.toba.Value=totalk jb=ROUND(VAL(thisform.jumbel.Value),0) jbk=jbk+jb thisform.totaljumbel.Value=jbk SELECT 4 APPEND BLANK REPLACE kd_brg WITH thisform.kd_brg.Value REPLACE nm_brg WITH thisform.nm_brg.Value REPLACE hrg_brg WITH thisform.hrg_brg.Value REPLACE jumbel WITH VAL(thisform.jumbel.Value) REPLACE jumha WITH thisform.jumha.Value thisform.Refresh lagi=MESSAGEBOX(quot;Mau Input Data Lagiquot;,32+4,quot;Pesanquot;) IF lagi=6 then thisform.kd_brg.Value=quot;quot; thisform.nm_brg.Value=quot;quot; thisform.hrg_brg.Value=quot;quot; thisform.jumbel.Value=quot;quot; thisform.hrg_brg.Value=quot;quot; thisform.totaljumbel.Value=quot;quot; thisform.totaljumhar.Value=quot;quot; thisform.kd_brg.SetFocus () ELSE thisform.toba.Enabled = .F. ENDIF thisform.grid1.Refresh thisform.grid1.RecordSource=quot;sementaraquot; ENDIF Cmdadd______________________________click jbk=0 totalk=0 thisform.bersih thisform.aktif 5
  6. 6. FOXPRO VSC/SHN thisform.no_faktur.SetFocus () SELECT 4 DELETE ALL PACK thisform.grid1.Refresh thisform.grid1.RecordSource=quot;sementaraquot; thn=LTRIM(STR(YEAR(DATE()))) bln=LTRIM(STR(month(DATE()))) SELECT 3 IF RECCOUNT()<=0 nof='0001' ELSE GO bott IF thn=LEFT(transaksi2.no_faktur,4) then IF VAL(bln)=VAL(substr(transaksi2.no_faktur,5,2)) nolama=VAL(right(transaksi2.no_faktur,4)) no=nolama+1 DO case CASE no<10 nof='000'+STR(no,1) CASE no<100 nof='00'+STR(no,2) CASE no<1000 nof='0'+STR(no,3) OTHERWISE nof=STR(no,4) ENDCASE ELSE nof='0001' ENDIF ELSE nof='0001' ENDIF ENDIF IF VAL(bln)<10 bulan='0'+bln else bulan=bln ENDIF thisform.no_faktur.Value=thn+bulan+(nof) thisform.tgL.Value=DATE() thisform.Refresh 6
  7. 7. FOXPRO VSC/SHN cmdsave__________________________click SELECT 3 APPEND BLANK REPLACE no_faktur WITH thisform.no_faktur.Value REPLACE tgl WITH thisform.tgl.Value IF thisform.optiongroup1.option1.Value=1 then REPLACE jcus WITH quot;Customerquot; ELSE REPLACE jcus WITH quot;Non Customerquot; ENDIF REPLACE kd_plg WITH thisform.kd_plg.Value REPLACE totaljumbel WITH thisform.totaljumbel.Value REPLACE totaljumha WITH thisform.totaljumhar.value thisform.Refresh thisform.nonaktif cmdcancel____________________________click thisform.nonaktif thisform.bersih SELECT 4 DELETE ALL PACK thisform.grid1.Refresh thisform.grid1.RecordSource=quot;sementaraquot; cmdbrow_________________________________click SELECT 3 BROWSE Cmdaexit________________________________________click keluar=MESSAGEBOX(quot;Mo Keluarquot;,36,quot;Pesan Keluarquot;) IF keluar=6 then MESSAGEBOX(quot;Yakin Niy..quot;,0,quot;Konfirmasiquot;) thisform.Release ELSE MESSAGEBOX(quot;Ups Ga Jadi Dech..!!quot;,16,quot;Batal Keluarquot;) ENDIF ** Selamat Mengerjakan ** 7

×