MODULO DE FACTURACIÓN

En esta factura realizaremos un descuento de 5 productos ya existentes por código y solo la cantidad sera ingresada y al ir al botón calcular nos saldrá 
1.-) El valor total a pagar 
2.-) El descuento de cuanto es 
3.-) El Subtotal.



Código:
Dim DES, ST As Integer
Dim T As Double
Dim COD1, COD2, COD3, COD4, COD5 As Integer
Dim D1, D2, D3, D4, D5 As String
Dim VU1, VU2, VU3, VU4, VU5 As Integer
Dim VT1, VT2, VT3, VT4, VT5 As Integer


Private Sub Command1_Click()
'--------------
'PRIMER CODIGO DE INGRESO
    Label10 = InputBox(" INGRESE EL CODIGO: ", Label12)
    Label10.Visible = Not Label10.Visible
    Label33.Visible = Not Label33.Visible
    Label11.Visible = Not Label11.Visible
    Label11 = 20
    Text1.Visible = Not Text1.Visible
    Label13.Visible = Not Label13.Visible

'SEGUNDO CODIGO DE INGRESO
    Label14 = InputBox(" INGRESE EL CODIGO: ", Label16)
    Label14.Visible = Not Label14.Visible
    Label15.Visible = Not Label15.Visible
    Label16.Visible = Not Label16.Visible
    Label16 = 70
    Text2.Visible = Not Text2.Visible
    Label17.Visible = Not Label17.Visible

'TERCER CODIGO DE INGRESO
    Label18 = InputBox(" INGRESE EL CODIGO: ", Label20)
    Label18.Visible = Not Label18.Visible
    Label19.Visible = Not Label19.Visible
    Label20.Visible = Not Label20.Visible
    Label20 = 15
    Text3.Visible = Not Text3.Visible
    Label21.Visible = Not Label21.Visible
    
'CUARTO CODIGO DE INGRESO
    Label22 = InputBox(" INGRESE EL CODIGO: ", Label24)
    Label22.Visible = Not Label22.Visible
    Label23.Visible = Not Label23.Visible
    Label24.Visible = Not Label24.Visible
    Label24 = 8
    Text4.Visible = Not Text4.Visible
    Label25.Visible = Not Label25.Visible
    
'QUINTO CODIGO DE INGRESO
    Label26 = InputBox(" INGRESE EL CODIGO: ", Label28)
    Label26.Visible = Not Label26.Visible
    Label27.Visible = Not Label27.Visible
    Label28.Visible = Not Label28.Visible
    Label28 = 12
    Text5.Visible = Not Text5.Visible
    Label29.Visible = Not Label29.Visible


End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""

Label10 = ""
Label11 = ""
Label12 = ""
Label13 = ""
Label14 = ""
Label15 = ""
Label16 = ""
Label17 = ""
Label18 = ""
Label19 = ""
Label20 = ""
Label21 = ""
Label22 = ""
Label23 = ""
Label24 = ""
Label25 = ""
Label26 = ""
Label27 = ""
Label28 = ""
Label29 = ""
Label30 = ""
Label31 = ""
Label32 = ""
Label33 = ""



End Sub

' OPERCACIONES DEL BOTON CALCULAR
Private Sub Command3_Click()

VT1 = (Text1.Text * Label11)
Label13 = VT1

VT2 = (Text2.Text * Label16)
Label17 = VT2

VT3 = (Text3.Text * Label20)
Label21 = VT3

VT4 = (Text4.Text * Label24)
Label25 = VT4

VT5 = (Text5.Text * Label28)
Label29 = VT5

ST = VT1 + VT2 + VT3 + VT4 + VT5

If ST < 100 Then
Label12 = "% 5"
DES = (ST * 5) / 100
Else
        If ST >= 100 And ST <= 200 Then
        Label12 = "% 10"
        DES = (ST * 10) / 100
        Else
                If ST > 200 Then
                Label12 = " %15"
                DES = (ST * 15) / 100
                End If
       End If
       
 End If
 T = (ST - DES)

 Label32 = T
 Label30 = ST
 Label31 = DES

MSBOX = ("SU TOTAL A PAGAR ES DE : " & T)
End Sub

' SALTOS DE LINEAS PRECIONANDO LA TECLA ENTER
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.SetFocus
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.SetFocus
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.SetFocus
End If
End Sub
Private Sub Command4_Click()
End
End Sub



FACTURACION EN VISUAL BASIC

Posted by : Jason
lunes, 31 de julio de 2017
1 Comment

- Copyright © Jason Igneel -