Ferretera.
--Impresión del ticket solo en cobranza de caja, y el formato tamaño carta, normalmente --Ventas. en modal de anticipos, poner un filtrador --Poder cambiar el vendedor, para facturar si viene de cotización
This commit is contained in:
@@ -5462,6 +5462,11 @@ Public Class ClsPaginas
|
|||||||
Vta = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.Factura)
|
Vta = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.Factura)
|
||||||
|
|
||||||
PathArchivo = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
|
PathArchivo = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
|
||||||
|
|
||||||
|
If EsTicket Then
|
||||||
|
PathArchivo = String.Format("{0}PDF\{1}\{2}_Ticket.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim Archivo As New System.IO.FileInfo(PathArchivo)
|
Dim Archivo As New System.IO.FileInfo(PathArchivo)
|
||||||
|
|
||||||
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
|
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
|
||||||
@@ -7443,25 +7448,31 @@ Public Class ClsPaginas
|
|||||||
params.Add(New ReportParameter("RegimenFiscalEmpresa", String.Format("{0} - {1}", UsuarioActual.Empresa.CodigoRegimenFiscal, UsuarioActual.Empresa.RegimenFiscal)))
|
params.Add(New ReportParameter("RegimenFiscalEmpresa", String.Format("{0} - {1}", UsuarioActual.Empresa.CodigoRegimenFiscal, UsuarioActual.Empresa.RegimenFiscal)))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim RutaPDF As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
|
||||||
|
If EsTicket Then
|
||||||
|
RutaPDF = String.Format("{0}PDF\{1}\{2}_Ticket.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
|
||||||
|
End If
|
||||||
|
|
||||||
If Not UsarStimul Then
|
If Not UsarStimul Then
|
||||||
Dim Archivo As New System.IO.FileInfo(RutaFormato)
|
Dim Archivo As New System.IO.FileInfo(RutaFormato)
|
||||||
If Archivo.Exists Then
|
If Archivo.Exists Then
|
||||||
|
|
||||||
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||||
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
|
Dim ArchivoPDF As New System.IO.FileInfo(RutaPDF)
|
||||||
If Guardar Then
|
If Guardar Then
|
||||||
If Not ArchivoPDF.Exists Then
|
If Not ArchivoPDF.Exists Then
|
||||||
Try
|
Try
|
||||||
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
||||||
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
||||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
File.WriteAllBytes(RutaPDF, retorno)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||||
End Try
|
End Try
|
||||||
Else
|
Else
|
||||||
Try
|
Try
|
||||||
ArchivoPDF.Delete()
|
ArchivoPDF.Delete()
|
||||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
File.WriteAllBytes(RutaPDF, retorno)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||||
End Try
|
End Try
|
||||||
@@ -7480,20 +7491,20 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
retorno = StreamBytesStimul("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
retorno = StreamBytesStimul("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||||
If UsuarioActual.Empresa.Funcionalidad(707) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(707) = "1" Then
|
||||||
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
|
Dim ArchivoPDF As New System.IO.FileInfo(RutaPDF)
|
||||||
If Guardar Then
|
If Guardar Then
|
||||||
If Not ArchivoPDF.Exists Then
|
If Not ArchivoPDF.Exists Then
|
||||||
Try
|
Try
|
||||||
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
||||||
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
||||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
File.WriteAllBytes(RutaPDF, retorno)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||||
End Try
|
End Try
|
||||||
Else
|
Else
|
||||||
Try
|
Try
|
||||||
ArchivoPDF.Delete()
|
ArchivoPDF.Delete()
|
||||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
File.WriteAllBytes(RutaPDF, retorno)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@@ -576,8 +576,12 @@ Partial Class Ventas_PVCobranza
|
|||||||
Dim ObjFactura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
Dim ObjFactura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||||
|
|
||||||
Dim ExistePDF As Boolean = False
|
Dim ExistePDF As Boolean = False
|
||||||
Dim ArchivoPDF As String = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
Dim ArchivoPDF As String = ""
|
||||||
|
If ObjFactura.TipoDocto = "Ing" Then
|
||||||
|
ArchivoPDF = String.Format("{0}/PDF/{1}/{2}_Ticket.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||||
|
Else
|
||||||
|
ArchivoPDF = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||||
|
End If
|
||||||
If File.Exists(ArchivoPDF) AndAlso ObjFactura.TipoDocto = "Rem" Then
|
If File.Exists(ArchivoPDF) AndAlso ObjFactura.TipoDocto = "Rem" Then
|
||||||
ExistePDF = True
|
ExistePDF = True
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -4568,6 +4568,13 @@
|
|||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div style="max-height: 300px; overflow-y: auto;">
|
<div style="max-height: 300px; overflow-y: auto;">
|
||||||
|
<div class="row" style="margin-left: 0px; text-align: right" align="left">
|
||||||
|
<div style="margin-right: 15px">
|
||||||
|
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
|
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
|
||||||
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
|
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None"
|
||||||
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos">
|
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos">
|
||||||
|
|||||||
@@ -5599,6 +5599,11 @@ Partial Class Ventas
|
|||||||
DdlVendedor.Enabled = False
|
DdlVendedor.Enabled = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'PERMITIR EDITAR EL VENDEDOR ANTES DE FACTURAR
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.SUM("CantidadFacturadaCot") = 0) Then
|
||||||
|
DdlVendedor.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
If CveVentaPadre > 0 Then
|
If CveVentaPadre > 0 Then
|
||||||
If IsNothing(Request("CveDevolucion")) AndAlso IsNumeric(Request("CveDevolucion")) Then
|
If IsNothing(Request("CveDevolucion")) AndAlso IsNumeric(Request("CveDevolucion")) Then
|
||||||
DdlNCFactura.Visible = True
|
DdlNCFactura.Visible = True
|
||||||
@@ -5802,6 +5807,10 @@ Partial Class Ventas
|
|||||||
'DdlSucursalEjecucion.Enabled = False
|
'DdlSucursalEjecucion.Enabled = False
|
||||||
'DdlSucursalCobranza.Enabled = False
|
'DdlSucursalCobranza.Enabled = False
|
||||||
DdlVendedor.Enabled = False
|
DdlVendedor.Enabled = False
|
||||||
|
'PERMITIR EDITAR EL VENDEDOR ANTES DE FACTURAR
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.SUM("CantidadFacturadaCot") = 0) Then
|
||||||
|
DdlVendedor.Enabled = True
|
||||||
|
End If
|
||||||
DdlSucursalCliente.Enabled = False
|
DdlSucursalCliente.Enabled = False
|
||||||
TxtTiempoEntrega.Enabled = False
|
TxtTiempoEntrega.Enabled = False
|
||||||
TxtAlfa1.ReadOnly = True
|
TxtAlfa1.ReadOnly = True
|
||||||
@@ -18322,6 +18331,11 @@ Partial Class Ventas
|
|||||||
DdlVendedor.Enabled = True
|
DdlVendedor.Enabled = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'PERMITIR EDITAR EL VENDEDOR ANTES DE FACTURAR
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.SUM("CantidadFacturadaCot") = 0) Then
|
||||||
|
DdlVendedor.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
UPPVentas.Update()
|
UPPVentas.Update()
|
||||||
'TxtCorreoNotificaciones.Text = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltroPrimeroValor("Correo")
|
'TxtCorreoNotificaciones.Text = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltroPrimeroValor("Correo")
|
||||||
End Sub
|
End Sub
|
||||||
@@ -37690,22 +37704,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ExistePDF Then
|
If ExistePDF Then
|
||||||
Dim pdf64 As String = ""
|
Dim pdf64 = Convert.ToBase64String(System.IO.File.ReadAllBytes(ArchivoPDF))
|
||||||
'DUPLICA EL PDF
|
|
||||||
Using ms As New MemoryStream
|
|
||||||
Using pdfdoc As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfWriter(ms))
|
|
||||||
pdfdoc.InitializeOutlines()
|
|
||||||
Dim reporteByte As New MemoryStream(System.IO.File.ReadAllBytes(ArchivoPDF))
|
|
||||||
|
|
||||||
Dim docPDF As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfReader(reporteByte))
|
|
||||||
docPDF.CopyPagesTo(1, docPDF.GetNumberOfPages(), pdfdoc)
|
|
||||||
docPDF.CopyPagesTo(1, docPDF.GetNumberOfPages(), pdfdoc)
|
|
||||||
docPDF.Close()
|
|
||||||
|
|
||||||
pdfdoc.Close()
|
|
||||||
End Using
|
|
||||||
pdf64 = Convert.ToBase64String(ms.ToArray())
|
|
||||||
End Using
|
|
||||||
|
|
||||||
RegistraScript($"impresionBase64('{pdf64}');", "Imprimir")
|
RegistraScript($"impresionBase64('{pdf64}');", "Imprimir")
|
||||||
Else
|
Else
|
||||||
|
|||||||
Reference in New Issue
Block a user