📄 frmlaporanrekap.frm
字号:
ElseIf Format(Date, "mm") = "03" Then
TxtBulan.Text = "Maret"
ElseIf Format(Date, "mm") = "04" Then
TxtBulan.Text = "April"
ElseIf Format(Date, "mm") = "05" Then
TxtBulan.Text = "Mei"
ElseIf Format(Date, "mm") = "06" Then
TxtBulan.Text = "Juni"
ElseIf Format(Date, "mm") = "07" Then
TxtBulan.Text = "Juli"
ElseIf Format(Date, "mm") = "08" Then
TxtBulan.Text = "Agustus"
ElseIf Format(Date, "mm") = "09" Then
TxtBulan.Text = "September"
ElseIf Format(Date, "mm") = "10" Then
TxtBulan.Text = "Oktober"
ElseIf Format(Date, "mm") = "11" Then
TxtBulan.Text = "November"
ElseIf Format(Date, "mm") = "12" Then
TxtBulan.Text = "Desember"
End If
TxtTahun.Text = Format(Date, "yyyy")
GridLapBil.Cols = 9
GridLapBil.ColWidth(0) = 500
GridLapBil.ColWidth(1) = 1000
GridLapBil.ColWidth(2) = 1200
GridLapBil.ColWidth(3) = 2000
GridLapBil.ColWidth(4) = 1000
GridLapBil.ColWidth(5) = 900
GridLapBil.ColWidth(6) = 900
GridLapBil.ColWidth(7) = 900
GridLapBil.ColWidth(8) = 1100
GridLapBil.TextMatrix(0, 0) = setNo
GridLapBil.TextMatrix(0, 1) = setTanggal
GridLapBil.TextMatrix(0, 2) = setClient
GridLapBil.TextMatrix(0, 3) = setNamaUser
GridLapBil.TextMatrix(0, 4) = setJenis
GridLapBil.TextMatrix(0, 5) = setMulai
GridLapBil.TextMatrix(0, 6) = setSelesai
GridLapBil.TextMatrix(0, 7) = setDurasi
GridLapBil.TextMatrix(0, 8) = setTotal
total = 0
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & Format(Date, "dd-mm-yyyy") & "'"
cmd.Execute
rs.ActiveConnection = cn
rs.Open "SELECT billing.* FROM billing WHERE billing.tanggal = '" & Format(Date, "dd-mm-yyyy") & "'", cn, adOpenStatic, adLockOptimistic
If Not rs.RecordCount = 0 Then
GridLapBil.Rows = rs.RecordCount + 1
rs.MoveFirst
For i = 1 To rs.RecordCount
GridLapBil.TextMatrix(i, 0) = rs(0) 'no nota
GridLapBil.TextMatrix(i, 1) = rs(1) ' tanggal
GridLapBil.TextMatrix(i, 2) = setClient & " " & rs(2) ' no client
GridLapBil.TextMatrix(i, 3) = rs(3) 'nama user
GridLapBil.TextMatrix(i, 4) = rs(10) 'mulai
GridLapBil.TextMatrix(i, 5) = rs(4) 'mulai
GridLapBil.TextMatrix(i, 6) = rs(5) 'selesai
GridLapBil.TextMatrix(i, 7) = rs(6) ' durasi
GridLapBil.TextMatrix(i, 8) = Format(rs(7), "#,###") ' total
total = total + rs(7)
rs.MoveNext
Next i
LabelTotal.Caption = Format(total, "#,###")
Else
GridLapBil.Rows = 1
End If
cn.Close
End Sub
Private Sub CmdCetakLaporan_Click()
On Error GoTo error
Printer.PrintQuality = 300
Printer.FontSize = 10
Printer.ScaleLeft = 10
Printer.ScaleTop = 10
Printer.Print Tab(10); FrmMain.Txtnama_warnet
Printer.Print Tab(10); FrmMain.Txtalamat1
Printer.Print Tab(10); FrmMain.Txtalamat2
Printer.Print Tab(10); setLaporanRekap & Format(Now, "dd, mmmm yyyy")
Printer.Print Tab(10); "---------------------------------------------------------------------------"
Printer.Print Tab(10); setNo & setNota; Tab(20); setTanggal; Tab(35); setClient; Tab(50); setNamaUser; Tab(70); setMulai; Tab(80); setSelesai; Tab(90); setDurasi; Tab(100); setTotal
Printer.Print Tab(10); "---------------------------------------------------------------------------"
For i = 1 To GridLapBil.Rows - 1
Printer.Print Tab(10); GridLapBil.TextMatrix(i, 0); Tab(20); GridLapBil.TextMatrix(i, 1); Tab(35); GridLapBil.TextMatrix(i, 2); Tab(50); GridLapBil.TextMatrix(i, 3); Tab(70); GridLapBil.TextMatrix(i, 4); Tab(80); GridLapBil.TextMatrix(i, 5); Tab(90); GridLapBil.TextMatrix(i, 6); Tab(100); GridLapBil.TextMatrix(i, 7)
Next i
Printer.Print Tab(10); "---------------------------------------------------------------------------"
Printer.Print Tab(80); setTotal; Tab(90); LabelTotal.Caption
Printer.Print Tab(10); "---------------------------------------------------------------------------"
Printer.Print Tab(10); "Di Cetak Oleh : " & FrmMain.nm.Text
Printer.EndDoc
error:
Select Case err.Number
Case 482
MsgBox "Maaf File/Printer Tidak Mendukung", vbOKOnly, "Save File"
End Select
End Sub
Private Sub CmdCetakNota_Click()
On Error GoTo error
Printer.PrintQuality = 300
Printer.FontSize = 10
Printer.ScaleLeft = 10
Printer.ScaleTop = 10
Printer.Print Tab(10); "Nota Pembayaran Client"
Printer.Print Tab(10); setTanggal; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 1)
Printer.Print Tab(10); setNo & setNota; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 0)
Printer.Print Tab(10); "-------------------------------"
Printer.Print Tab(10); FrmMain.Txtnama_warnet
Printer.Print Tab(10); FrmMain.Txtalamat1
Printer.Print Tab(10); FrmMain.Txtalamat2
Printer.Print Tab(10); "-------------------------------"
Printer.Print Tab(10); setNamaUser; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 3)
Printer.Print Tab(10); setClient; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 2)
Printer.Print Tab(10); setMulai; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 4)
Printer.Print Tab(10); setSelesai; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 5)
Printer.Print Tab(10); setDurasi; Tab(30); ":"; Tab(35); GridLapBil.TextMatrix(GridLapBil.Row, 6)
Printer.Print Tab(10); setTotal; Tab(30); ":"; Tab(35); mata_uang & ". " & GridLapBil.TextMatrix(GridLapBil.Row, 7)
Printer.Print Tab(10); "-------------------------------"
Printer.Print Tab(10); "Diterima Oleh : " & FrmMain.nm.Text
Printer.Print Tab(10); setGreeting
Printer.EndDoc
error:
Select Case err.Number
Case 482
MsgBox "Maaf File/Printer Tidak Mendukung", vbOKOnly, "Save File"
End Select
End Sub
Private Sub CmdRefresh_Click()
Call Billap
End Sub
Private Sub CmdTutup_Click()
Unload Me
End Sub
Private Sub Form_Load()
Init
End Sub
Private Sub Billap()
On Error Resume Next
Dim total As Single
Dim tgl As String
Dim bln As String
Dim thn As String
Dim sql As String
If TxtBulan.Text = "Januari" Then
bln = "01"
ElseIf TxtBulan.Text = "Februari" Then
bln = "02"
ElseIf TxtBulan.Text = "Maret" Then
bln = "03"
ElseIf TxtBulan.Text = "April" Then
bln = "04"
ElseIf TxtBulan.Text = "Mei" Then
bln = "05"
ElseIf TxtBulan.Text = "Juni" Then
bln = "06"
ElseIf TxtBulan.Text = "Juli" Then
bln = "07"
ElseIf TxtBulan.Text = "Agustus" Then
bln = "08"
ElseIf TxtBulan.Text = "September" Then
bln = "09"
ElseIf TxtBulan.Text = "Oktober" Then
bln = "10"
ElseIf TxtBulan.Text = "November" Then
bln = "11"
ElseIf TxtBulan.Text = "Desember" Then
bln = "12"
End If
tgl = TxtTgl.Text
thn = TxtTahun.Text
total = 0
If OpHari.value = True Then
If OpSemua.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "'"
ElseIf OpPersonal.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "' AND billing.jenis = 'personal'"
ElseIf OpPelajar.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "' AND billing.jenis = 'pelajar'"
ElseIf OpMember.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "' AND billing.jenis = 'member'"
ElseIf OpGame.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "' AND billing.jenis = 'game'"
ElseIf OpKetik.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "' AND billing.jenis = 'ketik'"
Else
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "'"
End If
ElseIf OpBulan.value = True Then
If OpSemua.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "'"
ElseIf OpPersonal.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "' AND billing.jenis = 'personal'"
ElseIf OpMember.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "' AND billing.jenis = 'member'"
ElseIf OpPelajar.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "' AND billing.jenis = 'pelajar'"
ElseIf OpGame.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "' AND billing.jenis = 'game'"
ElseIf OpKetik.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "' AND billing.jenis = 'ketik'"
Else
sql = "SELECT billing.* FROM billing WHERE billing.bulan = '" & bln & "' AND billing.tahun = '" & thn & "'"
End If
ElseIf OpTahun.value = True Then
If OpSemua.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "'"
ElseIf OpPersonal.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "' AND billing.jenis = 'personal'"
ElseIf OpPelajar.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "' AND billing.jenis = 'pelajar'"
ElseIf OpMember.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "' AND billing.jenis = 'member'"
ElseIf OpGame.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "' AND billing.jenis = 'game'"
ElseIf OpKetik.value = True Then
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "' AND billing.jenis = 'ketik'"
Else
sql = "SELECT billing.* FROM billing WHERE billing.tahun = '" & thn & "'"
End If
Else
sql = "SELECT billing.* FROM billing WHERE billing.tanggal = '" & tgl & "-" & bln & "-" & thn & "'"
End If
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = sql
cmd.Execute
rs.ActiveConnection = cn
rs.Open sql, cn, adOpenStatic, adLockOptimistic
If Not rs.RecordCount = 0 Then
GridLapBil.Rows = rs.RecordCount + 1
rs.MoveFirst
For i = 1 To rs.RecordCount
GridLapBil.TextMatrix(i, 0) = rs(0) 'no nota
GridLapBil.TextMatrix(i, 1) = rs(1) ' tanggal
GridLapBil.TextMatrix(i, 2) = setClient & " " & rs(2) ' no client
GridLapBil.TextMatrix(i, 3) = rs(3) 'nama user
GridLapBil.TextMatrix(i, 4) = rs(10) 'mulai
GridLapBil.TextMatrix(i, 5) = rs(4) 'mulai
GridLapBil.TextMatrix(i, 6) = rs(5) 'selesai
GridLapBil.TextMatrix(i, 7) = rs(6) ' durasi
GridLapBil.TextMatrix(i, 8) = Format(rs(7), "#,###") ' total
total = total + rs(7)
rs.MoveNext
Next i
LabelTotal.Caption = Format(total, "#,###")
Else
GridLapBil.Rows = 1
End If
cn.Close
End Sub
Private Sub OpBulan_Click()
Call Billap
End Sub
Private Sub OpGame_Click()
Call Billap
End Sub
Private Sub OpHari_Click()
Call Billap
End Sub
Private Sub OpKetik_Click()
Call Billap
End Sub
Private Sub OpMember_Click()
Call Billap
End Sub
Private Sub OpPelajar_Click()
Call Billap
End Sub
Private Sub OpPersonal_Click()
Call Billap
End Sub
Private Sub OpSemua_Click()
Call Billap
End Sub
Private Sub OpTahun_Click()
Call Billap
End Sub
Private Sub TxtBulan_Click()
Call Billap
End Sub
Private Sub TxtTahun_Click()
Call Billap
End Sub
Private Sub TxtTgl_Click()
Call Billap
End Sub
Private Sub XPButton1_Click()
FlexGrd_SaveToExcel GridLapBil, "The Header", "The Footer", 1, 16, App.path & "\logo.bmp", , , 37, 35, True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -