Selasa, 17 November 2015

Cara modifikasi pembuatan program dengan menggunakan visual foxpro. Modifikasi pada Form Outbound



Cara modifikasi pembuatan program dengan menggunakan visual foxpro.
Modifikasi pada Form Outbound



1.  FORM Input/edit data Outbound.
Create form outbound, seperti dibawah ini.
Nama Form : inp_pasien



CmdSimpan.click (Tombol Simpan)

with this.Parent
Do Case
 DO case
      Case empty(.cnorekam.value)
            messagebox('Nomor Resi harus diisi... !',48,NamaApp)
            .cnorekam.Setfocus
            RETURN
      endcase    
endcase


Select trans
rekord=RECNO()

If Messagebox('Data Sudah Benar?',4+32,NamaApp)=6
   If Thisformset.Status=0  && menambah data.
     
        APPEND BLANK
        replace no_resi      WITH  .cNorekam.value
       
        replace tanggal      WITH  .dTgl.value 
        replace Jenis        WITH  .cjenis.value     
        replace Nm_kirim1    WITH  .cnm_kirim.value
        replace sender       WITH  .csender.value    
        replace Kota_kirim   WITH  .cKota_kirim.value
        replace Kec_terima   WITH  .cKec_terima.value
        replace Kota_terim   WITH  .cKota_terima.value
        replace Telp_terim   WITH  .cTelp_terima.value     
        replace tgl_trm      WITH  .dTgl_terima.value
        replace pesan        WITH  .cIsi_kiriman.value
        replace Jml_Koli     WITH  .nKoli.value
        replace Jml_berat    WITH  .nBerat.value     
        replace price1       WITH  .nharga_tujuan.value    
        replace kd_kota1     WITH  .kd_kota1.value
        replace kd_kota2     with  .kd_kota2.value
        replace via          WITH  .cvia.value 
           
                 
ELSE  && edit data
       
        goto rekord

        replace tanggal      WITH  .dTgl.value 
        replace Jenis        WITH  .cjenis.value     
        replace Nm_kirim1    WITH  .cnm_kirim.value
        replace sender       WITH  .csender.value    
        replace Kota_kirim   WITH  .cKota_kirim.value
        replace Kec_terima   WITH  .cKec_terima.value
        replace Kota_terim   WITH  .cKota_terima.value
        replace Telp_terim   WITH  .cTelp_terima.value     
        replace tgl_trm      WITH  .dTgl_terima.value
        replace pesan        WITH  .cIsi_kiriman.value
        replace Jml_Koli     WITH  .nKoli.value
        replace Jml_berat    WITH  .nBerat.value     
        replace price1       WITH  .nharga_tujuan.value    
        replace kd_kota1     WITH  .kd_kota1.value
        replace kd_kota2     with  .kd_kota2.value
        replace via          WITH  .cvia.value 
           
           
Endi

        .dTgl.value = ''     
        .cjenis.value   = ''
        .cnm_kirim.value=' '
        .csender.value=' '   
        .cKota_kirim.value=' '     
        .cKec_terima.value=' '
        .cKota_terima.value=' '
        .cTelp_terima.value=' '    
        .dTgl_terima.value=' '
        .cIsi_kiriman.value=' '
        .nKoli.value=0
        .nBerat.value   =0
        .nharga_tujuan.value=0     
        .kd_kota1.value=' '
        .kd_kota2.value=' '
        .cvia.value=' '
       
       thisformset.pasien.grid1.refresh
     .cmdkeluar.click
    
ENDIF
ENDWITH 

CmdKeluar.click (Tombol Batal)
WITH thisform

    .cjenis.value = ' '
      .cnm_kirim.value=' '
      .cKota_kirim.value=' '
      .cKec_terima.value=' '
      .cKota_terima.value=' '
     
      .dTgl_terima.value=' '
      .cIsi_kiriman.value=' '
      .nKoli.value=0
      .nBerat.value=0
     
      .nharga_tujuan.value=0
      .kd_kota1.value=''
    .kd_kota2.value=''
    .cVia.value=''
     
.Hide

ENDWITH
Thisformset.pasien.Enabled = .T.
Thisformset.pasien.Grid1.Refresh
Thisformset.pasien.Grid1.Setfocus


