elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


  Mostrar Temas
Páginas: [1] 2 3
1  Programación / Programación Visual Basic / Control Ventas en: 24 Octubre 2024, 23:33 pm
Hola
eatoy intentando de hacer el proceso de  la venta de cualquier articulo y de cualquier almacen
en el formulario del almacen puedo hacear cualquier almacen
En el fomulario Frmfacturacionventa selecciono la facturacion y en el menu
de edicion se escoje nueva venta y va al formulario FrmCompra que es para vebta
hay un menu de buacr almaceb dentro del almacen hay abrir almacen y cerrar almacen
cuando digo abrir almacen me pone los datos en el list1. hasta ahi todo bien


https://workupload.com/file/YDzEPkjcWju



me faltaria pasar datos del liat1 a los text y hacer el proceso de venta para cada articuko

gracias
2  Programación / Programación Visual Basic / leer informacion a list1 en: 23 Agosto 2024, 12:15 pm
Hola
estoy intentando de leer la informacion del archivo almacen.regdata que esta en el directorio almacen al list1 y no lo consigo
tengo error en el proceso listar
aqui el archivo



https://workupload.com/file/Xd6GygBshTR


gracias
3  Programación / Programación Visual Basic / problema en i,primir varias hojas en: 15 Julio 2024, 00:02 am
Hola
tengo un problema a la hora de imprimir varias hojas me hace el listado seguido
hago el siguiente calculo

Código
  1.  
  2.  
  3. If i = 24 Then    
  4.  
  5.  
  6. Printer.NewPage
  7.  
  8. encabezado
  9. End If
  10.  
  11.  


no logro que me cambie de hoja



