'----****
'----**** MyBusiness POS V20
'----**** Version del script: 1.0
'----**** 19/02/2020
'----****
Public Sub Main()
Exit Sub
if rstArticulo.EOF Then
if rstClavesAdd Is Nothing Then
Exit Sub
end if
else
Set rstArticulo = CreaRecordSet( "SELECT * FROM prods WHERE articulo = '" & rstArticulo("Articulo") & "'", Ambiente.Connection )
If clEmpty( rstArticulo("Url") ) Then
if Ambiente.rstEConfig("usarweblocal") <> 0 Then
cUrl = Trim(Ambiente.rstEConfig("weblocal")) & Trim( rstArticulo("imagen") )
else
cUrl = Trim( rstArticulo("imagen") )
end if
else
cUrl = Trim( rstArticulo("url") )
end if
end if
if Not rstClavesAdd Is Nothing Then
if Not clEmpty( "" & rstClavesAdd("Imagen") ) Then
if Ambiente.rstEConfig("usarweblocal") <> 0 Then
cUrl = Trim(Ambiente.rstEConfig("weblocal")) & Trim( rstClavesAdd("imagen") )
else
cUrl = Trim( rstClavesAdd("imagen") )
end if
end if
end if
If clAt(".mpg", cUrl) > 0 Or _
clAt(".mov", cUrl) > 0 Or _
clAt(".mp3", cUrl) > 0 Or _
clAt(".wav", cUrl) > 0 Or _
clAt(".avi", cUrl) > 0 Or _
clAt(".jpg", cUrl) > 0 Or _
clAt(".gif", cUrl) > 0 Or _
clAt(".mpeg", cUrl) > 0 Then
cHtml = ""
cHtml = cHtml & "<html>"
cHtml = cHtml & "<head>"
cHtml = cHtml & "<title>Artículo: " & Trim(rstArticulo("Descrip")) & "</title>"
cHtml = cHtml & "</head>"
cHtml = cHtml & "<body>"
cHtml = cHtml & "<p>"
cHtml = cHtml & "</p>"
cHtml = cHtml & "<p align='center'><b><font face='Arial' size='5'>" & Trim(rstArticulo("Descrip")) & "</font></b></p>"
if clAt(".jpg", cUrl) > 0 Or _
clAt(".gif", cUrl) > 0 Or _
clAt(".bmp", cUrl) > 0 Then
cHtml = cHtml & "<p align='center'><img border='0' src='" & cUrl & "' width=100% start='fileopen'></p>"
else
cHtml = cHtml & "<p align='center'><img border='0' dynsrc='" & cUrl & "' start='fileopen'></p>"
end if
Else
Me.Wb.Navigate cUrl
Exit Sub
End If
cHtml = cHtml & "<center><table border='1' width='100%'>"
'cHtml = cHtml & "<tr>"
'cHtml = cHtml & "<td><p align='left'><b><font size='3'>Producto </font></b></p></td>"
'cHtml = cHtml & "<td><p align='left'><b><font size='3'>" & Trim(rstArticulo("Descrip")) & "</font></b></p></td>"
'cHtml = cHtml & "</tr>"
'cHtml = cHtml & "<tr>"
'cHtml = cHtml & "<td><p align='left'><b><font size='3'>Precio </font></b></p></td>"
'cHtml = cHtml & "<td><p align='left'><b><font size='3'>$ " & Libreria.Formato(rstArticulo("Precio1"), Ambiente.FDinero ) & "</font></b></p></td>"
'cHtml = cHtml & "</tr>"
cHtml = cHtml & "<tr>"
cHtml = cHtml & "<td><p align='left'><b><font size='3'>Existencia </font></b></p></td>"
cHtml = cHtml & "<td><p align='center'><b><font size='3'> " & Libreria.Formato(rstArticulo("Existencia"), Ambiente.Formato ) & " " & rstArticulo("Unidad") & "</font></b></p></td>"
cHtml = cHtml & "</tr>"
if Not Ambiente.Conexiones Is Nothing Then
' Obtenemos la existencia en cada sucursal
For n = 1 To Ambiente.Conexiones.Count
Set Sucursal = Ambiente.Conexiones(n)
if Sucursal.Connection.State = 1 Then
Set rstProd = CreaRecordSet( "SELECT articulo, existencia, unidad FROM prods WHERE articulo = '" & rstArticulo("Articulo") & "'", Sucursal.Connection, False )
if Not rstProd Is Nothing Then
if Not rstProd.EOF Then
cHtml = cHtml & "<tr>"
cHtml = cHtml & "<td><p align='left'><b><font size='3'>Existencia en <BR>" & Sucursal.Descripcion & " <BR>" & Sucursal.Direccion & " </font></b></p></td>"
cHtml = cHtml & "<td><p align='center'><b><font size='3'> " & Libreria.Formato(rstProd("Existencia"), Ambiente.Formato ) & " " & rstProd("Unidad") & "</font></b></p></td>"
cHtml = cHtml & "</tr>"
end if
end if
end if
Next
end if
cHtml = cHtml & "</table></center>"
cHtml = cHtml & "</body></html>"
cHtml = cHtml & "</body>"
cHtml = cHtml & "</html>"
CreaHTML "", (cHtml)
End Sub
Relacionado