diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs
index 368e21914..ffe0303e3 100644
--- a/CRM/EmpresaCRM.aspx.cs
+++ b/CRM/EmpresaCRM.aspx.cs
@@ -102,6 +102,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas
{
get
{
+ if (ViewState["DTContactos"] == null)
+ {
+ ViewState["DTContactos"] = new DataTable();
+ }
+
return (DataTable)ViewState["DTContactos"];
}
@@ -137,6 +142,26 @@ public partial class CRM_EmpresaCRM : ClsPaginas
}
}
+ private int VendedorTipo
+ {
+ get
+ {
+ if(ViewState["VendedorTipo"] == null)
+ {
+ ViewState["VendedorTipo"] = -1;
+ }
+ return ViewState["VendedorTipo"].ToString().ToEntero();
+ }
+
+ set
+ {
+ ViewState["VendedorTipo"] = value;
+ }
+ }
+
+
+
+
private int CveSubProyecto
{
get
@@ -154,6 +179,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
{
get
{
+
return (DataTable)ViewState["TempDTContactos"];
}
@@ -749,7 +775,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
CveVendedor = objServicio.Result[0].CveVendedorAsignado.ToEntero();
CveSubProyecto = objServicio.Result[0].CveSubProyecto.ToEntero();
CveCliente = objServicio.Result[0].CveCliente.ToEntero();
- CveGiroClasificacion = objServicio.Result[0].CveGiroClasificacion > 0 ? objServicio.Result[0].CveGiroClasificacion.ToEntero() : -1;
+ CveGiroClasificacion = objServicio.Result[0].CveGiroClasificacion > 0 ? objServicio.Result[0].CveGiroClasificacion.ToEntero() : -1;
if (!(CveCliente > 0))
{
@@ -803,6 +829,22 @@ public partial class CRM_EmpresaCRM : ClsPaginas
CargaEventoBitacora();
}
+
+ if(UsuarioActual.CveVendedor > 0)
+ {
+ ClsVtaVendedores ObjVendedores = new ClsVtaVendedores();
+ if (ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa))
+ {
+ if(ObjVendedores.DtResultados.Rows.Count > 0)
+ {
+ VendedorTipo = ObjVendedores.DtResultados.FiltroPrimeroValor("VendedorTipo", $"CveVendedor = {UsuarioActual.CveVendedor}").ToEntero();
+ }
+ }
+ ObjVendedores.Dispose();
+ }
+
+
+
}
protected void DdlTipoProceso_Change(object sender, EventArgs e)
@@ -1623,7 +1665,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
{
if (DTContactos.Rows.Count == 0)
{
- Alert("Para crear un nuevo acercamiento es necesario agregar al menos un Contacto.", ModExtensiones.TipoMensaje.MsgAdvertencia);
+ Alert("Para crear un nuevo acercamiento/Oportunidad es necesario agregar al menos un Contacto.", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
else
{
@@ -1707,22 +1749,22 @@ public partial class CRM_EmpresaCRM : ClsPaginas
}
else
{
- Alert("No tiene 'Etapa Proceso' con el 'Proceso' seleccionado al agregar el Acercamiento", ModExtensiones.TipoMensaje.MsgAdvertencia);
+ Alert("No tiene 'Etapa Proceso' con el 'Proceso' seleccionado al agregar el Acercamiento/Oportunidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
if (CveAcercamiento > 0)
{
- if (ObjBitacora.AddEventoBitacora(String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoPrincipal, CveEtapaProcesoCRM: CveEtapaProcesoActual))
+ if (ObjBitacora.AddEventoBitacora(String.Format("Se registró el Acercamiento/Oportunidad {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveContactoCRM: CveContactoPrincipal, CveEtapaProcesoCRM: CveEtapaProcesoActual))
{
- string asunto = String.Format("Se registró el Acercamiento {0}", NombreAcercamiento);
- string mensaje = String.Format("Se registró el Acercamiento {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text);
+ string asunto = String.Format("Se registró el Acercamiento/Oportunidad {0}", NombreAcercamiento);
+ string mensaje = String.Format("Se registró el Acercamiento/Oportunidad {0} como Proceso de Tipo {1}, con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text);
mandarCorreo(asunto, mensaje);
HuboError = false;
}
}
else
{
- Alert("Ocurrio un error al agregar el Acercamiento", ModExtensiones.TipoMensaje.MsgError);
+ Alert("Ocurrio un error al agregar el Acercamiento/Oportunidad", ModExtensiones.TipoMensaje.MsgError);
HuboError = false;
}
@@ -1741,7 +1783,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
//CARGA BITACORA
if (!HuboError)
{
- Alert(String.Format("Se registró el acercamiento
{0} como proceso de tipo
{1}.
Se le redireccionara al Detalle del Acercamiento.", NombreAcercamiento, DdlTipoProceso.SelectedItem), ModExtensiones.TipoMensaje.MsgInformacion, String.Format("document.location.href=\"/CRM/Acercamiento.aspx?CveAcercamiento={0}\"", CveAcercamiento));
+ Alert(String.Format("Se registró el acercamiento/Oportunidad
{0} como proceso de tipo
{1}.
Se le redireccionara al Detalle del Acercamiento/Oportunidad.", NombreAcercamiento, DdlTipoProceso.SelectedItem), ModExtensiones.TipoMensaje.MsgInformacion, String.Format("document.location.href=\"/CRM/Acercamiento.aspx?CveAcercamiento={0}\"", CveAcercamiento));
CargaEventoBitacora();
}
limpiarCamposModalAcercamiento();
@@ -1771,7 +1813,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
LnkAgregarAcercamiento.Visible = false;
}
- if ((UsuarioActual.CveVendedor != CveVendedor))
+ if ((UsuarioActual.CveVendedor != CveVendedor) & VendedorTipo != 2)
{
if (UsuarioActual.CveUsuario != 100)
{
diff --git a/CRM/RepAcercamientos.aspx b/CRM/RepAcercamientos.aspx
index c4666c501..ca7812381 100644
--- a/CRM/RepAcercamientos.aspx
+++ b/CRM/RepAcercamientos.aspx
@@ -5,7 +5,7 @@
- Reporte de Acercamientos
+ Reporte de Acercamientos/Oportunidades
@@ -149,7 +149,7 @@
<%--1--%>
-
+
diff --git a/CRM/RepAcercamientosProcesos.aspx b/CRM/RepAcercamientosProcesos.aspx
index 41a2ff356..9571cfe87 100644
--- a/CRM/RepAcercamientosProcesos.aspx
+++ b/CRM/RepAcercamientosProcesos.aspx
@@ -30,7 +30,7 @@
- Reporte de Procesos de Acercamientos
+ Reporte de Procesos de Acercamientos/Oportunidades
diff --git a/CRM/RepAcercamientosRechazos.aspx b/CRM/RepAcercamientosRechazos.aspx
index 83f91e875..bf2398e92 100644
--- a/CRM/RepAcercamientosRechazos.aspx
+++ b/CRM/RepAcercamientosRechazos.aspx
@@ -27,7 +27,7 @@
- Reporte de Rechazos Acercamientos
+ Reporte de Rechazos Acercamientos/Opotunidades
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 12851b38b..0baae99aa 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -1886,6 +1886,18 @@ Partial Class Ventas
End Set
End Property
+ Private Property CveAcercamiento As Integer
+ Get
+ If ViewState("CveAcercamiento") Is Nothing Then
+ ViewState("CveAcercamiento") = -1
+ End If
+ Return ViewState("CveAcercamiento").ToString().ToEntero()
+ End Get
+ Set(value As Integer)
+ ViewState("CveAcercamiento") = value
+ End Set
+ End Property
+
Private Property CveEmpresaCRM As Integer
Get
Return ViewState("CveEmpresaCRM").ToString().ToEntero()
@@ -1895,6 +1907,7 @@ Partial Class Ventas
End Set
End Property
+
Private Property CveAcercamientoCRM As Integer
Get
Return ViewState("CveAcercamientoCRM").ToString().ToEntero()
@@ -10072,6 +10085,18 @@ Partial Class Ventas
End If
End If
+ If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
+
+ Dim ArchivoCotRdlc As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
+ Dim ArchivoCotMrt As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta))
+
+ If ArchivoCotRdlc.Exists Or ArchivoCotMrt.Exists Then
+ MensajeAlert.AppendFormat("
", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
+ Else
+ MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
+ End If
+ End If
+
'ERROR DE NO TIMBRADO
If Not SeTimbro And (DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue = "Ant") Then
MensajeAlert.AppendFormat("La factura no se pudo timbrar. Por favor intentelo de nuevo a traves del boton Emitir.")
@@ -10100,6 +10125,10 @@ Partial Class Ventas
End If
End If
+ If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
+ RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))}'", "Imprimir")
+ End If
+
'DESCARGAR PDF DE CICOVISA
'If UsuarioActual.CveEmpresa = 72 And CveCliente = 70381 Then
' If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") Then
@@ -10108,6 +10137,7 @@ Partial Class Ventas
'End If
If DdlTipoComprobante.SelectedValue = "Cot" Then
+
If Not CveEmpresaCRM > 0 Then
'EN EMPRESA DE ACUMULADORES NO DESCARGAR EL PDF
@@ -10194,7 +10224,18 @@ Partial Class Ventas
Liga2 = $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}"";"
End If
- Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
+
+
+ If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
+ Liga = $"document.location.href=""/CRM/Acercamiento.aspx?CveAcercamiento={CveAcercamientoCRM}&OPTAB=COT"";"
+ Alert(MensajeAlert.ToString(), TipoMensaje.MsgInformacion, Liga, TextoConfirmacion:="Aceptar", TextoSegundoBoton:=Nothing, JSBtn2:=Nothing, ShowCloseButton:=False)
+ Else
+ Alert(MensajeAlert.ToString(), TipoMensaje.MsgDosBotones, Liga, TextoConfirmacion:="Seguir Registrando", TextoSegundoBoton:="Ir al Cliente", JSBtn2:=Liga2, ShowCloseButton:=False)
+ End If
+
+
+
+
MensajeAlert.Clear()