Código
  1.  
  2.  
  3. Private Sub imprimir()
  4. ' Imprimir
  5.  
  6. 'Imprimir
  7. Dim BeginPage As Long, EndPage As Long, NumCopies As Long, Orientation As Long, Tell As Long
  8. Dim i As Integer
  9. Dim fuente As StdFont
  10. Set fuente = Printer.Font
  11. 'Set fuente = Printer.Font
  12. CommonDialog1.CancelError = True
  13.  
  14. On Error GoTo ErrHandler
  15.  
  16.  
  17.  
  18. CommonDialog1.Flags = &H40&
  19.   CommonDialog1.ShowPrinter
  20.  
  21.  
  22. BeginPage = CommonDialog1.FromPage
  23.   EndPage = CommonDialog1.ToPage
  24.   NumCopies = CommonDialog1.Copies
  25.  
  26.  
  27.  Printer.Orientation = CommonDialog1.Orientation
  28.  
  29.  
  30.  With Printer
  31.   If .Orientation = 1 Then
  32.        .Orientation = vbPRORPortrait
  33.    Else
  34.        .Orientation = vbPRORLandscape
  35.    End If
  36.  
  37.  End With
  38.  
  39.  
  40. On Error Resume Next
  41.  
  42. Dim numCols As Integer
  43.    Dim filas As Long
  44.  
  45.  
  46. encabezado
  47.  
  48.  
  49.    listarcolumnas
  50.  
  51.  
  52.   If i = 24 Then    
  53.  
  54.  
  55. Printer.NewPage
  56.  
  57. encabezado
  58. End If
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. Printer.Print
  68.  
  69.  
  70.  
  71.  
  72. Set Printer.Font = fuente
  73.  
  74.  
  75. Printer.EndDoc
  76. ' Set Printer.Font = fuente
  77. Exit Sub
  78.  
  79. ErrHandler:
  80. ' El usuario hizo clic en el botón Cancelar.
  81. Exit Sub
  82.  
  83.  
  84. End Sub
  85.  
  86. Private Sub listarcolumnas()
  87. Dim AnchoPapel As Integer
  88.    Dim MargenIzquierdo As Integer
  89.    Dim numCols As Integer
  90.    Dim filas As Long
  91.    Dim ultimafila As Long
  92.    Dim k As Long, j As Long, i As Integer, n As Integer, anchocol As Integer
  93.    Dim linea As String
  94.    Dim margen As Integer
  95.    Dim fuente As StdFont
  96.  
  97.  
  98.    Set fuente = Printer.Font
  99.    numCols = 9
  100.    Printer.FontName = "Courier New"  ' una fuente monoespaciada, si no el trabajo es más laborioso...
  101.    filas = ((List1.ListCount + 1) \ numCols)
  102.    ultimafila = ((List1.ListCount + 1) Mod numCols) ' columnas que tendrá la última fila.
  103.    anchocol = ((AnchoPapel - MargenIzquierdo) \ numCols)
  104.  
  105.  
  106.    For k = 0 To filas - 1
  107.        n = margen
  108.        For i = 0 To numCols - 1
  109.            Printer.CurrentX = n  ' imprime el texto de la columna 'i'
  110.            Printer.Print List1.List(j + i)
  111.            n = (n + anchocol)
  112.        Next
  113.  
  114.        j = (j + numCols)
  115.        Printer.CurrentY = (Printer.CurrentY + Printer.TextHeight("t"))  ' el textheight depende de la fuente seleccionada en la impresora, no importa el texto entre paréntesis... es fijo para la  fuente.
  116.    Next
  117.  
  118.    If (ultimafila > 0) Then ' la última fila tiene 1 o más columnas, pero menos que 'numcols'.
  119.        n = margen
  120.        For i = 0 To ultimafila - 1
  121.            Printer.CurrentX = n  ' imprime el texto de la columna 'i'
  122.            Printer.Print List1.List(j + i)
  123.            n = (n + anchocol)
  124.        Next
  125.    End If
  126.  
  127.    Set Printer.Font = fuente
  128. End Sub
  129. Private Sub encabezado()
  130. Printer.Font.Name = "Courier"
  131. Printer.Font.Size = 10
  132. Printer.FontBold = True
  133.  
  134. Printer.Print Tab(5); "HORA: " & UCase(Format(Now, "hh:mm ")); Tab(80); "Fecha:"; Date
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. Printer.Font.Name = "Arial"
  143. Printer.Font.Size = 10
  144. Printer.FontBold = True
  145.  
  146. Printer.DrawWidth = 10
  147. Printer.DrawStyle = 2
  148.  
  149.  
  150.  
  151.  
  152. Printer.CurrentX = 4000
  153. Printer.CurrentY = 0
  154. Printer.Print "Listado de Almacen"
  155.  
  156.  
  157.  
  158.  
  159. Printer.CurrentY = 1000
  160. Printer.CurrentX = 200: Printer.Print "Codigo"
  161. Printer.CurrentY = 1000
  162. Printer.CurrentX = 1000: Printer.Print "Stock"
  163. Printer.CurrentY = 1000
  164. Printer.CurrentX = 2900: Printer.Print "Articulo"
  165. Printer.CurrentY = 1000
  166. Printer.CurrentX = 5000: Printer.Print "Precio"
  167. Printer.CurrentY = 1000
  168. Printer.CurrentX = 6000: Printer.Print "Impuesto"
  169. Printer.CurrentY = 1000
  170. Printer.CurrentX = 7200: Printer.Print "Uds.Caja"
  171. Printer.CurrentY = 1000
  172. Printer.CurrentX = 8300: Printer.Print "Umbral"
  173. Printer.CurrentY = 1000
  174. Printer.CurrentX = 9500: Printer.Print "Pedido"
  175. Printer.CurrentY = 1000
  176. Printer.CurrentX = 10500: Printer.Print "En Oferta"
  177.  
  178.  
  179. End Sub
  180.  
  181.  
  182.  
  183.  
  184.  


gracias


4  Programación / Programación Visual Basic / Programa Facturacion en: 18 Junio 2024, 00:00 am
Hola
estoy tratando de acabar el programa de Facturacion que tengo dos problemas
en el formulario almacen todo funciona bien

1:cuando cargo los datos de un almacen con el combo del formulario venta los carga bien por primera vez, cuando cargo otro almecen no me lo carga al combo del formulario venta

2:en el formulario compra tendria que ver un combo para dichos articulos de compra del formulario de almacen, para poder hacer dicha compra del articulo.

