From 8b0555f7f58cbc9b0215138b4eb6ea8ca440679d Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 2 Nov 2022 05:43:42 -0700 Subject: [PATCH 1/8] --- App_Code/LogicNominas.vb | 6 +- App_Code/modExtensiones.vb | 8 +-- Nomina/Nomina.aspx | 81 +++++++++++++++++++-- Nomina/Nomina.aspx.cs | 141 +++++++++++++++++++++++++++++++++++++ RH/CalculoSBC.aspx.cs | 16 ++--- vwd.webinfo | 2 + 6 files changed, 234 insertions(+), 20 deletions(-) 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 ee58149a8..38687b3e8 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/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 796e7f71e..acdab6bfe 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -615,19 +615,49 @@ -
-
-
-
+
+ <%--Descargar + Cargar--%> + + + + Asistencia + + + + + + + + + + + +
+
+
- + @@ -3195,6 +3225,47 @@ + + -
-
- - - -
- -
- - - - -
+
<%--
@@ -521,7 +525,14 @@
-
+ +
+
+ + +
+
+
<%--END DATOS DE EMPRESA CRM --%> diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 941639121..b1778e7cd 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -334,11 +334,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 +690,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)) diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index a186c7ebe..a805e84da 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -248,18 +248,25 @@
- - +   - + + +   + + + + + @@ -563,9 +570,17 @@ --%>
+ +
+ + + + +
+ + @@ -574,6 +589,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..40ab53418 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, @@ -1833,4 +1847,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 @@