Point Of Sales Simple


Option Explicit

Private Sub cmbSatuan_Click()
Select Case cmbSatuan.ListIndex
Case 0:
lblSatuan.Caption = “Person”
Case 1:
lblSatuan.Caption = “Cups”
Case 2:
lblSatuan.Caption = “Pcs”
End Select

End Sub

Private Sub cmdHitung_Click()
Dim SubTotal As Double
Dim Discount As Double
Dim Total As Double

If (txtNamaBarang.Text = “”) Or (txtJumlah.Text = “”) Or _
(txtHarga.Text = “”) Then
If txtNamaBarang.Text = “” Then
MsgBox “Insert Item!”, vbOKOnly, “Informasi”
txtNamaBarang.SetFocus
End If

If txtJumlah.Text = “” Then
MsgBox “Total is Empty!”, vbOKOnly, “Informasi”
txtJumlah.SetFocus
End If

If txtHarga.Text = “” Then
MsgBox “Price is Empty!”, vbOKOnly, “Informasi”
txtHarga.SetFocus
End If
Else
SubTotal = txtJumlah.Text * txtHarga.Text

Discount = 0
If Month(Date) = 6 Then
If Day(Date) >= 20 And Day(Date) <= 30 Then
If SubTotal >= 50000 Then
Discount = 10 / 100 * SubTotal
End If
End If
End If

Total = SubTotal – Discount

lblSubtotalRp.Caption = SubTotal
lblDiscountRp.Caption = Discount
lblTotalRp.Caption = Total
End If

End Sub

Private Sub Form_Load()
lblTanggal.Caption = “Date: ” & Date
cmbSatuan.AddItem “Foods”
cmbSatuan.AddItem “Drinks”
cmbSatuan.AddItem “Snack”
cmbSatuan.ListIndex = 0
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s