aqui te dejo el archivo que tengo hasta ahora


https://workupload.com/archive/6DYH2KtENe

lo de subir el archivo no se si lo he hecho bien, si sale bien veras dos archivos iguales


gracias

5  Programación / Programación Visual Basic / Problema de array en: 12 Junio 2024, 13:44 pm
Hola
estoy haciendo una aplicacion de loteria que en el array solo me acepta 19 numeros
¿como puedo hacer que el array me acepte 20 numeros o mas?

en el text1.text hay el total de las apuestas
el tect5.text esta la fecha actual
en el list1 estan todas las apuestas del text1.text


Código:

Option Explicit


Private Sub MakeUniqueCombinationOfSix(AryOfWhat() As Variant)

On Error GoTo MakeUniqueCombinationOfSixError

Dim NCnt1 As Integer, NCnt2 As Integer, NCnt3 As Integer
Dim NCnt4 As Integer, NCnt5 As Integer, NCnt6 As Integer
Dim UpperBoundsOfArray As Integer, LowerBoundsOfArray As Integer
List1.Clear
UpperBoundsOfArray = UBound(AryOfWhat)
LowerBoundsOfArray = LBound(AryOfWhat)

For NCnt1 = LowerBoundsOfArray To UpperBoundsOfArray
  For NCnt2 = NCnt1 + 1 To UpperBoundsOfArray
    For NCnt3 = NCnt2 + 1 To UpperBoundsOfArray
      For NCnt4 = NCnt3 + 1 To UpperBoundsOfArray
        For NCnt5 = NCnt4 + 1 To UpperBoundsOfArray
          For NCnt6 = NCnt5 + 1 To UpperBoundsOfArray
            List1.AddItem AryOfWhat(NCnt1) & "," & AryOfWhat(NCnt2) & "," & _
                          AryOfWhat(NCnt3) & "," & AryOfWhat(NCnt4) & "," & _
                          AryOfWhat(NCnt5) & "," & AryOfWhat(NCnt6)
                         
               Text1.Text = List1.ListCount
                                   
                         
                         
          Next NCnt6
        Next NCnt5
      Next NCnt4
    Next NCnt3
  Next NCnt2
Next NCnt1






Exit Sub
MakeUniqueCombinationOfSixError:

MsgBox "MakeUniqueCombinationOfSix " & Err.Number & ":" & Err.Description

End Sub



Private Sub Form_Load()
Text5.Text = Date
        Randomize
        Dim A() As Variant
        A = Array(4, 6, 14, 18, 19, 20, 21, 24, 26, 27, 31, 32, 35, 36, 40, 41, 42, 47, 49)
        MakeUniqueCombinationOfSix A
End Sub





gracias

6  Programación / Programación Visual Basic / imrimir varias hojas con numero de pagina en: 24 Noviembre 2022, 16:16 pm
Hola necesito imprimir varias paginas  con numero de pagina

en la facturacion de venta

el problema esta en cuanto imprimo lo hace todo seguido y hay un formato, cuando llega al final de la hoja y pasa a la siguiente el formato no lo hace
subo el ejemplo


https://workupload.com/file/4XXRNywJuA8

gracias
7  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
8  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
9  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

Código
  1.  
  2.  
  3. Private Sub CmbArticulo_Click()
  4.    Dim Id As Integer
  5.  
  6.    If (CmbArticulo.ListIndex >= 0) Then
  7.        Id = CmbArticulo.ItemData(CmbArticulo.ListIndex)
  8.        RegArt = FrmAlmacen.ArticuloByCode(Id)
  9.        With RegArt
  10.            TxtUnidades.Text = CStr(.UnidadesPorCaja)
  11.            Call EstablecerValorImpuestos(.PrecioUnitario, .ImpuestoIVA)
  12.  
  13.            If (.IdOferta > 0) Then
  14.                LabOferta.Caption = "¿Está en oferta?:     SI"
  15.                Id = FrmOfertas.BuscarPorCodigo(.IdOferta, RegOfer)
  16.            Else
  17.                LabOferta.Caption = "¿Está en oferta?:     NO"
  18.                TxtDescuento.Text = "- 0.0"
  19.                Call VaciarRegOferta
  20.            End If
  21.        End With
  22.  
  23.        Call Totalizar
  24.    End If
  25. End Sub
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  



