Dialog Screen Input Penjualan

5. Dialog Screen Input Penjualan

Nama Dialog Screen : Form Input Penjualan Fungsi : untuk melakukan pendataan penjualan dennga cara melakukan penginputan pada setiap ada transaksi baik Tunai maupun kredit Bentuk : Private Sub Check1_Click On Error Resume Next If Check1.Value = Checked Then Text22 = Masuk Else Text22 = End If End Sub Private Sub Combo1_Click On Error Resume Next Text25 = Text25 = Combo2 + + - + + Combo1 End Sub Private Sub Combo2_Click On Error Resume Next Text15.Locked = False Text15.SetFocus Text15.Locked = False Text9.Locked = False Text13.Locked = False Text10.Locked = False Text11.Locked = False Text12.Locked = False Text25 = Text25 = Combo2 + + - + + Combo1 End Sub Private Sub Command1_Click On Error Resume Next If Text31 = Then Text31 = - End If If Text18 = Or Text2 = Or Text3 = Or Text19 = Or Text20 = Or Text4 = Then MsgBox lengkapi data penjuaslan, vbCritical, NS Mobilindo Exit Sub Else If Option3.Value = True And Option1.Value = True Then con.Execute exec Sp_Simpan_Hed_Jual DataGrid1.Columns0 , Text2 , Text3 , Tunai , Cash , - , 0 , - , Text4 , - , - , - , - , - , - , - , Text28 , - , - , Text22 , 0 , Text31 MsgBox data telah tersimpan ElseIf Option3.Value = True And Option2.Value = True Then If Text8 = Then MsgBox Isi terlebih dahulu keterangan BGCEK, vbCritical Exit Sub Text8.SetFocus Else con.Execute exec Sp_Simpan_Hed_Jual DataGrid1.Columns0 , Text2 , Text3 , Tunai , BGCEK , Text8.Text , 0 , - , Text4 , - , - , - , - , - , - , - , Text28 , - , - , Text22 , 0 , Text31 MsgBox data telah tersimpan End If End If If Option4.Value = True And Option1.Value = True Then If Text7.Text = Or Combo2.Text = Or Text15 = Or Text9 = Or Text13 = Or Text10 = Or Text11 = Or Text12 = Then MsgBox Data transaksi Kredit Belum Lengkap, vbInformation, NS Mobilindo Exit Sub Else con.Execute exec Sp_Simpan_Hed_Jual DataGrid1.Columns0 , Text2 , Text3 , Kredit , Cash , - , Text1 , Text7 , Text4 , Text25.Text , Text15 , Text9 , Text13 , Text10 , Text11 , Text12 , Text28 , Belum , 0 , Text22 , Text24 , Text31 MsgBox data telah tersimpan End If End If If Option4.Value = True And Option2.Value = True Then If Text7.Text = Or Combo2.Text = Or Text15 = Or Text9 = Or Text13 = Or Text10 = Or Text11 = Or Text12 = Then MsgBox Data transaksi Kredit Belum Lengkap, vbInformation, NS Mobilindo Exit Sub Else If Text8 = Then MsgBox Isi terlebih dahulu keterangan BGCEK, vbCritical Exit Sub Text8.SetFocus Else con.Execute exec Sp_Simpan_Hed_Jual DataGrid1.Columns0 , Text2 , Text3 , Kredit , BGCEK , Text8.Text , Text1 , Text7 , Text4 , Text25.Text , Text15 , Text9 , Text13 , Text10 , Text11 , Text12 , Text28 , Belum , 0 , Text22 , Text24 , Text31 MsgBox data telah tersimpan End If End If End If End If tampil6 Text17.Locked = False Text27.Locked = False Text17.SetFocus tayang cetak2 cetak3 non_aktif Text18.Locked = True Text30.Locked = False Command7.Enabled = True Command7.SetFocus Command1.Enabled = False Command2.Enabled = False Command4.Enabled = True Command8.Enabled = False DataGrid1.Enabled = False DataGrid1.Refresh Frame4.Enabled = False ListView1.ListItems.Clear Bersih Me Text4 = FormatDate, yyyy - mm - dd Kunci Me Text30.Locked = False Text17.Locked = False Text27.Locked = False Check1.Value = Unchecked Check1.Enabled = False Text5 = End Sub Sub tayang On Error Resume Next Dim tayang As New ADODB.Recordset If tayang.State = 1 Then tayang.Close tayang.Open select No_Faktur from Hed_Jual WHERE No_Faktur =SELECT MAXno_fakturFROM Hed_Jual, con, 3, 2 If Not tayang.EOF Then Text6 = tayangNo_Faktur End If End Sub Private Sub Command2_Click On Error Resume Next If MsgBoxyakin anda akan membatalkan transaksi ini???, vbYesNo = vbYes Then Frame2.Visible = False Text18 = Kunci Me Bersih Me Frame4.Enabled = False Text17.Locked = False Text27.Locked = False Text30.Locked = False Text18.Locked = True non_aktif Frm_Jual.Option1.Value = False Frm_Jual.Option2.Value = False Frm_Jual.Option3.Value = False Frm_Jual.Option4.Value = False Bersih Me Text4 = FormatDate, yyyy - mm - dd Command7.Enabled = True Command7.SetFocus Command1.Enabled = False Command2.Enabled = False Command4.Enabled = True Command8.Enabled = False DataGrid1.Enabled = False ListView1.ListItems.Clear Text4 = FormatDate, yyyy - mm - dd Check1.Value = Unchecked Check1.Enabled = False Else Command2.SetFocus End If End Sub Private Sub Command4_Click On Error Resume Next If MsgBoxYakin Anda Akan Keluar Dari Transaksi Ini??, vbYesNo = vbYes Then sink Me Unload Me End If End Sub Private Sub Command5_Click On Error Resume Next Set Rslap2 = New ADODB.Recordset Rslap2.CursorLocation = adUseClient Rslap2.Open SELECT Hed_Jual.No_Faktur, Hed_Jual.No_Polisi, Kendaraan.Merk, Kendaraan.Tahun, Kendaraan.Warna, Kendaraan.No_Rangka, Kendaraan.no_Mesn, Kendaraan.No_BPKB, Kendaraan.An_BPKB, Hed_Jual.Jumlah_Bayar, Hed_Jual.Kode_Customer, Hed_Jual.Cara_Bayar, Hed_Jual.Jenis_Pembayaran, Hed_Jual.Ket_BG_CEK, Hed_Jual.Tanggal_Jual, Customer.Nama FROM Hed_Jual INNER JOIN Kendaraan ON Hed_Jual.No_Polisi = Kendaraan.No_Polisi INNER JOIN Customer ON Hed_Jual.Kode_Customer = Customer.Kode_Customer where Hed_Jual.No_Faktur= Text25.Text , con, 3, 2 DataEnvironment1.Commands1.CommandText = Set DataEnvironment1.rsCommand1.DataSource = Rslap2 DataReport1.Show End Sub Private Sub Command6_Click On Error Resume Next Frame2.Visible = False End Sub Private Sub Command7_Click On Error Resume Next Combo3.Locked = False Command7.Enabled = False Text18.Locked = False Command1.Enabled = True Command2.Enabled = True Command4.Enabled = False Command8.Enabled = True DataGrid1.Enabled = True DataGrid1.SetFocus Check1.Value = Unchecked Check1.Enabled = True End Sub Private Sub Command8_Click On Error Resume Next If Text18 = Then MsgBox Pilih Mobil terdahulu untuk melakukan proses berikutnya, vbInformation, NS Mobilindo Else Form1.Show Form1.Text11 = Bisa End If End Sub Private Sub Command9_Click On Error Resume Next Frm_Leasing.Show Frm_Leasing.Text6 = Bisa End Sub Private Sub DataGrid1_DblClick On Error Resume Next Text18 = DataGrid1.Columns0 Text28 = DataGrid1.Columns9 Text3.Locked = False Text18.Locked = True Text28.Locked = False Text2.SetFocus tampilkenjual End Sub Private Sub DataGrid1_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then Text18 = DataGrid1.Columns0 Text28 = DataGrid1.Columns9 Text3.Locked = False Text18.Locked = True Text28.Locked = False Text2.SetFocus tampilkenjual End If End Sub Private Sub DataGrid2_Click On Error Resume Next Text25 = DataGrid2.Columns0 Text24 = DataGrid2.Columns1 Text23 = DataGrid2.Columns2 Text22 = DataGrid2.Columns4 End Sub Private Sub Form_Activate On Error Resume Next DataGrid1.Columns0.Locked = True DataGrid1.Columns1.Locked = True DataGrid1.Columns2.Locked = True DataGrid1.Columns3.Locked = True DataGrid1.Columns4.Locked = True DataGrid1.Columns5.Locked = True DataGrid1.Columns6.Locked = True DataGrid1.Columns7.Locked = True DataGrid1.Columns8.Locked = True Text4 = FormatDate, yyyy - mm - dd Text3.Enabled = False Text18.Enabled = False End Sub Private Sub Form_Load On Error Resume Next BukaDB Kunci Me Text18.Locked = True Text17.Locked = False Text27.Locked = False Text30.Locked = False Option3.Enabled = False Option4.Enabled = False Option1.Enabled = False Option2.Enabled = False Frm_Jual.Left = 1920 Frm_Jual.Top = 300 Frm_Jual.Height = 9375 Frm_Jual.Width = 12375 tampil6 DataGrid1.Enabled = False Check1.Value = Unchecked Check1.Enabled = False Frame4.Enabled = False Command1.Enabled = False Command2.Enabled = False Command4.Enabled = True Command8.Enabled = False Command7.Enabled = True Command7.SetFocus For I = 1 To 12 Combo2.AddItem I Next I End Sub Private Sub Option1_Click On Error Resume Next If Option1.Value = True Then Text8 = Text8.Enabled = False Text20.Text = Cash ElseIf Option2.Value = True Then Text8.Enabled = True Text20.Text = CEK End If End Sub Private Sub Option2_Click On Error Resume Next If Option2.Value = True Then Text20.Text = CEK Text8.Enabled = True Text8.Locked = False Text8.SetFocus ElseIf Option1.Value = True Then Text8.Enabled = False Text20.Text = Cash End If End Sub Private Sub Option3_Click On Error Resume Next hapus Text1 = Frame4.Enabled = False Text19.Text = Tunai Option1.Enabled = True Option1.Value = False Option2.Enabled = True Option2.Value = False Text8 = Text3.Locked = False Text3 = Option4.Value = False Text31.Locked = False If Text28 = Or Text28 = 0 Then MsgBox Isi terlebih dahulu Harga Jadi untuk poroses berikutnya, vbInformation, NS Mobilindo Text28.SetFocus Text5 = Frame4.Enabled = False Option3.Value = False Else Text3.Enabled = True Text3.SetFocus Text3 = ValText28 Exit Sub End If If Option3.Value = True And Option1.Value = True Then Text8.Text = Text8.Locked = True ElseIf Option3.Value = True And Option2.Value = True Then Text8.Locked = False Text8.SetFocus End If End Sub Private Sub Option4_Click On Error Resume Next Frame4.Enabled = True Text7.SetFocus Text19.Text = Kredit aktif Option1.Enabled = True Option1.Value = False Option2.Enabled = True Option2.Value = False Text8 = Text3 = Option3.Value = False Combo1.Locked = False Combo2.Locked = False Text31.Locked = False If Text28 = Or Text28 = 0 Then MsgBox Isi terlebih dahulu Harga Jadi untuk proses berikutnya, vbInformation, NS Mobilindo Text28.SetFocus Text15 = Frame4.Enabled = False Option4.Value = False Else Text28.Locked = True Exit Sub End If If Option4.Value = True Then Combo1.Visible = True Combo1.SetFocus Label8.Visible = True Text3 = Text3.Locked = True ElseIf Option3.Value = True Then Combo1.Visible = False Label8.Visible = False Text3.Locked = False Text3 = End If End Sub Private Sub Text10_Change Text3 = ValText15 + ValText9 + ValText10 + ValText11 + ValText12 Text5.Text = TerbilangText3 + Rupiah Text1 = ValText28 - ValText3 End Sub Private Sub Text10_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then Text11.SetFocus End If End Sub Private Sub Text11_Change Text3 = ValText15 + ValText9 + ValText10 + ValText11 + ValText12 Text5.Text = TerbilangText3 + Rupiah Text1 = ValText28 - ValText3 End Sub Private Sub Text11_KeyPressKeyAscii As Integer On Error Resume Next Const Number = 0123456789 If KeyAscii 8 And KeyAscii 13 Then If InStrNumber, ChrKeyAscii = 0 Then KeyAscii = 0 Exit Sub End If End If If KeyAscii = 13 Then Text12.SetFocus End If End Sub Private Sub Text12_Change On Error Resume Next Text3 = ValText15 + ValText9 + ValText10 + ValText11 + ValText12 Text5.Text = TerbilangText3 + Rupiah Text1 = ValText28 - ValText3 End Sub Private Sub Text12_Click On Error Resume Next Text12.Locked = False Text12.SetFocus End Sub Private Sub Text12_KeyPressKeyAscii As Integer On Error Resume Next Const Number = 0123456789 If KeyAscii 8 And KeyAscii 13 Then If InStrNumber, ChrKeyAscii = 0 Then KeyAscii = 0 Exit Sub End If End If If KeyAscii = 13 Then Text3.SetFocus End If End Sub Private Sub Text13_Click On Error Resume Next Text13.Locked = False Text13.SetFocus End Sub Private Sub text13_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then Text24.SetFocus End If End Sub Private Sub Text15_Change On Error Resume Next Text3 = ValText15 + ValText9 + ValText10 + ValText11 + ValText12 Text5.Text = TerbilangText3 + Rupiah Text1 = ValText28 - ValText3 End Sub Private Sub Text15_KeyPressKeyAscii As Integer On Error Resume Next Const Number = 0123456789 If KeyAscii 8 And KeyAscii 13 Then If InStrNumber, ChrKeyAscii = 0 Then KeyAscii = 0 Exit Sub End If End If If KeyAscii = 13 Then Text9.SetFocus End If End Sub Private Sub Text15_LostFocus On Error Resume Next Text1 = ValText28 - ValText15 End Sub Private Sub Text17_Change On Error Resume Next Text30 = Dim rsCari1 As New ADODB.Recordset With rsCari1 If .State = 1 Then .Close .Open select No_Polisi,Merk,Type,Tahun,Warna,No_Rangka,no_Mesn,No_BPKB,An_BPKB,Harga_Jua l,Status from Kendaraan where Merk like Text17.Text and Type like Text27.Text and Status = Ada, con, 3, 2 If .RecordCount 0 Then Set DataGrid1.DataSource = rsCari1.DataSource End If End With End Sub Private Sub Text2_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then If Text18 = Then MsgBox Pilih Mobil terdahulu untuk melakukan proses berikutnya, vbInformation, NS Mobilindo Else Form1.Show Form1.Text11 = Bisa End If End If End Sub Private Sub Text24_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then Text10.SetFocus End If End Sub Private Sub Text27_Change On Error Resume Next Text30 = Dim rsCari1 As New ADODB.Recordset With rsCari1 If .State = 1 Then .Close .Open select No_Polisi,Merk,Type,Tahun,Warna,No_Rangka,no_Mesn,No_BPKB,An_BPKB,Harga_Jua l,Status from Kendaraan where Merk like Text17.Text and Type like Text27.Text and Status = Ada, con, 3, 2 If .RecordCount 0 Then Set DataGrid1.DataSource = rsCari1.DataSource End If End With End Sub Private Sub Text28_KeyPressKeyAscii As Integer On Error Resume Next If Not KeyAscii = Asc0 Chr13 And KeyAscii = Asc9 Chr13 Or KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete Or KeyAscii = vbKeySpace Then Beep KeyAscii = 0 End If End Sub Private Sub Text3_KeyPressKeyAscii As Integer On Error Resume Next Const Number = 0123456789 If KeyAscii 8 And KeyAscii 13 Then If InStrNumber, ChrKeyAscii = 0 Then KeyAscii = 0 Exit Sub End If End If If KeyAscii = 13 Then If Text3 = Then Text5.Text = Terbilang0 + Rupiah Else Text5.Text = TerbilangText3 + Rupiah DataGrid1.Columns8 = Text3 End If End If End Sub Private Sub Text30_Change On Error Resume Next Text27 = Text17 = Dim rsCari1 As New ADODB.Recordset With rsCari1 If .State = 1 Then .Close .Open select No_Polisi,Merk,Type,Tahun,Warna,No_Rangka,no_Mesn,No_BPKB,An_BPKB,Harga_Jua l,Status from Kendaraan where No_Polisi like Text30.Text and Status = Ada, con, 3, 2 If .RecordCount 0 Then Set DataGrid1.DataSource = rsCari1.DataSource End If End With End Sub Private Sub Text6_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then Text5.Text = TerbilangText3 + Rupiah End If End Sub Private Sub Text3_Change On Error Resume Next If Text3 = Then Text5.Text = Terbilang0 + Rupiah Else Text5.Text = TerbilangText3 + Rupiah End If End Sub Private Sub Text7_KeyPressKeyAscii As Integer On Error Resume Next If KeyAscii = 13 Then Frm_Leasing.Show Frm_Leasing.Text6 = Bisa End If End Sub Private Sub Text9_Change On Error Resume Next Text3 = ValText15 + ValText9 + ValText10 + ValText11 + ValText12 Text5.Text = TerbilangText3 + Rupiah Text1 = ValText28 - ValText3 End Sub Private Sub Text9_KeyPressKeyAscii As Integer On Error Resume Next Const Number = 0123456789 If KeyAscii 8 And KeyAscii 13 Then If InStrNumber, ChrKeyAscii = 0 Then KeyAscii = 0 Exit Sub End If End If If KeyAscii = 13 Then Text13.SetFocus End If End Sub Private Sub tampil6 On Error Resume Next Dim Rstampil4 As New ADODB.Recordset If Rstampil4.State = 1 Then Rstampil4.Close Rstampil4.Open Select No_Polisi,Merk,Type,Tahun,Warna,No_Rangka,no_Mesn,No_BPKB,An_BPKB,Harga_Jua l,Status from Kendaraan where Status = Ada , con, 3, 2 Set DataGrid1.DataSource = Rstampil4.DataSource DataGrid1.Refresh End Sub Sub aktif Combo2.Locked = False Combo1.Locked = False Text15.Locked = False Text9.Locked = False Text13.Locked = False Text24.Locked = False Text10.Locked = False Text11.Locked = False Text12.Locked = False End Sub Sub hapus On Error Resume Next Text24 = Text7 = Text1 = Text15 = Text9 = Text13 = Text16 = Text10 = Text11 = Text12 = Text21 = Combo2.Text = Combo1.Text = End Sub Sub non_aktif On Error Resume Next Option1.Value = False Option2.Value = False Option3.Value = False Option4.Value = False Option1.Enabled = False Option2.Enabled = False Option3.Enabled = False Option4.Enabled = False End Sub Sub tampilkenjual On Error Resume Next ListView1.ListItems.Clear With ListView1.ListItems.add, , Me.DataGrid1.Columns0 Call .ListSubItems.add, , Me.DataGrid1.Columns1 Call .ListSubItems.add, , Me.DataGrid1.Columns2 Call .ListSubItems.add, , Me.DataGrid1.Columns3 Call .ListSubItems.add, , Me.DataGrid1.Columns4 Call .ListSubItems.add, , Me.DataGrid1.Columns5 Call .ListSubItems.add, , Me.DataGrid1.Columns6 Call .ListSubItems.add, , Me.DataGrid1.Columns7 Call .ListSubItems.add, , Me.DataGrid1.Columns8 End With End Sub Sub cetak2 On Error Resume Next Dim I As Integer cetak detail If isprinted = True Then Exel.Application.Quit End If Screen.MousePointer = vbHourglass Exel.DisplayAlerts = False Exel.Application.Visible = True Exel.Workbooks.Open App.Path \FakPenjualan.xls Exel.Cells1, 1.Value = CV.NS mobilindo Exel.Cells2, 1.Value = Jl. Ibu Inggit Garnasih Ciateul No. 88, Telp 022 5202079, 5209880 Bandung 40252 Exel.Cells3, 1.Value = Jual Beli - Tukar Tambah - Cash Kredit Mobil Bekas Baru Exel.Cells4, 2.Value = Text6.Text Exel.Cells5, 2.Value = Text26.Text Exel.Cells6, 2.Value = Text5.Text Exel.Cells22, 1.Value = Text26.Text Exel.Cells13, 2.Value = Rp + + Text3.Text Exel.Cells14, 2.Value = Text19.Text Exel.Cells15, 2.Value = Text20.Text + + - + + Text8.Text Exel.Cells16, 2.Value = Text31 Exel.Cells17, 7.Value = Text4.Text For I = 1 To ListView1.ListItems.Count Exel.Cells10, 2.Value = ListView1.ListItemsI.Text No Polisi Exel.Cells8, 2.Value = ListView1.ListItemsI.ListSubItems1 + - + ListView1.ListItemsI.ListSubItems2 merk Exel.Cells9, 2.Value = ListView1.ListItemsI.ListSubItems3 Tahun Exel.Cells11, 2.Value = ListView1.ListItemsI.ListSubItems4 Warna Exel.Cells8, 6.Value = ListView1.ListItemsI.ListSubItems5 No rangka Exel.Cells9, 6.Value = ListView1.ListItemsI.ListSubItems6 No Mesin Exel.Cells10, 6.Value = ListView1.ListItemsI.ListSubItems7 No BPKB Exel.Cells11, 6.Value = ListView1.ListItemsI.ListSubItems8 An BPKB Next I Exel.ActiveWorkbook.PrintPreview Screen.MousePointer = Me.MousePointer End Sub Sub cetak3 On Error Resume Next Dim I As Integer cetak detail If isprinted = True Then Exel.Application.Quit End If Screen.MousePointer = vbHourglass Exel.DisplayAlerts = False Exel.Application.Visible = True Exel.Workbooks.Open App.Path \PenjualanBPB.xls Exel.Cells1, 1.Value = CV.NS mobilindo Exel.Cells2, 1.Value = Jl. Ibu Inggit Garnasih Ciateul No. 88, Telp 022 5202079, 5209880 Bandung 40252 Exel.Cells3, 1.Value = Jual Beli - Tukar Tambah - Cash Kredit Mobil Bekas Baru Exel.Cells6, 1.Value = Yth + + Text26.Text Exel.Cells7, 1.Value = Alamat : + + Text29.Text + + + Tlpn : + + Text23 Exel.Cells24, 1.Value = Text26.Text Exel.Cells18, 6.Value = Bandung, + + Text4.Text For I = 1 To ListView1.ListItems.Count Exel.Cells11, 2.Value = ListView1.ListItemsI.Text No Polisi Exel.Cells9, 2.Value = ListView1.ListItemsI.ListSubItems1 + - + ListView1.ListItemsI.ListSubItems2 merk Exel.Cells10, 2.Value = ListView1.ListItemsI.ListSubItems3 Tahun Exel.Cells12, 2.Value = ListView1.ListItemsI.ListSubItems4 Warna Exel.Cells9, 6.Value = ListView1.ListItemsI.ListSubItems5 No rangka Exel.Cells10, 6.Value = ListView1.ListItemsI.ListSubItems6 No Mesin Exel.Cells11, 6.Value = ListView1.ListItemsI.ListSubItems7 No BPKB Exel.Cells12, 6.Value = ListView1.ListItemsI.ListSubItems8 An BPKB Next I Exel.ActiveWorkbook.PrintPreview Screen.MousePointer = Me.MousePointer End Sub

6. Dialog Screen Pembayaran Leasing