Cambios en formato de pagaré
This commit is contained in:
@@ -7462,14 +7462,27 @@ Partial Class Clientes
|
||||
|
||||
Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click
|
||||
Dim memoryStreamDoc As New System.IO.MemoryStream
|
||||
|
||||
If Not File.Exists(linkDescargaPagare) Then
|
||||
Alert("No existe el formato", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim objGemBoxDocument As New clsGemBoxDocument(linkDescargaPagare)
|
||||
Dim Tags As New List(Of TagsDocumentos)
|
||||
Dim ObjClientes As New ClsClientes
|
||||
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
Try
|
||||
Dim monto As String = ""
|
||||
Dim razonSocial As String = ""
|
||||
Dim direccion As String = ""
|
||||
Dim colonia As String = ""
|
||||
Dim noInt As String = ""
|
||||
Dim noExt As String = ""
|
||||
Dim ciudad As String = ""
|
||||
Dim estado As String = ""
|
||||
Dim Telefono As String = ""
|
||||
Dim mesArray = New String() {"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"}
|
||||
Dim hoy As DateTime = DateTime.Now
|
||||
@@ -7479,7 +7492,11 @@ Partial Class Clientes
|
||||
monto = ObjClientes.DtResultados.FiltroPrimeroValor("LimiteCredito").ToDouble.ToString("N")
|
||||
razonSocial = ObjClientes.DtResultados.FiltroPrimeroValor("NombreComercial")
|
||||
direccion = ObjClientes.DtResultados.FiltroPrimeroValor("Direccion")
|
||||
colonia = ObjClientes.DtResultados.FiltroPrimeroValor("Colonia")
|
||||
noInt = ObjClientes.DtResultados.FiltroPrimeroValor("NoInt")
|
||||
noExt = ObjClientes.DtResultados.FiltroPrimeroValor("NoExt")
|
||||
ciudad = ObjClientes.DtResultados.FiltroPrimeroValor("Ciudad")
|
||||
estado = ObjClientes.DtResultados.FiltroPrimeroValor("Estado")
|
||||
Telefono = ObjClientes.DtResultados.FiltroPrimeroValor("Telefono")
|
||||
End If
|
||||
|
||||
@@ -7488,8 +7505,8 @@ Partial Class Clientes
|
||||
Tags.Add(New TagsDocumentos("{FechaConFormato}", fechaConFormato))
|
||||
Tags.Add(New TagsDocumentos("{CantidadLetra}", monto.ToDouble.Texto2Letras(1)))
|
||||
Tags.Add(New TagsDocumentos("{RazonSocial}", razonSocial))
|
||||
Tags.Add(New TagsDocumentos("{Direccion}", direccion))
|
||||
Tags.Add(New TagsDocumentos("{Ciudad}", ciudad))
|
||||
Tags.Add(New TagsDocumentos("{Direccion}", String.Format("{0} #{1} {2}, COL.{3}", direccion, noInt, noExt, colonia).ToUpper()))
|
||||
Tags.Add(New TagsDocumentos("{Ciudad}", String.Format("{0}, {1}", ciudad, estado).ToUpper()))
|
||||
Tags.Add(New TagsDocumentos("{Telefono}", Telefono))
|
||||
Tags.Add(New TagsDocumentos("{RazonSocialAval}", TxtAval.Text))
|
||||
Tags.Add(New TagsDocumentos("{DireccionAval}", TxtDireccionAval.Text))
|
||||
@@ -7497,22 +7514,28 @@ Partial Class Clientes
|
||||
Tags.Add(New TagsDocumentos("{TelefonoAval}", TxtTelefonoAval.Text))
|
||||
Tags.Add(New TagsDocumentos("{RepresentanteLegal}", TxtRepresentanteLegal.Text))
|
||||
|
||||
|
||||
|
||||
If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then
|
||||
Alert("no se pudo registrar el pagare")
|
||||
Exit Sub
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Alert("Pagaré registrado con exito")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al registrar el pagare", ex)
|
||||
End Try
|
||||
ObjClientes.Dispose()
|
||||
|
||||
'objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0)
|
||||
RegistraScript("$('#ModalDivPagare').modal('hide')")
|
||||
Alert("Pagaré registrado con exito")
|
||||
|
||||
If Not TieneError Then
|
||||
objGemBoxDocument.SustituirTags(Tags)
|
||||
objGemBoxDocument.GuardarStream()
|
||||
Dim memoryStream As New System.IO.MemoryStream(objGemBoxDocument.GetBytesDocumento())
|
||||
objGemBoxDocument.Dispose()
|
||||
ObjClientes.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/text"
|
||||
Response.AddHeader("content-disposition", "attachment;filename=pagare.docx")
|
||||
@@ -7520,6 +7543,8 @@ Partial Class Clientes
|
||||
memoryStream.WriteTo(Response.OutputStream)
|
||||
Response.End()
|
||||
memoryStream.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user