como puedo leer si son diferentes facturaciones y que vaya al combo del formulario frmcompra


gracias
10  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:


Código
  1.  
  2.  
  3. Option Explicit
  4. Private Type departamento
  5. d As Date
  6. w As Double
  7. x As Double
  8. y As Double
  9. z As Double
  10. zl As Double
  11. End Type
  12.  
  13. Dim dpto As departamento
  14. Dim NumRecs As Long
  15.  
  16. Private Sub Command1_Click()
  17. 'Grafico
  18. DrawPie
  19. End Sub
  20.  
  21. Private Sub DrawPiePiece(lColor As Long, ByVal fStart As Double, ByVal fEnd As Double)
  22.  Const PI As Double = 3.14159265359
  23.  Const CircleEnd As Double = -2 * PI
  24.  Dim dStart As Double
  25.  Dim dEnd As Double
  26.  
  27.  Picture2.FillColor = lColor
  28.  Picture2.FillStyle = 0
  29.  dStart = fStart * (CircleEnd / 100)
  30.  dEnd = fEnd * (CircleEnd / 100)
  31.  Picture2.Circle (170, 150), 100, , dStart, dEnd
  32. End Sub
  33.  
  34. Private Sub DrawPie()
  35.  Dim Disp As Single, Alq As Single, i As Byte, Vt As Integer, Ang1 As Single, Ang2 As Single
  36.  
  37.  Picture2.Cls
  38.  
  39.  Picture2.AutoRedraw = True
  40.  Picture2.BackColor = &H8000000E
  41.  Picture2.ScaleMode = vbPixels
  42.  
  43.  
  44.  Dim xx As Double
  45.  Dim yy As Double
  46.  Dim zz As Double
  47.  Dim uu As Double
  48.  
  49.  
  50.  With dpto
  51.    If .w = 0 Then MsgBox "No hay registros para" & DateTime.Date & "para ser mostrado"
  52.        Text1.Text = .d
  53.        If .w > 0 Then
  54.        xx = (.x * 100) / .w
  55.        yy = xx + (.y * 100) / .w
  56.        zz = yy + (.z * 100) / .w
  57.        uu = zz + (.zl * 100) / .w
  58.  
  59.        Call DrawPiePiece(QBColor(1), 0.001, xx)
  60.        Call DrawPiePiece(QBColor(6), xx, yy)
  61.        Call DrawPiePiece(QBColor(3), yy, zz)
  62.        Call DrawPiePiece(QBColor(5), zz, uu)
  63.    End If
  64.  
  65.  End With
  66. End Sub
  67.  
  68. Private Sub Command2_Click()
  69. 'Guardar
  70. With dpto
  71.      .d = Date
  72.      .w = 650
  73.      .x = 301
  74.      .y = 39
  75.      .z = 109
  76.      .zl = 201
  77.    End With
  78.  
  79.    NumRecs = 1
  80.    Open App.Path & "\PieData.dat" For Random As #1 Len = 64
  81.      Put #1, 1, NumRecs
  82.      Put #1, NumRecs + 1, dpto
  83.    Close #1
  84. End Sub
  85.  
  86. Private Sub Command3_Click()
  87. 'Leer
  88. If FileLen(App.Path & "\PieData.dat") > 60 Then
  89.    Open App.Path & "\PieData.dat" For Random As #1 Len = 64
  90.      Get #1, 1, NumRecs
  91.      Get #1, NumRecs + 1, dpto
  92.    Close #1
  93.    DrawPie
  94.  End If
  95. End Sub
  96.  
  97. Private Sub Command4_Click()
  98. End
  99. End Sub
  100.  
  101. Private Sub Command5_Click()
  102. Picture2.Cls
  103. End Sub
  104.  
  105.  
  106.  
  107.  




gracias
Páginas: [1] 2 3
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines