|
Mostrar Temas
|
Páginas: [1] 2 3
|
2
|
Programación / Programación Visual Basic / apertura y cierre de saldo
|
en: 4 Octubre 2022, 12:50 pm
|
Hola Serapis
he conseguido arreglar el programa de facturacion o sea ahora puedo hacer compras y ventas, bueno el de compras estaba practicamente eho, he tenido que hacer el de ventas. funciona todo bien
ahora solo faltaria hacer apertura de saldo y cierre para cada dia, un ejemplo una idea con codigo yo ya lo adaptaria.
muchas gracias
|
|
|
3
|
Programación / Programación Visual Basic / problema con hacer el carrito de almacen
|
en: 13 Julio 2022, 13:48 pm
|
hola serapis estoy intentando de hacer el carrito de la compra de facturacion, pero lo quiero adaptar para hacer el carrito de articulos de almacen para poder comprar, Editar y eliminar articulos, para control de varios almacenes.
el menu principal seria
archivo = crear almacen, abrir almacen, cerrar almacen
edicion = comprar articulos, editar articulo, eliminar articulos
en el list1 seria
Codigo Stock Articulo impuesto Uda.caja Umbral Pedido En Oferta
seria de mucha utilidad si me pudiese hacer la version del formulario frmalmacen
seria hacer el carrito de la compra de articulos
me hago un lio con las funciones el programa no para de darme errores
muchas gracias
|
|
|
4
|
Programación / Programación Visual Basic / leer archivo combo
|
en: 5 Junio 2022, 15:20 pm
|
tengo un pequeño problema del programa Facturacion a la hora de crear nueva facturacion va bien a la hora de leer la informacion parece que lee pero no me lee la informacion en el formulario frmcompra del combo donde tiene que ir los articulos de leer la facturacion. si yo creo varias facturaciones siempre en combo me lee la misma facturacion el codigo del combo es el siguiente Private Sub CmbArticulo_Click() Dim Id As Integer If (CmbArticulo.ListIndex >= 0) Then Id = CmbArticulo.ItemData(CmbArticulo.ListIndex) RegArt = FrmAlmacen.ArticuloByCode(Id) With RegArt TxtUnidades.Text = CStr(.UnidadesPorCaja) Call EstablecerValorImpuestos(.PrecioUnitario, .ImpuestoIVA) If (.IdOferta > 0) Then LabOferta.Caption = "¿Está en oferta?: SI" Id = FrmOfertas.BuscarPorCodigo(.IdOferta, RegOfer) Else LabOferta.Caption = "¿Está en oferta?: NO" TxtDescuento.Text = "- 0.0" Call VaciarRegOferta End If End With Call Totalizar End If End Sub
como puedo leer si son diferentes facturaciones y que vaya al combo del formulario frmcompra gracias
|
|
|
5
|
Programación / Programación Visual Basic / poner tanto por ciento en el grafico circular
|
en: 30 Marzo 2022, 12:30 pm
|
estoy haciendo un pequeño programa con el cual hay unos datos fijos y quisiera poner esos datos en el grafico circular hay cuatro datos pero hay un quinto dato que falta dibujar que es la variable z1 en el grafico y poner el dato en el grafico. en el programa faltaria controlar el indice de introducir los datos que empezara por 1,2,3,4,5, etc el ejemplo que tengo hasta ahora es el siguiente: Option Explicit Private Type departamento d As Date w As Double x As Double y As Double z As Double zl As Double End Type Dim dpto As departamento Dim NumRecs As Long Private Sub Command1_Click() 'Grafico DrawPie End Sub Private Sub DrawPiePiece(lColor As Long, ByVal fStart As Double, ByVal fEnd As Double) Const PI As Double = 3.14159265359 Const CircleEnd As Double = -2 * PI Dim dStart As Double Dim dEnd As Double Picture2.FillColor = lColor Picture2.FillStyle = 0 dStart = fStart * (CircleEnd / 100) dEnd = fEnd * (CircleEnd / 100) Picture2.Circle (170, 150), 100, , dStart, dEnd End Sub Private Sub DrawPie() Dim Disp As Single, Alq As Single, i As Byte, Vt As Integer, Ang1 As Single, Ang2 As Single Picture2.Cls Picture2.AutoRedraw = True Picture2.BackColor = &H8000000E Picture2.ScaleMode = vbPixels Dim xx As Double Dim yy As Double Dim zz As Double Dim uu As Double With dpto If .w = 0 Then MsgBox "No hay registros para" & DateTime.Date & "para ser mostrado" Text1.Text = .d If .w > 0 Then xx = (.x * 100) / .w yy = xx + (.y * 100) / .w zz = yy + (.z * 100) / .w uu = zz + (.zl * 100) / .w Call DrawPiePiece(QBColor(1), 0.001, xx) Call DrawPiePiece(QBColor(6), xx, yy) Call DrawPiePiece(QBColor(3), yy, zz) Call DrawPiePiece(QBColor(5), zz, uu) End If End With End Sub Private Sub Command2_Click() 'Guardar With dpto .d = Date .w = 650 .x = 301 .y = 39 .z = 109 .zl = 201 End With NumRecs = 1 Open App.Path & "\PieData.dat" For Random As #1 Len = 64 Put #1, 1, NumRecs Put #1, NumRecs + 1, dpto Close #1 End Sub Private Sub Command3_Click() 'Leer If FileLen(App.Path & "\PieData.dat") > 60 Then Open App.Path & "\PieData.dat" For Random As #1 Len = 64 Get #1, 1, NumRecs Get #1, NumRecs + 1, dpto Close #1 DrawPie End If End Sub Private Sub Command4_Click() End End Sub Private Sub Command5_Click() Picture2.Cls End Sub
gracias
|
|
|
6
|
Programación / Programación Visual Basic / Problema hacer Menu
|
en: 5 Febrero 2022, 13:51 pm
|
Hola soy corlo
estoy haciendo un formulario menu mdi principal aqui no hay problema cuando hago el primer menu fichero no hay problema pero cuando hago el segundo menu clientes los botones de nuevo, editar,eliminar,imprimir me van al formulario mdi hay alguna manera de que los botones me vaya al menu clientes con su respectivo codigo. si voy haciendo mas menus los botones de los respectivos menus me van ha ir al formulario principal mdi y todo el codigo tambien. gracias
|
|
|
7
|
Programación / Programación Visual Basic / Guardar list2 y leer list1
|
en: 15 Diciembre 2021, 17:59 pm
|
Hola soy corlo
ahora en pantalla principal hay list1 y list2
en el list2 es donde se va entrando los articulos desde el formulario y en el list1 es donde se guardan los datos del list2 al list1 para poder sumar el contado y tarjeta de credito
A la hora de entrar los datos al list2 desde el formulario lo hace bien, el problema es para guardar todos los datos del list2 a una fila del list1 asi sucesivamente con numero de ticket 1,2,3, etc del list1
a la hora de guardar seria:Command2_click()
N de ticket, fecha y hora, metodo de pago, total en el list1
en el metodo de pago esta en la pantalla principal no desde el formulario
a la hora de leer seria list1_click() N ticket, Fecha y hora, Producto, Precio Unitario, cantidad, subtotal, total, en el list2
Gracias
|
|
|
8
|
Programación / Programación Visual Basic / sumar list1
|
en: 3 Diciembre 2021, 00:44 am
|
Hola soy colro necesito sumar el total contado y el total tarjeta de credito consigo sumar el total del list1 pongo el codigo Case 1 ' Leer fichero de facturación FrmFile.Show 1 Dim h As Integer Dim totalcontado As Integer Dim totaltcredito As Integer totalcontado = 0: totaltcredito = 0 If (Len(FrmFile.File) > 0) Then If (LeerFacturacion(App.Path & "\" & FrmFile.File) = True) Then Call Activar(True) For h = 0 To List1.ListCount - 1 If reg2.MetodoDePago = "0" Then totalcontado = totalcontado + Val(Split(List1.List(h), vbTab)(6)) End If If reg2.MetodoDePago = "1" Then totaltcredito = totaltcredito + Val(Split(List1.List(h), vbTab)(6)) End If Next h txttotal.Text = Format(totalcontado, "#,##0.00") Txttotal1.Text = Format(totaltcredito, "#,##0.00") Else Call Activar(False) End If End If
Gracias
|
|
|
9
|
Programación / Programación Visual Basic / leer datos en archivo secuencial
|
en: 22 Noviembre 2021, 16:41 pm
|
Hola soy corlo estoy haciendo una mini aplicacion de guardar datos de factura y leerlos por pantalla, en archivo secuencial. guardar datos lo hace bien el problema esta en leer los datos de la factura en pantalla el archivo es 1.txt y hay lo siguiente: ============================== COMPROBANTE DE VENTA ============================== TICKET Nº: 1 TIPO : CONTADO FECHA : 20/11/2021 HORA : 20:30:59 ------------------------------------------------------- R.U.C/C.I : a CLIENTE : a =============================== CANTIDAD PRODUCTO PRECIO SUBTOTAL =============================== 12 r 8 96 3 k 1.5 4,5 =============================== TOTAL : 100,50 ------------------------------------------- GRACIAS POR SU COMPRA! me sale todo mezclado el código que tengo hasta ahora es el siguiente: Option Explicit Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const LB_SETTABSTOPS = &H192 Dim I As Integer Dim orden As Integer 'numero de ticket Dim fecha As Date 'para leer la fecha Dim hora As Date 'para leer la hora Dim contado As String 'para contado Dim credito As String 'para credito Dim cedu1 As String ' para el RUC/C.I Dim nom1 As String ' para el cliente 'abajo son datos del list1 Dim cantidad As Integer Dim producto As String * 12 Dim preciox As String * 8 Dim subtot As Double 'varible del total Dim tot As Double Private Sub Command4_Click() End End Sub Private Sub Command5_Click() 'Nuevo registro '//recuperar el dato. Open App.Path & "\Numero1.txt" For Input As #1 Do While Not EOF(1) Input #1, orden Loop Close #1 Txtnum = orden + 1 List1.Clear txtCedula1.Text = "" txtNombre1.Text = "" total.Text = "" txtCedula1.SetFocus End Sub Private Sub Command6_Click() 'Guardar Factura Dim cantidadtotal As Double Dim k As Integer orden = Txtnum.Text On Error GoTo salir Open App.Path & "\Numero1.txt" For Append As #1 Print #1, Txtnum Close #1 Dim bmx As String bmx = App.Path + "\" + Txtnum + ".txt" Open bmx For Append As #1 Txtnum = orden Print #1, Print #1, Print #1, Print #1, Tab(1); String(44, "=") Print #1, Tab((44 - Len("COMPROBANTE DE VENTA")) \ 2); "COMPROBANTE DE VENTA" Print #1, Tab(1); String(44, "=") If Option1.Value = True Then Print #1, Tab(1); "TICKET Nº: " & Txtnum.Text; Tab(44 - Len("TIPO : CONTADO")); "TIPO : CONTADO" Else Print #1, Tab(1); "TICKET Nº: " & Txtnum.Text; Tab(44 - Len("TIPO : CREDITO")); "TIPO : CREDITO" End If Print #1, Tab(1); "FECHA : " & Date; Tab(44 - Len("HORA : " & Time)); "HORA : " & Time Print #1, Tab(1); String(44, "-") Print #1, Tab(1); "R.U.C/C.I : " & txtCedula1.Text Print #1, Tab(1); "CLIENTE : " & txtNombre1.Text Print #1, Tab(1); String(44, "=") Print #1, Tab(1); "CANTIDAD"; Tab(11); "PRODUCTO"; Tab(24); "PRECIO"; Tab(37); "SUBTOTAL" Print #1, Tab(1); String(44, "=") For k = 0 To List1.ListCount - 1 Print #1, List1.List(k) Next k Print #1, Tab(1); String(44, "=") Print #1, Tab(15); "TOTAL : "; Tab(43 - Len(Format(total.Text, "#,##0.00"))); Format(total.Text, "#,##0.00") Print #1, Tab(16); "-----------------------------" Print #1, Print #1, Tab((44 - Len("GRACIAS POR SU COMPRA!")) \ 2); "GRACIAS POR SU COMPRA!" For I = 1 To 10 Print #1, Next I Close #1 Option1.Value = False Option2.Value = False txtCedula1.Text = "" txtNombre1.Text = "" List1.Clear cant.Text = "" prod.Text = "" precio.Text = "" subtotal.Text = "" total.Text = "" cant.SetFocus Exit Sub salir: Dim msgb msgb = MsgBox("Error Nº : [ " & Err.Number & " ]" & " " & Err.Description, vbOKCancel + vbInformation) End Sub Private Sub Command7_Click() 'Leer Factura Dim tabs(0 To 3) As Long tabs(0) = 20 tabs(1) = 60 tabs(2) = 95 tabs(3) = 138 ' Set the tabs. SendMessage List1.hwnd, LB_SETTABSTOPS, 4, tabs(1) Dim str As String Dim thj As String Dim plo As Boolean Dim j As Integer Dim h As Integer On Error GoTo lo List1.Clear thj = App.Path + "\" + Txtnum.Text + ".txt" If Dir(thj) <> "" Then Open thj For Input As #1 Input #1, orden Txtnum.Text = orden Input #1, fecha Label4.Caption = fecha Input #1, hora Label5.Caption = hora Input #1, contado Input #1, credito Input #1, cedu1, nom1 txtCedula1.Text = cedu1 txtNombre1.Text = nom1 While Not EOF(1) Input #1, cantidad, producto, preciox, subtot cant.Text = cantidad prod.Text = producto precio.Text = preciox subtotal.Text = subtot List1.AddItem cantidad & vbTab & producto & vbTab & preciox & vbTab & subtot Wend j = 0 For h = 0 To List1.ListCount - 1 j = j + Val(Split(List1.List(h), vbTab)(3)) Next h total.Text = j Close #1 End If If contado= contado Then Option1.Value = True Else If credito = credito Then Option2.Value = True End If End If Exit Sub lo: If Not plo = True Then MsgBox "La Factura no existe, gracias", vbCritical End If End Sub Private Sub Command8_Click() 'Agregar Dim h As Integer Dim j As Double cantidad = cant.Text producto = prod.Text preciox = precio.Text subtot = subtotal.Text List1.AddItem cantidad & vbTab & producto & vbTab & preciox & vbTab & subtot j = 0 For h = 0 To List1.ListCount - 1 j = j + Split(List1.List(h), vbTab)(3) Next h total.Text = Format(j, "#,##0.00") cant.Text = "" prod.Text = "" precio.Text = "" subtotal.Text = "" cant.SetFocus End Sub Private Sub Form_Load() Dim tabs(0 To 3) As Long tabs(0) = 20 tabs(1) = 123 tabs(2) = 237 tabs(3) = 370 SendMessage List1.hwnd, LB_SETTABSTOPS, 4, tabs(1) Option1.Value = False Option2.Value = False Open App.Path & "\Numero1.txt" For Append As #1 Close #1 Open App.Path & "\Numero1.txt" For Append As #1 Close #1 '//recuperar el dato. Open App.Path & "\Numero1.txt" For Input As #1 Do While Not EOF(1) Input #1, orden Loop Close #1 Txtnum = orden + 1 End Sub Private Sub List1_Click() Text1.Text = Mid(List1.Text, 1, InStr(1, List1.Text, " ") - 1) Text2.Text = Mid(List1.Text, InStr(1, List1.Text, " ") + 1) I = List1.ListIndex End Sub Private Sub Option1_Click() Option2.Value = False End Sub Private Sub Option2_Click() Option1.Value = False End Sub Private Sub precio_KeyUp(KeyCode As Integer, Shift As Integer) subtotal.Text = cant.Text * Val(precio.Text) End Sub Private Sub Timer1_Timer() Label4.Caption = Date Label5.Caption = Format(Time, "hh:mm:ss") End Sub
Gracias
|
|
|
10
|
Programación / Programación Visual Basic / eliminar registro
|
en: 9 Noviembre 2021, 19:14 pm
|
Hola soy corlo estoy haciendo una mini aplicacion en añadir datos a los textbox , para luego leer los datos con el combo y una opcion para eliminar los datos. añadir los datos: lo hace bien leer los datos: lo hace bien eliminar los datos: elimina el dato en el combo pero no elimina los datos de los textbox no se que hago mal paso el codigo que tengo hasta ahora en un formulario Option Explicit
Private Sub Boton_añadir_Click() totalregistros = totalregistros + 1 If totalregistros > 50 Then MsgBox "lista completa", 16, "error" Else agenda(totalregistros).Nombre = Nom.Text agenda(totalregistros).apellidos = Ape.Text agenda(totalregistros).telefono = Tel.Text agenda(totalregistros).Edad = Val(Edad.Text)
Combo2.AddItem Nom.Text End If Nom.SetFocus End Sub
Private Sub Boton_eliminar_Click() Dim b As String
b = MsgBox("Eliminar Registro:" + Nom.Text, 3 + 32, "Eliminar") If b = vbYes Then
If Combo2.ListIndex <> -1 Then
Combo2.RemoveItem (Combo2.ListIndex)
End If
totalregistros = totalregistros - 1
agenda(totalregistros).Nombre = Nom.Text agenda(totalregistros).apellidos = Ape.Text agenda(totalregistros).telefono = Tel.Text agenda(totalregistros).Edad = Val(Edad.Text)
End If Nom.Text = "" Ape.Text = "" Tel.Text = "" Edad.Text = "" End Sub
Private Sub Boton_fin_Click() End End Sub
Private Sub Botonnuevo_Click() Nom.Text = "" Ape.Text = "" Tel.Text = "" Edad.Text = "" Nom.SetFocus
End Sub
Private Sub Combo2_Click() Dim n As Integer n = Combo2.ListIndex + 1
Nom.Text = agenda(n).Nombre Ape.Text = agenda(n).apellidos Tel.Text = agenda(n).telefono Edad.Text = Val(agenda(n).Edad)
End Sub
Private Sub Ape_GotFocus() Ape.SelStart = 0 Ape.SelLength = Len(Ape.Text) End Sub
Private Sub Edad_GotFocus() Edad.SelStart = 0 Edad.SelLength = Len(Edad.Text) End Sub
Private Sub Nom_GotFocus() Nom.SelStart = 0 Nom.SelLength = Len(Nom.Text) End Sub Private Sub Tel_GotFocus() Tel.SelStart = 0 Tel.SelLength = Len(Tel.Text) End Sub
Private Sub Form_Load() totalregistros = 0 End Sub
y en un modulo Type registro Nombre As String * 15 apellidos As String * 25 telefono As String * 15 Edad As String * 3 End Type Global agenda(1 To 50) As registro Global totalregistros As Integer
gracias
|
|
|
|
|
|
|