diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index a07d2a7d3..2c84fb3e1 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -431,7 +431,8 @@ Public Class ClsCRM Return Retorno End Function - Public Function AddEmpresaCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, CveEncuestaAplicada As Integer, CveVendedor As Integer, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Integer + Public Function AddEmpresaCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, CveEncuestaAplicada As Integer, CveVendedor As Integer, + Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional CveGiroClasificacion As Integer = -1) As Integer Dim CveEmpresaCRM As Integer = -1 DataAdapter("PA_CRM_EmpresaAdd") With SqlAdapter.SelectCommand.Parameters @@ -444,6 +445,7 @@ Public Class ClsCRM .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -456,7 +458,8 @@ Public Class ClsCRM Return CveEmpresaCRM End Function - Public Function UpdateEmpresCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresaCRM As Integer, CveVendedor As Integer, CveUsuarioMod As Integer, Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Boolean + Public Function UpdateEmpresCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresaCRM As Integer, CveVendedor As Integer, CveUsuarioMod As Integer, + Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional CveGiroClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_EmpresaUpdate") With SqlAdapter.SelectCommand.Parameters @@ -469,6 +472,7 @@ Public Class ClsCRM .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@CveGiroClasificaciones", SqlDbType.Int).Value = CveGiroClasificacion End With Try SqlAdapter.Fill(Data) @@ -651,7 +655,8 @@ Public Class ClsCRM Public Function GetAcercamiento(CveEmpresa As Integer, Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamiento As Integer = -1, Optional CveTipoProceso As Integer = -1, 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) As Boolean + 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 Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoGet") With SqlAdapter.SelectCommand.Parameters @@ -675,6 +680,9 @@ Public Class ClsCRM .Add("@FechaCierre", SqlDbType.VarChar).Value = FechaCierre .Add("@TopSelect", SqlDbType.Int).Value = TopSelect + + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion End With Try SqlAdapter.Fill(Data) @@ -688,7 +696,7 @@ Public Class ClsCRM Public Function AddAcercamiento(CveEmpresaCRM As Integer, CveContactoPrincipal As Integer, CveTipoProceso As Integer, CveEtapaProcesoActual As Integer, CveVendedor As Integer, CveMedioCaptacion As Integer, CveRechazoMotivo As Integer, CveProbabilidadAcercamiento As Integer, FechaApertura As DateTime, NombreAcercamiento As String, Descripcion As String, Importe As Double, Comision As Double, Prioridad As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, - Optional FechaCierre As Nullable(Of DateTime) = Nothing) As Integer + Optional FechaCierre As Nullable(Of DateTime) = Nothing, Optional CvePS As Integer = -1) As Integer Dim _CveAcercamiento As Integer = -1 DataAdapter("PA_CRM_AcercamientoAdd") @@ -714,6 +722,7 @@ Public Class ClsCRM .Add("@Prioridad", SqlDbType.Int).Value = Prioridad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuarioIng", SqlDbType.Int).Value = CveUsuarioIng + .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -729,7 +738,7 @@ Public Class ClsCRM Public Function UpdateAcercamiento(CveAcercamiento As Integer, CveContactoPrincipal As Integer, CveTipoProceso As Integer, CveEtapaProcesoActual As Integer, CveVendedor As Integer, CveMedioCaptacion As Integer, CveProbabilidadAcercamiento As Integer, NombreAcercamiento As String, Descripcion As String, Importe As Double, Comision As Double, Prioridad As Integer, CveUsuarioMod As Integer, Optional CveRechazoMotivo As Integer = -1, Optional CveEncuestaAplicadaProceso As Integer = -1, - Optional FechaApertura As Nullable(Of DateTime) = Nothing, Optional FechaCierre As Nullable(Of DateTime) = Nothing) As Boolean + Optional FechaApertura As Nullable(Of DateTime) = Nothing, Optional FechaCierre As Nullable(Of DateTime) = Nothing, Optional CvePS As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoUpdate") With SqlAdapter.SelectCommand.Parameters @@ -755,6 +764,7 @@ Public Class ClsCRM .Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo .Add("@FechaApertura", SqlDbType.DateTime).Value = IIf(FechaApertura Is Nothing, SqlTypes.SqlDateTime.Null, FechaApertura) .Add("@FechaCierre", SqlDbType.DateTime).Value = IIf(FechaCierre Is Nothing, SqlTypes.SqlDateTime.Null, FechaCierre) + .Add("@CvePS", SqlDbType.Int).Value = CvePS End With Try SqlAdapter.Fill(Data) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index c16a3ca10..b11dc7cc1 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1832,7 +1832,7 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria 'tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) - Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion) + Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioCompraValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * TipoCambioPago) 'Añadimos la diferencia de perdida en la venta diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx index ef2aec956..4fac5eeab 100644 --- a/CRM/Acercamiento.aspx +++ b/CRM/Acercamiento.aspx @@ -405,12 +405,15 @@ <%-- style="padding-bottom: 17px;" --%>
- + diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 3890d6dc8..30c7a064f 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -234,6 +234,18 @@ public partial class CRM_Acercamiento : ClsPaginas ViewState["CveAcercamientoGasto"] = value; } } + private int CvePS + { + get + { + return ViewState["CvePS"] == null ? -1 : ViewState["CvePS"].ToString().ToEntero(); + } + + set + { + ViewState["CvePS"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -269,6 +281,7 @@ public partial class CRM_Acercamiento : ClsPaginas } } } + CargarPS(); } } @@ -322,6 +335,8 @@ public partial class CRM_Acercamiento : ClsPaginas CveEncuestaAplicadaProceso = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() : -1; //CveEtapaBitacoraSeleccionada = CveEtapaActual; + CvePS = ObjCRM.DtResultados.FiltroPrimeroValor("CvePS").ToEntero(); + HdfEtapaSeleccionada.Value = CveEtapaActual.ToString(); //INHABILITAMOS CAMPOS QUE NO SE PUEDEN EDITAR DdlEmpresaCRM.Enabled = false; @@ -556,6 +571,17 @@ public partial class CRM_Acercamiento : ClsPaginas if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1", "2", "3")) GuardarCambioEtapa(); } + + private void CargarPS() + { + DdlPS.setEsWebService(true); + if(CvePS > 0) + { + string productoAsignado = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS: CvePS).FiltroPrimeroValor("PSCodigo"); + DdlPS.SelectedValue = CvePS.ToString(); + DdlPS.SelectedText = productoAsignado; + } + } #endregion #region "GUARDAR" @@ -605,7 +631,7 @@ public partial class CRM_Acercamiento : ClsPaginas } if ((CveEncuestaAplicadaProceso != 0) && ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento, - NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre)) + NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS:DdlPS.SelectedValue.ToEntero())) { //String MensajeBitacora = (CveEtapaProcesoActualActualizar != CveEtapaActual) ? String.Format("Se actualizó la etapa del acercamiento a {0}.", DTEtapasProceso.FiltroPrimeroValor("EtapaProceso", "CveEtapaProceso = " + CveEtapaProcesoActualActualizar)) : String.Format("Se actualizó el Acercamiento {0} con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text); @@ -671,7 +697,7 @@ public partial class CRM_Acercamiento : ClsPaginas int CveUsuarioIng = UsuarioActual.CveUsuario; if (ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento, - NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre)) + NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS: DdlPS.SelectedValue.ToEntero())) { CveEtapaActual = CveEtapaProcesoActualActualizar; HdfEtapaSeleccionada.Value = CveEtapaProcesoActualActualizar.ToString(); diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index 9ff6a1393..24e763256 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -109,6 +109,11 @@