diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 2a9ab0bf8..d8084033f 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -306,13 +306,14 @@ Public Class ClsOIEventos End Function - Public Function GetUnoaUnoCuestionario(cveUnoaUnoCuestionario As Int32, cveUsuario As Int32) As Boolean + Public Function GetUnoaUnoCuestionario(cveUnoaUnoCuestionario As Integer, cveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_OI_UnoaUnoCuestionarioGet", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (cveUnoaUnoCuestionario) .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + .Add("@CveEmpresa", SqlDbType.Int).Value = (CveEmpresa) End With Try SqlAdapter.Fill(Data) @@ -337,7 +338,7 @@ Public Class ClsOIEventos End Try Return retorno End Function - Public Function AddUnoaUnoCuestionario(Cuestionario As String, Comentario As String, CveUsuario As Integer, ListPreguntas As List(Of Integer)) As Boolean + Public Function AddUnoaUnoCuestionario(Cuestionario As String, Comentario As String, CveUsuario As Integer, ListPreguntas As List(Of Integer), CveEmpresa As Integer) As Boolean Dim retorno As Boolean = False Dim xmlPreguntas As System.Xml.Linq.XDocument = Nothing @@ -349,6 +350,7 @@ Public Class ClsOIEventos .Add("@Cuestionario", SqlDbType.VarChar).Value = (Cuestionario) .Add("@Comentario", SqlDbType.VarChar).Value = (Comentario) .Add("@CveUsuario", SqlDbType.Int).Value = (CveUsuario) + .Add("@CveEmpresa", SqlDbType.Int).Value = (CveEmpresa) .Add("@xmlPreguntas", SqlDbType.Xml).Value = If(xmlPreguntas Is Nothing, DBNull.Value, DirectCast(xmlPreguntas.ToString(), Object)) End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8d894b822..6c1eaf2e6 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -73,8 +73,9 @@ Public Class ClsPaginas 'UsuarioActual = DirectCast(Session("UsuarioSIG"), Usuario) If Context.Session("UsuarioSIG") Is Nothing Then Usuario.CerrarSession() + Return Nothing Else - UsuarioActual = CType(Context.Session("UsuarioSIG"), Usuario) + Return CType(Context.Session("UsuarioSIG"), Usuario) End If Catch ex As Exception Usuario.CerrarSession() @@ -3626,14 +3627,13 @@ Public Class ClsPaginas PaginaDict.Add("/Default2.aspx".ToUpper(), -1) PaginaDict.Add("/CargaCuentas.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Tareas.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/RepProyectos.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/Tablero.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/TableroDetalle.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/UnoaUno.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/UnoaUnoConfiguracion.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), -1) - PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/RepProyectos.aspx".ToUpper(), 907) + PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), 907) + PaginaDict.Add("/OI/Tablero.aspx".ToUpper(), 910) + PaginaDict.Add("/OI/TableroDetalle.aspx".ToUpper(), 910) + PaginaDict.Add("/OI/UnoaUno.aspx".ToUpper(), 909) + PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), 908) + PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), 908) PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatOrdenesServiciosCaracteristicas.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatOSCaracteristicasOpciones.aspx".ToUpper(), -1) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index d19de8eef..eb2eea490 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4217,16 +4217,14 @@ Namespace Modelos 'GENERAMOS EL ACUSE Y MANDAMOS MAIL DE CON EL ACUSE DE CANCELACIÓN If RequiereAceptacion Then CancelacionFecha = Now.Date - CancelacionAcuse = "" CveEstatus = 20 - Else CancelacionFecha = ObjCancelacion.CancelacionFecha - CancelacionAcuse = ObjCancelacion.CancelacionAcuse CveEstatus = 5 End If + CancelacionAcuse = ObjCancelacion.CancelacionAcuse Else - Retorno.Mensaje = "La factura no se pudo cancelar ante el SAT." + Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
Origen del error: WebService www.sat.gob.mx" Retorno.TipoMensaje = TipoMensaje.MsgError Return Retorno @@ -4568,22 +4566,21 @@ Namespace Modelos 'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN GENERAL If Not ErrorCancelar AndAlso ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 Then For Each CveRemision As Integer In ListaRemisionesCancelar - For Each RowDevolucion As DataRow In DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}", DistinctColumns:={"CveRemision", "CveAlmacen", "CveAlmacenDestino"}).Rows + Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}") - Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}") + Dim RowDevolucion As DataRow = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveRemision", "CveAlmacen", "CveAlmacenDestino"}).Rows(0) - CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() - CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() + CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() + CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() - 'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN GENERAL - If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision, ObjVentas, ObjInventario) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." - Exit For - End If + 'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN GENERAL + If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision, ObjVentas, ObjInventario) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." + Exit For + End If - DtDevRemision.Dispose() - Next + DtDevRemision.Dispose() Next End If @@ -5030,22 +5027,34 @@ Namespace Modelos End If 'ENTRADA A (ALMACEN GENERAL) + Dim DtEntradaDetalle As DataTable = Nothing + If Not ErrorCancelar Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows + DtEntradaDetalle = ObjInventario.DtResultados.Copy() + End If + End If + + If Not ErrorCancelar Then + If DtEntradaDetalle IsNot Nothing Then + For Each Dr As DataRow In DtEntradaDetalle.Rows If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then ErrorCancelar = True Exit For End If Next + Else + ErrorCancelar = True End If End If - - If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveRemision) Then - ErrorCancelar = True + If Not ErrorCancelar Then + If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveRemision) Then + ErrorCancelar = True + End If End If + Return Not ErrorCancelar End Function diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 07b34e090..b124bd0a3 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -3417,7 +3417,7 @@ Partial Class Contratos_Default Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else @@ -3741,7 +3741,7 @@ Partial Class Contratos_Default #Region " IMPRIMIR DOCUMENTO - SABE " Public Sub DescarFormato(documento As String) - Dim PathRoot As String = ModExtensiones.DirectorioBaseEmpresas + Dim PathRoot As String = Server.MapPath("/") Dim PathSource As String Dim pathDesti As String diff --git a/Imagenes/Bell.png b/Imagenes/Bell.png new file mode 100644 index 000000000..352602b08 Binary files /dev/null and b/Imagenes/Bell.png differ diff --git a/Inicio.aspx b/Inicio.aspx index 603783288..b45294990 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -483,43 +483,10 @@ - - -
+
+ + -<%--
-
-
- - OI -
-
-
-
-
-
-
-
- - - - -   - - - - - - -
- -
-
--%>
@@ -565,9 +532,78 @@
+
+
+
+
+
+
+
+ + Eventos +
+
+
+
+
- - +
+
+ <%-- + + + +   + + + + + --%> +
+ + Eventos +
    +
  • +
    +
    Tareas
    +
    + 0
    +
    + +
  • +
  • +
    +
    Convocatorias
    +
    + 0
    +
    + +
  • +
  • +
    +
    Minutas
    +
    + 0
    +
    + +
  • +
  • +
    +
    Proyectos
    +
    + 0
    +
    + +
  • +
