diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index f4cf2ee95..d5be1124a 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -105,6 +105,14 @@ Partial Class AF_AF
Set(value As Integer)
ViewState("AFInvCveAlmacen") = value
End Set
+ End Property
+ Private Property AFInvCveSeccionAlmacen As Integer
+ Get
+ Return If(ViewState("AFInvCveSeccionAlmacen") Is Nothing, -1, ViewState("AFInvCveSeccionAlmacen").ToString.ToEntero())
+ End Get
+ Set(value As Integer)
+ ViewState("AFInvCveSeccionAlmacen") = value
+ End Set
End Property
Private Property AFInvSerie As String
Get
@@ -2102,8 +2110,8 @@ Partial Class AF_AF
If AFInvCvePS > 0 AndAlso AFInvCveAlmacen > 0 Then
Dim CveUMInv = GlobalDTPS(CveEmpresaActual, CvePS:=AFInvCvePS).FiltroPrimeroValor("CveUM").ToEntero
If CveUMInv > 0 Then
- CveMovimientoSalidaInv = ObjInventarios.AddMovimiento(AFInvCveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, CveEmpresaActual, -1, -1, -1, -1, Observaciones:=$"Salida de inventario para Activo Fijo | {TxtCodigo.Text.Trim}")
- If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaInv, 1, CveUMInv, AFInvCvePS, 0, -1, Serie:=AFInvSerie) Then
+ CveMovimientoSalidaInv = ObjInventarios.AddMovimiento(AFInvCveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, CveEmpresaActual, -1, -1, -1, -1, Observaciones:=$"Salida de inventario para Activo Fijo | {TxtCodigo.Text.Trim}", Modulo:="AF1")
+ If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaInv, 1, CveUMInv, AFInvCvePS, 0, -1, Serie:=AFInvSerie, CveSeccionAlmacen:=AFInvCveSeccionAlmacen) Then
ErrorGuardar = True
End If
Else
@@ -3051,6 +3059,7 @@ Partial Class AF_AF
AFInvSerie = ""
AFInvCvePS = -1
AFInvCveAlmacen = -1
+ AFInvCveSeccionAlmacen = -1
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlAFInvPS.SelectedValue.ToEntero).FiltroPrimero("")
If DrPS Is Nothing Then Exit Sub
@@ -3076,6 +3085,7 @@ Partial Class AF_AF
AFInvSerie = ""
AFInvCvePS = -1
AFInvCveAlmacen = -1
+ AFInvCveSeccionAlmacen = -1
Alert("No hay existencias suficientes del producto. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -3094,7 +3104,7 @@ Partial Class AF_AF
AFInvCvePS = DdlAFInvPS.SelectedValue.ToEntero
AFInvCveAlmacen = DdlAFInvAlmacen.SelectedValue.ToEntero
-
+ AFInvCveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
RegistraScript("$('#ModalAFInv').modal('hide')", "hide")
DivAFInvAdvertencia.Visible = True
@@ -3652,12 +3662,12 @@ Partial Class AF_AF
DivSeccion.Visible = CBool(drr("AplicaSeccion"))
DdlSeccionAlmacen.Items.Clear()
If CBool(drr("AplicaSeccion")) Then
- CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAFInvAlmacen.SelectedValue.ToEntero, DdlAFInvPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
- 'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAFInvAlmacen.SelectedValue.ToEntero, DdlAFInvPS.SelectedValue.ToEntero)
- 'DdlSeccionAlmacen.DataSource = dtt
- 'DdlSeccionAlmacen.DataBind()
+ 'CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAFInvAlmacen.SelectedValue.ToEntero, DdlAFInvPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
+ Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAFInvAlmacen.SelectedValue.ToEntero, DdlAFInvPS.SelectedValue.ToEntero)
+ DdlSeccionAlmacen.DataSource = dtt
+ DdlSeccionAlmacen.DataBind()
- 'dtt.Dispose()
+ dtt.Dispose()
End If
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 78bc5b906..f68808600 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -3876,6 +3876,32 @@ Public Class ClsContabilidad
Return Retorno
End Function
+
+ Public Function GetLibroDiario(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer) As Boolean
+ Dim Retorno = False
+
+ 'SqlAdapter.SelectCommand.t
+
+ DataAdapter("PA_Conta_LibroDiario")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ SqlAdapter.SelectCommand.CommandTimeout = 0
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al obtener libro diario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
#End Region
#Region "I N C O N S I S T E N C I A S"
diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb
index 6abe367d1..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
@@ -3089,6 +3090,48 @@ Public Class ClsOIEventos
Return Retorno
End Function
+
+ Public Function UpdateDocumentoAutorizacion(CveAutorizacion As Integer, CveDocumento As Integer, Comentarios As String, Adjunto As String, FechaAprobacion As Date) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosAutorizacionesUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
+ .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
+ .Add("@Comentarios", SqlDbType.NVarChar).Value = Comentarios
+ .Add("@Adjunto", SqlDbType.NVarChar).Value = Adjunto
+ .Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el usuario para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function DesaprobarDocumentoAutorizacion(CveAutorizacion As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosAutorizacionesDesaprobar")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al desaprobar la autorización del documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
#End Region
#End Region
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 7cdb07053..40f6c1946 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4257,6 +4257,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoCC.aspx".ToUpper(), 594)
PaginaDict.Add("/Contabilidad2/RepVariacionHaciendaPublica.aspx".ToUpper(), 595)
PaginaDict.Add("/Contabilidad2/CatCuentas.aspx".ToUpper(), 596)
+ PaginaDict.Add("/Contabilidad2/RepLibroDiario.aspx".ToUpper(), 544)
PaginaDict.Add("/Contabilidad2/RepSituacionFinancieraSAT.aspx".ToUpper(), 615)
PaginaDict.Add("/Contabilidad2/RepEstadoActividadesSAT.aspx".ToUpper(), 616)
@@ -4627,7 +4628,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/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/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx
index 5ab24ec65..eb3f2fa7d 100644
--- a/Ashx/SIGFacturacion.ashx
+++ b/Ashx/SIGFacturacion.ashx
@@ -11,40 +11,64 @@ Imports Extensiones
Imports System.IO
Imports Modelos
-Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
+Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
+
+ Private Property CveEmpresaFacturar As Integer = 143
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
- context.Response.ContentType = "application/json"
- Try
- If context.Request.InputStream IsNot Nothing Then
- Using reader As New StreamReader(context.Request.InputStream)
- Dim json = reader.ReadToEnd
+ context.Response.ContentType = "text/plain"
+ Dim Retorno As Boolean = False
- If Not String.IsNullOrEmpty(json) Then
- Dim JsonRequest As JObject = JObject.Parse(json)
- If JsonRequest IsNot Nothing Then
- Dim Metodo = JsonRequest("Metodo").ToString()
- If Metodo = "FactMasivaRemisiones" Then
- Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
- Dim pFechaI As String = ""
- Dim pFechaF As String = ""
-
- If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
- pFechaI = JsonRequest("FechaI")
- pFechaF = JsonRequest("FechaF")
- End If
-
- IniciaFacturacionMasiva(context, pCveEmpresa, pFechaI, pFechaF)
- End If
- End If
- End If
-
- End Using
+ Try
+ 'If context.Request.InputStream IsNot Nothing Then
+ ' Using reader As New StreamReader(context.Request.InputStream)
+ ' Dim json = reader.ReadToEnd
+
+ ' If Not String.IsNullOrEmpty(json) Then
+ ' Dim JsonRequest As JObject = JObject.Parse(json)
+ ' If JsonRequest IsNot Nothing Then
+ ' Dim Metodo = JsonRequest("Metodo").ToString()
+ ' If Metodo = "FactMasivaRemisiones" Then
+ ' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
+ ' Dim pFechaI As String = ""
+ ' Dim pFechaF As String = ""
+
+ ' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
+ ' pFechaI = JsonRequest("FechaI")
+ ' pFechaF = JsonRequest("FechaF")
+ ' End If
+
+ ' IniciaFacturacionMasiva(context, CveEmpresaFacturar, pFechaI, pFechaF)
+ ' End If
+ ' End If
+ ' End If
+
+ ' End Using
+ 'End If
+
+ Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
+ If Metodo = "FactMasivaRemisiones" Then
+ Dim pFechaI As String = ""
+ Dim pFechaF As String = ""
+
+ If context.Request("FechaI") IsNot Nothing AndAlso context.Request("FechaF") IsNot Nothing Then
+ pFechaI = context.Request("FechaI")
+ pFechaF = context.Request("FechaF")
+ End If
+
+ Retorno = IniciaFacturacionMasiva(CveEmpresaFacturar, pFechaI, pFechaF)
End If
Catch ex As Exception
ex.GuardaLog(ex.Message)
- End Try
+ End Try
+
+ If Retorno Then
+ context.Response.Write("True")
+ Else
+ context.Response.Write("False")
+ End If
+
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
@@ -53,7 +77,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
End Get
End Property
- Private Sub IniciaFacturacionMasiva(ByVal context As HttpContext, pCveEmpresa As String, pFechaI As String, pFechaF As String)
+ Private Function IniciaFacturacionMasiva(pCveEmpresa As String, pFechaI As String, pFechaF As String) As Boolean
+ Dim Retorno As Boolean = True
Dim JsonRetorno As New JObject()
Dim CveEmpresa As Integer = pCveEmpresa.ToEntero()
If CveEmpresa > 0 Then
@@ -71,7 +96,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
FechaI = New DateTime(DomingoAnterior.Year, DomingoAnterior.Month, DomingoAnterior.Day, 0, 0, 0)
FechaF = New DateTime(Sabado.Year, Sabado.Month, Sabado.Day, 23, 59, 59)
- JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
+ JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
+ Else
+ Retorno = False
+ GuardaLogFacturacion("Ejecución no permitida, no es el dia permitido para ejecucion o no se espeficaron las fechas")
End If
Else
FechaI = pFechaI.ToDateTime()
@@ -79,11 +107,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
End If
-
-
- End If
- context.Response.Write(JsonRetorno)
- End Sub
+ End If
+
+ GuardaLogFacturacion("Ejecución Exitosa, se generaron las siguientes facturas:")
+ GuardaLogFacturacion(JsonRetorno.ToString())
+
+ Return Retorno
+ End Function
Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 58d72438a..5d65c848e 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -3146,6 +3146,8 @@ Partial Class Compras_Compras
ViewState("CveProveedor") = ObjProveedor.CveProveedor
ViewState("CveTipoProveedor") = ObjProveedor.CveTipoProveedor
+ If ObjProveedor.CveTipoProveedor = 1 Then LblProveedor.Text = "Proveedor:" Else LblProveedor.Text = "Acreedor:"
+ CveTipoConcepto = ObjProveedor.CveTipoProveedor
'Conta ContPAQ
ViewState("CtaProveedor") = ObjProveedor.IdCtaContProveedores
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/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
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 @@
+ trueDataSet1End
+ true0.05076cm3.18542cm
@@ -1642,7 +1645,8 @@
Textbox35
- 17.03312cm
+ 0.26458cm
+ 16.57041cm0.52564cm2.8175cm2
@@ -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/Empresas/72/Formatos/Entradas.rdlc b/Empresas/72/Formatos/Entradas.rdlc
index 8a86b04cd..36bd50101 100644
--- a/Empresas/72/Formatos/Entradas.rdlc
+++ b/Empresas/72/Formatos/Entradas.rdlc
@@ -866,11 +866,77 @@
+
+ true
+ true
+
+
+
+
+ =Parameters!Observaciones.Value
+
+
+
+
+
+
+ Textbox8
+ 3.8986cm
+ 0.17882cm
+ 0.97952cm
+ 19.04079cm
+ 4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ OBSERVACIONES:
+
+
+
+
+
+
+ Textbox5
+ 3.11339cm
+ 0.18166cm
+ 0.60882cm
+ 3.98167cm
+ 5
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
- 1.75444in
+ 1.94921in