diff --git a/App_Code/BundleConfig.vb b/App_Code/BundleConfig.vb index 96ebcff7a..e3da720f1 100644 --- a/App_Code/BundleConfig.vb +++ b/App_Code/BundleConfig.vb @@ -51,6 +51,7 @@ Public Class BundleConfig "~/Metronic/assets/admin/layout/scripts/demo.js", "~/Metronic/assets/admin/pages/scripts/table-advanced.js", "~/Metronic/assets/admin/pages/scripts/ui-alert-dialog-api.js", + "~/Metronic/assets/global/plugins/icheck/icheck.min.js", "~/Metronic/assets/global/plugins/dropzone/dropzone.js", "~/Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js", "~/Scripts/custom.js" @@ -76,6 +77,7 @@ Public Class BundleConfig "~/Metronic/assets/layouts/global/scripts/quick-nav.min.js", "~/Metronic/assets/admin/pages/scripts/table-advanced.js", "~/Metronic/assets/admin/pages/scripts/ui-alert-dialog-api.js", + "~/Metronic/assets/global/plugins/icheck/icheck.min.js", "~/Metronic/assets/global/plugins/dropzone/dropzone.js", "~/Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js", "~/Scripts/custom.js" @@ -198,6 +200,7 @@ Public Class BundleConfig "~/Metronic/assets/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css", "~/Metronic/assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css", "~/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css", + "~/Metronic/assets/global/plugins/icheck/skins/all.css", "~/Styles/thickbox.css", "~/Metronic/assets/global/css/components.css", "~/Metronic/assets/global/css/plugins.css", @@ -221,6 +224,7 @@ Public Class BundleConfig "~/Metronic/assets/global/plugins/datatables2/extensions/KeyTable/css/keyTable.dataTables.min.css", "~/Metronic/assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css", "~/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css", + "~/Metronic/assets/global/plugins/icheck/skins/all.css", "~/Styles/thickbox.css", "~/Metronic/assets/global/css/components.css", "~/Metronic/assets/global/css/plugins.css", diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index f541e0e97..1f94c267d 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -2683,7 +2683,10 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza As Integer, CveConcepto As Integer, TipoMovto As Integer, IdCtaContable As Integer, Orden As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, CveProveedor As Integer, Optional CvePersonal As Integer = -1) As Boolean + Public Function AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza As Integer, CveConcepto As Integer, TipoMovto As Integer, + IdCtaContable As Integer, Orden As Integer, CveUsuario As Integer, CveEmpresa As Integer, + CveSubProyecto As Integer, CveProveedor As Integer, Optional CvePersonal As Integer = -1, + Optional PorcentajeImpuesto As Decimal = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_PlantillasPolizasDetalleAdd") @@ -2699,6 +2702,7 @@ Public Class ClsContabilidad .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@PorcentajeImpuesto", SqlDbType.SmallMoney).Value = PorcentajeImpuesto End With Try @@ -2715,7 +2719,9 @@ Public Class ClsContabilidad End Try Return Retorno End Function - Public Function UpdateConta_PlantillasPolizasDetalle(CveConcepto As Integer, TipoMovto As Integer, IdCtaContable As Integer, Orden As Integer, CvePlantillaPolizaDetalle As Integer, CveSubProyecto As Integer, CveProveedor As Integer, Optional CvePersonal As Integer = -1) As Boolean + Public Function UpdateConta_PlantillasPolizasDetalle(CveConcepto As Integer, TipoMovto As Integer, IdCtaContable As Integer, Orden As Integer, + CvePlantillaPolizaDetalle As Integer, CveSubProyecto As Integer, CveProveedor As Integer, + Optional CvePersonal As Integer = -1, Optional PorcentajeImpuesto As Decimal = 0) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Conta_PlantillasPolizasDetalleUpdate") @@ -2729,6 +2735,7 @@ Public Class ClsContabilidad .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@PorcentajeImpuesto", SqlDbType.SmallMoney).Value = PorcentajeImpuesto End With Try diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 4404872e7..73f8c4b6f 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -4,7 +4,18 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports Extensiones - +Public Enum OITipoEventos + Tarea = 1 + Agenda = 2 + Proyecto = 3 + Control_de_Versiones_de_Doctos = 4 + Minuta = 5 + Bitacora = 6 + Scrum = 7 + ISO = 8 + Soporte = 9 + Gastos_Mes = 10 +End Enum Public Class ClsOIEventos Implements IDisposable @@ -171,7 +182,192 @@ Public Class ClsOIEventos End Sub +#Region "oieventos2.0" + Public Function GetOI_Eventos2(cveEvento As Int32, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_GetOI_Eventos2", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = cveEvento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + + Public Function AddOI_Eventos2(cveTipoEvento As OITipoEventos, asunto As String, descripcion As String, prioridad As Int32, cveUsuarioDe As Int32, cveUsuarioPara As Int32, + fechaInicio As String, fechaFin As String, cveRevision As Int32, archivo As String, cveUsuarioIng As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_AddOI_Eventos2", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@cveTipoEvento", SqlDbType.Int).Value = cveTipoEvento + .Add("@asunto", SqlDbType.VarChar).Value = asunto + .Add("@descripcion", SqlDbType.VarChar).Value = descripcion + .Add("@prioridad", SqlDbType.Int).Value = prioridad + .Add("@cveUsuarioDe", SqlDbType.Int).Value = cveUsuarioDe + .Add("@cveUsuarioPara", SqlDbType.Int).Value = cveUsuarioPara + .Add("@fechaInicio", SqlDbType.VarChar).Value = fechaInicio + .Add("@fechaFin", SqlDbType.VarChar).Value = fechaFin + .Add("@cveRevision", SqlDbType.Int).Value = cveRevision + .Add("@archivo", SqlDbType.VarChar).Value = archivo + .Add("@cveUsuarioIng", SqlDbType.Int).Value = cveUsuarioIng + .Add("@cveEmpresa", SqlDbType.Int).Value = cveEmpresa + End With + Try + SqlAdapter.Fill(Data) + CveEvento = SqlAdapter.SelectCommand.Parameters("@CveEvento").Value.ToString().ToEntero() + Folio = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString().ToEntero() + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Catálogo de Eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + Public Function UpdateEstatusEvento2(CveEventoEstatus As Integer, CveComentario As Integer, CveEvento As Integer, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_OI_EventosEstatusUpdate2") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@pCveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus + .Add("@pCveComentario", SqlDbType.Int).Value = CveComentario + .Add("@pCveEvento", SqlDbType.Int).Value = CveEvento + .Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el estatus en el Evento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#Region "CRUD_cheklist" + Public Function Getcheklist(cveEvento As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Addcheklist(cveEvento As Int32, eventoComentario As String, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Upcheklist(cveEventoCheckList As Int32, cveEvento As Int32, eventoComentario As String, estatus As Boolean, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistUp", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEventoCheckList", SqlDbType.Int).Value = cveEventoCheckList + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@eventoComentario", SqlDbType.VarChar).Value = eventoComentario + .Add("@estatus", SqlDbType.Bit).Value = estatus + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function Removecheklist(cveEventoCheckList As Int32, cveEvento As Int32, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_cheklistRemove", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveEventoCheckList", SqlDbType.Int).Value = cveEventoCheckList + .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el checklist.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function +#End Region + + Public Function AddUPEventoArchivo(CveEvento As Integer, Archivo As String, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OI_EventosArchivoAddUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@Archivo", SqlDbType.VarChar).Value = Archivo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Retorno = False + Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + Retorno = False + OnError("Ocurrió un error al Guardar el Evento Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function UPEventoAAvance(CveEvento As Integer, Avance As Decimal, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_OI_EventosAvanceUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEvento", SqlDbType.Int).Value = CveEvento + .Add("@Avance", SqlDbType.Decimal).Value = Avance + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Retorno = False + Me.OnError("Ocurrió un error al Guardar el comentario del evento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + Retorno = False + OnError("Ocurrió un error al Guardar el Evento Comentario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 140fa5c21..624b4cb6d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4405,6 +4405,7 @@ Public Class ClsPaginas 'OI #Region "OI" PaginaDict.Add("/OI/EventoDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/TareaDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Normatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/RepNormatividad.aspx".ToUpper(), 669) PaginaDict.Add("/OI/Minutas.aspx".ToUpper(), -1) @@ -5164,7 +5165,11 @@ Public Class ClsPaginas Dim ds As New DataSet For Each rpds As ReportDataSource In DataSource Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) - dt = dt.Copy() + If dt Is Nothing Then + dt = New DataTable() + Else + dt = dt.Copy() + End If dt.TableName = rpds.Name ds.Tables.Add(dt) Next diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 6c3cd5518..6b853e4f4 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4006,7 +4006,7 @@ Namespace Modelos '1 NORMAL, 2 CON PAGOS Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero() - If ModalidadRefacturacion <= 0 Then + If EsRefacturacion AndAlso ModalidadRefacturacion <= 0 Then Retorno.Mensaje = "La factura no se puede refacturar debido a que la empresa no tiene asignada una modalidad de refacturación." Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 0a0c9935b..ed22628cc 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -569,6 +569,14 @@ Namespace Extensiones Else Return Nothing End If + End Function + + + + Public Function ToDateTimeExcat(Str As String, Optional format As String = "dd/MM/yyyy HH:mm") As DateTime + Dim fecha As DateTime = New DateTime() + DateTime.TryParseExact(Str, format, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, fecha) + Return fecha End Function diff --git a/Ashx/GenerarPDFFactura.ashx b/Ashx/GenerarPDFFactura.ashx new file mode 100644 index 000000000..bf3b15b44 --- /dev/null +++ b/Ashx/GenerarPDFFactura.ashx @@ -0,0 +1,281 @@ +<%@ WebHandler Language="VB" Class="GenerarPDFFactura" %> + +Imports System +Imports System.Web +Imports System.Data +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq +Imports Extensiones +Imports System.IO +Imports Microsoft.Reporting.WebForms + +Public Class GenerarPDFFactura : Implements IHttpHandler + + Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable + Get + Return False + End Get + End Property + + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest + Dim retorno As String = "no se encontro la variable" + + Try + Dim datos As ParametroWS = Nothing + If context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then + context.Response.ContentType = "application/json" + Using reader As New StreamReader(context.Request.InputStream) + Dim json = reader.ReadToEnd() + datos = JsonConvert.DeserializeObject(Of ParametroWS)(json) + End Using + End If + + If datos IsNot Nothing Then + Dim ListaDS = New List(Of ReportDataSource) + Dim Parametros As New List(Of ReportParameter) + + Dim Formato = context.Server.MapPath("/") + "Empresas/1/Report.rdlc" + + Parametros.Add(New ReportParameter("Empresa", datos.Empresa.Empresa)) + Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC)) + Parametros.Add(New ReportParameter("DomicilioExpedicion", datos.Empresa.DomicilioFiscal)) + Parametros.Add(New ReportParameter("Serie", datos.Factura.Serie)) + Parametros.Add(New ReportParameter("Folio", datos.Factura.Folio)) + Parametros.Add(New ReportParameter("Fecha", datos.Factura.Fecha)) + Parametros.Add(New ReportParameter("ClienteNombre", datos.Cliente.NombreComercial)) + Parametros.Add(New ReportParameter("ClienteDireccion", datos.Cliente.Calle + " Colonia " + datos.Cliente.Colonia + " " + datos.Cliente.Ciudad + ", " + datos.Cliente.Estado)) + Parametros.Add(New ReportParameter("ClienteLugar", datos.Cliente.Ciudad)) + Parametros.Add(New ReportParameter("ClienteRFC", datos.Cliente.RFC)) + 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("FolioFiscal", datos.Factura.UUID)) + Parametros.Add(New ReportParameter("SerieCertificadoSAT", "")) + Parametros.Add(New ReportParameter("FechaCertificado", "")) + Parametros.Add(New ReportParameter("CertificadoContribuyente", "")) + Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI)) + Parametros.Add(New ReportParameter("Vencimiento", Now.AddDays(30))) + 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", "")) + + Dim DtDatos As New DataTable + DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) + DtDatos.Columns.Add(New DataColumn("UnidadMedida", GetType(String))) + DtDatos.Columns.Add(New DataColumn("PS", GetType(String))) + DtDatos.Columns.Add(New DataColumn("PU", GetType(Decimal))) + DtDatos.Columns.Add(New DataColumn("IVA", GetType(Decimal))) + DtDatos.Columns.Add(New DataColumn("IEPS", GetType(Decimal))) + DtDatos.Columns.Add(New DataColumn("Total", GetType(Decimal))) + + For Each PS In datos.Factura.ListaProductos + Dim Row = DtDatos.NewRow() + Row("Cantidad") = PS.Cantidad + Row("UnidadMedida") = PS.UnidadMedida + Row("PS") = PS.CodigoPS + Row("PU") = PS.PU + Row("IVA") = PS.IVA + Row("IEPS") = PS.IEPS + Row("Total") = (PS.Cantidad * PS.PU) + PS.IVA + PS.IEPS + + DtDatos.Rows.Add(Row) + Next + ListaDS.Add(New ReportDataSource("DsProductos", DtDatos)) + + ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "test") + End If + + Catch ex As Exception + ex.GuardaLog(ex.ToString()) + context.Response.Write(retorno) + End Try + + 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 + 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 + Dim extension As String = Nothing + + 'If Descarga Then + ' Try + ' bytes = bytes + ' File.WriteAllBytes(String.Format("{0}PDF/whatever.gif", UsuarioActual.Empresa.Ruta), img) + ' Catch ex As Exception + ' If UsuarioActual.CveRol = 1 Then + ' Alert(ex.Message, TipoMensaje.MsgAdvertencia) + ' Else + ' Alert("Ocurrió un error al generar la descarga. Favor de contactar a soporte tecnico cod'IMPDFclspag'", TipoMensaje.MsgAdvertencia) + ' End If + ' End Try + 'End If + + Try + + bytes = bytes + context.Response.Buffer = True + context.Response.Clear() + context.Response.ContentType = mimeType + context.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}.{1}", NombreArchivo, If(Formato = "PDF", "pdf", "xls"))) + context.Response.BinaryWrite(bytes) ' create the file + context.Response.Flush() ' send it to the client to download + context.Response.SuppressContent = True + context.ApplicationInstance.CompleteRequest() + context.Response.End() + + Catch ex As Exception + End Try + End Sub + + + Public Class FacturaWS + Public Property Id As Integer + Public Property CveVenta As Integer + Public Property CveCliente As Integer + Public Property NombreCliente As String + Public Property Fecha As DateTime + Public Property CveSubCentroCosto As Integer + Public Property CveTipoDocumento As Integer + Public Property TipoDocumento As String + Public Property Serie As String + Public Property Folio As Integer + Public Property CveVendedor As Integer + Public Property CveUsuario As Integer + Public Property CveEstatusVenta As Integer + Public Property EstatusVenta As String + Public Property UUID As String + Public Property ListaProductos As List(Of ProductoWS) + Public Property CveUsoCFDI As Integer + Public Property UsoCFDI As String + Public Property CveMetodoPago As Integer + Public Property MetodoPago As String + Public Property ClaveMetodoPagoSAT As String + Public Property CveFormaPago As Integer + Public Property FormaPago As String + Public Property ClaveFormaPagoSAT As String + Public Property Observaciones As String + Public Property CveMoneda As Integer + Public Property TipoCambio As Double + Public Property FechaIng As DateTime + Public Property CveEmpresa As Integer + Public Property SubTotal As Double + Public Property Descuentos As Double + Public Property IVA As Double + Public Property IEPS As Double + Public Property Total As Double + End Class + + Public Class ProductoWS + Public Property Id As Integer + Public Property CveVentaDetalle As Integer + Public Property CveVenta As Integer + Public Property CveProductoServicio As Integer + Public Property CodigoPS As String + Public Property CveUnidadMedida As Integer + Public Property UnidadMedida As String + Public Property Cantidad As Double + Public Property Observacion As String + Public Property PU As Double + Public Property Descuento As Double + Public Property IVA As Double + Public Property IEPS As Double + Public Property IVAPorcentaje As Double + Public Property IEPSPorcentaje As Double + Public Property CveSubCentroCosto As Integer + Public Property SubCentroCosto As String + End Class + + Public Class ClienteWS + Public Property Id As Integer + Public Property CveCliente As Integer + Public Property RazonSocial As String + Public Property NombreComercial As String + Public Property RFC As String + Public Property Codigo As String + Public Property Calle As String + Public Property NoExterior As String + Public Property Colonia As String + Public Property Ciudad As String + Public Property Municipio As String + Public Property Estado As String + Public Property CodigoPostal As Integer + Public Property Contacto As String + Public Property ContactoTelefono As String + Public Property Correo As String + Public Property CveVendedor As Integer + Public Property Estatus As Boolean + Public Property CveUsuario As Integer + Public Property CveEmpresa As Integer + Public Property CveRegimenFiscal As Integer + Public Property RegimenFiscal As String + Public Property CodigoRegimenFiscal As String + End Class + + Public Class EmpresaWS + Public Property Id As Integer + Public Property CveEmpresa As Integer + Public Property Empresa As String + Public Property RFC As String + Public Property DomicilioFiscal As String + Public Property ArchivoCER As String + Public Property ArchivoKEY As String + Public Property FieldPassword As String + Public Property CveRegimenFiscal As Integer + Public Property RegimenFiscal As String + End Class + + Public Class ParametroWS + Public Property Factura As FacturaWS + Public Property Cliente As ClienteWS + Public Property Empresa As EmpresaWS + End Class + + +End Class \ No newline at end of file diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index 451c90e33..bebd16b8c 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -370,8 +370,7 @@ public partial class Bancos_Devoluciones : ClsPaginas } // DATOS PREPOLIZA - if ((DdlTipoTransanccion.SelectedValue == "1")) - FolioFijo = TxtFolio.Text.ToEntero(); + if ( DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransanccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 874e91841..535b52b64 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -299,8 +299,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas AsignaCuentaProveedor(DdlProveedores.SelectedValue.ToEntero()); // DATOS PREPOLIZA - if ((DdlTipoTransaccion.SelectedValue == "1")) - FolioFijo = TxtFolio.Text.ToEntero(); + if ( DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index e2d5b27ef..0a066a52f 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -339,9 +339,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas } // DATOS PREPOLIZA - if ((DdlTipoTransaccionPrestamo.SelectedValue == "1")) - FolioFijo = TxtFolioPrestamo.Text.ToEntero(); - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PRESTAMO DEUDORES", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMonedaPrestamo, TxtFechaPrestamo.Text.ToDate(), DdlProveedorPrestamo.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccionPrestamo.SelectedValue, "-1", UsuarioActual.CveEmpresa)); + if (DdlTipoTransaccionPrestamo.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolioPrestamo.Text.ToEntero(); + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PRESTAMO DEUDORES", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMonedaPrestamo, TxtFechaPrestamo.Text.ToDate(), DdlProveedorPrestamo.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccionPrestamo.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) { @@ -674,8 +673,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas } // DATOS PREPOLIZA - if ((DdlTipoTransaccion.SelectedValue == "1")) - FolioFijo = TxtFolio.Text.ToEntero(); + if (DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO DEUDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index 60cd167ef..fc10b964d 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -250,8 +250,8 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas AsignaCuentaPersonal(DdlFuncionarioEmpleadoPago.SelectedValue.ToEntero(), CveMoneda); // DATOS PREPOLIZA - if ((DdlTipoTransaccion.SelectedValue == "1")) - FolioFijo = TxtFolio.Text.ToEntero(); + if (DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlFuncionarioEmpleadoPago.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) @@ -539,9 +539,9 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas AsignaCuentaPersonal(DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), CveMoneda); // DATOS PREPOLIZA - if ((DdlTipoTransanccionPrestamo.SelectedValue == "1")) - FolioFijo = TxtFolioPrestamo.Text.ToEntero(); - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PRESTAMO PERSONAL", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMoneda, TxtFechaPrestamo.Text.ToDate(), DdlFuncionarioEmpleadoPrestamo.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa)); + if (DdlTipoTransanccionPrestamo.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119 ) FolioFijo = TxtFolioPrestamo.Text.ToEntero(); + + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/PRESTAMO PERSONAL", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMoneda, TxtFechaPrestamo.Text.ToDate(), DdlFuncionarioEmpleadoPrestamo.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) { diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index 59f188c36..16ad716a1 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -358,7 +358,7 @@ diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 7ed2ecc68..9bfc2c3e8 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -709,7 +709,7 @@ Partial Class Bancos_ProveedoresAbonar - Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("Original").ToDecimal) + Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal) If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then Valida.EsValida = 1 diff --git a/Bancos/ProveedoresCreditos.aspx.vb b/Bancos/ProveedoresCreditos.aspx.vb index 26580af8b..145376793 100644 --- a/Bancos/ProveedoresCreditos.aspx.vb +++ b/Bancos/ProveedoresCreditos.aspx.vb @@ -912,7 +912,7 @@ Partial Class Bancos_ProveedoresCreditos Dim tImporteMonedaExtranjera As Decimal = 0 If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal 'cheque - If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero + If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = TxtFolio.Text.ToEntero CvePrePoliza = ObjMov.AddPrePolizas("Bancos/ProvCred", CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, TxtPagueseA.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) diff --git a/CRM/CatEtapasProceso.aspx b/CRM/CatEtapasProceso.aspx index 3baa490c2..7143b56a1 100644 --- a/CRM/CatEtapasProceso.aspx +++ b/CRM/CatEtapasProceso.aspx @@ -15,6 +15,12 @@
  • Agregar Etapas de Proceso
  • +
  • + PDF +
  • +
  • + Excel +
  • diff --git a/CRM/CatEtapasProceso.aspx.cs b/CRM/CatEtapasProceso.aspx.cs index 6bcb487ca..64ba4adf0 100644 --- a/CRM/CatEtapasProceso.aspx.cs +++ b/CRM/CatEtapasProceso.aspx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; +using Microsoft.Reporting.WebForms; using Extensiones; @@ -317,4 +318,36 @@ public partial class CRM_CatEtapasProceso : ClsPaginas CargaDatos(DdlFiltroProceso.SelectedValue.ToEntero()); } #endregion + + protected void LnkImprimir_Click(object sender,EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkImprimirExcel_Click(object sender, EventArgs e) + { + Imprimir("EXCEL"); + } + + private void Imprimir(string formato) + { + System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + + List param = new List(); + + param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + if (Image.Exists) + { + param.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + param.Add(new ReportParameter("LogoPath", "")); + } + param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString())); + + ImprimirPDF("Empresas/Grales/Formatos/RepCatEtapasProceso.rdlc", TmpDT, param, "Report Cat Etapas Proceso", formato); + } } \ No newline at end of file diff --git a/CRM/CatProbabilidadAcercamiento.aspx b/CRM/CatProbabilidadAcercamiento.aspx index e2978bb2b..9e7699641 100644 --- a/CRM/CatProbabilidadAcercamiento.aspx +++ b/CRM/CatProbabilidadAcercamiento.aspx @@ -15,6 +15,12 @@
  • Agregar Probabilidad de Acercamiento
  • +
  • + PDF +
  • +
  • + Excel +
  • @@ -32,11 +38,12 @@ CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true" GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVDatos_RowDeleting" OnRowDataBound="GVDatos_RowDataBound"> - + + <%-- - + --%> <%-- diff --git a/CRM/CatProbabilidadAcercamiento.aspx.cs b/CRM/CatProbabilidadAcercamiento.aspx.cs index 9b9d51d3d..218417bfb 100644 --- a/CRM/CatProbabilidadAcercamiento.aspx.cs +++ b/CRM/CatProbabilidadAcercamiento.aspx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; +using Microsoft.Reporting.WebForms; using Extensiones; @@ -195,4 +196,35 @@ public partial class CRM_CatProbabilidadAcercamiento : ClsPaginas } } #endregion + protected void LnkImprimir_Click(object sender, EventArgs e) + { + Imprimir("PDF"); + } + + protected void LnkImprimirExcel_Click(object sender, EventArgs e) + { + Imprimir("EXCEL"); + } + + private void Imprimir(string formato) + { + System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); + + List param = new List(); + + param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); + if (Image.Exists) + { + param.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + param.Add(new ReportParameter("LogoPath", "")); + } + param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString())); + + ImprimirPDF("Empresas/Grales/Formatos/RepCatProbabilidadAcercamiento", TmpDT, param, "Report Cat Etapas Proceso", formato); + } } \ No newline at end of file diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 3e3673985..33c26c6dd 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -302,7 +302,13 @@ public partial class CRM_EmpresaCRM : ClsPaginas } if (!ObjBitacora.AddEventoBitacora(Mensaje, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { HuboError = true; + }else + { + string asunto = String.Format("Se registró la empresa {0} con datos RFC: {1}, Vendedor: {2}", NombreEmpresa, RFC, Vendedor); + mandarCorreo(asunto, Mensaje); + } } } } @@ -316,10 +322,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas if ((CveEncuestaAplicada != 0) && ObjCRM.UpdateEmpresCRM(NombreEmpresa, RFC, CveMedioCaptacion, CveEmpresaCRM, CveVendedorActualizar, UsuarioActual.CveUsuario, CveSubProyecto: CveSubProyecto, Correo: Correo)) { - //if (ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) - //{ - HuboError = false; - //} + if (!ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { + HuboError = true; + }else + { + string asunto = String.Format("Se actualizó la empresa {0}",NombreEmpresa); + string mensaje = String.Format("Se actualizó la empresa {0} con RFC {1} por el usuario {2}", NombreEmpresa, RFC,UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); + } } } @@ -563,8 +574,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas protected void CargaSucursales() { - DdlSucursales.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1); - DdlSucursales.DataBind(); + //DdlSucursales.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1); + //DdlSucursales.DataBind(); DdlSucursales.Items.Insert(0, new ListItem("Todos ", "-1")); } @@ -856,6 +867,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjBitacora.AddEventoBitacora(String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}", NombreContacto, TelefonoOficina, Celular, Correo), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { + string asunto = "Se registró un Contacto"; + string mensaje = String.Format("Se registró un Contacto con Nombre: {0}{1}{2}{3}. Realzado por el usuario {4}", NombreContacto, TelefonoOficina, Celular, Correo,UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); HuboError = false; Alert("El Contacto fue creado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion); } @@ -933,7 +947,12 @@ public partial class CRM_EmpresaCRM : ClsPaginas Alert("El Contacto ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion); if (ObjBitacora.AddEventoBitacora(String.Format("Se eliminó el contacto {0}", NombreContacto), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) + { + string asunto = "Se eliminó el contacto"; + string mensaje = String.Format("Se eliminó el contacto {0} por el usuario {1}", NombreContacto,UsuarioActual.Nombre); + mandarCorreo(asunto, mensaje); ObjCRM.Commit(); + } } else { @@ -1079,6 +1098,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjEventos.AddEventoAgenda(DdlTipoAgenda.SelectedValue.ToEntero(), TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridadAgenda.SelectedValue.ToEntero(), FechaInicio, FechaInicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveContactoCRM: DdlContactoAgenda.SelectedValue.ToEntero())) { + mandarCorreo(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text); limpiarModalAgendar(); RegistraScript("$('#ModalAgenda').modal('hide')"); Alert("El Evento se agendó correctamente", ModExtensiones.TipoMensaje.MsgInformacion); @@ -1389,6 +1409,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas { if (ObjBitacora.AddEventoBitacora(String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoPrincipal, CveEtapaProcesoCRM: CveEtapaProcesoActual)) { + string asunto = String.Format("Se registró el Acercamiento {0}",NombreAcercamiento); + string mensaje = String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text); + mandarCorreo(asunto, mensaje); HuboError = false; } } @@ -1471,4 +1494,17 @@ public partial class CRM_EmpresaCRM : ClsPaginas } } #endregion + private void mandarCorreo(string Asunto, string body) + { + DataTable Usuarios = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa); + int CveUsuario = Usuarios.FiltroPrimeroValor("CveUsuario",String.Format("CveVendedor = {0}",DdlVendedor.SelectedValue)).ToEntero(); + if (CveUsuario != UsuarioActual.CveUsuario) + { + string correoVendedor = Usuarios.FiltroPrimeroValor("Correo", String.Format("CveUsuario = {0}", CveUsuario)); + ClsSisMail Mail = new ClsSisMail(); + List LSRutasMail = new List(); + //ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail(); + Mail.SendMail(ClsPaginas.EmpresaNotificaciones, correoVendedor, Asunto,body); + } + } } \ No newline at end of file diff --git a/CRM/RepAcercamientosProcesos.aspx b/CRM/RepAcercamientosProcesos.aspx index 20b4d8e37..86033c53b 100644 --- a/CRM/RepAcercamientosProcesos.aspx +++ b/CRM/RepAcercamientosProcesos.aspx @@ -34,7 +34,7 @@
  • - Ver Grafica +
  • @@ -86,6 +86,7 @@ + @@ -98,6 +99,7 @@ + diff --git a/CRM/RepAcercamientosProcesos.aspx.cs b/CRM/RepAcercamientosProcesos.aspx.cs index 420dff2cd..b37b05f13 100644 --- a/CRM/RepAcercamientosProcesos.aspx.cs +++ b/CRM/RepAcercamientosProcesos.aspx.cs @@ -107,6 +107,14 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas DdlMedioCaptacion.SelectedValue = "-1"; DdlProbabilidad.SelectedValue = "-1"; DdlTipoProceso.SelectedIndex = 0; + + int n; + string CveProbabilidadAcercamiento = Request["CveProbabilidadAcercamiento"]; + bool isNumeric = int.TryParse(CveProbabilidadAcercamiento, out n); + if (isNumeric) + { + DdlProbabilidad.SelectedValue = CveProbabilidadAcercamiento; + } upDatosRepA.Update(); } protected void cargarDatos() diff --git a/CRM/RepAcercamientosRechazos.aspx b/CRM/RepAcercamientosRechazos.aspx index 380159036..92c87d3e6 100644 --- a/CRM/RepAcercamientosRechazos.aspx +++ b/CRM/RepAcercamientosRechazos.aspx @@ -34,7 +34,7 @@
  • - Ver Grafica +
  • @@ -86,6 +86,7 @@ + @@ -98,6 +99,7 @@ + diff --git a/CRM/Report.rdlc b/CRM/Report.rdlc new file mode 100644 index 000000000..0a9e83690 --- /dev/null +++ b/CRM/Report.rdlc @@ -0,0 +1,51 @@ + + + + + + true + true + + + + + test reporte + + + + Textbox1 + 0.69667in + 1.88417in + 0.25in + 2.55208in + + + 2pt + 2pt + 2pt + 2pt + + + + 2in + - =Sum(Fields!Cantidad.Value, "DsInventarios") + =Sum(iif(Not Fields!Clasificacion.Value = "USADOS",CInt(Fields!Cantidad.Value),0),"DsInventarios") - =Sum(iif(Fields!Clasificacion.Value = "USADOS",Fields!Cantidad.Value,0),"DsInventarios") + =Sum(iif(Fields!Clasificacion.Value = "USADOS",CInt(Fields!Cantidad.Value),0),"DsInventarios") - - true - true - - - - - =Parameters!SubProyecto.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - true true @@ -849,7 +816,7 @@ - Origen 2: + Origen: @@ -911,7 +878,7 @@ 0.00711cm 0.6cm 14.27979cm - 8 + 7 @@ -930,7 +897,7 @@ 0.1121cm 2.53711cm 4.08574cm - 9 + 8 diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index c16252ec5..00b8b801b 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1546,7 +1546,7 @@ - FACTURA + =UCase(Parameters!TipoDocumento.Value) + + + =UCase(Parameters!TipoDocumento.Value) + + + + ,Moneda: + + + + + + +
  • + Agregar Tarea +
  • +
    + + + + + + + + + + + + diff --git a/OI/RepTareas2.aspx.cs b/OI/RepTareas2.aspx.cs new file mode 100644 index 000000000..6662bf5e9 --- /dev/null +++ b/OI/RepTareas2.aspx.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class OI_RepTareas2 : System.Web.UI.Page +{ + public const string iddivAgregar = "divModalAgregarEvento"; + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void LnkAddEvento_Click(object sender, EventArgs e) + { + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregar)); + } +} \ No newline at end of file diff --git a/OI/TareaDetalle.aspx b/OI/TareaDetalle.aspx new file mode 100644 index 000000000..ff7fe8719 --- /dev/null +++ b/OI/TareaDetalle.aspx @@ -0,0 +1,722 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TareaDetalle.aspx.cs" Inherits="OI_TareaDetalle" %> + + + + + + + + + + + + + + + + + + + + + + + + +
  • + Agregar CheckList
  • +
  • + Cambiar Estatus
  • +
  • + Agregar Comentario
  • +
  • + Agregar Tema
  • +
  • + Agregar Archivo
  • + +
    +
    +
    + + + + + +
    +
    + + +
    +
    + + Tarea +
    +
    + +
    +
    +
    +
    + + + +
    +
    + + + +
    + +
    +
    +

    Para

    +
    +
    + +
    +
    + + +
    +
    +

    C. C. Para

    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + <%----%> + +
    +
    +
    +
    + + + + <%----%> + +
    +
    +
    +
    +
    +
    + + + + + + + + Prioridad: + +
    +
    +
    +
    + + + + Tema: +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + Estatus +
    +
    + +
    +
    +
    + + + + +
    + + + Estatus: +
    +
    + Avance: + +
    + +
    +
    +
    +
    + + + +
    +
    + + Archivo +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + + + +
    +
    + + CheckList +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + Agregar + <%--Agregar--%> +
    +
    + + + + + + + + + + + <%--
    --%>
    +                                                
    +                                                     
    +                                                
    +                                                <%--
    --%> +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + Miembros +
    +
    + +
    +
    +
    + <%--
    +
    +
    + + + Usuario: +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + +
    Para
    jorge caudillo
    Con copia para
    Julian Moreno
    --%> + + + + + + Para + + + <%----%> + + + + + + C. C. Para + + + + + + Usuario + + + + + + Rol + + + + + + +
    +
    +
    +
    +
    + Guardar +
    +
    + +
    +
    + + Registro de actividades +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + +
    + + + + + + + + + diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs new file mode 100644 index 000000000..477602ab3 --- /dev/null +++ b/OI/TareaDetalle.aspx.cs @@ -0,0 +1,691 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class OI_TareaDetalle : ClsPaginas +{ + #region Propiedades + public const string iddivAgregar = "divModalAgregarActividad"; + public const string iddivAgregarArchivo = "divModalAgregarArchivo"; + public const string iddivAgregarTema = "divModalAgregartema"; + public const string iddivCambiarEstatus = "divModalCambiarEstatus"; + public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } } + public int Folio { get { return ViewState["Folio"] != null ? ViewState["Folio"].ToString().ToEntero() : 0; } set { ViewState["Folio"] = value; } } + public decimal Avance { get { return ViewState["Avance"] != null ? ViewState["Avance"].ToString().ToEntero() : 0; } set { ViewState["Avance"] = value; } } + public int CveUsuarioPara { get { return ViewState["CveUsuarioPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioPara"] = value; } } + public int CveUsuarioCCPara { get { return ViewState["CveUsuarioCCPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioCCPara"] = value; } } + public bool EsNuevo { get { return Convert.ToBoolean(ViewState["EsNuevo"]); } set { ViewState["EsNuevo"] = value; } } + + public System.Data.DataTable CheckListNew { get { return ViewState["CheckListNew"] != null ? (System.Data.DataTable)ViewState["CheckListNew"] : null; } set { ViewState["CheckListNew"] = value; } } + public int chklistitemindex { get { return ViewState["chklistitemindex"] != null ? ViewState["chklistitemindex"].ToString().ToEntero() : 0; } set { ViewState["chklistitemindex"] = value; } } + + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + EsNuevo = true; + CveUsuarioPara = 0; + CveUsuarioCCPara = 0; + if (Request["Archivo"] != null) + { + string strArchivo = string.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ModExtensiones.Decripta(Request["Archivo"].ToString())); + if (System.IO.File.Exists(strArchivo)) + { + try + { + string filename = ModExtensiones.Decripta(Request["filename"].ToString()); + + System.IO.FileInfo file = new System.IO.FileInfo(strArchivo); + string mimeType = "text/plain"; + try { mimeType = MimeMapping.GetMimeMapping(strArchivo); } + catch (Exception) { } + // Response.Write(path) + Response.Clear(); + Response.ClearHeaders(); + Response.ClearContent(); + Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(filename)}"); + Response.AddHeader("Content-Length", file.Length.ToString()); + Response.ContentType = mimeType; + Response.Flush(); + Response.TransmitFile(file.FullName); + Response.End(); + } + catch (Exception) + { + this.RegistraScript("window.close();"); + } + } + else + { + this.RegistraScript("window.close();"); + } + } + else + { + + CargaTemas(); + CargaEstatus(); + cargaUsuarios(); + if (Request["CveEvento"] != null) + { + RCveEvento = Request["CveEvento"].ToString().ToEntero(); + } + if (RCveEvento > 0) + { + EsNuevo = false; + LoadTarea(); + } + else + { + LtlTitulo.Text = "Tarea Nueva"; + TxtArchivo.Visible = true; + CveUsuarioCCPara = UsuarioActual.CveUsuario; + } + SetUsuarios(); + HypArchivo.Visible = !TxtArchivo.Visible; + } + } + } + private void CargaTemas() + { + DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DdlTema.DataBind(); + DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + private void CargaEstatus() + { + + DdlEventoEstatus.DataSource = GlobalDTOIEstatusEventos;//get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); + DDlEstatus.DataSource = DdlEventoEstatus.DataSource; + DdlEventoEstatus.DataBind(); + DDlEstatus.DataBind(); + DdlEventoEstatus.Enabled = false; + //DdlEventoEstatus.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + private void cargaUsuarios() + { + string FiltroAD = ""; + + GVUsuarios.DataSource = get_GlobalDTUsuarios().FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1 {1}", UsuarioActual.CveEmpresa, FiltroAD), "Rol ASC"); + GVUsuarios.DataBind(); + } + private void cargaActividades(ClsOIEventos ObjOI) + { + GvActividades.DataSource = null; + if (ObjOI.GetEventosComentarios(RCveEvento)) + { + GvActividades.DataSource = ObjOI.DtResultados; + } + GvActividades.DataBind(); + UpActividades.Update(); + } + private void SetUsuarios() + { + StringBuilder para = new StringBuilder(); + StringBuilder CCpara = new StringBuilder(); + foreach (GridViewRow gvRow in GVUsuarios.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + chkpara.Checked = false; + chkCCpara.Checked = false; + + if (EsNuevo) + { + chkpara.Enabled = true; + chkCCpara.Enabled = true; + //if (CveUsuario == CveUsuarioCCPara) + //{ + // chkCCpara.Enabled = false; + //} + } + else + { + + chkpara.Enabled = false; + chkCCpara.Enabled = false; + } + + if (CveUsuario == CveUsuarioPara) + { + chkpara.Checked = true; + para.AppendFormat("\"{0}\"",gvRow.DataKey("Nombre").ToString()); + } + if (CveUsuario == CveUsuarioCCPara) + { + chkCCpara.Checked = true; + CCpara.AppendFormat("\"{0}\"", gvRow.DataKey("Nombre").ToString()); + } + + } + LtlPara.Text = para.ToString(); + LtlCCPara.Text = CCpara.ToString(); + } + } + + public void LoadTarea() + { + GVcheklist.DataSource = new System.Data.DataTable(); + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetOI_Eventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0) + { + PnlUsuarios.Visible = true; + portletMiembros.Visible = false; + LnkUpFile.Visible = true; + System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0]; + + Folio = drow["Folio"].ToString().ToEntero(); + Avance = drow["Avance"].ToString().ToDecimal(); + + TxtAsunto.Text = drow["Asunto"].ToString(); + TxtDescripcion.Text = drow["Descripcion"].ToString(); + DdlPrioridad.SelectedValueExist(drow["Prioridad"].ToString()); + txtFechaI.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaInicio"]); + txtFechaF.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaFin"]); + DdlTema.SelectedValueExist(drow["CveRevision"].ToString()); + DdlEventoEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString()); + DDlEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString()); + HypArchivo.Text = string.Format("{0}
    ", drow["Archivo"].ToString()); + HypArchivo.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString())); + TxtArchivo.Visible = (drow["Archivo"].ToString().Length == 0); + portletArchivo.Visible = !TxtArchivo.Visible; + LnkUpFile.Text = (portletArchivo.Visible ? "Actualizar archivo" : "Agregar archivo"); + CveUsuarioCCPara = drow["CveUsuarioDe"].ToString().ToEntero(); + CveUsuarioPara = drow["CveUsuarioPara"].ToString().ToEntero(); + TxtAvance.Text = string.Format("{0:##0}", drow["Avance"]); + //OIE.[CveEvento], OIE.[CveTipoEvento], OIE.[Folio], OIE.[Asunto], OIE.[Descripcion], OIE.[Prioridad], OIE.[CveUsuarioDe], OIE.[CveUsuarioPara], + //OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng], + //OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance] + + LtlTitulo.Text = drow["Titulo"].ToString(); + if (ObjOI_E.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = ObjOI_E.DtResultados; + if (ObjOI_E.DtResultados.Rows.Count > 0) + { + portletChekList.Visible = true; + LnkAgregarCheckList.Visible = false; + } + } + cargaActividades(ObjOI_E); + } + } + GVcheklist.DataBind(); + } + + protected void LnkGuardar_Click(object sender, EventArgs e) + { + if (EsNuevo) + { + string errorMessage = ""; + int cveUsuarioDe = -1; + int cveUsuarioPara = -1; + + foreach (GridViewRow gvRow in GVUsuarios.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkpara = gvRow.FCCheckBox("ChkPara"); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + if (chkpara.Checked) + { + cveUsuarioPara = CveUsuario; + } + if (chkCCpara.Checked) + { + cveUsuarioDe = CveUsuario; + } + } + } + + OITipoEventos cveTipoEvento = OITipoEventos.Tarea; + string asunto = TxtAsunto.Text; + string descripcion = TxtDescripcion.Text; + int prioridad = DdlPrioridad.SelectedValue.ToEntero(); + + + string fechaInicio = ""; + if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "no se ingreso una fecha de inicio valida"; + + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); + } + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = ""; + if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) + { + errorMessage = "no se ingreso una fecha fin valida"; + + } + else + { + fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); + } + } + else + { + fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + int cveRevision = DdlTema.SelectedValue.ToEntero(); + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in TxtArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + + + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + int Folio = -1; + int CveEvento = -1; + + if (cveUsuarioDe <= 0) + { + errorMessage = "no se selecciono el miembro 'C C Para'"; + } + if (cveUsuarioPara <= 0) + { + errorMessage = "no se selecciono el miembro 'Para'"; + + } + if (errorMessage.Length == 0) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, cveUsuarioIng, cveEmpresa); + CveEvento = objOI.CveEvento; + Folio = objOI.Folio; + if (Continuar) + { + foreach (System.Data.DataRow item in CheckListNew.Rows) + { + if (Continuar) + { + Continuar = objOI.Addcheklist(CveEvento, item["EventoComentario"].ToString(), UsuarioActual.CveUsuario); + + } + + } + } + if (Continuar && CveEvento > 0) + { + objOI.Commit(); + + } + else + { + objOI.RollBack(); + Continuar = false; + } + } + if (Continuar && CveEvento > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + } + else + { + this.Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia); + + } + } + } + + protected void LnkEliminarchek_Click(object sender, EventArgs e) + { + GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer; + + if (EsNuevo) + { + CheckListNew = CheckListNew.FiltraParametros(string.Format("CveEventoCheckList <> {0}", gvrow.DataKey("CveEventoCheckList"))); + GVcheklist.DataSource = CheckListNew; + GVcheklist.DataBind(); + } + else + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Removecheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), UsuarioActual.CveUsuario)) + { + Alert("Se ha eliminado la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + } + protected void LnkAgregarCheckList_Click(object sender, EventArgs e) + { + portletChekList.Visible = true; + LnkAgregarCheckList.Visible = false; + if (RCveEvento > 0) + { + + } + else + { + GVcheklist.Columns[0].Visible = false; + CheckListNew = new System.Data.DataTable(); + //CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng + CheckListNew.Columns.Add("CveEventoCheckList", typeof(int)); + CheckListNew.Columns.Add("CveEvento", typeof(int)); + CheckListNew.Columns.Add("CveTipoEvento", typeof(int)); + CheckListNew.Columns.Add("EventoComentario", typeof(String)); + CheckListNew.Columns.Add("Estatus", typeof(bool)); + CheckListNew.Columns.Add("CveUsuario", typeof(int)); + CheckListNew.Columns.Add("Usuario", typeof(string)); + CheckListNew.Columns.Add("FechaIng", typeof(DateTime)); + + } + UpChkList.Update(); + } + protected void LnkAgregarchklistitem_Click(object sender, EventArgs e) + { + if (RCveEvento > 0) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Addcheklist(RCveEvento, TxtActividad.Text, UsuarioActual.CveUsuario)) + { + Alert("Se ha agregó la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + + } + else + { + System.Data.DataRow drow = CheckListNew.NewRow(); + drow["CveEventoCheckList"] = chklistitemindex++; + drow["EventoComentario"] = TxtActividad.Text; + drow["Estatus"] = false; + //CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng + CheckListNew.Rows.Add(drow); + GVcheklist.DataSource = CheckListNew; + GVcheklist.DataBind(); + } + TxtActividad.Text = ""; + } + protected void ChkEstatus_CheckedChanged(object sender, EventArgs e) + { + CheckBox chk = (CheckBox)sender; + GridViewRow gvrow = (GridViewRow)chk.NamingContainer; + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Upcheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), gvrow.DataKey("EventoComentario"), chk.Checked, UsuarioActual.CveUsuario)) + { + Alert("Se actualizo el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(RCveEvento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + cargaActividades(objOI); + } + } + } + } + protected void LnkEditarCheck_Click(object sender, EventArgs e) + { + + } + + protected void BtnCambiarEstatus_Click(object sender, EventArgs e) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + + + if (objOI.UpdateEstatusEvento2(DDlEstatus.SelectedValue.ToEntero(), -1, RCveEvento, UsuarioActual.CveUsuario)) + { + //CargaEstatusEventos(DdlEventoEstatus.SelectedValue.ToEntero); + + //if (DdlEventoEstatus.SelectedValue.ToEntero == 3 | DdlEventoEstatus.SelectedValue.ToEntero == 1) + // EnviarCorreoCambioEstatus(false); + //CargaDatos(); + string mensaje = string.Format("Se cambio el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text); + DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue); + UpEstatus.Update(); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus)); + Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion); + cargaActividades(objOI); + } + + } + + } + + protected void LnkcambiarEstatus_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivCambiarEstatus)); + + } + + + + protected void LnkSinfuncion_Click(object sender, EventArgs e) + { + + } + + protected void LnkAgregarTema_Click(object sender, EventArgs e) + { + + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarTema)); + + } + + protected void BtnAgregarTema_Click(object sender, EventArgs e) + { + + using (ClsOIEventos objoi = new ClsOIEventos()) + { + if (objoi.AddRevisionesEventos(TxtTema.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + Alert("Tema agregada con éxito.", ModExtensiones.TipoMensaje.MsgInformacion); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarTema)); + TxtTema.Text = ""; + set_GlobalDTOIRevision(-1, objoi.DtResultados); + CargaTemas(); + UpContenido.Update(); + } + else { Alert("Ocurrió un error al agregar la revisión. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError); } + + } + } + + protected void LnkAgregarActividad_Click(object sender, EventArgs e) + { + + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregar)); + } + + protected void BtnAgregarComentario_Click(object sender, EventArgs e) + { + string Comentario = TxtComentario.Text; + int CveComentario = 0; + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + using (ClsOIEventos objoi = new ClsOIEventos()) + { + CveComentario = objoi.AddEventoComentario(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario); + if (CveComentario > 0) { cargaActividades(objoi); } + } + Txtfilecomentario.Text = ""; + if (CveComentario > 0) + { + if (rutaarchivoOri.Length > 0) + { + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}{2}", ruta, CveComentario, archivoname);//, ArchivoExtencion); + System.IO.File.Move(rutaarchivoOri, ruta); + } + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregar)); + this.Alert("comentario agregado", ModExtensiones.TipoMensaje.ToastInformacion); + //this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento)); + } + + } + + protected void GvActividades_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + HyperLink HplA = e.Row.FCHyperLink("HplA"); + string archivoname = e.Row.DBCampo("Archivo"); + string CveComentario = e.Row.DBCampo("CveEventoComentario"); + HplA.Visible = archivoname != ""; + if (HplA.Visible) + { + HplA.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, archivoname)), ModExtensiones.Encripta(archivoname)); + } + + } + //Visible='<%# Eval("Archivo").ToString() != "" %>' data-archivo ='<%# string.Format("",Eval("CveEventoComentario").ToString()) %>' + //string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString())) + } + + protected void LnkUpFile_Click(object sender, EventArgs e) + { + this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarArchivo)); + + } + + protected void BtnActualizarArchivo_Click(object sender, EventArgs e) + { + string archivoname = ""; + string rutaarchivoOri = ""; + string ArchivoExtencion = ""; + foreach (Archivo item in txtActualizarArchivo.getfiles().Archivos) + { + archivoname = item.filenameO; + ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + } + string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + ruta = string.Format("{0}{1}\\", ruta, Folio); + if (!System.IO.Directory.Exists(ruta)) + { + System.IO.Directory.CreateDirectory(ruta); + } + string rutafin = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion); + int index = 0; + while (System.IO.File.Exists(rutafin)) + { + archivoname = string.Format("{0}{1}", index++, archivoname); + rutafin = string.Format("{0}{1}", ruta, archivoname); + } + System.IO.File.Move(rutaarchivoOri, rutafin); + bool continuar = false; + using (ClsOIEventos objoi = new ClsOIEventos()) + { + continuar = objoi.AddUPEventoArchivo(RCveEvento, archivoname, UsuarioActual.CveUsuario); + + } + if (continuar) + { + LoadTarea(); + this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarArchivo)); + this.Alert("Archivo Actualizado", ModExtensiones.TipoMensaje.ToastInformacion); + } + UpContenido.Update(); + } + + protected void BtnUpAvance_Click(object sender, EventArgs e) + { + + bool continuar = false; + using (ClsOIEventos objoi = new ClsOIEventos()) + { + continuar = objoi.UPEventoAAvance(RCveEvento, TxtAvance.Text.ToDecimal(), UsuarioActual.CveUsuario); + if (continuar){ + if (objoi.DtResultados.Rows.Count > 0) + { + LtlTitulo.Text = objoi.DtResultados.Rows[0]["Titulo"].ToString(); + } + cargaActividades(objoi); + } + } + if (continuar) + { + this.Alert("Avance Actualizado", ModExtensiones.TipoMensaje.ToastInformacion); + + } + UpTitulo.Update(); + } +} \ No newline at end of file diff --git a/Scripts/custom.js b/Scripts/custom.js index 2e9e49583..4212ccf60 100644 --- a/Scripts/custom.js +++ b/Scripts/custom.js @@ -1993,7 +1993,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }); } - textoOld = texto + textoOld = texto; }; let GETPSALMACEN = function () { @@ -2016,10 +2016,10 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }; lupa.bind("click", function () { buscaPS(Minput.val()); - }) + }); Minput.bind("copy paste cut", function () { buscaPS(Minput.val()); - }) + }); Minput.bind("keyup ", function (e) { if (e.keyCode == 13) { buscaPS(Minput.val()); @@ -2027,7 +2027,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { } else { buscaPSTimer(Minput.val()); } - }) + }); PSModal.on('click', '.list-group-item ', function (e) { let $this = $(this).hasClass('list-group-item') ? $(this) : $(this).closest('.list-group-item'); @@ -2054,7 +2054,7 @@ function AddFunctionPS(inputProducto, inputAlmace, datos) { }); PSModal.on('shown.bs.modal', function () { Minput.focus(); - }) + }); PSModal.on('click', '.item-almacen', function (e) { let $this = $(this).hasClass('item-almacen') ? $(this) : $(this).closest('.item-almacen'); let cveps = $(PSModal.find('.active')).data('cve'); diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 4d726dadd..5747d66dc 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -863,7 +863,7 @@ Partial Class Ventas_ClientesAbonar importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaValuacion ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaValuacion + importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal importeMX = ImporteMovimiento * tipoCambioVentaValuacion @@ -1467,6 +1467,7 @@ Partial Class Ventas_ClientesAbonar If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.FCHyperLink("HplF2").Text.ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=importeMX, CveCuenta:=CveCuenta, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then MsgError = "No se pudo insertar la póliza" + Exit For End If End If @@ -1568,7 +1569,7 @@ Partial Class Ventas_ClientesAbonar End If End If - If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then + If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then If ObjMov.ValorPolizaDescuadre > 0 Then MsgError = ObjMov.MensajePolizaDescuadre + " La diferencia es de: " + ObjMov.ValorDiferencia End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d9d67b00f..420ebafa3 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -11787,7 +11787,10 @@ Partial Class Ventas If CveCliente > 0 Then HdnIVACalculado.Value = "0" - HdnFolioFiscalNC.Value = "0" + 'SI ES REFACTURACION NO LIMPIAR EL FOLIO FISCAL + If NuevaFactura <> 1 Then + HdnFolioFiscalNC.Value = "0" + End If LblAntAplicados.Text = "" LblAntAplicados.Visible = False LblAmortizacion.Text = "0.00" @@ -15078,7 +15081,7 @@ Partial Class Ventas End If ObjVentas.Dispose() End Sub - Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, factura As Modelos.Factura, Optional CancelacionIngreso As Boolean = False) As RetornoPolizaConta + Private Function GenerarPolizaAC(ObjAC As ClsContPAQi, factura As Modelos.Factura, Optional CancelacionIngreso As Boolean = False) As Modelos.RetornoPolizaConta Dim Retorno As New Modelos.RetornoPolizaConta Dim IDPoliza As Integer = 0