From ecae4cf4bd39d79b30f4004c09a2bac494d9456f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 20 Jul 2020 20:57:18 -0700 Subject: [PATCH 01/15] Correciones de impresion de PDF en API SALI --- Ashx/GenerarPDFFactura.ashx | 162 +- Empresas/Grales/ReporteAPI.rdlc | 3710 +++++++++++++++++++++++++++++++ 2 files changed, 3822 insertions(+), 50 deletions(-) create mode 100644 Empresas/Grales/ReporteAPI.rdlc diff --git a/Ashx/GenerarPDFFactura.ashx b/Ashx/GenerarPDFFactura.ashx index e4e126787..b6a4e841c 100644 --- a/Ashx/GenerarPDFFactura.ashx +++ b/Ashx/GenerarPDFFactura.ashx @@ -17,6 +17,16 @@ Public Class GenerarPDFFactura : Implements IHttpHandler End Get End Property + Public ReadOnly Property EsProduccion As Boolean + Get + If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then + Return False + Else + Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1") + End If + End Get + End Property + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim retorno As String = "no se encontro la variable" @@ -34,7 +44,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Dim ListaDS = New List(Of ReportDataSource) Dim Parametros As New List(Of ReportParameter) - Dim Formato = context.ModExtensiones.DirectorioBaseEmpresas + "Empresas/1/Report.rdlc" + Dim Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPI.rdlc" Parametros.Add(New ReportParameter("Empresa", datos.Empresa.Empresa)) Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC)) @@ -49,20 +59,20 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Parametros.Add(New ReportParameter("ImporteLetra", datos.Factura.Total.Texto2Letras())) Parametros.Add(New ReportParameter("FormaPago", datos.Factura.FormaPago)) Parametros.Add(New ReportParameter("MetodoPago", datos.Factura.MetodoPago)) - Parametros.Add(New ReportParameter("SelloCFDI", "")) - Parametros.Add(New ReportParameter("SelloSAT", "")) - Parametros.Add(New ReportParameter("CadenaOriginal", "")) + Parametros.Add(New ReportParameter("SelloCFDI", datos.Timbrado.SelloCFDI)) + Parametros.Add(New ReportParameter("SelloSAT", datos.Timbrado.SelloSAT)) + Parametros.Add(New ReportParameter("CadenaOriginal", datos.Timbrado.CadenaOriginal)) Parametros.Add(New ReportParameter("FolioFiscal", datos.Factura.UUID)) - Parametros.Add(New ReportParameter("SerieCertificadoSAT", "")) - Parametros.Add(New ReportParameter("FechaCertificado", "")) - Parametros.Add(New ReportParameter("CertificadoContribuyente", "")) + Parametros.Add(New ReportParameter("SerieCertificadoSAT", datos.Timbrado.SerieCertificadoSAT)) + Parametros.Add(New ReportParameter("FechaCertificado", datos.Timbrado.FechaCertificado)) + Parametros.Add(New ReportParameter("CertificadoContribuyente", datos.Timbrado.CertificadoContribuyente)) Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI)) - Parametros.Add(New ReportParameter("Vencimiento", Now.AddDays(30))) + Parametros.Add(New ReportParameter("Vencimiento", datos.Factura.FechaVencimiento)) Parametros.Add(New ReportParameter("SubTotal", datos.Factura.SubTotal)) Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA)) Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS)) Parametros.Add(New ReportParameter("Total", datos.Factura.Total)) - Parametros.Add(New ReportParameter("QR", "")) + Parametros.Add(New ReportParameter("QR", datos.Timbrado.QR)) Dim DtDatos As New DataTable DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) @@ -85,9 +95,10 @@ Public Class GenerarPDFFactura : Implements IHttpHandler DtDatos.Rows.Add(Row) Next + ListaDS.Add(New ReportDataSource("DsProductos", DtDatos)) - ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "test") + ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "Factura") End If Catch ex As Exception @@ -97,48 +108,87 @@ Public Class GenerarPDFFactura : Implements IHttpHandler End Sub - Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() - 'limpio ReportViwer - Dim sw As New System.Diagnostics.Stopwatch() - sw.Start() - - If IsNothing(MR) Then MR = New ReportViewer - Dim Bytes As Byte() = Nothing - Try - ' MasterReporteador.LocalReport.DataSources.Clear() - For Each RDS As ReportDataSource In DataSource - MR.LocalReport.DataSources.Add(RDS) - Next - - MR.LocalReport.ReportPath = RutaReporte - MR.ProcessingMode = ProcessingMode.Local - MR.LocalReport.EnableExternalImages = True - MR.LocalReport.SetParameters(Parametros) - MR.LocalReport.Refresh() - Dim Warnings As Warning() = Nothing - Dim StreamIds As String() = Nothing - Dim MimeType As String = Nothing - Dim Encoding As String = Nothing - Dim Extension As String = Nothing - Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings) - Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException - GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") - 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 - 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") - Catch ex As Exception - GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") - 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 - 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") - End Try - - sw.Stop() - If sw.Elapsed.TotalSeconds > 10 Then - GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") - End If - - Return Bytes + Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() + 'limpio ReportViwer + Dim sw As New System.Diagnostics.Stopwatch() + sw.Start() + Dim Bytes As Byte() = Nothing + + Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory) + RutaReporte.Replace("/", "\") + If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then + RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) + End If + + If EsProduccion Then + + Dim CveUsuario As Integer = 0 + Dim CveEmpresa As Integer = 0 + + Dim wsreport As New WSRDLC.WebServiceSoapClient + Dim params As New List(Of WSRDLC.ReportParameter) + Dim ds As New DataSet + For Each rpds As ReportDataSource In DataSource + Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) + If dt Is Nothing Then + dt = New DataTable() + Else + dt = dt.Copy() + End If + dt.TableName = rpds.Name + ds.Tables.Add(dt) + Next + For Each rpds As ReportParameter In Parametros + Dim param As New WSRDLC.ReportParameter + param.Name = rpds.Name + param.Values = {rpds.Values(0)} + params.Add(param) + Next + Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + wsreport = Nothing + params = Nothing + Else + If IsNothing(MR) Then MR = New ReportViewer + Try + ' MasterReporteador.LocalReport.DataSources.Clear() + For Each RDS As ReportDataSource In DataSource + MR.LocalReport.DataSources.Add(RDS) + Next + + MR.LocalReport.ReportPath = RutaReporte + MR.ProcessingMode = ProcessingMode.Local + MR.LocalReport.EnableExternalImages = True + MR.LocalReport.SetParameters(Parametros) + MR.LocalReport.Refresh() + Dim Warnings As Warning() = Nothing + Dim StreamIds As String() = Nothing + Dim MimeType As String = Nothing + Dim Encoding As String = Nothing + Dim Extension As String = Nothing + Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings) + Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + Catch ex As Exception + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + End Try + MR.Dispose() + + End If + sw.Stop() + + If sw.Elapsed.TotalSeconds > 5 Then + GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") + End If + + Return Bytes End Function + + Public Sub ImprimirbytesPDF(ByVal context As HttpContext, bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False) 'limpio ReportViwer Dim mimeType As String = Nothing @@ -181,6 +231,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Public Property CveCliente As Integer Public Property NombreCliente As String Public Property Fecha As DateTime + Public Property FechaVencimiento As DateTime Public Property CveSubCentroCosto As Integer Public Property CveTipoDocumento As Integer Public Property TipoDocumento As String @@ -271,10 +322,21 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Public Property RegimenFiscal As String End Class + Public Class DatosSATWS + Public Property SelloCFDI As String + Public Property SelloSAT As String + Public Property CadenaOriginal As String + Public Property SerieCertificadoSAT As String + Public Property FechaCertificado As String + Public Property CertificadoContribuyente As String + Public Property QR As String + End Class + Public Class ParametroWS Public Property Factura As FacturaWS Public Property Cliente As ClienteWS Public Property Empresa As EmpresaWS + Public Property Timbrado As DatosSATWS End Class diff --git a/Empresas/Grales/ReporteAPI.rdlc b/Empresas/Grales/ReporteAPI.rdlc new file mode 100644 index 000000000..620989a0f --- /dev/null +++ b/Empresas/Grales/ReporteAPI.rdlc @@ -0,0 +1,3710 @@ + + + + + + + + + 0.68312in + + + 0.74612in + + + 3.55631in + + + 0.73983in + + + 0.67767in + + + 0.68332in + + + 0.77646in + + + + + 0.21354in + + + + + true + true + + + + + Cantidad + + + + + + + Textbox15 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Unidad + + + + + + + Textbox33 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Descripción + + + + + + + Textbox17 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Precio + + + + + + + Textbox21 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + IVA + + + + + + + Textbox1 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + IEPS + + + + + + + Textbox14 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox23 + + + #4f81bd + Middle + 2pt + 2pt + + + + + + + + 0.25521in + + + + + true + true + + + + + =Fields!Cantidad.Value + + + + + + + Cantidad + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!UnidadMedida.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PS.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PU.Value + + + + + + + PU + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!IVA.Value + + + + + + + IVA + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!IEPS.Value + + + + + + + IEPS + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.03125in + + + + + true + true + + + + + =Sum(Fields!Cantidad.Value) + + + + + + + Textbox71 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!PU.Value) + + + + + + + Textbox74 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!IVA.Value) + + + + + + + Textbox5 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!IEPS.Value) + + + + + + + Textbox26 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!Total.Value) + + + + + + + Textbox75 + + + + #1414ff + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + Before + + + + DsProductos + 2.02937in + 0.03703cm + 0.5in + 7.86283in + + + + + + true + true + + + + + Tipo + + + + + + + Textbox3 + 0.912in + 5.63144in + 0.5cm + 2.24597in + 1 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y hora de emisión + + + + + + + + + + + + + + + + Textbox3 + 0.46414in + 5.63144in + 0.5cm + 2.24597in + 2 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Serie.Value + + + + - + + + + =Parameters!Folio.Value + + + + + + + Textbox3 + 0.22455in + 5.63144in + 0.60856cm + 2.24597in + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + FACTURA + + + + + + + Textbox3 + 0.0412cm + 5.63144in + 0.5cm + 2.24597in + 4 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Empresa.Value + + + + + + + + + R.F.C + + + + =Parameters!RFC.Value + + + + + + + Textbox4 + 1.75306in + 0.46414in + 3.96172in + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SON: ( + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + ) + + + + + + + ImporteLetra + 2.53743in + 1.36047in + 0.23264in + 4.73657in + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloCFDI.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SelloSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CadenaOriginal.Value + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Database + =System.Convert.FromBase64String(Parameters!QR.Value) + image/png + FitProportional + 4.61035in + 0.00068in + 1.46528in + 1.56699in + 10 + + + + + + true + true + + + + + =Parameters!Fecha.Value + + + + + + + Textbox3 + 0.66099in + 5.63144in + 0.25114in + 2.24597in + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Factura + + + + + + + Textbox3 + 1.10885in + 5.63144in + 0.20721in + 2.24597in + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Domicilio Fiscal + + + + + + + + + =Parameters!DomicilioExpedicion.Value + + + + + + + Textbox10 + 0.46414in + 1.75306in + 0.69679in + 1.74651in + 13 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Lugar de Expedición + + + + + + + + + =Parameters!DomicilioExpedicion.Value + + + + + + + Textbox10 + 0.46414in + 3.81766in + 0.69679in + 1.786in + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteNombre.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cuidad + + + + + + + #4f81bd + + 1.25pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteLugar.Value + + + + RFC: + + + + =Parameters!ClienteRFC.Value + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sub Total + + + + + + + Textbox19 + 2.55788in + 6.12482in + 0.25in + 0.86113in + 21 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IEPS + + + + + + + Textbox19 + 2.96771in + 6.12482in + 0.21875in + 0.84815in + 22 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total + + + + + + + Textbox19 + 3.18334in + 6.12482in + 0.21875in + 0.84815in + 23 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SubTotal.Value + + + + + + + Textbox42 + 2.57352in + 6.97297in + 0.18211in + 0.89055in + 24 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IVA.Value + + + + + + + Textbox42 + 2.76813in + 6.97297in + 0.19289in + 0.89054in + 25 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!IEPS.Value + + + + + + + Textbox42 + 2.97282in + 6.97297in + 0.20219in + 0.89054in + 26 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Total.Value + + + + + + + Textbox42 + 3.19376in + 6.97297in + 0.19791in + 0.89054in + 27 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Importe con letra: + + + + + + + Textbox19 + 2.53316in + 0.00068in + 0.2053in + 1.35979in + 28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Forma de pago: + + + + + + + Textbox19 + 2.73851in + 0.00068in + 0.24305in + 1.35979in + 29 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello digital del CFDI: + + + + + + + Textbox19 + 2.93573in + 0.00068in + 0.61916in + 1.35979in + 30 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Sello del SAT: + + + + + + + Textbox19 + 3.55489in + 0.00068in + 0.30208in + 1.36417in + 31 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Cadena original del complemento de certificación digital del SAT: + + + + + + + Textbox19 + 3.85765in + 0.21875in + 7.87741in + 32 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FormaPago.Value + + + + + + + ImporteLetra + 2.73851in + 1.36047in + 0.20833in + 4.73657in + 33 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Folio Fiscal: + + + + + + + Textbox54 + 4.59646in + 1.62669in + 0.19445in + 4.36369in + 34 + + + + + + + White + + + + + + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + No. Serie del Certificado del SAT: + + + + + + + Textbox54 + 4.79091in + 1.62322in + 0.21105in + 4.37758in + 35 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha y Hora de certificación: + + + + + + + Textbox54 + 5.00196in + 1.62322in + 0.19444in + 4.37064in + 36 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Certificado del Contribuyente: + + + + + + + Textbox54 + 5.19715in + 1.62322in + 0.20487in + 4.37064in + 37 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!SerieCertificadoSAT.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!FechaCertificado.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CertificadoContribuyente.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Regímen: Regímen General de Ley Personas Morales; Uso CFDI: + + + + =Parameters!UsoCFDI.Value + + + + ; Método de Pago: + + + + =Parameters!MetodoPago.Value + + + + ; + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Éste documento es una representacion impresa de un CFDi + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + true + true + + + + + P A G A R E con Folio + + + + =Parameters!Serie.Value + + + + - + + + + =Parameters!Folio.Value + + + + Por éste pagare prometo (emos) pagar incondicionalmente a la orden de + + + + =Parameters!Empresa.Value + + + + a su vencimiento el + + + + =Parameters!Vencimiento.Value + + + + , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ + + + + =Parameters!Total.Value + + + + SON: ( + + + + =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) + + + + ). Valor recibido a mi (nuestra) entera satisfaccion. la falta de pago de éste documento a su vencimiento dará derecho a + + + + =Parameters!Empresa.Value + + + + o tenedor, desde el dia siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionén. Lugar y Fecha de Suscripcion: Hermosillo, Sonora a + + + + =Parameters!Fecha.Value + + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Nombre: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Dirección: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteNombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!ClienteDireccion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Acepto de conformidad + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.26711cm + 0.05457cm + 0cm + 0.57653cm + 7 + + + + + + 0.26711cm + 0.69053cm + 0cm + 0.57653cm + 8 + + + + + + 0.26711cm + 1.32627cm + 0cm + 0.57653cm + 9 + + + + + + 0.26711cm + 1.63234cm + 0cm + 0.57653cm + 10 + + + + + + 0.26711cm + 2.2683cm + 0cm + 0.57653cm + 11 + + + + + + 0.26711cm + 2.90404cm + 0cm + 0.57653cm + 12 + + + + + + 0.26711cm + 3.57348cm + 0cm + 0.57653cm + 13 + + + + + + 0.26711cm + 4.20944cm + 0cm + 0.57653cm + 14 + + + + + + 0.26711cm + 4.84518cm + 0cm + 0.57653cm + 15 + + + + + + 0.26711cm + 5.15125cm + 0cm + 0.57653cm + 16 + + + + + + 0.26711cm + 5.78721cm + 0cm + 0.57653cm + 17 + + + + + + 0.26711cm + 6.42295cm + 0cm + 0.57653cm + 18 + + + + + + 0.26711cm + 7.10321cm + 0cm + 0.57653cm + 19 + + + + + + 0.26711cm + 7.73917cm + 0cm + 0.57653cm + 20 + + + + + + 0.26711cm + 8.37491cm + 0cm + 0.57653cm + 21 + + + + + + 0.26711cm + 8.68098cm + 0cm + 0.57653cm + 22 + + + + + + 0.26711cm + 9.31694cm + 0cm + 0.57653cm + 23 + + + + + + 0.26711cm + 9.95268cm + 0cm + 0.57653cm + 24 + + + + + + 0.26711cm + 14.03363cm + 0cm + 0.57653cm + 25 + + + + + + 0.26711cm + 14.66959cm + 0cm + 0.57653cm + 26 + + + + + + 0.26711cm + 15.30533cm + 0cm + 0.57653cm + 27 + + + + + + 0.26711cm + 15.6114cm + 0cm + 0.57653cm + 28 + + + + + + 0.26711cm + 16.24736cm + 0cm + 0.57653cm + 29 + + + + + + 0.26711cm + 16.8831cm + 0cm + 0.57653cm + 30 + + + + + + 0.26711cm + 10.5767cm + 0cm + 0.57653cm + 31 + + + + + + 0.26711cm + 11.21266cm + 0cm + 0.57653cm + 32 + + + + + + 0.26711cm + 11.8484cm + 0cm + 0.57653cm + 33 + + + + + + 0.26711cm + 12.15447cm + 0cm + 0.57653cm + 34 + + + + + + 0.26711cm + 12.79043cm + 0cm + 0.57653cm + 35 + + + + + + 0.26711cm + 13.42617cm + 0cm + 0.57653cm + 36 + + + + + + 0.26711cm + 18.37745cm + 0cm + 0.57653cm + 37 + + + + + + 0.26711cm + 19.01341cm + 0cm + 0.57653cm + 38 + + + + + + 0.26711cm + 17.71435cm + 0cm + 0.57653cm + 39 + + + + + + true + 15.71618cm + 0.01661cm + 4.36819cm + 20.04854cm + 44 + + + + + + true + true + + + + + IVA + + + + + + + Textbox19 + 2.76952in + 6.12573in + 0.19444in + 0.86113in + 45 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + 20.08437cm + + + true + true + + + + + =Parameters!Observaciones.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + OBSERVACIONES: + + + + + + 2pt + 2pt + 2pt + 2pt + + - 1.75444in + 1.94921in - 2.33028cm + 2.93363cm true true - 0.92688cm + 1.1404cm 0.05012cm 0cm 19.16949cm @@ -1229,7 +1295,7 @@ Textbox12 - 1.03271cm + 1.22061cm 0.12893cm 0.44125cm 1.36232cm @@ -1264,7 +1330,7 @@ Textbox18 - 1.03271cm + 1.22061cm 1.49125cm 0.44125cm 5.21516cm @@ -1297,7 +1363,7 @@ Textbox12 - 1.03271cm + 1.22061cm 7.7587cm 0.44125cm 2.68521cm @@ -1333,7 +1399,7 @@ Textbox18 - 1.03271cm + 1.22061cm 10.44391cm 0.44125cm 3.44953cm @@ -1368,7 +1434,7 @@ Textbox3 - 1.03271cm + 1.22061cm 15.59511cm 0.38981cm 3.61081cm @@ -1401,7 +1467,7 @@ Textbox29 - 1.47396cm + 1.66186cm 0.12912cm 0.41981cm 5.78083cm @@ -1419,7 +1485,7 @@ - 0.19459cm + 0.3175cm 1.19476cm 0cm 5.13525cm @@ -1447,9 +1513,9 @@ Textbox31 - 0.37098cm + 0.4239cm 0.77992cm - 0.09729cm + 0.56472cm 5.95755cm 1 - 0.19459cm + 0.3175cm 13.20536cm 0cm 5.24108cm @@ -1492,9 +1558,9 @@ Textbox31 - 0.3357cm + 0.38862cm 12.80849cm - 0.13257cm + 0.6cm 5.95755cm 3 - - 0.75931cm - 0.05417cm - 0cm - 19.1695cm - 4 - - - - - - true - true - - - - - OBSERVACIONES: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - true - 0.05922cm - 0.90952cm + 0.04233cm + 0.05012cm + 0.98862cm 19.22367cm 7 diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index 74d725561..62abdcdbf 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -72,7 +72,7 @@
-
+
@@ -99,7 +99,7 @@ @@ -110,13 +110,19 @@ - + - + - - +
+
+ +
+
+ +
+
@@ -132,6 +138,7 @@
+
@@ -148,7 +155,8 @@
- +
+
- + - + - + - + - - - - - - + @@ -243,11 +238,12 @@ - + - + +
@@ -488,7 +484,7 @@
- + @@ -509,6 +505,11 @@ + + + + + diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 8af94a12a..d76c06fd0 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -88,14 +88,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado ViewState("CveCliente") = value End Set End Property - Private Property CveTipoPS As Integer + + Private Property AplicaSerie As Boolean Get - Return CType(ViewState("CveTipoPS"), Integer) + Return CType(ViewState("AplicaSerie"), Boolean) End Get - Set(value As Integer) - ViewState("CveTipoPS") = value + Set(value As Boolean) + ViewState("AplicaSerie") = value End Set End Property + Private Property DtSeriesDesarmado As DataTable Get Return CType(ViewState("DtSeriesDesarmado"), DataTable) @@ -208,7 +210,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim ObjProductosServicios As New ClsProductosServicios Dim DtDatos As New DataTable - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimeroValor("CveUM").ToEntero + Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("") + Dim AplicaSerie As Boolean = False + Dim CveUMTemp = drP("CveUM").ToString.ToEntero If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteArmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadArmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then DtDatos = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy Else @@ -240,15 +244,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Next - Dim AplicaSerie As String = "" + If ErrorExistencias Then Alert(TextoExistencias, TipoMensaje.MsgAdvertencia) Else - AplicaSerie = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimeroValor("AplicaSerie") + AplicaSerie = CBool(drP("AplicaSerie")) BtnGuadarArmado.Visible = True End If - If AplicaSerie = "True" Then + If AplicaSerie Then DivSeriesPaqueteArmado.Visible = True Dim Dt As New DataTable Dt.Columns.Add("Row", GetType(Integer)) @@ -274,9 +278,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosArmado.DataSource = DtDatos GvDatosArmado.DataBind() - If ErrorExistencias Then - GvDatosArmado.Columns(4).Visible = False - End If + GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True" + 'GvDatosArmado.Columns(6).Visible = DtDatos.MAX("Serie", "") <> "" + GvDatosArmado.Columns(6).Visible = False 'DtDatos.MAX("Lote", "") <> "" + GvDatosArmado.Columns(7).Visible = False 'DtDatos.MAX("FechaCaducidad", "FechaCaducidad is not null").ToDate > MinFecha + + 'If ErrorExistencias Then + ' GvDatosArmado.Columns(4).Visible = False + 'End If UpDatosArmado.Update() UpGeneralesArmado.Update() @@ -285,7 +294,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado DtDatosDetalle.Clear() BtnGuadarDesarmado.Visible = False TotalDesarmado.Visible = False - CveTipoPS = -1 + AplicaSerie = False TxtSerieDesarmado.Text = "" CvePaqueteDesarmado = -1 TipoMovimiento = 2 @@ -299,7 +308,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado BtnAgregarSerieDesarmado.Enabled = True - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimeroValor("CveUM").ToEntero + Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimero("") + + Dim CveUMTemp = drP("CveUM").ToString.ToEntero CveVendedor = If(RowApartadosDesarmado.Visible, DdlVendedorDesarmado.SelectedValue.ToEntero, -1) CveCliente = If(RowClienteDesarmado.Visible, DdlClienteDesarmado.SelectedValue.ToEntero, -1) Dim FechaFin As String = TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd 23:59") @@ -314,7 +325,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Alert($"No hay existencia suficiente del paquete ""{DdlPaqueteDesarmado.SelectedItem.Text}"" para desarmar. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia) Exit Sub Else - CveTipoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimeroValor("Inv_CveMetodoInventario").ToEntero + AplicaSerie = CBool(drP("AplicaSerie")) End If @@ -343,8 +354,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next End If - If CveTipoPS = 5 Then - GvDatosDesarmado.Columns(4).Visible = True + If AplicaSerie Then + DivSeriesPaqueteDesarmado.Visible = True CreaDtSeriesDesarmado() DtSeriesDesarmado.Clear() @@ -363,6 +374,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosDesarmado.DataSource = DtDatos GvDatosDesarmado.DataBind() + GvDatosDesarmado.Columns(4).Visible = CBool(DtDatos.MAX("AplicaSerie")) + GvDatosDesarmado.Columns(5).Visible = CBool(DtDatos.MAX("AplicaSeccion")) + BtnGuadarDesarmado.Visible = True TotalDesarmado.Visible = True @@ -404,7 +418,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Select Case (Tipo) Case 1 ' ARMADO For Each gvr As GridViewRow In GvDatosArmado.Rows - If gvr.DataKey("Inv_CveMetodoInventario").ToEntero = 5 Then + If gvr.DataKey("AplicaSerie") = "True" Then If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -413,7 +427,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next Case 2 ' DESARMADO For Each gvr As GridViewRow In GvDatosDesarmado.Rows - If gvr.DataKey("Inv_CveMetodoInventario").ToEntero = 5 Then + If gvr.DataKey("AplicaSerie") = "True" Then If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -423,7 +437,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End Select 'VALIDA SI EL PAQUETE ES DE SERIE QUE SE INGRESEN TODAS LAS SERIES (CANTIDAD) - If CveTipoPS = 5 Then + If AplicaSerie Then Select Case (Tipo) Case 1 ' ARMADO For Each gvr As GridViewRow In GvSeriesPaqueteArmado.Rows @@ -458,7 +472,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Case 1 ' ARMADO 'SALIDA COMPONENTES - CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenArmado, 5, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) + CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenArmado, 5, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ1") FolioSalida = ObjInventario.Folio If CveMovimientoSalida <= 0 Then @@ -472,7 +486,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text) Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text) Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() - If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If CBool(Gvr.DataKey("AplicaSerie")) Then For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then MensajeError = String.Format("El Producto {0} con Serie: {1} no tiene existencia suficiente", Dr("PS"), Dr("Serie")) @@ -506,7 +520,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'ENTRADA PAQUETE If Not TieneError Then - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenArmado, 19, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida) + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenArmado, 19, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ2") FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada <= 0 Then @@ -520,14 +534,22 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next PUTemp = PUTemp / LbCantidadArmado.Text.ToDecimal Dim CvePSTemp = CvePaqueteArmado - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimeroValor("CveUM").ToEntero + Dim CveSeccionAlmacen As Integer = -1 + Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimero("") - If CveTipoPS = 5 Then + Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero + Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) + If AplicaSeccion Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenArmado, CvePaqueteArmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + End If + + + If AplicaSerie Then Dim ContadorPaquete = 1 Dim DtSeriesComponentes As New DataTable For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows 'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, -1, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada" Exit For @@ -535,7 +557,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'INGRESA EN TABLA DE CONTROL DE PAQUETES CON SERIE For Each Gvr2 As GridViewRow In GvDatosArmado.Rows - If Gvr2.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If CBool(Gvr2.DataKey("AplicaSerie")) Then DtSeriesComponentes = New DataTable DtSeriesComponentes = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Copy Dim CantidadComponente = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Rows.Count / LbCantidadArmado.Text.ToEntero @@ -552,7 +574,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado ContadorPaquete = ContadorPaquete + 1 Next Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, LbCantidadArmado.Text.ToDouble, CveUMTemp, CvePSTemp, PUTemp, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, LbCantidadArmado.Text.ToDouble, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada" End If @@ -569,7 +591,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'SALIDA PAQUETE - CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 20, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) + CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 20, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ3") FolioSalida = ObjInventario.Folio If CveMovimientoSalida <= 0 Then @@ -579,12 +601,18 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Dim CvePSTemp = CvePaqueteDesarmado - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero + Dim CveSeccionAlmacen As Integer = -1 + Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("") - If CveTipoPS = 5 Then + Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero + Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) + If AplicaSeccion Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + End If + If AplicaSerie Then For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows 'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, -1, Serie:=Gvr.DataKey("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.DataKey("Serie").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida" Exit For @@ -598,7 +626,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Next Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDouble, CveUMTemp, CvePSTemp, 0, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDouble, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de salida" End If @@ -607,7 +635,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'ENTRADA COMPONENTES If Not TieneError Then - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 4, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida) + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 4, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ4") FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada <= 0 Then @@ -616,16 +644,20 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Else For Each Gvr As GridViewRow In GvDatosDesarmado.Rows If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then - If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If CBool(Gvr.DataKey("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + End If + + If CBool(Gvr.DataKey("AplicaSerie")) Then For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1, Serie:=Dr("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada. Por favor vuelva a intentar." TieneError = True Exit For End If Next Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, CveSeccionAlmacen:=CveSeccionAlmacen) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada. Por favor vuelva a intentar." TieneError = True Exit For @@ -662,7 +694,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Private Sub Limpia(Tipo As Integer) DtDatosDetalle.Clear() - CveTipoPS = -1 + AplicaSerie = False 'If Tipo = 1 Then @@ -719,20 +751,18 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Protected Sub GvDatosArmado_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosArmado.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then + If CBool(e.Row.DBCampo("AplicaSerie")) Then e.Row.FCButton("BtnSerie").Visible = True e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°1", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) e.Row.FCLinkButton("BtnSeriePaquete").CommandArgument = e.Row.DBCampo("Consec") 'Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count 'e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString - If CveTipoPS = 5 Then + If AplicaSerie Then e.Row.FCLinkButton("BtnSeriePaquete").Visible = True e.Row.FCLinkButton("BtnSeriePaquete").Attributes.Add("data-toggle", "tooltip") End If - GvDatosArmado.Columns(4).Visible = True - Else e.Row.FCButton("BtnSerie").Visible = False End If @@ -740,16 +770,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado If e.Row.DataKey("AplicaSeccion") = "False" Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False Else - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenArmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) + End If e.Row.FCTextBox("TxtCaducidad").Visible = e.Row.DataKey("AplicaCaducidad") = "True" e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True" - e.Row.FCTextBox("TxtSerie").Visible = e.Row.DataKey("AplicaSerie") = "True" ''FUNCIONALIDAD PISTOLA DE CODIGOS 'If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then ' e.Row.FCTextBox("TbCantidadF").Enabled = False @@ -763,13 +791,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Protected Sub GvDatosDesarmado_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosDesarmado.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then + If CBool(e.Row.DBCampo("AplicaSerie")) Then e.Row.FCButton("BtnSerie").Visible = True e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°2", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) Else e.Row.FCButton("BtnSerie").Visible = False End If - + If e.Row.DataKey("AplicaSeccion") = "False" Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False + Else + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenDesarmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) + End If e.Row.FCTextBox("TxtCosto").Attributes.Add("onkeyup", "SumaValores();") From 860348d7b0dc980b1451213acbb913405b17bd06 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 7 Aug 2020 11:42:24 -0700 Subject: [PATCH 12/15] -- libro de diario conta sig --- Contabilidad2/RepLibroDiario.aspx | 104 +++++++++++++++++++ Contabilidad2/RepLibroDiario.aspx.vb | 144 +++++++++++++++++++++++++++ 2 files changed, 248 insertions(+) create mode 100644 Contabilidad2/RepLibroDiario.aspx create mode 100644 Contabilidad2/RepLibroDiario.aspx.vb diff --git a/Contabilidad2/RepLibroDiario.aspx b/Contabilidad2/RepLibroDiario.aspx new file mode 100644 index 000000000..4224c2fa5 --- /dev/null +++ b/Contabilidad2/RepLibroDiario.aspx @@ -0,0 +1,104 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepLibroDiario.aspx.vb" Inherits="Contabilidad2_RepLibroDiario" %> + + + + + + + Libro Diario + + + + + + +
  • + Generar EXCEL +
  • +
  • + Imprimir +
  • +
    + + + + +
    +
    + + + + + + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/Contabilidad2/RepLibroDiario.aspx.vb b/Contabilidad2/RepLibroDiario.aspx.vb new file mode 100644 index 000000000..3f01252dc --- /dev/null +++ b/Contabilidad2/RepLibroDiario.aspx.vb @@ -0,0 +1,144 @@ +Option Explicit On +Option Strict On +Imports System.Data +Imports Extensiones + +Partial Class Contabilidad2_RepLibroDiario + Inherits ClsPaginas + +#Region "PROPIEDADES" + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + Private Property FechaInicio As Date + Get + FechaInicio = ViewState("FechaInicio").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicio") = value + End Set + End Property + Private Property FechaFin As Date + Get + FechaFin = ViewState("FechaFin").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFin") = value + End Set + End Property + +#End Region + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + InicializaValores() + + BtnConsultar.Enabled = True + + End If + End Sub + + Private Sub InicializaValores() + + TxtFechaDel.Text = $"01/01/{Now.Year}" + TxtFechaAl.Text = Now.ToShortDateString + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + +#Region "C A R G A - D A T O S" + Private Sub CargaDatos() + + FechaInicio = If(IsDate(TxtFechaDel.Text), TxtFechaDel.Text.ToDate, MinFecha) + FechaFin = If(IsDate(TxtFechaAl.Text), TxtFechaAl.Text.ToDate, MaxFecha) + + 'FechaInicio = New Date(2016, 1, 1) + 'FechaFin = New Date(2016, 1, 31) + + Dim ObjConta As New ClsContabilidad + If ObjConta.GetLibroDiario(FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then + DtDatos = ObjConta.DtResultados + Else + DtDatos = Nothing + End If + ObjConta.Dispose() + + GvDatos.DataSource = DtDatos + GvDatos.DataBind() + UpDatos.Update() + + If DtDatos IsNot Nothing Then + ImgExcel.Visible = True + Imprimir.Visible = True + + Else + ImgExcel.Visible = False + Imprimir.Visible = False + End If + + End Sub +#End Region + + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + + ''CABECERA + 'If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 1 Then + ' e.Row.Font.Bold = True + ' e.Row.Cells(4).Text = "" + ' e.Row.Cells(5).Text = "" + ' e.Row.Cells(6).Text = "" + ' e.Row.Cells(7).Text = "" + ' e.Row.Cells(8).Text = "" + ' e.Row.CssClass = "SubTotales" ' + 'End If + + 'DETALLE + If e.Row.DBCampo("Codigo") <> "" Then + e.Row.Cells(0).Text = "" + e.Row.Cells(1).Text = "" + e.Row.Cells(2).Text = "" + e.Row.Cells(3).Text = "" + End If + + 'SUBTOTAL + If e.Row.DBCampo("Codigo") = "" Then + e.Row.Font.Bold = True + e.Row.Cells(0).Text = "" + e.Row.Cells(1).Text = "" + e.Row.Cells(2).Text = "" + e.Row.Cells(3).Text = "" + e.Row.Cells(4).Text = "" + e.Row.Cells(5).Text = "" + e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right + e.Row.Cells(6).Text = "Total:" + e.Row.CssClass = "SubTotales" + End If + + 'TOTAL + If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 4 Then + e.Row.Font.Bold = True + e.Row.Cells(0).Text = "" + e.Row.Cells(1).Text = "" + e.Row.Cells(2).Text = "" + e.Row.Cells(3).Text = "" + e.Row.Cells(4).Text = "" + e.Row.Cells(5).Text = "" + e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right + e.Row.Cells(6).Text = "Total:" + e.Row.CssClass = "Totales" + End If + + End If + End Sub + +End Class From 92728d726b97217b499c9659e7a75b55b87b0e46 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 7 Aug 2020 11:42:53 -0700 Subject: [PATCH 13/15] -- que tome la cuenta de descuento de la clasificacion --- Ventas/Ventas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 90183a6fb..c99cb1fd4 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10953,7 +10953,7 @@ Partial Class Ventas If ObjFactura.TipoDocto.Contiene("Egs") Then IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() Else - IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() + IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaDescuento", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero() End If If importeMovimiento <> 0 Then From 81859f6e951f8c34d0eb237e5353b662fef28ecd Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 7 Aug 2020 11:43:26 -0700 Subject: [PATCH 14/15] -- validacion si usa AC, que marque error sino tiene la informacion del almacen contable --- Inventarios/EntradasSalidas.aspx.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 1f6a9efdf..3c28d2384 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1408,7 +1408,8 @@ Partial Class Inventarios_EntradasSalidas Else ErrorAC = True End If - + Else + ErrorAC = True End If End If From f1b7df3cfdfab8881bb38b44e9db387c2201f09c Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 7 Aug 2020 14:13:02 -0700 Subject: [PATCH 15/15] - --- App_Code/ClsOIEventos.vb | 3 +- App_Code/ClsPaginas.vb | 2 +- Compras/PopUpVerFactura.aspx.vb | 10 +- Empresas/119/Formatos/Polizas.rdlc | 12 +- General/PopUpPaqueteriasGuias.aspx.cs | 15 +- General/RepPaqueteriasGuias.aspx.cs | 14 +- Inventarios/EntregaAlmacen.aspx.vb | 7 +- Inventarios/EntregasPorRealizar.aspx | 2 +- Inventarios/EntregasPorRealizar.aspx.cs | 7 +- OI/DocumentoDetalle.aspx | 297 ++++++++++++------------ OI/DocumentoDetalle.aspx.cs | 123 ++++++++-- 11 files changed, 309 insertions(+), 183 deletions(-) diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index b8eb3b700..78af613be 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -2836,7 +2836,7 @@ Public Class ClsOIEventos #End Region #Region "OI_DocumentosSubCategoria" - Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1") As Boolean + Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1", Optional CveCategoria As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -2845,6 +2845,7 @@ Public Class ClsOIEventos With SqlAdapter.SelectCommand.Parameters .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7cdb07053..f474affc2 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4627,7 +4627,7 @@ Public Class ClsPaginas PaginaDict.Add("/OI/CatDocumentoCategoria.aspx".ToUpper(), 760) PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), 761) PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), 762) - PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), 763) + PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), -1) #End Region #Region "Planeacion" 'PLANEACIÓN diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 3e8f29ec9..39658a220 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1444,9 +1444,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Concepto", ConceptoFormato)) params.Add(New ReportParameter("Almacen", Almacen)) - params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) - params.Add(New ReportParameter("CveTipoAlmacen", Almacen)) - + params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy"))) + + params.Add(New ReportParameter("Folio", Folio)) params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0, dr("SerieFolio").ToString, ""))) @@ -1456,6 +1456,10 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Fecha", Fecha)) End If + If UsuarioActual.CveEmpresa = 72 Then + params.Add(New ReportParameter("CveTipoAlmacen", CveTipoAlmacen.ToString())) + End If + params.Add(New ReportParameter("Observaciones", Observaciones)) If UsuarioActual.CveEmpresa.Contiene(72, 80) Then diff --git a/Empresas/119/Formatos/Polizas.rdlc b/Empresas/119/Formatos/Polizas.rdlc index a2c8d63c8..30145ef5f 100644 --- a/Empresas/119/Formatos/Polizas.rdlc +++ b/Empresas/119/Formatos/Polizas.rdlc @@ -1295,6 +1295,7 @@ End + true @@ -1331,9 +1332,11 @@ + true DataSet1 End + true 0.05076cm 3.18542cm @@ -1642,7 +1645,8 @@ Textbox35 - 17.03312cm + 0.26458cm + 16.57041cm 0.52564cm 2.8175cm 2 @@ -1790,7 +1794,8 @@ ReportParameter1 - REM Reset Page Number: + + REM Reset Page Number: Shared offset As Integer Shared newPage As Object Shared currentgroup1 As Object @@ -1822,7 +1827,8 @@ End If End If Return newPage - End Function + End Function + image/jpeg diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 80bf6aae8..c124dbd4e 100644 --- a/General/PopUpPaqueteriasGuias.aspx.cs +++ b/General/PopUpPaqueteriasGuias.aspx.cs @@ -812,25 +812,28 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas int CveVendedor = ObjVentas.DtResultados.Rows[0]["CveVendedor"].ToEntero(); int CveCliente = ObjVentas.DtResultados.Rows[0]["CveCliente"].ToEntero(); DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}",CveVendedor)); + DataRow VendedorAsistente = get_GlobalDTVendedores(UsuarioActual.CveEmpresa,VendedorTipo:3).FiltroPrimero(string.Format("CveSuperior = {0}", CveVendedor)); DataRow Cliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente : CveCliente).FiltroPrimero(""); - string CobranzaCorreo = ""; string CorreoEntregaAlmacen = ""; string CorreoEntregaCompras = ""; string CorreoVendedor = ""; - string CorreoAdicionalNotificacionesVendedor = ""; + string CorreoNotificaciones = ObjVentas.DtResultados.Rows[0]["CorreoNotificacion"] != null ? ObjVentas.DtResultados.Rows[0]["CorreoNotificacion"].ToString():""; + string CorreoAsistente = ""; if (Cliente != null) { - CobranzaCorreo=Cliente["CobranzaCorreo"].ToString(); CorreoEntregaAlmacen=Cliente["CorreoEntregaAlmacen"].ToString(); CorreoEntregaCompras = Cliente["CorreoEntregaCompras"].ToString(); } if (Vendedor != null) { CorreoVendedor=Vendedor["Correo"].ToString(); - CorreoAdicionalNotificacionesVendedor=Vendedor["CorreoAdicionalNotificaciones"].ToString(); + //CorreoAdicionalNotificacionesVendedor=Vendedor["CorreoAdicionalNotificaciones"].ToString(); } - - string CorreosConcat = String.Format("{0};{1};{2};{3};{4}", CobranzaCorreo, CorreoEntregaAlmacen, CorreoEntregaCompras, CorreoVendedor, CorreoAdicionalNotificacionesVendedor); + if (VendedorAsistente != null) + { + CorreoAsistente = VendedorAsistente["Correo"].ToString(); + } + string CorreosConcat = String.Format("{0};{1};{2};{3};{4}", CorreoEntregaAlmacen, CorreoEntregaCompras, CorreoVendedor, CorreoNotificaciones, CorreoAsistente); return CorreosConcat; } ObjVentas.Dispose(); diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index bddef6c59..5a4109349 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -175,6 +175,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas ViewState["Folio"] = value; } } + #endregion @@ -1008,6 +1009,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas int CveCliente = DbRowVenta["CveCliente"].ToString().ToEntero(); int CveVendedor = DbRowVenta["CveVendedor"].ToString().ToEntero(); + string CorreoNotificacion = DbRowVenta["CorreoNotificacion"] != null ? DbRowVenta["CorreoNotificacion"].ToString():""; SerieFolio = String.Format("{0}-{1}", DbRowVenta["Serie"].ToString(), DbRowVenta["Folio"].ToString().ToEntero()); NombreCliente = DbRowVenta["ClienteNombre"].ToString(); @@ -1027,7 +1029,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas Destinatario = "sig.buzon02@gmail.com"; // CORREO PRUEBA if (UsuarioActual.Empresa.Funcionalidad(280) == "1" && CveCliente > 0 && CveVendedor > 0) { - Destinatario = getCorreoNotificacion(CveCliente, CveVendedor); + Destinatario = getCorreoNotificacion(CveCliente, CveVendedor,CorreoNotificacion); } if (ObjVentas.GetVentaDetalle(CveVenta)) @@ -1037,20 +1039,24 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas } } + ObjVentas.Dispose(); } } - private string getCorreoNotificacion(int CveCliente, int CveVendedor) + private string getCorreoNotificacion(int CveCliente, int CveVendedor,string CorreoNotificacion) { DataRow DatosCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}", CveCliente)); DataRow DatosVendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}", CveVendedor)); + string CorreoAsistente = get_GlobalDTVendedores(UsuarioActual.CveEmpresa,VendedorTipo:3).FiltroPrimeroValor("Correo", string.Format("CveSuperior = {0}", CveVendedor)); if (DatosCliente != null && DatosVendedor != null) { StringBuilder correos = new StringBuilder(""); if (DatosCliente["CorreoEntregaCompras"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosCliente["CorreoEntregaCompras"].ToString())); if (DatosCliente["CorreoEntregaAlmacen"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosCliente["CorreoEntregaAlmacen"].ToString())); if (DatosVendedor["Correo"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["Correo"].ToString())); - if (DatosVendedor["CorreoAdicionalNotificaciones"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["CorreoAdicionalNotificaciones"].ToString())); + correos.Append(CorreoNotificacion + ";"); + correos.Append(CorreoAsistente + ";"); + //if (DatosVendedor["CorreoAdicionalNotificaciones"].ToString().Length > 0) correos.Append(string.Format("{0};", DatosVendedor["CorreoAdicionalNotificaciones"].ToString())); return correos.ToString(); } return ""; @@ -1104,7 +1110,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas string detalle = string.Format("{0}{1}{2}", dRow["Codigo"], dRow["Cantidad"], dRow["PS"]); DetalleTable += detalle; } - + CargaDatosCorreo(CveVenta); StringBuilder strBody = new StringBuilder(); strBody.Append(""); strBody.Append(""); diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 2adc2532c..74aac45cc 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3222,14 +3222,17 @@ Partial Class Inventarios_EntregaAlmacen Dim Destinatario As String = "" Dim MensajeEnviado = False Dim tCvecliente As Integer + Dim tCveVendedor As Integer Dim bytes() As Byte = Nothing Dim ObjVentas As New ClsVentas() Dim strBody As New StringBuilder If ObjVentas.GetVenta(tCveVenta, UsuarioActual.CveEmpresa) Then Dim dr As DataRow = ObjVentas.DtResultados.FiltroPrimero("") - Destinatario = String.Format("{0};{1}", dr("CorreoNotificacion"), dr("CorreoVendedorVenta")) - + tCveVendedor = dr("CveVendedor").ToString.ToEntero + Dim CorreoVendedor As String = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Correo", String.Format("CveVendedor = {0}", tCveVendedor)) + Dim CorreoAsistente As String = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=3).FiltroPrimeroValor("Correo", String.Format("CveSuperior = {0}", CveVendedor)) + Destinatario = String.Format("{0};{1};{2}", dr("CorreoNotificacion"), CorreoVendedor, CorreoAsistente) tCvecliente = dr("CveCliente").ToString.ToEntero Dim drC As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=tCvecliente).FiltroPrimero("") diff --git a/Inventarios/EntregasPorRealizar.aspx b/Inventarios/EntregasPorRealizar.aspx index 76ec2b76f..3bf84154d 100644 --- a/Inventarios/EntregasPorRealizar.aspx +++ b/Inventarios/EntregasPorRealizar.aspx @@ -70,7 +70,7 @@
    - <%--
  • - +
  • +
  • - Imprimir PDF +
  • -
  • - Imprimir Excel -
  • --%>
    - - -
    -
    - - -
    -
    - - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - - -
    -
    -
    - - - -
    -
    -
    - - - -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - -
    -
    -
    - - - -
    - - -
    -
    -
    +
    + + +
    +
    + + +
    +
    + + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + + +
    + + +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4; border: 1px solid #e5e5e5" /> + " class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    -
    - " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4; border: 1px solid #e5e5e5" /> - " class="btn btn-circle btn-sm label-info"> -
    - + + + +
    +
    +
    + -
    -
    -
    - - - -
    +
    -
    - -
    - - + + +
    diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index 717c52222..ce4b59da1 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -88,6 +88,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas ViewState["CveAsignacion"] = value; } } + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -112,19 +113,23 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void CargarMensajeNuevoEditado() { string MensajeNuevoEditado = Page.Request["Mensaje"]; - if (MensajeNuevoEditado == "Nuevo") + switch (MensajeNuevoEditado) { - Alert("El Documento ha sido creado correctamente"); - } - else if (MensajeNuevoEditado == "Editado") - { - Alert("Los cambios en el Documento han sido guardado correctamente"); + case "Nuevo": + Alert("El Documento ha sido creado correctamente"); + break; + case "NuevaVersion": + Alert("Nueva versión del Documento creado correctamente"); + break; + case "Publicado": + Alert("Documento publicado"); + break; } } private void CargarUsuarios() { - GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); + GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1"); GvUsuarios.DataBind(); } @@ -171,8 +176,10 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void CargarSubCategoria() { + DdlSubCategoria.Items.Clear(); + int CveCategoria = DdlCategoria.SelectedValue.ToEntero(); ClsOIEventos ObjOI = new ClsOIEventos(); - if (ObjOI.GetDocumentoSubCategoria()) + if (ObjOI.GetDocumentoSubCategoria(CveCategoria: CveCategoria)) { DdlSubCategoria.DataSource = ObjOI.DtResultados; DdlSubCategoria.DataBind(); @@ -196,6 +203,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas CveUsuarioResponsable = Documento["CveUsuario"].ToString().ToEntero(); TxtDescripcion.Text = Documento["Descripcion"].ToString(); + DdlCategoria.SelectedValue = Documento["CveCategoria"].ToString(); + CargarSubCategoria(); DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString(); DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString(); TxtVersion.Text = Documento["Version"].ToString(); @@ -230,6 +239,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { LkbGuardar.Visible = false; LkbActualizar.Visible = true; + LkbPublicar.Visible = true; GvUsuarios.Columns[1].Visible = false; GvUsuarios.Columns[2].Visible = true; GvUsuarios.Columns[3].Visible = true; @@ -265,14 +275,51 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } + private void ConfigurarSegunEstatus() + { + bool MostrarSegunAprobado = (DdlEstatus.SelectedValue == "2"); + DivBotonesAcciones.Visible = !MostrarSegunAprobado; + UpAgregar.Visible = MostrarSegunAprobado; + } + + private void CargarCategorias() + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.GetDocumentoCategoria()) + { + DdlCategoria.DataSource = ObjOI.DtResultados; + } + ObjOI.Dispose(); + DdlCategoria.DataBind(); + DdlCategoria.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlSubCategoria.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + + protected void DdlCategoria_SelectedIndexChanged(object sender, EventArgs e) + { + if (DdlCategoria.SelectedValue != "-1") + { + CargarSubCategoria(); + } + } + + private void EstatusMostrar(bool Mostrar) + { + DivEstatus.Visible = Mostrar; + brEstatus.Visible = Mostrar; + DivEstatusInicial.Visible = !Mostrar; + brEstatusInicial.Visible = !Mostrar; + } + private void Cargar() { - CargarSubCategoria(); + CargarCategorias(); CargarResponsable(); CargarCveDocumento(); CargarUsuarios(); if (this.CveDocumento > 0) { + EstatusMostrar(true); CargarDocumentoYaExistente(); CargarUsuariosParticipantes(); CargarUsuariosAutorizo(); @@ -281,6 +328,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas ConfigurarCamposDetalleSegunUsuario(); CargarMensajeNuevoEditado(); } + ConfigurarSegunEstatus(); } #endregion @@ -310,7 +358,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (!TieneError) { ObjOI.Commit(); - string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "Editado";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página + string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "NuevaVersion";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); } else @@ -326,7 +374,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { int CveDocumentoPadre = this.CveDocumento > 0 ? this.CveDocumento : -1; //Asociamos el nuevo insert con un CveDocumento ya generado en caso de ser una nueva versión del documento - int CveDocumento = ObjOI.AddDocumento(DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(), + int CveDocumento = ObjOI.AddDocumento(DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 1, "", TxtResponsable.Text, CveDocumentoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); if (!(CveDocumento > 0)) { @@ -439,10 +487,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas { try { - string Version = TxtVersion.Text; string NombreArchivo = fileItem.filenameO; //Preparamos la ruta donde moveremos el archivo cargado - //string NombreArchivoGuardado = NombreArchivo; string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, CveDocumento, NombreArchivo); //Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa @@ -456,6 +502,30 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } } + else if (this.CveDocumento > 0) + { + try + { + if (ArchivoAdjuntoNombre != "") + { + string RutaOrigen = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, this.CveDocumento, ArchivoAdjuntoNombre); + string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, CveDocumento, ArchivoAdjuntoNombre); + + System.IO.File.Move(RutaOrigen, RutaDestino); + RutaArchivo = ArchivoAdjuntoNombre; + } + else + { + RutaArchivo = ""; + } + } + catch (Exception e) + { + Alert(e.Message); + RutaArchivo = "Error"; + } + } + return RutaArchivo; } @@ -668,8 +738,6 @@ public partial class OI_DocumentoDetalle : ClsPaginas if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 2, "-1", TxtResponsable.Text, DateTime.Now, -1, -1, UsuarioActual.CveEmpresa)) { - Cargar(); - UpCliente.Update(); Alert("Documento publicado"); } ObjOI.Dispose(); @@ -678,6 +746,31 @@ public partial class OI_DocumentoDetalle : ClsPaginas { Alert("Los usuarios participantes aún no autorizan este Documento"); } + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", this.CveDocumento, "Publicado")); } #endregion + + #region "NUEVA VERSION" + protected void LkbNuevaVersion_Click(object sender, EventArgs e) + { + CargarUsuarios(); + LkbGuardar.Text = "Crear Nueva Versión"; + DivBotonesAcciones.Visible = true; + LkbActualizar.Visible = false; + LkbPublicar.Visible = false; + LkbGuardar.Visible = true; + GvUsuarios.Columns[1].Visible = true; + GvUsuarios.Columns[2].Visible = false; + GvUsuarios.Columns[3].Visible = false; + EstatusMostrar(false); + UpCliente.Update(); + } + #endregion + + protected void LbPruebas_Click(object sender,EventArgs e) + { + Cargar(); + UpCliente.Update(); + Alert("Documento actualizado"); + } } \ No newline at end of file