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/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index eb4b801f9..56829dfa0 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -690,7 +690,7 @@ Public Class ClsMovimientos Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, Optional Comprobaciones As Integer = -1, - Optional TipoDocto As String = "-1", Optional TipoAgrupacion As Integer = -1) As Boolean + Optional TipoDocto As String = "-1", Optional TipoAgrupacion As Integer = -1, Optional CveProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False If FechaCorte = Nothing Then FechaCorte = Now @@ -719,7 +719,8 @@ Public Class ClsMovimientos .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor .Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@TipoAgrupacion", SqlDbType.Int).Value = TipoAgrupacion + .Add("@TipoAgrupacion", SqlDbType.Int).Value = TipoAgrupacion + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto End With @@ -1295,7 +1296,7 @@ Public Class ClsMovimientos CveEstatusFactura As Integer, Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, - Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1, Optional TipoDocto As String = "-1") As Boolean + Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1, Optional TipoDocto As String = "-1", Optional CveProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False If FechaCorte = Nothing Then FechaCorte = Now @@ -1330,6 +1331,7 @@ Public Class ClsMovimientos .Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones .Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto End With Try 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 b90afc4fa..4441ae54c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6032,16 +6032,22 @@ Public Class ClsPaginas Dim ds As New DataSet For Each rpds As ReportDataSource In DataSource - If rpds.Value.GetType().ToString() = "System.Data.DataTable" Then - Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) - dt = dt.Copy() - dt.TableName = rpds.Name - ds.Tables.Add(dt) + If rpds.Value IsNot Nothing Then + If rpds.Value.GetType().ToString() = "System.Data.DataTable" Then + Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) + dt = dt.Copy() + dt.TableName = rpds.Name + ds.Tables.Add(dt) + Else + Dim ojext As New WSRDLC2.ReportObjects + ojext.Name = rpds.Name + ojext.Value = rpds.Value + reportobjects.Add(ojext) + End If Else - Dim ojext As New WSRDLC2.ReportObjects - ojext.Name = rpds.Name - ojext.Value = rpds.Value - reportobjects.Add(ojext) + Dim dt = New DataTable() + dt.TableName = If(String.IsNullOrEmpty(rpds.Name), "DataTable1", rpds.Name) + ds.Tables.Add(dt) End If Next @@ -7145,7 +7151,10 @@ Public Class ClsPaginas nRowCECabecera("Version") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("Version").InnerText - nRowCECabecera("MotivoTraslado") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText + If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado") IsNot Nothing Then + nRowCECabecera("MotivoTraslado") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText + End If + nRowCECabecera("TipoOperacion") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoOperacion").InnerText nRowCECabecera("ClaveDePedimento") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("ClaveDePedimento").InnerText nRowCECabecera("CertificadoOrigen") = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("CertificadoOrigen").InnerText @@ -7180,8 +7189,10 @@ Public Class ClsPaginas End Try + If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado") IsNot Nothing Then + CEMotivoTraslado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText + End If - CEMotivoTraslado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText CETipoCambio = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoCambioUSD").InnerText @@ -7377,7 +7388,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("CEIncoterm", RCEIncoterm)) params.Add(New ReportParameter("CEId", CEId)) params.Add(New ReportParameter("CEMotivoTraslado", RCEMotivoTraslado)) - params.Add(New ReportParameter("CETipoCamvio", CETipoCambio)) + params.Add(New ReportParameter("CETipoCambio", CETipoCambio)) End If diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 8f2cafafa..6fee37f4c 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -19,7 +19,7 @@ Public Class LogicNominas sw.Start() End If - Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False) 'CvePersonal, CvePeriodo, + Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False, CvePAC) 'CvePersonal, CvePeriodo, If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then If Not cfdi.Timbrado Then Dim ObjTimbrado As New Timbrado @@ -81,7 +81,7 @@ Public Class LogicNominas Return Retorno End Function Dim hasfiniquito As Boolean - Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean) As CFDITimbre + Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean, Optional CvePAC As Integer = 4) As CFDITimbre Dim continuar As Boolean = True hasfiniquito = False Dim CvePersonal As Integer = -1 @@ -439,7 +439,7 @@ Public Class LogicNominas cfdi.Comprobante.TipoComprobante = "N" cfdi.Comprobante.TipoDocto = "Egs" cfdi.Comprobante.MetodoPago = "PUE" - cfdi.Comprobante.CondicionesdePago = "" '"CONTADO" + cfdi.Comprobante.CondicionesdePago = If(CvePAC < 4, "CONTADO", "") '"" '"" cfdi.Comprobante.FormadePago = If(UsuarioActual.Empresa.Funcionalidad(350).Contiene("1"), "", "99") cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString() ' AHORITA SOLO SE REQUIERE ESPECIFICAR EL CODIGO POSTAL cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index ab81ea721..0f178b373 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -59,14 +59,14 @@ Namespace Extensiones #End Region - Public Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable + Public Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean, Optional curRow As Integer = 0) As DataTable GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim excelFile As GemBox.Spreadsheet.ExcelFile = GemBox.Spreadsheet.ExcelFile.Load(flatFilePath) Dim unnamed As Integer = 0 Dim cols As Integer Dim columns As String() - Dim curRow As Integer = 0 + 'Dim curRow As Integer = 0 Dim curCol As Integer = 0 Dim dataTable As DataTable = New DataTable() Dim worksheet As GemBox.Spreadsheet.ExcelWorksheet = excelFile.Worksheets(0) @@ -75,8 +75,8 @@ Namespace Extensiones If firstRowHasHeaders Then - If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) + If worksheet.Rows(curRow).Cells(cols).Value IsNot Nothing Then + dataTable.Columns.Add(worksheet.Rows(curRow).Cells(cols).Value.ToString()) Else dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) 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 @@