diff --git a/AF/RepDepreciacion.aspx.vb b/AF/RepDepreciacion.aspx.vb index 03b7aaf75..c78d0f4e3 100644 --- a/AF/RepDepreciacion.aspx.vb +++ b/AF/RepDepreciacion.aspx.vb @@ -38,17 +38,16 @@ Partial Class AF_RepDepreciacion For Each RowsDt As GridViewRow In GvDatos.Rows CveActivoFijo = RowsDt.DataKey("CveActivoFijo").ToEntero - If RowsDt.FCLiteral("LtlDepreciacionMensual").Text.ToDouble > 0 And CveActivoFijo <> 0 Then - - Dim MontoDepreciacion As Double = RowsDt.FCLiteral("LtlDepreciacionMensual").Text.ToDouble + Dim MontoDepreciacion As Decimal = RowsDt.FCLiteral("LtlDepreciacionMensual").Text.ToDecimal + If MontoDepreciacion > 0 And CveActivoFijo <> 0 Then Dim ConceptoPolizaDetalle As String = String.Format("Depreciacion - {0} - {1}", txtFechaI.Text, RowsDt.FCLiteral("LtlDescripcion").Text) If CvePrePoliza > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, MontoDepreciacion.ToDecimal, ConceptoPolizaDetalle, 101, ConceptoPolizaDetalle, txtFechaI.Text.ToDate, 0, -1, CveActivoFijo:=CveActivoFijo, ImporteMX:=MontoDepreciacion.ToDecimal, ImporteME:=MontoDepreciacion.ToDecimal, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -MontoDepreciacion, -MontoDepreciacion, 270, ConceptoPolizaDetalle, ConceptoPolizaDetalle, 0, CveActivoFijo:=CveActivoFijo, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True Exit For End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, MontoDepreciacion.ToDecimal, ConceptoPolizaDetalle, 51, ConceptoPolizaDetalle, txtFechaI.Text.ToDate, 0, -1, CveActivoFijo:=CveActivoFijo, ImporteMX:=MontoDepreciacion.ToDecimal, ImporteME:=MontoDepreciacion.ToDecimal, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, MontoDepreciacion, MontoDepreciacion, 101, ConceptoPolizaDetalle, ConceptoPolizaDetalle, 0, CveActivoFijo:=CveActivoFijo, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True Exit For End If diff --git a/Acumuladores/CatGarantiasMeses.aspx.vb b/Acumuladores/CatGarantiasMeses.aspx.vb index 3e71a5f47..0f204a538 100644 --- a/Acumuladores/CatGarantiasMeses.aspx.vb +++ b/Acumuladores/CatGarantiasMeses.aspx.vb @@ -72,15 +72,20 @@ Partial Class Acumuladores_CatFoliosGarantia Private Sub CargaCombos() - Dim ObjPS As New ClsProductosServicios + 'Dim ObjPS As New ClsProductosServicios - If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then - DdlMarca.DataSource = ObjPS.DtResultados - DdlMarca.DataBind() - DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) - DdlMarca.SelectedValue = "-1" - End If - ObjPS.Dispose() + 'If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + ' DdlMarca.DataSource = ObjPS.DtResultados + ' DdlMarca.DataBind() + ' DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + ' DdlMarca.SelectedValue = "-1" + 'End If + 'ObjPS.Dispose() + + DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) + DdlMarca.DataBind() + DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + DdlMarca.SelectedValue = "-1" DdlTipoUso.DataSource = GlobalDTAcumTiposUso() DdlTipoUso.DataBind() @@ -109,13 +114,14 @@ Partial Class Acumuladores_CatFoliosGarantia Private Sub CargaCombosModal() - Dim ObjPS As New ClsProductosServicios + 'Dim ObjPS As New ClsProductosServicios - If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then - DdlMarcaM.DataSource = ObjPS.DtResultados + 'If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + ' DdlMarcaM.DataSource = ObjPS.DtResultados - End If - ObjPS.Dispose() + 'End If + 'ObjPS.Dispose() + DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) DdlMarcaM.DataBind() DdlTipoUsoM.DataSource = GlobalDTAcumTiposUso() diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index 1b845f870..3545d849f 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -667,7 +667,7 @@ Public Class ClsCRM Optional CveVendedor As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional NombreAcercamiento As String = "-1", Optional CveMedioCaptacion As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional CveProbabilidad As Integer = -1, Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000, Optional CvePS As Integer = -1, - Optional CveGiroClasificacion As Integer = -1) As Boolean + Optional CveGiroClasificacion As Integer = -1, Optional EnPausa As Integer = -1, Optional CveEtapaProceso As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoGet") With SqlAdapter.SelectCommand.Parameters @@ -694,6 +694,12 @@ Public Class ClsCRM .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveEtapaProceso", SqlDbType.Int).Value = CveEtapaProceso + '.Add("@CveMedioCaptacion", SqlDbType.Int).Value = CveMedioCaptacion + '.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso + End With Try SqlAdapter.Fill(Data) @@ -1030,7 +1036,8 @@ Public Class ClsCRM #Region "REPORTES" - Public Function RepAcercamientosEtapas(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1) As Boolean + Public Function RepAcercamientosEtapas(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, + cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1, Optional EnPausa As Integer = -1, Optional CveEtapaProceso As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosEtapas", CommandType.StoredProcedure) @@ -1046,6 +1053,13 @@ Public Class ClsCRM .Add("@CveProbabilidadAcercamiento", SqlDbType.Int).Value = cveProbabilidadAcercamiento .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveEtapaProcesoFiltro", SqlDbType.Int).Value = CveEtapaProceso '@CveEtapaProcesoFiltro + '.Add("@CveMedioCaptacion", SqlDbType.Int).Value = cveMedioCaptacion + '.Add("@CveTipoProceso", SqlDbType.Int).Value = cveTipoProceso + + End With Try SqlAdapter.Fill(DSet) @@ -1056,7 +1070,8 @@ Public Class ClsCRM Return retorno End Function - Public Function RepAcercamientosRechazos(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1) As Boolean + Public Function RepAcercamientosRechazos(cveEmpresa As Int32, cveTipoProceso As Int32, idgrupo1 As Int32, idgrupo2 As Int32, fechaIni As String, fechaFin As String, cveVendedor As Int32, cveMedioCaptacion As Int32, + cveProbabilidadAcercamiento As Int32, Optional CvePS As Integer = -1, Optional CveGiroClasificacion As Integer = -1, Optional EnPausa As Integer = -1, Optional CveEtapaProceso As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosRechazos", CommandType.StoredProcedure) @@ -1072,6 +1087,10 @@ Public Class ClsCRM .Add("@CveProbabilidadAcercamiento", SqlDbType.Int).Value = cveProbabilidadAcercamiento .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion + + .Add("@EnPausa", SqlDbType.Int).Value = EnPausa + .Add("@CveEtapaProcesoFiltro", SqlDbType.Int).Value = CveEtapaProceso + End With Try SqlAdapter.Fill(DSet) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index d80321677..51d7d76b3 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3378,10 +3378,10 @@ Public Class ClsContabilidad With SqlAdapter.SelectCommand.Parameters .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@Codigo", SqlDbType.VarChar).Value = Codigo - .Add("@Afectable", SqlDbType.VarChar).Value = Afectable - .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa + .Add("@Afectable", SqlDbType.Int).Value = Afectable + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Nombre", SqlDbType.VarChar).Value = Nombre - .Add("@RowNum", SqlDbType.VarChar).Value = RowNum + .Add("@RowNum", SqlDbType.Int).Value = RowNum .Add("@CvePadre", SqlDbType.Int).Value = CvePadre End With diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 6d9a760da..4b96a1d4c 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -1189,12 +1189,13 @@ Public Class ClsOIEventos #Region "CRUD_cheklist" - Public Function Getcheklist(cveEvento As Int32) As Boolean + Public Function Getcheklist(cveEvento As Int32, Optional CveAcercamiento As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_OI_cheklistGet", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@cveEvento", SqlDbType.Int).Value = cveEvento + .Add("@CveAcercamiento", SqlDbType.Int).Value = CveAcercamiento End With Try SqlAdapter.Fill(Data) @@ -1204,13 +1205,14 @@ Public Class ClsOIEventos End Try Return retorno End Function - Public Function Addcheklist(cveEvento As Int32, eventoComentario As String, cveUsuario As Int32) As Boolean + Public Function Addcheklist(cveEvento As Int32, eventoComentario As String, cveUsuario As Int32, Optional CveAcercamiento As Integer = -1) 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 + .Add("@CveAcercamiento", SqlDbType.Int).Value = CveAcercamiento End With Try SqlAdapter.Fill(Data) @@ -1220,7 +1222,7 @@ Public Class ClsOIEventos End Try Return retorno End Function - Public Function Upcheklist(cveEventoCheckList As Int32, cveEvento As Int32, eventoComentario As String, estatus As Boolean, cveUsuario As Int32, CveEmpresa As Int32) As Boolean + Public Function Upcheklist(cveEventoCheckList As Int32, cveEvento As Int32, eventoComentario As String, estatus As Boolean, cveUsuario As Int32, CveEmpresa As Int32, Optional CveAcercamiento As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_OI_cheklistUp", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -1230,6 +1232,7 @@ Public Class ClsOIEventos .Add("@estatus", SqlDbType.Bit).Value = estatus .Add("@cveUsuario", SqlDbType.Int).Value = cveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAcercamiento", SqlDbType.Int).Value = CveAcercamiento End With Dim separador As String = "" @@ -1272,13 +1275,14 @@ Public Class ClsOIEventos End If Return retorno End Function - Public Function Removecheklist(cveEventoCheckList As Int32, cveEvento As Int32, cveUsuario As Int32) As Boolean + Public Function Removecheklist(cveEventoCheckList As Int32, cveEvento As Int32, cveUsuario As Int32, Optional CveAcercamiento As Integer = -1) 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 + .Add("@CveAcercamiento", SqlDbType.Int).Value = CveAcercamiento End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d72be053a..4441ae54c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4712,7 +4712,6 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/RepCxP.aspx".ToUpper(), 168) PaginaDict.Add("/Compras/RepCxPDetalle.aspx".ToUpper(), 168) PaginaDict.Add("/Compras/CatProveedoresClasificaciones.aspx".ToUpper(), 186) - PaginaDict.Add("/Compras/CatAcreedores.aspx".ToUpper(), 303) PaginaDict.Add("/Compras/Acreedores.aspx".ToUpper(), 303) PaginaDict.Add("/Compras/RepComprasG.aspx".ToUpper(), 286) PaginaDict.Add("/Compras/Compras2.aspx".ToUpper(), -1) @@ -5778,11 +5777,11 @@ Public Class ClsPaginas If sw IsNot Nothing AndAlso Not (Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing) Then sw.Stop() - 'If Not Page.IsPostBack Then - ' Using ObjUsuario As New ClsSisUsuarios - ' ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.PathAndQuery.ToString(), sw.ElapsedMilliseconds) - ' End Using - 'End If + If Not Page.IsPostBack Then + Using ObjUsuario As New ClsSisUsuarios + ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.PathAndQuery.ToString(), sw.ElapsedMilliseconds) + End Using + End If End If If Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString.Length > 0 Then @@ -9633,6 +9632,8 @@ Public Class ClsPaginas Dim ImporteMN As Decimal = 0 Dim ImporteME As Decimal = 0 Dim TCValuacion As Decimal = CompraActual.TC + Dim TCValuacionPago As Decimal = Pago.TCPago + Dim tFechaUltimaFluctuacion As Date Dim tImportePago, tImporteCompra As Decimal Dim CveConceptoContableComplementaria As Integer = 206 @@ -9650,16 +9651,15 @@ Public Class ClsPaginas Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim tFecha As Date = Pago.Fecha + Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) - If CompraActual.CveMoneda <> 1 OrElse Pago.CveMonedaPago <> 1 Then - Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) - - If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then - If UltimaFluctuacion.FechaFluctuacion <= tFecha AndAlso CompraActual.Fecha <= UltimaFluctuacion.FechaFluctuacion Then - 'FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion - TCValuacion = UltimaFluctuacion.TCFluctuacion - End If + If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then + If UltimaFluctuacion.FechaFluctuacion <= tFecha Then + tFechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion + TCValuacion = UltimaFluctuacion.TCFluctuacion End If + If CompraActual.Fecha < tFechaUltimaFluctuacion Then TCValuacion = TCValuacion + If Pago.Fecha < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion End If If CompraActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares @@ -9793,6 +9793,82 @@ Public Class ClsPaginas End If + 'concepto pago + Concepto = String.Format("{0} NC:{1}", CompraActual.ProveedorNombre, Pago.Referencia) + + If Pago.TipoPago = "Egsc" AndAlso Not ErrorMovtos Then ' A N T I C I P O / E G R E S O S X C O M P R O B A R + Dim Ret As New ConceptosRetenciones + If Pago.CveMonedaPago > 1 Then + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 21, Pago.Referencia, Concepto, CompraActual.IdCtaContableAnticipoProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + + ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 266, Pago.Referencia, Concepto, CompraActual.IdCtaContableAnticipoProvComplementaria, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + Else + 'Agregamos Nacional + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 21, Pago.Referencia, Concepto, CompraActual.IdCtaContableAnticipoProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago) Then ErrorMovtos = True + + End If + + End If + + If Pago.TipoPago.Contiene("NC", "DEV") AndAlso Not ErrorMovtos Then ' N O T A D E C R E D I T O + Dim Ret As New ConceptosRetenciones + If Pago.CveMonedaPago > 1 Then + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 60, Pago.Referencia, Concepto, CompraActual.IdCtaContableProv, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + + ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 235, Pago.Referencia, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=Pago.CveCompraAmortizacion, CveVentaAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True + Else + 'Agregamos Nacional + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 60, Pago.Referencia, Concepto, CompraActual.IdCtaContableProv, CveCompra:=Pago.CveCompraAmortizacion, CveVentaAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + + End If + + End If + + If Pago.TipoPago = "DD" AndAlso Not ErrorMovtos Then ' D E U D O R D I V E R S O + Dim Ret As New ConceptosRetenciones + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + If Pago.CveMonedaPago > 1 AndAlso ObjConta.GetRetCuenta(207, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + End If + + If Pago.CveMonedaPago > 1 Then + 'Agregamos la Extranjera + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, CompraActual.IdCtaContableProv, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + + ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=Pago.CveCompraAmortizacion, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + Else + 'Agregamos Nacional + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, CompraActual.IdCtaContableProv, CveVenta:=Pago.CveCompraAmortizacion, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CveSubProyecto:=CompraActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + + End If + End If + + 'If Pago.TipoPago = "Egsc" AndAlso Not ErrorMovtos Then ' I N G R E S O S X C O M P R O B A R + ' Dim Ret As New ConceptosRetenciones + ' If UsuarioActual.Empresa.TipoContabilidad = 2 Then + ' If ObjConta.GetRetCuenta(66, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero + ' If Pago.CveMonedaPago > 1 AndAlso ObjConta.GetRetCuenta(207, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero + + ' End If + + ' If Pago.CveMonedaPago > 1 Then + ' 'Agregamos la Extranjera + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipo, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + + ' ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 207, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + ' Else + ' 'Agregamos Nacional + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, VentaActual.IdCtaContableClienteAnticipoExtranjera, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True + + ' End If + 'End If + If Not ErrorMovtos AndAlso TCValuacion <> Pago.TCPago Then Dim ConceptoContable, IdCtaContable As Integer Dim TipoMovimiento As Boolean @@ -9844,6 +9920,7 @@ Public Class ClsPaginas Public Property OtroGastoIngreso As Decimal = 0 Public Property CveConceptoPago As Integer = -1 'no definido de inicio Public Property CveCreditoDetalle As Integer = -1 + Public Property Referencia As String = "" Public Property AplicaAcreditable As Boolean = True End Class @@ -9870,9 +9947,10 @@ Public Class ClsPaginas Public Property CveConceptoRetISR As Integer Public Property CveSubProyecto As Integer Public Property UsuarioActual As Usuario - Public Property IdCtaContableProv As Integer Public Property IdCtaContableProvComplementaria As Integer + Public Property IdCtaContableAnticipoProv As Integer + Public Property IdCtaContableAnticipoProvComplementaria As Integer Public ReadOnly Property ConceptoPrePolizaIVA As ConceptosRetenciones Get Dim Ret As New ConceptosRetenciones diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 38687b3e8..0f178b373 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -1004,11 +1004,11 @@ Namespace Extensiones '**********Une la parte entera y la parte decimal************* If dec <> "" Then - palabras.AppendFormat("{0} {1} /100 {2}", Moneda, dec, AbrevMoneda) + palabras.AppendFormat("{0} {1}/100 {2}", Moneda, dec, AbrevMoneda) Retorno = palabras.ToString Else - palabras.AppendFormat("{0} {1} /100 {2}", Moneda, dec, AbrevMoneda) + palabras.AppendFormat("{0} {1}/100 {2}", Moneda, dec, AbrevMoneda) Retorno = palabras.ToString End If diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index a75ea1a03..4c8df82ed 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -5462,7 +5462,7 @@ Partial Class Bancos_IE Else - Alert("El documento no ha sido eliminado.", TipoMensaje.MsgAdvertencia) + Alert($"El documento no ha sido eliminado. {If(UsuarioActual.CveRol = 1, MsgEliminar, "")}", TipoMensaje.MsgAdvertencia) If ObjAC IsNot Nothing Then ObjAC.RollBack() diff --git a/Bin/ADSNetLibrary.7z b/Bin/ADSNetLibrary.7z new file mode 100644 index 000000000..91e95b751 Binary files /dev/null and b/Bin/ADSNetLibrary.7z differ diff --git a/Bin/ADSNetLibrary.dll b/Bin/ADSNetLibrary.dll index 8adb6bab4..8071a9a71 100644 Binary files a/Bin/ADSNetLibrary.dll and b/Bin/ADSNetLibrary.dll differ diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx index 8bc859a44..c1345f8ca 100644 --- a/CRM/Acercamiento.aspx +++ b/CRM/Acercamiento.aspx @@ -349,6 +349,7 @@ +
@@ -410,6 +411,21 @@
+ +
+ + + +
+ +
+ + + + +
+ +
@@ -482,6 +498,7 @@
+
@@ -494,19 +511,7 @@
-
-
- - - -
- -
- - - - -
+
<%--
@@ -521,8 +526,82 @@
+ +
+
+ + +
+
+ +
+ + + + +
+
+
+ + + +
+
+
+ <%----%> + Agregar + <%--Agregar--%> +
+
+ +
+
+ + + + + + + + + + + <%--
--%>
+                                                                        
+                                                                             
+                                                                        
+                                                                        <%--
--%> +
+
+ + + <%----%> + + + + + + + +
+
+ +
+ +
+ + + +
+ + +
+
+
+
<%--END DATOS DE EMPRESA CRM --%>
diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 941639121..97a6fe078 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -5,11 +5,14 @@ using ADSNetLibrary.SIGAPI.Models.Ventas.Request; using ADSNetLibrary.SIGAPI.Services; using ADSNetLibrary.SIGAPI.Services.CRM; using ADSNetLibrary.SIGAPI.Services.Encuestas; +using DocumentFormat.OpenXml.Drawing.Diagrams; using Extensiones; +using FormulaEvaluator; using MoreLinq; using System; using System.Collections.Generic; using System.Data; +using System.Data.SqlClient; using System.IO; using System.Linq; using System.Web; @@ -266,6 +269,10 @@ public partial class CRM_Acercamiento : ClsPaginas ViewState["TieneCotizacion"] = value; } } + + //public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = 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) @@ -300,6 +307,8 @@ public partial class CRM_Acercamiento : ClsPaginas DivMensajeDatosTecnicos.Visible = false; } } + + CargaCheckLis(); } CargarPS(); } @@ -334,11 +343,12 @@ public partial class CRM_Acercamiento : ClsPaginas TxtNombreAcercamiento.Text = objAcercamiento.Result[0].NombreAcercamiento; TxtDescripcion.Text = objAcercamiento.Result[0].Descripcion; TxtFechaApertura.Text = objAcercamiento.Result[0].FechaApertura.ToDateTime().ToShortDateString(); - TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString(); + TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") || objAcercamiento.Result[0].FechaCierre.ToString().ToDate() == ModExtensiones.MinFecha ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString(); TxtImporte.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Importe.ToEntero()); TxtComision.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Comision.ToEntero()); DdlProbabilidadAcercamiento.SelectedValueExist(objAcercamiento.Result[0].CveProbabilidadAcercamiento); DdlPrioridad.SelectedValueExist(objAcercamiento.Result[0].Prioridad); + ChkePausa.Checked = objAcercamiento.Result[0].EnPausa; CargaDdl(); //SECCION DATOS DE LA EMPRESA @@ -689,6 +699,7 @@ public partial class CRM_Acercamiento : ClsPaginas AcercaminetoModel.FechaCierre = FechaCierre != null ? (DateTime)FechaCierre : ModExtensiones.MinFecha; AcercaminetoModel.CvePS = DdlPS.SelectedValue.ToEntero(); AcercaminetoModel.CveRechazoMotivo = CveRechazoMotivo; + AcercaminetoModel.EnPausa = ChkePausa.Checked; if (cRMService.AcercamientoUpdate(AcercaminetoModel)) @@ -1812,4 +1823,135 @@ public partial class CRM_Acercamiento : ClsPaginas } #endregion + + + + #region "CHECK LIST" + + + private void CargaCheckLis() + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Getcheklist(-1, CveAcercamiento: CveAcercamiento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + } + } + + UpChkList.Update(); + } + + protected void LnkAgregarchklistitem_Click(object sender, EventArgs e) + { + if (TxtActividad.Text.Trim().Length > 0) + { + if (CveAcercamiento > 0) + { + using (ClsOIEventos objOI = new ClsOIEventos()) + { + if (objOI.Addcheklist(-1, TxtActividad.Text, UsuarioActual.CveUsuario, CveAcercamiento: CveAcercamiento)) + { + Alert("Se agregó la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(-1, CveAcercamiento: CveAcercamiento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + } + } + } + } + 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.Focus(); + 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, UsuarioActual.CveEmpresa, + CveAcercamiento: CveAcercamiento)) + { + //ObjEventosCorreo o = objOI.objCorreo; + Alert("Se actualizó el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(-1, CveAcercamiento: CveAcercamiento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + } + } + } + } + + + protected void LnkEliminarchek_Click(object sender, EventArgs e) + { + GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer; + + if(!(CveAcercamiento > 0)) + { + 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, CveAcercamiento: CveAcercamiento)) + { + Alert("Se ha eliminadó la actividad", ModExtensiones.TipoMensaje.ToastInformacion); + if (objOI.Getcheklist(-1, CveAcercamiento)) + { + GVcheklist.DataSource = objOI.DtResultados; + GVcheklist.DataBind(); + } + } + } + } + } + + protected void LnkSinfuncion_Click(object sender, EventArgs e) + { + // es para mandar llamar el ChkEstatus_CheckedChanged + } + + + + //private bool GuardaCheckList(SqlTransaction transaction, int CveAcercamientoNuevo) + //{ + // bool respuesta = true; + + // ClsOIEventos objOI = new ClsOIEventos(transaction); + + // foreach (GridViewRow GvRow in GVcheklist.Rows) + // { + // if (!objOI.Addcheklist(-1, TxtActividad.Text, UsuarioActual.CveUsuario, CveAcercamiento: CveAcercamiento)) + // { + // respuesta = false; + // break; + // } + // } + + // return respuesta; + //} + + #endregion + } \ No newline at end of file diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index a186c7ebe..c01d3a2ed 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -248,18 +248,25 @@
- - +   - + + +   + + + + + @@ -395,7 +402,7 @@
- @@ -404,7 +411,9 @@ - + + + @@ -563,9 +572,17 @@ --%>
+ +
+ + + + +
+ +
@@ -574,6 +591,73 @@ <%-- END MODAL AGREGAR CONTACTO --%> + <%-- MODAL TIPO CONTACTO --%> + + <%-- END MODAL TIPO CONTACTO --%> + + + <%-- MODAL AGREGAR ACERCAMIENTO --%> -
+
+
+
-
- - - - - +
+ + + + + +
+ + + + + +
- - - - +
+
+
+ + + + + +
+ <%----%> + + +
+
+ +
diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index b63b5860a..6747ded25 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -5,6 +5,7 @@ using ADSNetLibrary.SIGAPI.Models.Ventas.Request; using ADSNetLibrary.SIGAPI.Services; using ADSNetLibrary.SIGAPI.Services.CRM; using ADSNetLibrary.SIGAPI.Services.Encuestas; + using Extensiones; using MoreLinq; using System; @@ -938,6 +939,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas TempDTContactos.Columns.Add("FechaIng", typeof(string)); TempDTContactos.Columns.Add("CveContacto", typeof(string)); + TempDTContactos.Columns.Add("CveTipoContacto", typeof(string)); + TempDTContactos.Columns.Add("TipoContacto", typeof(string)); GVContactos.DataSource = TempDTContactos; GVContactos.DataBind(); @@ -996,6 +999,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtTelefonoOficina.Text = ""; TxtCelular.Text = ""; TxtCorreo.Text = ""; + DdlTipocontacto.SelectedValueExist(-1); } protected void BtnAgregarContacto_Click(object sender, EventArgs e) @@ -1004,6 +1008,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas limpiarCamposModalContato(); UPModalContacto.Update(); + CargaGridTipoContacto(); + this.RegistraScript("$('#DivModalContacto').modal();"); } @@ -1020,11 +1026,15 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtTelefonoOficina.Text = GvRow.DataKey("TelefonoOficina").ToString(); TxtCelular.Text = GvRow.DataKey("Celular").ToString(); TxtCorreo.Text = GvRow.DataKey("Correo").ToString(); + DdlTipocontacto.SelectedValueExist( GvRow.DataKey("CveTipoContacto").ToString()); IndexDTContacto = GvRow.RowIndex; + CargaGridTipoContacto(); + UPModalContacto.Update(); + this.RegistraScript("$('#DivModalContacto').modal();"); } @@ -1057,6 +1067,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas contacto.Correo = Correo; contacto.CveEmpresaCRM = CveEmpresaCRM; contacto.CveUsuarioIng = CveUsuarioIng; + contacto.CveTipoContacto = DdlTipocontacto.SelectedValue.ToEntero(); if (cRMService.EmpresasCRMContactoAdd(contacto)) { @@ -1088,6 +1099,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas contacto.Correo = Correo; contacto.CveContacto = CveContactoEditado; contacto.CveUsuarioIng = CveUsuarioIng; + contacto.CveTipoContacto = DdlTipocontacto.SelectedValue.ToEntero(); if (cRMService.EmpresasCRMContactoUpdate(contacto)) { @@ -1580,6 +1592,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas TxtAcercamiento.Text = ""; TxtDescripcionAcercamiento.Text = ""; TxtFechaApertura.Text = DateTime.Now.ToShortDateString(); + TxtFechaCierre.Text = ""; TxtImporte.Text = "0.00"; TxtComision.Text = "0.00"; @@ -1651,6 +1664,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas int CveRechazoMotivo = -1; DateTime FechaApertura = TxtFechaApertura.Text.ToDateTime(); + DateTime FechaCierre = TxtFechaCierre.Text.ToDateTime(); Double Importe = TxtImporte.Text.ToDouble(); Double Comision = TxtComision.Text.ToDouble(); @@ -1673,8 +1687,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveMedioCaptacion = CveMedioCaptacion, CveRechazoMotivo = CveRechazoMotivo, CveProbabilidadAcercamiento = CveProbabilidadAcercamiento, - FechaApertura = FechaApertura, - FechaCierre = (DateTime)System.Data.SqlTypes.SqlDateTime.Null, + FechaApertura = FechaApertura, + FechaCierre = FechaCierre > ModExtensiones.MinFecha ? FechaCierre : (DateTime)System.Data.SqlTypes.SqlDateTime.Null, NombreAcercamiento = NombreAcercamiento, Descripcion = Descripcion, Importe = Importe, @@ -1775,7 +1789,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas #region "COTIZACIONES" protected void CargaCotizaciones() { - ClsVentas ObjVentas = new ClsVentas(); + IVentaService ventaService = new VentaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); RequestVentas requestVentas = new RequestVentas(UsuarioActual.CveEmpresa, TipoDocto: "Cot", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario); var objVentas = ventaService.GetVentas(requestVentas); @@ -1788,7 +1802,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas //{ // GvCotizacion.DataSource = ObjVentas.DtResultados; //} - ObjVentas.Dispose(); + GvCotizacion.DataBind(); UpCotizacion.Update(); } @@ -1801,6 +1815,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas { e.Row.FCLabel("lblEstatus").Text = String.Format("{0}", e.Row.DataKey("EstatusFactura")); } + + if(e.Row.DataKey("Total").ToDecimal() != 0) + { + e.Row.Cells[5].Text = e.Row.DataKey("Total").ToDecimal().ToString("###,###,###.00"); + } } } #endregion @@ -1833,4 +1852,109 @@ public partial class CRM_EmpresaCRM : ClsPaginas DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlGiroClasificacion.SelectedValueExist(CveGiroClasificacion); } + + + #region "TIPO CONTACTO" + + + protected void LnkAgregartipoContacto_Click(object sender, EventArgs e) + { + + CargaGridTipoContacto(); + RegistraScript("$('#DivModalTipoContacto').modal('show');"); + } + + + private void LimpiaTipoContacto() + { + TxtTipoContacto.Text = ""; + UpModalTipoContacto.Update(); + } + + private void CargaGridTipoContacto() + { + DdlTipocontacto.Items.Clear(); + DdlTipocontacto.SelectedValue = null; + + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + RequestTipoContacto requestTipoContacto = new RequestTipoContacto(-1,"-1",-1,UsuarioActual.CveEmpresa); + + var ObjTIpocontacto = cRMService.TipoContactoGet(requestTipoContacto); + + if (ObjTIpocontacto.Result.Count > 0) + { + GvModalTipoContacto.DataSource = ObjTIpocontacto.Result; + DdlTipocontacto.DataSource = ObjTIpocontacto.Result; + } + + GvModalTipoContacto.DataBind(); + + DdlTipocontacto.DataBind(); + DdlTipocontacto.Items.Insert(0, new ListItem("Seleccione Uno", "-1")); + + UpModalTipoContacto.Update(); + UPModalContacto.Update(); + + cRMService = null; + } + protected void btnAgregarTipoContacto_Click(object sender, EventArgs e) + { + bool ErrorProceso = false; + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + TipoContactoModel TipoContacto = new TipoContactoModel(); + + TipoContacto.TipoContacto = TxtTipoContacto.Text; + TipoContacto.CveUsuario = UsuarioActual.CveUsuario; + TipoContacto.CveEmpresa = UsuarioActual.CveEmpresa; + + if (!cRMService.TipoContactoAdd(TipoContacto)) + { + Alert("Se presento un error al agregar el tipo de contacto", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + + if (!ErrorProceso) + { + CargaGridTipoContacto(); + LimpiaTipoContacto(); + } + } + + protected void LnkEliminarTipoContacto_Click(object sender, EventArgs e) + { + bool ErrorProceso = false; + + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + int CveTipoContactoEliminar = GvRow.DataKey("CveTipoContacto").ToEntero(); + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + + TipoContactoModel TipoContacto = new TipoContactoModel(); + TipoContacto.CveTipoContacto = CveTipoContactoEliminar; + TipoContacto.CveEmpresa = UsuarioActual.CveEmpresa; + + if (cRMService.TipoContactoRemove(TipoContacto)) + { + Alert("Tipo Contacto eliminado correctamente."); + }else{ + Alert("Se presento un error al eliminar el tipo de contacto.", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + + if (!ErrorProceso) + { + CargaGridTipoContacto(); + } + + } + + #endregion + + + + + } \ No newline at end of file diff --git a/CRM/RepAcercamientos.aspx b/CRM/RepAcercamientos.aspx index f3f14be4a..0fab43eb1 100644 --- a/CRM/RepAcercamientos.aspx +++ b/CRM/RepAcercamientos.aspx @@ -30,7 +30,7 @@ -
+
@@ -39,14 +39,14 @@
- -
+ +
- -
-
+ +
+
@@ -56,9 +56,9 @@
- -
-
+ +
+
@@ -68,8 +68,8 @@
- -
+ +
@@ -80,10 +80,40 @@
diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs index 07844b84b..d94cf2787 100644 --- a/CRM/RepAcercamientos.aspx.cs +++ b/CRM/RepAcercamientos.aspx.cs @@ -8,6 +8,10 @@ using Extensiones; using System.Data; using Microsoft.Reporting.WebForms; +using ADSNetLibrary.SIGAPI.Services.CRM; +using ADSNetLibrary.SIGAPI.Models.CRM.Request; +//using ADSNetLibrary.SIGAPI.Helpers; + public partial class CRM_RepAcercamientos : ClsPaginas { #region "PROPIEDADES" @@ -58,8 +62,12 @@ public partial class CRM_RepAcercamientos : ClsPaginas string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; int CvePS = DdlPS.SelectedValue.ToEntero() == 0 ? -1 : DdlPS.SelectedValue.ToEntero(); + ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) + + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, + CveGiroClasificacion: DdlGiroClasificacion.SelectedValue.ToEntero(), CveMedioCaptacion: DdlMedioCaptacion.SelectedValue.ToEntero(), CveTipoProceso: DdlTipoProceso.SelectedValue.ToEntero(), + EnPausa: DdlEnPausa.SelectedValue.ToEntero(), CveEtapaProceso: DdlEtapaProceso.SelectedValue.ToEntero())) { GVDatos.DataSource = ObjCRM.DtResultados; DtDatos = ObjCRM.DtResultados; @@ -100,6 +108,23 @@ public partial class CRM_RepAcercamientos : ClsPaginas DdlGiroClasificacion.DataSource = dtGiroClasificaciones; DdlGiroClasificacion.DataBind(); DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); + + ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, -1); + RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa); + RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa, 1, -1); + + DdlEtapaProceso .DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetEtapaProcesoCRM(EtapaProceso).Result); + DdlMedioCaptacion.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable( cRMService.GetMedioCaptacionCRM(MedioCaptacion).Result); + DdlTipoProceso.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetTipoProcesoCRM(tipoProceso).Result); + + DdlEtapaProceso.DataBind(); + DdlMedioCaptacion.DataBind(); + DdlTipoProceso.DataBind(); + + DdlEtapaProceso.Items.Insert(0,new ListItem("Todas", "-1")); + DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1")); + DdlTipoProceso.Items.Insert(0, new ListItem("Todos", "-1")); } #endregion diff --git a/CRM/RepAcercamientosProcesos.aspx b/CRM/RepAcercamientosProcesos.aspx index 7e1ca826a..92527d994 100644 --- a/CRM/RepAcercamientosProcesos.aspx +++ b/CRM/RepAcercamientosProcesos.aspx @@ -58,7 +58,7 @@ -
+
@@ -66,23 +66,23 @@
- -
+ +
- -
+ +
- -
+ +
- -
+ +
@@ -90,8 +90,9 @@