+
+ +
+ +
+
+
<%-- DIRECTORIO TELEFONICO --%> @@ -739,7 +775,8 @@
-
+ +
@@ -789,7 +826,8 @@
-
+ +
@@ -1105,7 +1143,7 @@
- + diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 0d8762b4d..55ee7d78a 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1419,13 +1419,22 @@ Partial Class Inventarios_TraspasoAlmacen CargaRecepcion() End Sub Private Sub CargaRecepcion() - Dim ObjInventarios As New ClsInventarios + Dim Dtt As DataTable = Nothing FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero) + Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then Dtt = ObjInventarios.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4")) + Else + Alert("Ocurrió un error al consultar los movimientos transitorios. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) + Dtt = Nothing + End If + ObjInventarios.Dispose() + + If Dtt IsNot Nothing Then + If TxtFolioRecepcion.Text.Trim <> "" Then CveMovimientoSalida = ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimiento", "").ToEntero @@ -1433,14 +1442,7 @@ Partial Class Inventarios_TraspasoAlmacen CveAlmacenDestino = DdlAlmacenRecepcion.SelectedValue.ToEntero CveAlmacenTransitorio = DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero 'CveUsuarioResponsable = DdlResponsableRecepcion.SelectedValue.ToEntero - Else - Alert("Ocurrió un error al consultar los movimientos transitorios. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Dtt = Nothing - End If - ObjInventarios.Dispose() - - If Dtt IsNot Nothing Then GvDatosRecepcion.DataSource = Dtt GvDatosRecepcion.DataBind() diff --git a/OI/ConvocatoriaDetalle.aspx b/OI/ConvocatoriaDetalle.aspx index 82d14f09e..7c1aed61c 100644 --- a/OI/ConvocatoriaDetalle.aspx +++ b/OI/ConvocatoriaDetalle.aspx @@ -135,7 +135,14 @@
  • - Actualizar Participantes
  • + Actualizar Participantes + +
  • + Asistencia +
  • +
  • + Enviar correo +
  • @@ -430,7 +437,7 @@ @@ -438,7 +445,62 @@
    - + + diff --git a/OI/ConvocatoriaDetalle.aspx.cs b/OI/ConvocatoriaDetalle.aspx.cs index 612a0ddfe..c4f84764d 100644 --- a/OI/ConvocatoriaDetalle.aspx.cs +++ b/OI/ConvocatoriaDetalle.aspx.cs @@ -11,8 +11,10 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas { #region Propiedades - public const string iddivAgregarTema = "divModalAgregartema"; + public const string iddivAgregarTema = "divModalAgregartema"; + public const string iddivTomarAsistencia = "iddivTomarAsistencia"; public const string iddivAgregarMiembros = "iddivAgregarMiembros"; + public int CveEventoMinuta { get { return ViewState["CveEventoMinuta"] != null ? ViewState["CveEventoMinuta"].ToString().ToEntero() : 0; } set { ViewState["CveEventoMinuta"] = value; } } public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } } public int RCveEventoPadre { get { return ViewState["RCveEventoPadre"] != null ? ViewState["RCveEventoPadre"].ToString().ToEntero() : 0; } set { ViewState["RCveEventoPadre"] = value; } } public bool EsNuevo { get { return Convert.ToBoolean(ViewState["EsNuevo"]); } set { ViewState["EsNuevo"] = value; } } @@ -30,18 +32,19 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas cargaUsuarios(); if (Request["CveEvento"] != null) - { - RCveEvento = Request["CveEvento"].ToString().ToEntero(); + { + RCveEvento = Request["CveEvento"].ToString().ToEntero(); } if (Request["CveEventoPadre"] != null) { - - RCveEventoPadre = Request["CveEventoPadre"].ToString().ToEntero(); + + RCveEventoPadre = Request["CveEventoPadre"].ToString().ToEntero(); } if (RCveEvento > 0) { + LnkEnviarCorreo.Visible = true; EsNuevo = false; - LnkGuardar.Visible = false; + //LnkGuardar.Visible = false; loadConvocatoria(); } } @@ -79,6 +82,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas { System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0]; CveEventoHijo = drow["CveEvento"].ToString().ToEntero(); + CveEventoMinuta = drow["CveEvento"].ToString().ToEntero(); + LnkOpenModalAsistencia.Visible = true; } if (ObjOI_E.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0) { @@ -87,6 +92,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas pnlmiembrosvista.Visible = true; TxtAsunto.Text = drow["Asunto"].ToString(); TxtDescripcion.Text = drow["Descripcion"].ToString(); + TxtAsistentesExternos.Text = drow["Asistencia"].ToString(); TxtDuracion.Text = drow["Duracion"].ToString(); DdlPrioridad.SelectedValueExist(drow["Prioridad"].ToString()); txtFechaI.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaInicio"]); @@ -99,7 +105,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas CveUsuarioDe = drow["CveUsuarioDe"].ToString().ToEntero(); int CveEventoEstatus = drow["CveEventoEstatus"].ToString().ToEntero(); bool permisoeditar = UsuarioActual.CveUsuario == CveUsuarioDe || UsuarioActual.CveUsuario == CveUsuarioIng; - LnkIniciar.Visible = permisoeditar && (CveEventoHijo <=0); + LnkIniciar.Visible = permisoeditar && (CveEventoHijo <= 0); HypIrMinuta.Visible = (CveEventoHijo > 0); HypIrMinuta.NavigateUrl = string.Format("/OI/MinutaDetalle.aspx?CveEvento={0}", CveEventoHijo); TxtAsunto.Enabled = permisoeditar; @@ -197,7 +203,6 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarMiembros)); LtlTituloUsuarios.Text = "Actualizar miembros"; BtnUpMiembros.Visible = true; - BtnReasignarTarea.Visible = false; DdlModera.SelectedValueExist(CveUsuarioDe.ToString()); foreach (GridViewRow gvRow in GVUsuarios.Rows) { @@ -209,8 +214,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas chkCCpara.Enabled = true; - if ( (CveUsuario == CveUsuarioDe)) - { + if ((CveUsuario == CveUsuarioDe)) + { if (CveUsuario == CveUsuarioDe) { chkCCpara.Checked = true; @@ -234,8 +239,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas { if (gvRow.RowType == DataControlRowType.DataRow) { - int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); - CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); if (chkCCpara.Checked) { listaCCP.Add(CveUsuario); @@ -271,84 +276,85 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas protected void LnkGuardar_Click(object sender, EventArgs e) { string errorMessage = ""; - if (EsNuevo) + + int cveUsuarioDe = DdlModerador.SelectedValue.ToEntero(); + List listaCCP = new List(); + int cveUsuarioPara = -1; + //string Nombrepara = ""; + string Nombrede = ""; + foreach (GridViewRow gvRow in GVUsuariosB.Rows) { - int cveUsuarioDe = DdlModerador.SelectedValue.ToEntero(); - List listaCCP = new List(); - int cveUsuarioPara = -1; - //string Nombrepara = ""; - string Nombrede = ""; - foreach (GridViewRow gvRow in GVUsuariosB.Rows) + if (gvRow.RowType == DataControlRowType.DataRow) { - if (gvRow.RowType == DataControlRowType.DataRow) + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); + if (CveUsuario == cveUsuarioDe) { - int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); - CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP"); - if (CveUsuario == cveUsuarioDe) - { - Nombrede = gvRow.DataKey("Nombre").ToString(); - } - if (chkCCpara.Checked) - { - listaCCP.Add(CveUsuario); - //cveUsuarioDe = CveUsuario; - } + Nombrede = gvRow.DataKey("Nombre").ToString(); + } + if (chkCCpara.Checked) + { + listaCCP.Add(CveUsuario); + //cveUsuarioDe = CveUsuario; } } - OITipoEventos cveTipoEvento = OITipoEventos.Convocatorias; - string asunto = TxtAsunto.Text; - string descripcion = TxtDescripcion.Text; - int prioridad = DdlPrioridad.SelectedValue.ToEntero(); - string fechaInicio = ""; - if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) + } + OITipoEventos cveTipoEvento = OITipoEventos.Convocatorias; + string asunto = TxtAsunto.Text; + string descripcion = TxtDescripcion.Text; + int prioridad = DdlPrioridad.SelectedValue.ToEntero(); + string fechaInicio = ""; + if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) + { + if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) { - if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) - { - errorMessage = "No se ingresó una fecha de inicio valida"; + errorMessage = "No se ingresó una fecha de inicio valida"; - } - else - { - fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); - } } else { - fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); } - string fechaFin = ""; - if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999) + } + else + { + fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + } + string fechaFin = ""; + DateTime dfechaF; + if ((dfechaF=txtFechaF.Text.ToDateTimeExcat()).Year <= 1999) + { + if ((dfechaF = txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")).Year <= 1999) { - if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) - { - errorMessage = "No se ingresó una fecha fin valida"; + errorMessage = "No se ingresó una fecha fin valida"; - } - else - { - fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); - } } else { - fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); + fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", dfechaF); } - int cveRevision = DdlTema.SelectedValue.ToEntero(); - string archivoname = ""; - string rutaarchivoOri = ""; + } + else + { + fechaFin = dfechaF.ToString("yyyy/MM/dd HH:mm"); + } + int cveRevision = DdlTema.SelectedValue.ToEntero(); + string archivoname = ""; + string rutaarchivoOri = ""; - int cveUsuarioIng = UsuarioActual.CveUsuario; - int cveEmpresa = UsuarioActual.CveEmpresa; - bool Continuar = false; - int Folio = -1; - int CveEvento = -1; - - if (cveUsuarioDe <= 0) - { - errorMessage = "Asegúrese de seleccionar al menos un miembro \"C C Para\""; - } + int cveUsuarioIng = UsuarioActual.CveUsuario; + int cveEmpresa = UsuarioActual.CveEmpresa; + int Folio = -1; + int CveEvento = -1; + if (cveUsuarioDe <= 0) + { + errorMessage = "Asegúrese de seleccionar al menos un miembro \"C C Para\""; + } + if (EsNuevo) + { + bool Continuar = false; if (errorMessage.Length == 0) { @@ -356,7 +362,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas using (ClsOIEventos objOI = new ClsOIEventos()) { objOI.IniciaTransacSQL(); - Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, CorreoExterno: TxtCorreoExterno.Text, Acuerdos: TxtOrdendeldia.Text.Replace("< ", "<"), Lugar: TxtLugar.Text,CveEventoPadre: (RCveEventoPadre>0? RCveEventoPadre:-1),Duracion:TxtDuracion.Text); + Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, CorreoExterno: TxtCorreoExterno.Text, Acuerdos: TxtOrdendeldia.Text.Replace("< ", "<"), Lugar: TxtLugar.Text, CveEventoPadre: (RCveEventoPadre > 0 ? RCveEventoPadre : -1), Duracion: TxtDuracion.Text); CveEvento = objOI.CveEvento; Folio = objOI.Folio; @@ -367,7 +373,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas if (Continuar) { objOI.Commit(); - ObjEventosCorreo o = objOI.objCorreo; + enviarConvocatoria(CveEvento); + //ObjEventosCorreo o = objOI.objCorreo; //string mailbody = MailgetBodyNuevatarea(o.Folio, o.Link, o.Asunto, o.Descripcion, string.Format("{0:dd/MM/yyyy}", fechaInicio.ToDateTime()), string.Format("{0:HH:mm horas}", fechaInicio.ToDateTime()), string.Format("{0:dd/MM/yyyy}", fechaFin.ToDateTime()), string.Format("{0:HH:mm horas}", fechaFin.ToDateTime()), o.Prioridad, o.Tema, Nombrede, Nombrepara); //EnviarCorreo(UsuarioActual.Empresa, o.AsuntoCorreo, mailbody, o.mailPara, ""); } @@ -400,77 +407,29 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas } else { + + bool Continuar = true; + using (ClsOIEventos objOI = new ClsOIEventos()) + { + objOI.IniciaTransacSQL(); + Continuar = objOI.UP_Eventos2(RCveEvento, asunto, descripcion, prioridad, fechaInicio, fechaFin, cveRevision, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + if (Continuar) + { - //string asunto = TxtAsunto.Text; - //string descripcion = TxtDescripcion.Text; - //int prioridad = DdlPrioridad.SelectedValue.ToEntero(); - //string fechaInicio = ""; - //if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999) - //{ - // if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) - // { - // errorMessage = "No se ingresó una fecha de inicio valida"; - - // } - // else - // { - // fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm"); - // } - //} - //else - //{ - // fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); - //} - //string fechaFin = ""; - //if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999) - //{ - // if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999) - // { - // errorMessage = "No se ingresó una fecha fin valida"; - - // } - // else - // { - // fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy")); - // } - //} - //else - //{ - // fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm"); - //} - //int cveRevision = DdlTema.SelectedValue.ToEntero(); - //bool Continuar = true; - //using (ClsOIEventos objOI = new ClsOIEventos()) - //{ - // objOI.IniciaTransacSQL(); - // Continuar = objOI.UP_Eventos2(RCveEvento, asunto, descripcion, prioridad, fechaInicio, fechaFin, cveRevision, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); - - // if (Continuar) - // { - // objOI.Commit(); - // string Nombrede = ""; - // string Nombrepara = ""; - // System.Data.DataTable dt = get_GlobalDTUsuarios(CveUsuario: CveUsuarioDe, CveEmpresa: UsuarioActual.CveEmpresa); - // if (dt.Rows.Count > 0) - // { - // Nombrede = dt.Rows[0]["Nombre"].ToString(); - // } - // dt = get_GlobalDTUsuarios(CveUsuario: CveUsuarioDe, CveEmpresa: UsuarioActual.CveEmpresa); - // if (dt.Rows.Count > 0) - // { - // Nombrepara = dt.Rows[0]["Nombre"].ToString(); - // } - // ObjEventosCorreo o = objOI.objCorreo; - // string mailbody = MailgetBodyNuevatarea(o.Folio, o.Link, o.Asunto, o.Descripcion, string.Format("{0:dd/MM/yyyy}", fechaInicio.ToDateTime()), string.Format("{0:HH:mm} horas", fechaInicio.ToDateTime()), string.Format("{0:dd/MM/yyyy}", fechaFin.ToDateTime()), string.Format("{0:HH:mm} horas", fechaFin.ToDateTime()), o.Prioridad, o.Tema, Nombrede, Nombrepara, "Tarea Actualizada"); - // //string mailbody = MailgetBodyActualizartarea(o.Folio, o.Link, o.Asunto, o.Descripcion, o.Fechai, o.Fechaf, o.Prioridad, o.Tema); - // EnviarCorreo(UsuarioActual.Empresa, o.AsuntoCorreo, mailbody, o.mailPara, ""); - // } - // else - // { - // objOI.RollBack(); - // Continuar = false; - // } - //} + Continuar= objOI.UpdateEventoMinuta(asunto, descripcion, TxtOrdendeldia.Text.Replace("< ", "<"), dfechaF, "-1", RCveEvento); + } + if (Continuar) + { + objOI.Commit(); + enviarConvocatoria(RCveEvento); + Alert("Convocatoria actualizada"); + } + else + { + objOI.RollBack(); + Continuar = false; + } + } } if (errorMessage.Length > 0) @@ -534,8 +493,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0]; ObjOI_E.IniciaTransacSQL(); Continuar = ObjOI_E.AddOI_Eventos2(OITipoEventos.Minuta, drow["Asunto"].ToString(), drow["descripcion"].ToString(), drow["Prioridad"].ToString().ToEntero(), drow["cveUsuarioDe"].ToString().ToEntero(), - drow["cveUsuarioPara"].ToString().ToEntero(), string.Format("{0:yyyy/MM/dd HH:mm}", drow["fechaInicio"]),string.Format("{0:yyyy/MM/dd HH:mm}", drow["fechaFin"]), drow["cveRevision"].ToString().ToEntero(), "", - LCveUsuarioCCP, new List(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CorreoExterno: drow["CorreoExterno"].ToString(), Lugar: drow["Lugar"].ToString(),CveEventoPadre:RCveEvento); + drow["cveUsuarioPara"].ToString().ToEntero(), string.Format("{0:yyyy/MM/dd HH:mm}", drow["fechaInicio"]), string.Format("{0:yyyy/MM/dd HH:mm}", drow["fechaFin"]), drow["cveRevision"].ToString().ToEntero(), "", + LCveUsuarioCCP, new List(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CorreoExterno: drow["CorreoExterno"].ToString(), Lugar: drow["Lugar"].ToString(), CveEventoPadre: RCveEvento); CveEvento = ObjOI_E.CveEvento; Folio = ObjOI_E.Folio; if (CveEvento == 0) @@ -557,13 +516,226 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas } if (Continuar) { - this.Alert("Se ha agregadó la nueva convocatoria", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/MinutaDetalle.aspx?CveEvento={0}\");", CveEvento)); - + CveEventoMinuta = CveEvento; + LnkOpenModalAsistencia.Visible = true; + UpAcciones.Update(); + this.Alert(string.Format("Se ha iniciado la minuta
    para ir a la minuta click aquí", CveEvento), ModExtensiones.TipoMensaje.ToastInformacion, "", 0); + LnkOpenModalAsistencia_Click(null,null); } } - protected void BtnReasignarTarea_Click(object sender, EventArgs e) + protected void LnkOpenModalAsistencia_Click(object sender, EventArgs e) + { + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + GvTomarAsistencia.DataSource = null; + if (ObjOI_E.GetEventosUsuario2(CveEventoMinuta, UsuarioActual.CveEmpresa)) { GvTomarAsistencia.DataSource = ObjOI_E.DtResultados; } + } + GvTomarAsistencia.DataBind(); + UpTomarASistencia.Update(); + RegistraScript(string.Format("$('#{0}').modal();", iddivTomarAsistencia)); + } + + protected void LnkUpAsistencia_Click(object sender, EventArgs e) { + List listaasistencia = new List(); + foreach (GridViewRow gvRow in GvTomarAsistencia.Rows) + { + if (gvRow.RowType == DataControlRowType.DataRow) + { + int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero(); + CheckBox ChkAsistio = gvRow.FCCheckBox("ChkAsistio"); + if (ChkAsistio.Checked) + { + listaasistencia.Add(CveUsuario); + } + } + } + bool continuar = false; + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + continuar = (ObjOI_E.UPMinutasAsistentes(CveEventoMinuta, UsuarioActual.CveEmpresa, TxtAsistentesExternos.Text, UsuarioActual.CveUsuario, listaasistencia)); + } + if (continuar) + { + if (CveEventoMinuta > 0) + { + Alert(string.Format("se ingresó la asistencia correctamente.
    para ir a la minuta click aquí", CveEventoMinuta)); + } + else + { + Alert("se ingresó la asistencia correctamente."); + + } + RegistraScript(string.Format("$('#{0}').modal('hide');", iddivTomarAsistencia)); + } + } + + protected void GvTomarAsistencia_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.CssClass = "items"; + } + } + + + private string GetDominio(string addstr = "") + { + return string.Format("{0}/{1}", HttpContext.Current.Request.Url.ToString().Replace(HttpContext.Current.Request.Url.PathAndQuery, ""), addstr); + } + private string MailgetBodyConvocatoria(int RCveEvento) + { + + int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue; + string UsuarioDe = ""; + string UsuarioPara = ""; + string UsuarioDeAbr = ""; + System.Data.DataTable dttareas; + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0) + { + System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0]; + UsuarioDe = drow["NombreRegistro"].ToString(); + Folio = drow["Folio"].ToString().ToEntero(); + Link = GetDominio(string.Format("OI/ConvocatoriaDetalle.aspx?CveEvento={0}", RCveEvento)); + Asunto = drow["Asunto"].ToString(); + Descripcion = drow["Descripcion"].ToString(); + Acuerdos = drow["Acuerdos"].ToString(); + DateTime.TryParse(drow["FechaInicio"].ToString(), out DFechai); + DateTime.TryParse(drow["FechaFin"].ToString(), out DFechaf); + //OIE.[CveEvento], OIE.[CveTipoEvento], OIE.[Folio], OIE.[Asunto], OIE.[Descripcion], OIE.[Prioridad], OIE.[CveUsuarioDe], OIE.[CveUsuarioPara], + //OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng], + //OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance] NombreRegistro + } + ObjOI_E.GetEventos2(-1, UsuarioActual.CveEmpresa, RCveEvento); + dttareas = ObjOI_E.DtResultados; + } + if (UsuarioDe != null) + { + string[] str = UsuarioDe.Split(' '); + if (str.Length > 0 && str[0].Length > 0) + { + UsuarioDeAbr = str[0].Substring(0, 1).ToUpper(); + } + if (str.Length > 1 && str[1].Length > 0) + { + UsuarioDeAbr = string.Format("{0}{1}", UsuarioDeAbr, str[1].Substring(0, 1).ToUpper()); + + } + } + string UsuariParaAbr = ""; + if (UsuarioPara != null) + { + string[] str = UsuarioPara.Split(' '); + if (str.Length > 0 && str[0].Length > 0) + { + UsuariParaAbr = str[0].Substring(0, 1).ToUpper(); + } + if (str.Length > 1 && str[1].Length > 0) + { + UsuariParaAbr = string.Format("{0}{1}", UsuariParaAbr, str[1].Substring(0, 1).ToUpper()); + + } + } + + StringBuilder StrMail = new StringBuilder(); + StrMail.Append(""); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    SIG Notificaciones
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append(" "); + StrMail.Append(" "); + StrMail.Append(" "); + StrMail.Append(" "); + StrMail.Append(" "); + StrMail.Append(" "); + StrMail.Append("
    "); + StrMail.Append(" Moderador:"); + StrMail.Append($" {UsuarioDeAbr}"); + StrMail.Append($" {UsuarioDe}
    "); + StrMail.Append(" Fecha:"); + StrMail.Append($" {DFechai: dd} de {DFechai: MMMM yyyy HH:mm}
    "); + StrMail.Append("
    "); + StrMail.Append(" Convocatoria "); + StrMail.Append(" "); + StrMail.Append(" "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append(""); + StrMail.Append("
    "); + StrMail.Append($" {Asunto}"); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append(" Folio:"); + StrMail.Append($" {Folio}"); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append($" {Descripcion}"); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append(" ORDEN DEL DÍA"); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append(Acuerdos); + StrMail.Append("
    "); + StrMail.Append("
    "); + + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append($" Minuta"); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append("
    "); + StrMail.Append(""); + return StrMail.ToString(); + } + private void enviarConvocatoria(int RCveEvento) + { + + string Body; + Body = MailgetBodyConvocatoria(RCveEvento); + string ArrayCC = ""; + //ViewState("Para") = GlobalDTUsuarios(CveUsuarioIng)(0)("correo").ToString; + //ViewState("Asunto") = string.Format("SIG - Minuta {0}", TxtAsunto.Text); + //ViewState("Body") = Body; + //System.Threading.Thread Hilo = new System.Threading.Thread(MandaCorreo); + //Hilo.Start(); + string abre = ""; + using (ClsOIEventos ObjOI_E = new ClsOIEventos()) + { + if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados != null && ObjOI_E.DtResultados.Rows.Count > 0) + { + foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Rows) + { + if (item["Correo"].ToString().Trim().Length > 0) + ArrayCC = string.Format("{0}{1}{2}", ArrayCC, abre, item["Correo"].ToString().Trim()); + abre = ";"; + } + } + } + List LSRutasMail = new List(); + ClsSisMail.ArchivoMail mailfile = new ClsSisMail.ArchivoMail { Ruta = string.Format("{0}Imagenes\\Bell.png", ModExtensiones.DirectorioBaseEmpresas), NombreArchivo = "Bell.png" }; + LSRutasMail.Add(mailfile); + ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail(); + + + ClsSisMail Mail = new ClsSisMail(); + Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString() + TxtCorreoExterno.Text, TxtAsunto.Text, Body, CCP: ArrayCC, Archivos: LSRutasMail); + } + protected void LnkEnviarCorreo_Click(object sender, EventArgs e) + { + enviarConvocatoria(RCveEvento); + Alert("Se Envió por correo la convocatoria", ModExtensiones.TipoMensaje.MsgInformacion); } } \ No newline at end of file diff --git a/OI/MinutaDetalle.aspx b/OI/MinutaDetalle.aspx index 63e0682ff..b0b1d6b1d 100644 --- a/OI/MinutaDetalle.aspx +++ b/OI/MinutaDetalle.aspx @@ -519,7 +519,7 @@
    - Agregar + Agregar
    @@ -528,12 +528,12 @@
    - +
    - +
    @@ -547,7 +547,7 @@
    - + <%----%> @@ -569,7 +569,7 @@ diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d1d61a0b7..b775018f3 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10,6 +10,7 @@ Imports System.Security.Cryptography.X509Certificates Imports System.Globalization Imports System.Net.Http Imports Newtonsoft.Json.Linq +Imports System.Diagnostics Partial Class Ventas Inherits ClsPaginas @@ -7011,11 +7012,18 @@ Partial Class Ventas 'End If 'Esquema viejo, evitamos que aparezca por surtir If ErrorList.Count = 0 Then + 'MARCAR VENTA ANTERIOR + If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then + ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") + End If + + 'MARCAR VENTA ANTERIOR If VentaSaldoAlmacenNC <> 0 OrElse DevolucionAlmacenNC = 2 Then If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") End If End If + End If End If End If @@ -10152,10 +10160,10 @@ Partial Class Ventas Exit For Else ViewState("SeGuardoPrePoliza") = True - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 2, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=importeMovimiento, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, CveIE:=CveIEAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then - ErrorPrepoliza = True - Exit For - End If + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, importeMovimiento, Referencia, 2, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=Dr("CveVenta").ToString().ToEntero(), CveCliente:=ObjFactura.CveCliente, ImporteMX:=importeMovimiento, ImporteME:=If(Dr("TCCambioValuacion").ToString().ToDecimal = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, CveIE:=CveIEAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=Dr("TCCambioValuacion").ToString().ToDecimal, TipoCambioPago:=tipoCambio) Then + ErrorPrepoliza = True + Exit For + End If 'se hace acreditamiento de impuestos 'IVA X TRASLADAR Dim EsAnticipoEspecial As Boolean = False @@ -10208,10 +10216,10 @@ Partial Class Ventas End If - End If - End If + End If + End If Next End If @@ -13289,7 +13297,7 @@ Partial Class Ventas End If Else - Alert("Se presento un error al cancelar el complemento.") + Alert("Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
    Origen del error: WebService www.sat.gob.mx", TipoMensaje.MsgError) End If ObjBanco.Dispose() @@ -16154,6 +16162,8 @@ Partial Class Ventas End If MovDetalle.Dispose() + + OcurrioError = Not GeneroMovimientoAlmacen End If End If @@ -16167,7 +16177,7 @@ Partial Class Ventas End If Next - OcurrioError = Not GeneroMovimientoAlmacen + End If End If @@ -16321,7 +16331,7 @@ Partial Class Ventas CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero() End If - If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CVeSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then + If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then ContadorMovtosDetalles += 1 Else OcurrioError = True @@ -17022,7 +17032,21 @@ Partial Class Ventas Dim TotalT As Decimal = TxtTotal.Text.ToDecimal Dim RFCReceptor As String = LblRFC.Text.Trim + + Dim SWatch As New Stopwatch + SWatch.Start() + Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) + + SWatch.Stop() + + Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000 + SegundosRespuesta = SegundosRespuesta.ToEntero + + If SegundosRespuesta >= 5 Then + Alert($"Los servicios de validacion del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastError, "") + End If + If Vigencia IsNot Nothing Then If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then @@ -17990,17 +18014,30 @@ Partial Class Ventas Private Function ValidaPagosContado() As Boolean Dim Retorno = False + Dim AmortizacionNC As Decimal = 0 + + 'SI ES AMORTIZACION POR NOTA DE CREDITO DEBE SUMAR LA TOTALIDAD PARA COMPARAR EL PAGO + If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then + For Each gvr As GridViewRow In GVAnticipos.Rows + If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then + AmortizacionNC += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal + End If + Next + End If + + Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0 + 'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then - If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then + If Not PermiteCredito AndAlso Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Retorno = True Return Retorno End If - If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then - Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then + Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC If TotalPago < TxtTotal.Text.ToDecimal Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) @@ -18013,15 +18050,15 @@ Partial Class Ventas 'SI TIENE SALDO PENDIENTE VALIDA SI TIENE PAGOS If Me.SaldoVenta > 0 Then - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso (UsuarioActual.Empresa.Funcionalidad(531) = "1") AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) And TxtTotal.Text.ToDecimal > 0 Then + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso (UsuarioActual.Empresa.Funcionalidad(531) = "1") AndAlso (Not PermiteCredito) AndAlso Not TienePagos And TxtTotal.Text.ToDecimal > 0 Then Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Retorno = True End If If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then - If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso TxtTotal.Text.ToDecimal > 0 Then - Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then + Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC If TotalPago < TxtTotal.Text.ToDecimal Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) @@ -18035,18 +18072,18 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(572) = "1" Then Dim TotalNC As Decimal = If(ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0, LblTotalNC.Text.Trim().ToDecimal(), 0) If TotalNC > 0 Then - If (DtPagos.SUM("Importe").ToString().ToDecimal + Total - TxtCambio.Text.ToDecimal) > TotalNC Then + If (DtPagos.SUM("Importe").ToString().ToDecimal() + AmortizacionNC + Total - TxtCambio.Text.ToDecimal) > TotalNC Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) Retorno = True End If Else - If (DtPagos.SUM("Importe").ToString().ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + If (DtPagos.SUM("Importe").ToString().ToDecimal() + AmortizacionNC + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) Retorno = True End If End If Else - If (DtPagos.SUM("Importe").ToString().ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + If (DtPagos.SUM("Importe").ToString().ToDecimal() + AmortizacionNC + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) Retorno = True End If @@ -19165,6 +19202,7 @@ Partial Class Ventas End If End If + ObjVentas.Dispose() End Sub Private Sub MostrarCondicionesCancelacion() @@ -19199,7 +19237,19 @@ Partial Class Ventas Dim TotalT As Decimal = TxtTotal.Text.ToDecimal Dim RFCReceptor As String = LblRFC.Text.Trim + Dim SWatch As New Stopwatch + SWatch.Start() Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) + + SWatch.Stop() + + Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000 + SegundosRespuesta = SegundosRespuesta.ToEntero + + If SegundosRespuesta >= 5 Then + Alert($"Los servicios de validacion del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "") + End If + If Vigencia IsNot Nothing Then If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then Alert("Esta factura no es cancelable.", TipoMensaje.MsgAdvertencia) @@ -19259,7 +19309,7 @@ Partial Class Ventas CancelacionAcuse = ObjCancelacion.CancelacionAcuse CveEstatus = 5 Else - Alert("La factura no se pudo cancelar ante el SAT", TipoMensaje.MsgError) + Alert("Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.
    Origen del error: WebService www.sat.gob.mx", TipoMensaje.MsgError) Exit Sub End If Else @@ -19379,6 +19429,8 @@ Partial Class Ventas Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing If ObjFacturaCancelacion IsNot Nothing AndAlso ObjFacturaCancelacion.CveVenta > 0 Then + Dim SWatch As New Stopwatch + SWatch.Start() If EsRefacturacion Then resp = ObjFacturaCancelacion.CancelarPorRefacturacion() @@ -19397,16 +19449,25 @@ Partial Class Ventas resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar) End If + SWatch.Stop() + + Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000 + SegundosRespuesta = SegundosRespuesta.ToEntero + + If SegundosRespuesta >= 5 Then + Alert($"Los servicios de cancelación del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "") + End If + If resp.CveEstatus = 5 AndAlso Not EsRefacturacion Then Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnEnviarMailCancelacion();", TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") Else If EsRefacturacion Then If resp.CveEstatus = 20 Then ObjFacturaCancelacion.Dispose() - Response.Redirect($"/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={CveVenta}") + Server.Transfer($"/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={CveVenta}") ElseIf resp.CveEstatus.Contiene(4, 5) Then ObjFacturaCancelacion.Dispose() - Response.Redirect($"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1") + Server.Transfer($"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1") Else Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();") End If