Dataenvironment.Init (open database)
Do SetSet
Cekselect()

Cekselect()
Use Poswin.dat Orde NamaWindow Alias Poswin

Cekselect()
cFile = _Drive+'outbound'
use &cFile alias TRANS

Cekselect()
cFile = _Drive+'tmpkirim'
use &cFile alias tmpkirim excl

Cekselect()
cFile = _Drive+'mtcode.dat'
use &cFile alias mtcode

Cekselect()
cFile = _Drive+'customer'
use &cFile alias customer
SET ORDER to cust_id

Cekselect()
cFile = _Drive+'kota'
use &cFile alias kota
SET ORDER to kd_kota


Cekselect()
cFile = _Drive+'mobil'
use &cFile alias mobil
SET ORDER to no_polisi

2.  FORM List / Daftar data Outbound






Tombol –tombol yang mendukung.




CmdEdit.click
If 'Beauty House 2014' $ PROGRAM(1)
      If !CEKTOMBOL('REVISI') 
            Retu
      Endif
Endif
Thisform.Enabled = .F.
Acti Wind Inp_pasien
Thisformset.Status=1

Select trans
WITH Thisformset.inp_pasien
.cnorekam.value=no_resi

    .dTgl.value=tanggal
      .cjenis.value=jenis
     
      .cnm_kirim.value=nm_kirim1
      .cKota_kirim.value=kota_kirim

      .cKec_terima.value=kec_terima
      .cKota_terima.value=kota_terim
     
      .cTelp_terima.value=telp_terim     
      .dTgl_terima.value=tgl_trm
      .cIsi_kiriman.value=pesan
     
      .nKoli.value=jml_koli
      .nBerat.value=jml_berat
     
      .nharga_tujuan.value=price1
      .nharga_modal.value=price2
     
           
      .kd_kota1.value=kd_kota1
      .kd_kota2.value=kd_kota2
      .cvia.value=via
      .csender.value=sender
     

SELECT customer
SET ORDER to cust_id
SEEK trans.cs_cust
IF FOUND()
   thisformset.Inp_pasien.label27.caption =  customer.cust_name
      thisformset.Inp_pasien.text3.value =  customer.cust_term + thisformset.Inp_pasien.dTgl.value
*!*      thisformset.Inp_pasien.cTOP.value =  customer.cust_term
*!*      thisformset.Inp_pasien.nharga_tujuan.value =  customer.cust_price
*!*      thisformset.Inp_pasien.nharga_transit.value =  customer.cust_trans 
  
ELSE
*   thisformset.Inp_pasien.label27.caption =  ' '  
endif
SELECT trans
           

.cnorekam.enabled=.f.
.dTgl.Setfocus
ENDWITH







3.  Design Printout Outbound
Ctk_pasien



Tombol Preview & Printer

SELECT TmpKirim
ZAP

select trans
set orde to no_resi
GO top


 DO WHILE .not. EOF()

      SELECT TmpKirim
      APPEND BLANK
     
     
      replace no_resi      WITH   trans.no_resi
       
        replace tanggal      WITH   trans.tanggal    
        replace Jenis        WITH   trans.jenis
        replace Nm_kirim1    WITH   trans.nm_kirim1
        replace sender       WITH   trans.sender     
       
        replace Kota_terim   WITH   trans.kota_terim
       
        replace Jml_Koli     WITH   trans.jml_koli
        replace Jml_berat    WITH   trans.jml_berat  
        replace price1       WITH   trans.price1     
        replace price2       WITH   trans.price2     
       
       
        replace via          WITH   trans.via  
       
      SELECT trans
      SKIP
 Enddo    




SELECT tmpKirim
GO top




Tanggal
No_Resi
Expedisi
Pengirim
Kota_tujuan
Jenis barang
Jml_koli
Jml_kilo
Harga yang disetujui
Pengeluaran/Modal
Profit
Expedisi via
Keterangan

Untuk anda yang ingin membuat system komputerisasi, saya akan create sesuai dengan keperluan usaha anda, dijamin akan sesuai & cepat diselesaikan.
Silahkan hubungi kami disini...