From 52c1f890d47d05e4e2e4b9af974ce4d4c270f22f Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 22 Sep 2020 18:38:55 -0700 Subject: [PATCH] =?UTF-8?q?154.Solicitudes=20de=20traspaso=20correcto=20no?= =?UTF-8?q?tificaci=C3=B3n=20rechazo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RepMovimientosAuxiliaresCatalogo.aspx.vb | 10 +- Inventarios/TrasladoSolicitud.aspx | 48 ++++++++- Inventarios/TrasladoSolicitud.aspx.vb | 99 ++++++++++++++++--- 3 files changed, 137 insertions(+), 20 deletions(-) diff --git a/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb b/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb index 6d168533d..77d5c0459 100644 --- a/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb +++ b/Contabilidad2/RepMovimientosAuxiliaresCatalogo.aspx.vb @@ -130,11 +130,11 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo TxtFechaDel.Text = FechaInicio.ToShortDateString End If - 'If Request("CveSubProyecto") IsNot Nothing Then - ' If IsNumeric(Request("CveSubProyecto")) Then - ' CveSubProyecto = Request("CveSubProyecto").ToString - ' End If - 'End If + If Request("CveSubProyecto") IsNot Nothing Then + If IsNumeric(Request("CveSubProyecto")) Then + DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto").ToString) + End If + End If ErrorParametros = False diff --git a/Inventarios/TrasladoSolicitud.aspx b/Inventarios/TrasladoSolicitud.aspx index a210fbb38..5e5b351c2 100644 --- a/Inventarios/TrasladoSolicitud.aspx +++ b/Inventarios/TrasladoSolicitud.aspx @@ -259,8 +259,7 @@ data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar autorización?" data-btn-ok-label="Si" OnClick="LnkAceptarTraslado_Click">
- +
@@ -500,6 +499,51 @@ + + + + diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb index 85eec4810..13286849f 100644 --- a/Inventarios/TrasladoSolicitud.aspx.vb +++ b/Inventarios/TrasladoSolicitud.aspx.vb @@ -36,19 +36,19 @@ Partial Class Inventarios_TrasladoSolicitud ViewState("CveDireccionEnvio") = value End Set End Property - 'Private Property CveUsuarioAutoriza As Integer - ' Get - ' If ViewState("CveUsuarioAutoriza") Is Nothing Then - ' Return -1 - ' Else - ' Return CType(ViewState("CveUsuarioAutoriza"), Integer) - ' End If + Private Property CveUsuarioSolicita As Integer + Get + If ViewState("CveUsuarioSolicita") Is Nothing Then + Return -1 + Else + Return CType(ViewState("CveUsuarioSolicita"), Integer) + End If - ' End Get - ' Set(value As Integer) - ' ViewState("CveUsuarioAutoriza") = value - ' End Set - 'End Property + End Get + Set(value As Integer) + ViewState("CveUsuarioSolicita") = value + End Set + End Property #End Region @@ -178,6 +178,8 @@ Partial Class Inventarios_TrasladoSolicitud HplContrato.Text = ObjInventarios.DtResultados.Rows(0)("DescripcionContrato").ToString HplContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={ObjInventarios.DtResultados.Rows(0)("CveContrato").ToString.ToEntero}" + CveUsuarioSolicita = ObjInventarios.DtResultados.Rows(0)("CveUsuario").ToString.ToEntero + '25/04/2018 CveDireccionEnvio = ObjInventarios.DtResultados.Rows(0)("CveDireccionEnvio").ToString.ToEntero If CveDireccionEnvio > 0 And ObjClientes.DireccionEnvioGet(CveDireccionEnvio, -1, -1) Then @@ -994,15 +996,85 @@ Partial Class Inventarios_TrasladoSolicitud CargaDatos() End Sub + Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs) + TxtMotivoRechazo.Text = "" + UpModalRechazo.Update() + RegistraScript("$('#ModalRechazarTraslado').modal();") + + End Sub + + + Protected Sub BtnModalRechazo_Click(sender As Object, e As EventArgs) + RechazarTraslado() + End Sub + + Private Sub RechazarTraslado() + + Dim ErrorProceso As Boolean = False + + If TxtMotivoRechazo.Text.Trim.Length.ToEntero = 0 Then + Alert("El motivo de rechazo es necesario", TipoMensaje.MsgAdvertencia) + End If + + Dim ObjInven As New ClsInventarios + If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then Alert("Rechazado correctamente.") + ErrorProceso = False + Else + ErrorProceso = True End If + ObjInven.Dispose() - CargaDatos() + If Not ErrorProceso Then + MandaCorreoRechazo(LbFolio.Text.ToEntero, CveTraspasoSolicitud, CveUsuarioSolicita, TxtMotivoRechazo.Text) + CargaDatos() + RegistraScript("$('#ModalRechazarTraslado').modal('hide');") + End If + + End Sub + + + Private Sub MandaCorreoRechazo(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioSolicita As Integer, MotivoRechazo As String) + + Dim SB As New StringBuilder + + Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioSolicita)(0)("Correo").ToString.Trim + + + If CorreoDestino.Length > 0 Then + + + SB.AppendLine($"

Se ha rechazado la solicitud de traspaso con folio {Folio}, el traspaso fue rechazado por el usuario {UsuarioActual.Nombre }, el traspaso fue rechazado por el motivo: {MotivoRechazo}

") + + + + SB.AppendLine("
") + SB.AppendLine("") + SB.AppendLine("") + + For Each GvRow As GridViewRow In GvDatos.Rows + + If GvRow.RowType = DataControlRowType.DataRow Then + SB.AppendLine($"") + End If + + Next + SB.AppendLine("
Cantidad U.M. Producto Observaciones
{GvRow.DataKey("Cantidad")} {GvRow.DataKey("UnidadMedida")} {GvRow.DataKey("CodigoPS")} {GvRow.DataKey("Observaciones")}
") + SB.AppendLine("
") + + SB.AppendLine($" Ir a solicitud de traspaso folio {Folio}") + + + + Dim MandaCorre As New ClsSisMail + MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Rechazo de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Rechazo de Traspaso") + + End If End Sub @@ -1057,5 +1129,6 @@ Partial Class Inventarios_TrasladoSolicitud Next GvDatos.Columns(5).Visible = Mostrar End Sub + End Class