diff --git a/AF/CatCheckList.aspx b/AF/CatCheckList.aspx new file mode 100644 index 000000000..790db7f2a --- /dev/null +++ b/AF/CatCheckList.aspx @@ -0,0 +1,74 @@ +<%@ Page Title="AF - Catálogo de CheckList" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatCheckList.aspx.cs" Inherits="AF_CatCheckList" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de CheckList + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatCheckList.aspx.cs b/AF/CatCheckList.aspx.cs new file mode 100644 index 000000000..d488bf25c --- /dev/null +++ b/AF/CatCheckList.aspx.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatCheckList : ClsPaginas +{ + private int CveCheckList + { + get + { + return ViewState["CveCheckList"].ToString().ToEntero(); + } + + set + { + ViewState["CveCheckList"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetCheckList(-1, -1, -1)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + DdlTipoServicio.Items.Clear(); + if (ObjAF.GetTiposServicios(-1,-1,-1,UsuarioActual.CveEmpresa)) + { + DdlTipoServicio.DataSource = ObjAF.DtResultados; + DdlTipoServicio.DataBind(); + DdlTipoServicio.Items.Insert(0, new ListItem("Seleccione","-1")); + } + + DdlCheckListActividad.Items.Clear(); + if (ObjAF.GetCheckListActividad(-1, -1)) + { + DdlCheckListActividad.DataSource = ObjAF.DtResultados; + DdlCheckListActividad.DataBind(); + DdlCheckListActividad.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + + ObjAF.Dispose(); + } + + protected void BtnAgregarCheckListD_Click(object sender, EventArgs e) + { + BtnAgregarCheckList.Text = "Agregar"; + DdlTipoServicio.SelectedValueExist(-1); + DdlCheckListActividad.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarCheckList.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckList = GvRow.DataKey("CveCheckList").ToEntero(); + DdlTipoServicio.SelectedValueExist(GvRow.DataKey("CveTipoServicio")); + DdlCheckListActividad.SelectedValueExist(GvRow.DataKey("CveCheckListActividad")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckList = GvRow.DataKey("CveCheckList").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteCheckList(CveCheckList)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se eliminó el CheckList correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarCheckList_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarCheckList.Text == "Agregar") + { + if (ObjAF.AddCheckList(DdlTipoServicio.SelectedValue.ToEntero(), DdlCheckListActividad.SelectedValue.ToEntero())) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se agregó el CheckList correctamente"); + } + } + else + { + if (ObjAF.UpdateCheckList(CveCheckList, DdlTipoServicio.SelectedValue.ToEntero(), DdlCheckListActividad.SelectedValue.ToEntero())) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se actualizó el CheckList correctamente"); + } + } + ObjAF.Dispose(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + } +} \ No newline at end of file diff --git a/AF/CatCheckListActividades.aspx b/AF/CatCheckListActividades.aspx new file mode 100644 index 000000000..e4179f25a --- /dev/null +++ b/AF/CatCheckListActividades.aspx @@ -0,0 +1,76 @@ +<%@ Page Title="AF - Catálogo de Actividades de CheckList" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatCheckListActividades.aspx.cs" Inherits="AF_CatCheckListActividades" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Actividades de CheckList + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatCheckListActividades.aspx.cs b/AF/CatCheckListActividades.aspx.cs new file mode 100644 index 000000000..f21d58f7a --- /dev/null +++ b/AF/CatCheckListActividades.aspx.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatCheckListActividades : ClsPaginas +{ + private int CveCheckListActividad + { + get + { + return ViewState["CveCheckListActividad"].ToString().ToEntero(); + } + + set + { + ViewState["CveCheckListActividad"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetCheckListActividad(-1, -1)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + if (ObjAF.GetCheckListActividadGrupo(-1)) + { + DdlCheckListActividadGrupo.DataSource = ObjAF.DtResultados; + DdlCheckListActividadGrupo.DataBind(); + DdlCheckListActividadGrupo.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarActividadCheckListD_Click(object sender, EventArgs e) + { + BtnAgregarActividadCheckList.Text = "Agregar"; + TxtCheckListActividad.Text = ""; + DdlCheckListActividadGrupo.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarActividadCheckList.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckListActividad = GvRow.DataKey("CveCheckListActividad").ToEntero(); + TxtCheckListActividad.Text = GvRow.DataKey("CheckListActividad"); + DdlCheckListActividadGrupo.SelectedValueExist(GvRow.DataKey("CveCheckListActividadGrupo")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveCheckListActividad = GvRow.DataKey("CveCheckListActividad").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteCheckListActividad(CveCheckListActividad)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + Alert("Se eliminó la Actividad de CheckList correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarActividadCheckList_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarActividadCheckList.Text == "Agregar") + { + if (ObjAF.AddCheckListActividad(TxtCheckListActividad.Text, DdlCheckListActividadGrupo.SelectedValue.ToEntero())) + { + Alert("Se agregó la Actividad de CheckList correctamente"); + } + } + else + { + if (ObjAF.UpdateCheckListActividad(CveCheckListActividad, TxtCheckListActividad.Text, DdlCheckListActividadGrupo.SelectedValue.ToEntero())) + { + Alert("Se actualizó la Actividad de CheckList correctamente"); + } + } + ObjAF.Dispose(); + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD")); + } +} \ No newline at end of file diff --git a/AF/TipoOrdenTrabajo.aspx b/AF/TipoOrdenTrabajo.aspx index e6ebb33b7..907178821 100644 --- a/AF/TipoOrdenTrabajo.aspx +++ b/AF/TipoOrdenTrabajo.aspx @@ -39,15 +39,21 @@ - - - - - Registro Revisión + Tipo Servicio + + + +
  • + +
  • +
    +
    + +
    @@ -90,9 +96,7 @@
    - - @@ -100,13 +104,13 @@
    -
    - +<%--
    + -
    +
    --%> @@ -125,28 +129,43 @@ - +
    - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
    @@ -156,49 +175,73 @@
    -
    +
    - - + + - - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + + +
    - +
    - - + + + + - - - - - - + + + + + + - - + + + + + + + +
    @@ -209,13 +252,60 @@ - - - - - - + + + @@ -262,13 +352,14 @@
    +
    - + diff --git a/AF/TipoOrdenTrabajo.aspx.vb b/AF/TipoOrdenTrabajo.aspx.vb index 71b84d52f..f559d1da8 100644 --- a/AF/TipoOrdenTrabajo.aspx.vb +++ b/AF/TipoOrdenTrabajo.aspx.vb @@ -12,20 +12,59 @@ Partial Class AF_TipoOrdenTrabajo #Region " PROPIEDADES" - Property CveOrdenTrabajo As Integer + Property CveTipoServicio As Integer Get - If ViewState("CveOrdenTrabajo") Is Nothing Then + If ViewState("CveTipoServicio") Is Nothing Then Return -1 Else - Return ViewState("CveOrdenTrabajo").ToString.ToEntero + Return ViewState("CveTipoServicio").ToString.ToEntero End If End Get Set(value As Integer) - ViewState("CveOrdenTrabajo") = value + ViewState("CveTipoServicio") = value + End Set + End Property + + Property DTMateriales As DataTable + Get + If ViewState("DTMateriales") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTMateriales"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTMateriales") = value End Set End Property + Property DTActividades As DataTable + Get + If ViewState("DTActividades") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTActividades"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTActividades") = value + End Set + End Property + + + Property DTACheckList As DataTable + Get + If ViewState("DTACheckList") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTACheckList"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTACheckList") = value + End Set + End Property #End Region @@ -34,8 +73,12 @@ Partial Class AF_TipoOrdenTrabajo If Not Page.IsPostBack Then - If Request("CveOrdenTrabajo") IsNot Nothing Then - CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero + If Request("CveTipoServicio") IsNot Nothing Then + CveTipoServicio = Request("CveTipoServicio").ToEntero + End If + + If CveTipoServicio = -1 Then + CrearTablas() End If CargaCombos() @@ -43,11 +86,57 @@ Partial Class AF_TipoOrdenTrabajo End Sub + + Property IndexMaterial As Integer + Get + If ViewState("IndexMaterial") Is Nothing Then + Return -1 + Else + Return ViewState("IndexMaterial").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("IndexMaterial") = value + End Set + End Property + + + + Property IndexActividades As Integer + Get + If ViewState("IndexActividades") Is Nothing Then + Return -1 + Else + Return ViewState("IndexActividades").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("IndexActividades") = value + End Set + End Property + + Property IndexCheckList As Integer + Get + If ViewState("IndexCheckList") Is Nothing Then + Return -1 + Else + Return ViewState("IndexCheckList").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("IndexCheckList") = value + End Set + End Property + + + + #Region " CARGA PARAMETROS " #End Region #Region " CARGA COMBOS " + Protected Sub CargaCombos() Dim ObjAF As New ClsAF @@ -65,6 +154,52 @@ Partial Class AF_TipoOrdenTrabajo UpFiltro.Update() + DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + + + If CveTipoServicio <= 0 Then + CargaActividades() + + End If + + End Sub + + + + + +#End Region + +#Region "CREAR TABLAS" + + Private Sub CrearTablas() + 'CveTipoServicioMaterial CveTipoServicio Cantidad CveUM CvePS Tipo + + Dim DtTempMaterial As New DataTable + Dim DtTempActividades As New DataTable + + DtTempMaterial.Columns.Add("CveTipoServicioMaterial", GetType(Integer)) + DtTempMaterial.Columns.Add("CveTipoServicio", GetType(Integer)) + DtTempMaterial.Columns.Add("Cantidad", GetType(Decimal)) + DtTempMaterial.Columns.Add("CveUM", GetType(Integer)) + DtTempMaterial.Columns.Add("CvePS", GetType(Integer)) + DtTempMaterial.Columns.Add("Tipo", GetType(Integer)) + DtTempMaterial.Columns.Add("PS", GetType(String)) + DtTempMaterial.Columns.Add("Abreviatura", GetType(String)) + DtTempMaterial.AcceptChanges() + + DTMateriales = DtTempMaterial + + + 'CveTipoServicioActividad CveActividad Duracion Observaciones + + DtTempActividades.Columns.Add("CveTipoServicioActividad", GetType(String)) + DtTempActividades.Columns.Add("CveActividad", GetType(String)) + DtTempActividades.Columns.Add("Duracion", GetType(Decimal)) + DtTempActividades.Columns.Add("Observaciones", GetType(String)) + DtTempActividades.AcceptChanges() + + DTActividades = DtTempActividades End Sub @@ -72,6 +207,7 @@ Partial Class AF_TipoOrdenTrabajo #End Region + #Region " CARGA DATOS " 'Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) ' CargaDatos() @@ -85,6 +221,61 @@ Partial Class AF_TipoOrdenTrabajo Private Sub CargaDatos() + CargaMateriales() + CargaActividades() + CargaCheckList() + + End Sub + + Private Sub CargaMateriales() + + If CveTipoServicio > 0 Then + + Dim ObjAF As New ClsAF + + If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio) Then + GvMaterial.DataSource = DTMateriales + + Else + GvMaterial = Nothing + End If + + ObjAF.Dispose() + + GvMaterial.DataBind() + Else + GvMaterial.DataSource = DTMateriales + GvMaterial.DataBind() + End If + + UpGvMaterial.Update() + + End Sub + + Private Sub CargaActividades() + + Dim ObjAF As New ClsAF + + If CveTipoServicio <= 0 Then + + If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then + GvActividades.DataSource = ObjAF.DtResultados + Else + GvActividades.DataSource = Nothing + End If + + End If + + ObjAF.Dispose() + + GvActividades.DataBind() + + UpGvActividades.Update() + + End Sub + + Private Sub CargaCheckList() + Dim ObjAF As New ClsAF @@ -94,7 +285,6 @@ Partial Class AF_TipoOrdenTrabajo End Sub - Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then @@ -110,9 +300,6 @@ Partial Class AF_TipoOrdenTrabajo - Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) - - End Sub @@ -277,4 +464,154 @@ Partial Class AF_TipoOrdenTrabajo + Protected Sub LnkAgregarMaterial_Click(sender As Object, e As EventArgs) + + RegistraScript("$('#ModalMateriales').modal('show');") + ResetModalMaterial() + End Sub + + Private Sub ResetModalMaterial() + + DdlPS.txtValue.Value = "" + DdlPS.txtText.Value = "" + TxtCantidad.Text = "" + + UpModalMaterialesBody.Update() + + End Sub + + + + + Protected Sub BtnGuardarMaterial_Click(sender As Object, e As EventArgs) + + If DdlPS.txtValue.Value.ToString.ToEntero <= 0 Then + Alert("Debe seleccionar un producto o servicio", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim CveUnidadMedida As Integer = -1 + Dim CvePS As Integer = DdlPS.txtValue.Value.ToEntero + Dim Tipo As Integer = -1 + Dim UMAbreviatura As String = "" + + Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") + CveUnidadMedida = drPS("CveUM").ToString.ToEntero + Tipo = drPS("CveTipoPS").ToString.ToEntero + UMAbreviatura = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Abreviatura", $"CveUnidadMedida = {CveUnidadMedida}") + + If CveTipoServicio > 0 Then + + Dim ObjAF As New ClsAF + + If ObjAF.AddTiposServiciosMaterial(CveTipoServicio, TxtCantidad.Text.ToDecimal, CveUnidadMedida, CvePS, Tipo) Then + Alert("Material agregado correctamente") + End If + + ObjAF.Dispose() + + Else + + Dim nRow As DataRow = DTMateriales.NewRow + + nRow("CveTipoServicioMaterial") = -1 + nRow("CveTipoServicio") = -1 + nRow("Cantidad") = TxtCantidad.Text.ToEntero + nRow("CveUM") = CveUnidadMedida + nRow("CvePS") = DdlPS.txtValue.Value.ToEntero + nRow("Tipo") = Tipo + nRow("Abreviatura") = UMAbreviatura + nRow("PS") = DdlPS.txtText.Value + + DTMateriales.Rows.Add(nRow) + Alert("Material agregado correctamente") + + End If + + CargaMateriales() + + ResetModalMaterial() + + RegistraScript("$('#ModalMateriales').modal('hide');") + + End Sub + + Protected Sub LnkEliminarMaterial_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow) + If CveTipoServicio > 0 Then + + + Dim CveTipoServicioMaterial As Integer = GvRow.DataKey("CveTipoServicioMaterial").ToEntero + + Dim ObjAF As New ClsAF + If ObjAF.DeleteTiposServiciosMaterial(CveTipoServicioMaterial, UsuarioActual.CveEmpresa) Then + Alert("Material agregado correctamente") + End If + ObjAF.Dispose() + Else + + + Dim dr As DataRow = DTMateriales.Rows(GvRow.RowIndex) + dr.Delete() + DTMateriales.AcceptChanges() + Alert("Material agregado correctamente") + End If + + CargaMateriales() + + End Sub + + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + + Dim ObjAF As New ClsAF + Dim ErrorProceso As Boolean = False + Dim SBError As New StringBuilder + + ObjAF.IniciaTransacSQL() + + 'validacion? + + + + If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + + CveTipoServicio = ObjAF.CveTipoServicio + + For Each GvRow As GridViewRow In GvMaterial.Rows + + If Not ObjAF.AddTiposServiciosMaterial(CveTipoServicio, GvRow.DataKey("Cantidad").ToDecimal, GvRow.DataKey("CveUM").ToEntero, GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("Tipo").ToEntero) Then + ErrorProceso = True + Exit For + End If + + Next + + For Each GvRow As GridViewRow In GvActividades.Rows + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim Horas As Decimal = GvRow.FCTextBox("").Text.ToDecimal + + + If ObjAF.AddTiposServiciosActividades(GvRow.DataKey("").ToEntero) Then + + Next + + + End If + + + If ErrorProceso Then + ObjAF.RollBack() + Else + ObjAF.Commit() + Alert("Tipo servicio guardado correctamente.", TipoMensaje.MsgInformacion) + End If + + + ObjAF.Dispose() + + End Sub + End Class diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index c8f341270..c66beb356 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -89,10 +89,12 @@ Public Class ClsAF Public Property CveGrupoAF As Integer Public Property CveAFPadre As Integer Public Property CveDispositivo As Integer - Public Property MedidaVehicular As Integer - + Public Property MedidaVehicular As Integer + Public Property CveTipoServicio As Integer + + #End Region - + Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) If TransaccionCompartida Is Nothing Then @@ -3502,7 +3504,7 @@ Public Class ClsAF Public Function AddTiposServicios(Nombre As String, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False - + CveTipoServicio = -1 DataAdapter("PA_AF_TiposServicioAdd") With SqlAdapter.SelectCommand.Parameters @@ -3510,10 +3512,16 @@ Public Class ClsAF .Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveTipoServicio", SqlDbType.Int).Direction = ParameterDirection.Output + + End With Try SqlAdapter.Fill(Data) + + CveTipoServicio = SqlAdapter.SelectCommand.Parameters("@CveTipoServicio").Value.ToString.ToEntero + Retorno = True Catch ex As Exception OnError("Ocurrió un error al agregar los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) @@ -3715,13 +3723,15 @@ Public Class ClsAF Return Retorno End Function - Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer) As Boolean + Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosMaterialDelete") With SqlAdapter.SelectCommand.Parameters .Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try @@ -3995,6 +4005,167 @@ Public Class ClsAF Return Retorno End Function + Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddCheckListActividad(CheckListActividad As String, CveCheckListActividadGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CheckListActividad", SqlDbType.NVarChar).Value = CheckListActividad + .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateCheckListActividad(CveCheckListActividad As Integer, CheckListActividad As String, CveCheckListActividadGrupo As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + .Add("@CheckListActividad", SqlDbType.NVarChar).Value = CheckListActividad + .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function DeleteCheckListActividad(CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListActividadDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddCheckList(CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function DeleteCheckList(CveCheckList As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_CheckListDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #End Region diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 7532b38b7..388666a47 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -1785,6 +1785,27 @@ Public Class ClsCompProveedores End Function + Public Function GetContratoProvedores(CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_ContratosProveedoresGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al Obtener los contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -1812,7 +1833,7 @@ Public Class ClsCompProveedores - Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean Dim Retorno As Boolean = False @@ -1822,6 +1843,7 @@ Public Class ClsCompProveedores .Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor End With Try diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index 878dbc95b..b06f629cf 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -458,7 +458,8 @@ Public Class ClsEdocumentacion Return Retorno End Function - Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1) As Boolean + Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional CveTipoContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionElectronicaAuditoriaGet") @@ -471,6 +472,8 @@ Public Class ClsEdocumentacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Modulo", SqlDbType.Int).Value = Modulo .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato End With Try diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index 4a1cd26ba..b12725805 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1729,9 +1729,11 @@ Public Class ClsOC 'End Function #End Region - Public Function GetOrdenesCompraRep(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveEstatus As Integer, - FechaInicio As Date, FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", Optional CveActivoFijo As Integer = -1, - Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean + Public Function GetOrdenesCompraRep(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveEstatus As Integer, FechaInicio As Date, + FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, + CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", + Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, + Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraRep") @@ -1757,6 +1759,8 @@ Public Class ClsOC .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@SoloSubProyectosConPermiso", SqlDbType.Bit).Value = SoloSubProyectosConPermiso .Add("@CveUsuarioAutorizo", SqlDbType.Int).Value = CveUsuarioAutorizo + .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado + .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With @@ -1863,7 +1867,7 @@ Public Class ClsOC End Function Public Function GetOrdenesPendientes(pTipo As String, pTipoBusqueda As Integer, pCveEmpresa As Integer, pCveProyecto As Integer, pCveSubProyecto As Integer, pCveEstatusCompra As Integer, - pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False) As Boolean + pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraPendientes") @@ -1878,6 +1882,8 @@ Public Class ClsOC .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@TipoBusqueda", SqlDbType.Int).Value = pTipoBusqueda .Add("@SoloSubProyectosConPermiso", SqlDbType.Bit).Value = SoloSubProyectosConPermiso + .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado + .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ddee3fb68..1e93bc42a 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3958,6 +3958,8 @@ Public Class ClsPaginas PaginaDict.Add("/AF/CatActividades.aspx".ToUpper(), 768) PaginaDict.Add("/AF/CatCheckListActividadesGrupos.aspx".ToUpper(), 769) PaginaDict.Add("/AF/CatCheckListTipo.aspx".ToUpper(), 770) + PaginaDict.Add("/AF/CatCheckListActividades.aspx".ToUpper(), 771) + PaginaDict.Add("/AF/CatCheckList.aspx".ToUpper(), 772) PaginaDict.Add("/AF/TipoOrdenTrabajo.aspx".ToUpper(), -1) PaginaDict.Add("/AF/OrdenTrabajo.aspx".ToUpper(), -1) diff --git a/App_Code/DtDatos.xsd b/App_Code/DtDatos.xsd index f4839bec3..f64700eb6 100644 --- a/App_Code/DtDatos.xsd +++ b/App_Code/DtDatos.xsd @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -235,12 +235,12 @@ - + - + @@ -256,7 +256,7 @@ - + diff --git a/App_Code/DtDatos.xss b/App_Code/DtDatos.xss index 3d21fe6c6..e0a664890 100644 --- a/App_Code/DtDatos.xss +++ b/App_Code/DtDatos.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -16,7 +16,7 @@ - + diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index a58e8d78b..2fc14f0ad 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -467,6 +467,7 @@ + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 51c1fb889..a28d0e56b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2986,10 +2986,17 @@ Partial Class Compras_Compras 'ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2)") 'solo muestra tipo material y herramientas 'ddlAlmacen.DataBind() - ddlAlmacenAdd.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") 'solo muestra tipo material y herramientas - ddlAlmacenAdd.DataBind() + Dim DtAlmacenes = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") - DdlAlmacenDevolucion.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") 'solo muestra tipo material y herramientas + If DdlTipoCompra.SelectedValue = "10" Then + ddlAlmacenAdd.DataSource = DtAlmacenes.FiltraParametros("Modalidad = 0") + DdlAlmacenDevolucion.DataSource = DtAlmacenes.FiltraParametros("Modalidad = 0") + Else + ddlAlmacenAdd.DataSource = DtAlmacenes + DdlAlmacenDevolucion.DataSource = DtAlmacenes + End If + + ddlAlmacenAdd.DataBind() DdlAlmacenDevolucion.DataBind() DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -6411,6 +6418,13 @@ Partial Class Compras_Compras idCuentaContabilizacion = 0 End If + 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 + If DdlTipoCompra.SelectedValue = "10" Then + SeContabiliza = False + IdCtaContable = 0 + CveCuenta = 0 + End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If @@ -6611,6 +6625,13 @@ Partial Class Compras_Compras idCuentaContabilizacion = 0 End If + 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 + If DdlTipoCompra.SelectedValue = "10" AndAlso ConceptoContabilizacionNC = 68 Then + SeContabiliza = False + IdCtaContable = 0 + CveCuenta = 0 + End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If @@ -10117,9 +10138,18 @@ Partial Class Compras_Compras End If End If If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta) Then + Dim SeContabiliza As Boolean = True + 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 + If DdlTipoCompra.SelectedValue = "10" Then + SeContabiliza = False + IdCtaContable = 0 + CveCuenta = 0 + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If + End If Next End If @@ -11589,6 +11619,10 @@ Partial Class Compras_Compras StrAlmacenes = "CveTipoAlmacen IN (21)" End If + If DdlTipoCompra.SelectedValue.ToEntero = 10 Then + StrAlmacenes = $"Modalidad = 0" + End If + e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlAlmacen").DataBind() @@ -18715,7 +18749,12 @@ Partial Class Compras_Compras If CveCuenta = 0 Then CuentasContablesInvalidasSIG.Append("
    " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString) End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 68, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveMovimientoAlmacen:=Row("CveMovimiento").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(TipoCambioActual = 1, 0, ImporteMovimiento), CveCuenta:=Row("CveCuenta").ToString.ToEntero) Then + Dim SeContabiliza As Boolean = True + 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68 + If DdlTipoCompra.SelectedValue = "10" Then + SeContabiliza = False + End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 68, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveMovimientoAlmacen:=Row("CveMovimiento").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(TipoCambioActual = 1, 0, ImporteMovimiento), CveCuenta:=Row("CveCuenta").ToString.ToEntero, Contabilizable:=SeContabiliza) Then TieneError = True Exit For End If @@ -19625,7 +19664,7 @@ Partial Class Compras_Compras Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs) - If DdlTipoCompra.SelectedValue.ToEntero = 9 Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada + If DdlTipoCompra.SelectedValue.ToEntero.Contiene(9, 10) Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada CargaGvInv() End If diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index c1496d8c6..7cd807988 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -604,11 +604,11 @@
    --%> -
    +
    - Representastes Legales + Representantes Legales
    diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx index f4f0139f4..14fed4ef1 100644 --- a/Compras/RepDocumentacionProveedor.aspx +++ b/Compras/RepDocumentacionProveedor.aspx @@ -94,7 +94,32 @@
    -
    +
    + + + +
    +
    + +
    +
    + + Todos + +
    + +
    Perfil:
    +
    + + Todos + +
    + + + +
    +
    +
    @@ -125,7 +150,10 @@ - + + + + diff --git a/Compras/RepDocumentacionProveedor.aspx.vb b/Compras/RepDocumentacionProveedor.aspx.vb index 5a05ce29e..5e8e053ac 100644 --- a/Compras/RepDocumentacionProveedor.aspx.vb +++ b/Compras/RepDocumentacionProveedor.aspx.vb @@ -212,8 +212,20 @@ Partial Class Proveedores_RepDocumentacionProveedor DdlProveedores.setEsWebService(True) DdlProveedores.Attributes.Add("data-metodo", "getproveedores") DdlProveedores.SelectedText = "Todos" - DdlProveedores.SelectedValue = "-1" - + DdlProveedores.SelectedValue = "-1" + + CargarCentrosDeCosto(Nothing, DdlSubProyectoFiltro, Nothing, LblSubProyectoFiltro) + + Dim ObjProveedor As New ClsCompProveedores + + If ObjProveedor.GetTiposContratos(-1, UsuarioActual.CveEmpresa, 1) Then + DdlTipoContratoFiltro.DataSource = ObjProveedor.DtResultados + End If + ObjProveedor.Dispose() + + DdlTipoContratoFiltro.DataBind() + DdlTipoContratoFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub @@ -247,7 +259,7 @@ Partial Class Proveedores_RepDocumentacionProveedor Dim obEDoc As New ClsEdocumentacion - If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then + If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero, DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlTipoContratoFiltro.SelectedValue.ToEntero) Then GvDocumentos.DataSource = obEDoc.DtResultados Else GvDocumentos.DataSource = Nothing @@ -269,6 +281,10 @@ Partial Class Proveedores_RepDocumentacionProveedor Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + If e.Row.RowType = DataControlRowType.Header Then + e.Row.FCLabel("LblSubProyecto").Text = LblSubProyectoFiltro.Text + End If + If e.Row.RowType = DataControlRowType.DataRow Then Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString diff --git a/Edoc/CatDocumentosContratos.aspx b/Edoc/CatDocumentosContratos.aspx index 96906ac70..357a66069 100644 --- a/Edoc/CatDocumentosContratos.aspx +++ b/Edoc/CatDocumentosContratos.aspx @@ -27,34 +27,36 @@ - - -
    - - - - - - - - - - - - - - - - - - - - - - +
    +
    + + -
    + + + + + + + + + + + + + + + + + + + + +
    +
    + + diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx index ff3e1493a..9fa61d2e9 100644 --- a/Edoc/CatTipoContratos.aspx +++ b/Edoc/CatTipoContratos.aspx @@ -30,7 +30,7 @@
    + ToolTip="Listado de Genero" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" > diff --git a/Edoc/Contratos.aspx b/Edoc/Contratos.aspx index bc9e9b3c4..ca690e7c6 100644 --- a/Edoc/Contratos.aspx +++ b/Edoc/Contratos.aspx @@ -16,22 +16,92 @@
  • +
  • + PDF +
  • +
  • + Excel +
  • + + + + - + + + + +
    +
    + +
    + + "> + +
    +
    +
    + + +
    +
    + + Todos + +
    + +
    Proveedor:
    +
    + + +
    + +
    Tipo Contrato:
    +
    + + Todos + +
    + +
    +
    +
    + <%--
    +
    + +
    Estatus:
    +
    + + + Todos + Vigente + Rescindido + Suspendido + Terminado + + +
    +
    +
    --%> + +
    + + + -
    - + @@ -40,7 +110,10 @@ - + + + + @@ -121,7 +194,7 @@
    - + @@ -137,7 +210,7 @@
    -
    + Sub Proyecto:
    @@ -147,7 +220,7 @@
    -
    +
    @@ -157,11 +230,17 @@

    -
    -
    -
    - -
    +
    + + + + + + + -
    -
    - -
    + + + + +
    + + + +
    + + +
    @@ -172,14 +251,16 @@ -
    - - + +
    +
    @@ -191,9 +272,27 @@ -
    - + +
    + + <%--
    + +
    + +
    +
    + +
    + +
    + + +
    +
    --%>
    @@ -202,7 +301,7 @@ -
    +
      @@ -243,7 +342,7 @@
    - diff --git a/Edoc/Contratos.aspx.vb b/Edoc/Contratos.aspx.vb index 153298752..87fd7d107 100644 --- a/Edoc/Contratos.aspx.vb +++ b/Edoc/Contratos.aspx.vb @@ -3,6 +3,7 @@ Imports System.Data Imports System.Linq Imports Extensiones +Imports Microsoft.Reporting.WebForms Partial Class Proveedores_Contratos Inherits ClsPaginas @@ -20,11 +21,22 @@ Partial Class Proveedores_Contratos End Set End Property + Protected Property DtDatos As DataTable + Get + Return CType(ViewState("DtDatos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then - CargaDatos() + CargaCombos() + CargaDatos() + End If @@ -35,8 +47,9 @@ Partial Class Proveedores_Contratos Dim ObjProv As New ClsCompProveedores - If ObjProv.GetContrato(-1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then + If ObjProv.GetContrato(-1, DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlProveedorFiltro.SelectedValue.ToEntero, DdlTipoContratoFiltro.SelectedValue.ToEntero, -1, -1, UsuarioActual.CveEmpresa) Then GvDatos.DataSource = ObjProv.DtResultados + DtDatos = ObjProv.DtResultados Else GvDatos.DataSource = Nothing End If @@ -50,18 +63,24 @@ Partial Class Proveedores_Contratos Private Sub CargaCombos() 'CargaProveedores + + + DdlProveedores.setEsWebService(True) DdlProveedores.Attributes.Add("data-metodo", "getproveedores") DdlProveedores.SelectedText = "Todos" DdlProveedores.SelectedValue = "-1" - DdlSubProyecto.Items.Clear() - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlSubProyecto.Items.Clear() + 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) + 'DdlSubProyecto.DataBind() + 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + CargarCentrosDeCosto(Nothing, DdlSubProyectoFiltro, Nothing, LblSubProyectoFiltro) + DdlTipoContrato.Items.Clear() Dim ObjProveedor As New ClsCompProveedores @@ -69,15 +88,26 @@ Partial Class Proveedores_Contratos If ObjProveedor.GetTiposContratos(-1, UsuarioActual.CveEmpresa, 1) Then DdlTipoContrato.DataSource = ObjProveedor.DtResultados + DdlTipoContratoFiltro.DataSource = ObjProveedor.DtResultados End If + If ObjProveedor.GetContratoProvedores(UsuarioActual.CveEmpresa) Then + DdlProveedorFiltro.DataSource = ObjProveedor.DtResultados + End If + + ObjProveedor.Dispose() DdlTipoContrato.DataBind() + DdlTipoContratoFiltro.DataBind() + DdlProveedorFiltro.DataBind() DdlTipoContrato.Items.Insert(0, New ListItem("Seleccione", "-1")) - CargaRepresentantes() + DdlTipoContratoFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + DdlProveedorFiltro.Items.Insert(0, New ListItem("Todos", "-1")) + + End Sub @@ -96,6 +126,10 @@ Partial Class Proveedores_Contratos DdlTipoContrato.SelectedValueExist("-1") DdlSubProyecto.SelectedValueExist("-1") + + + DDlRePresentanteLegal.Items.Clear() + DDlRePresentanteLegal.Items.Add(New ListItem("Seleccione uno", "-1")) DDlRePresentanteLegal.SelectedValueExist("-1") TxtFechaInicio.Text = "" @@ -104,6 +138,11 @@ Partial Class Proveedores_Contratos BtnAgregarModalContrato.Text = "Agregar" + CheckActiveSection.Visible = False + ChkEstatus.Enabled = True + + + UpModalContrato.Update() RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato")) @@ -119,8 +158,13 @@ Partial Class Proveedores_Contratos DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor") DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial") + DdlTipoContrato.SelectedValueExist(GvRow.DataKey("CveTipoContrato")) DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto")) + + + CargaRepresentantes(GvRow.DataKey("CveProveedor").ToEntero) + DDlRePresentanteLegal.SelectedValueExist(GvRow.DataKey("CveRepresentanteLegal")) TxtFechaInicio.Text = GvRow.DataKey("FechaInicio").ToString.ToDate().ToString("dd/MM/yyyy") @@ -128,9 +172,12 @@ Partial Class Proveedores_Contratos ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus")) - BtnAgregarModalContrato.Text = "Actualizar" + CheckActiveSection.Visible = True + + + UpModalContrato.Update() RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarContrato")) @@ -183,10 +230,6 @@ Partial Class Proveedores_Contratos End If - - - - End Sub Protected Sub LnkGvEliminar_Click(sender As Object, e As EventArgs) @@ -221,25 +264,32 @@ Partial Class Proveedores_Contratos Protected Sub BtnAgregarRepresentante_Click(sender As Object, e As EventArgs) + Dim CveProveedor As Integer = DdlProveedores.txtValue.Value.ToEntero + + If CveProveedor <= 0 Then + Alert("Debe de seleccionar un proveedor", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim ObjProv As New ClsCompProveedores - If ObjProv.AddRePresentanteLegal(TxtRepresentanteLegal.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjProv.AddRePresentanteLegal(TxtRepresentanteLegal.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedor) Then Alert("Se agrego representante correctamente.") TxtRepresentanteLegal.Text = "" End If ObjProv.Dispose() - CargaRepresentantes() + CargaRepresentantes(CveProveedor) End Sub - Private Sub CargaRepresentantes() + Private Sub CargaRepresentantes(CveProveedor As Integer) Dim ObjProv As New ClsCompProveedores - If ObjProv.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa) Then + If ObjProv.GetRePresentanteLegal(-1, UsuarioActual.CveEmpresa, CveProveedor) Then GvRepresentante.DataSource = ObjProv.DtResultados DDlRePresentanteLegal.DataSource = ObjProv.DtResultados Else @@ -263,6 +313,7 @@ Partial Class Proveedores_Contratos Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim CveRepresentanteLegal As Integer = GvRow.DataKey("CveRepresentanteLegal").ToEntero + Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero Dim ObjProv As New ClsCompProveedores If ObjProv.RemoveRePresentanteLegal(CveRepresentanteLegal, UsuarioActual.CveEmpresa) Then @@ -271,7 +322,49 @@ Partial Class Proveedores_Contratos ObjProv.Dispose() - CargaRepresentantes() + CargaRepresentantes(CveProveedor) End Sub + Protected Sub DdlProveedores_selectedindexchange(sender As Object, e As EventArgs) + + Dim CveProveedor As Integer = DdlProveedores.txtValue.Value.ToEntero + CargaRepresentantes(CveProveedor) + End Sub + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.Header Then + e.Row.FCLabel("LblSubProyecto").Text = LblSubProyectoFiltro.Text + End If + + End Sub + + Protected Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPDF.Click + Imprimir("PDF") + End Sub + + Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click + Imprimir("Excel") + End Sub + + Private Sub Imprimir(Formato As String) + Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + + Dim params As New List(Of ReportParameter) + + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + + Dim Filtro As String = String.Format("{0}: {1}   Proveedor: {2}   Tipo Contrato: {3}", LblSubProyectoFiltro.Text, DdlSubProyectoFiltro.SelectedItem.Text, DdlProveedorFiltro.SelectedItem.Text, DdlTipoContratoFiltro.SelectedItem.Text) + params.Add(New ReportParameter("Filtro", Filtro)) + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", logouri)) + End If + ImprimirPDF("Empresas/Grales/Formatos/RepContratosGen.rdlc", DtDatos, params, "Reporte de Contratos", Formato) + End Sub End Class diff --git a/Empresas/Grales/Formatos/RepIVA.rpt b/Empresas/Grales/Formatos/RepIVA.rpt index 9010bd468..d3b3d6240 100644 Binary files a/Empresas/Grales/Formatos/RepIVA.rpt and b/Empresas/Grales/Formatos/RepIVA.rpt differ diff --git a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt index eb0fede9e..d29e92534 100644 Binary files a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt and b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt differ diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 3b47512cb..cb8126518 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -458,7 +458,7 @@ Partial Class Inventarios_RecepcionAlmacen ''' ''' ''' Parametro sin espacios y separado por comas ["1,2,3,21"] - Private Sub CargaAlmacenes(CveSubProyecto As Integer, Optional CveTiposAlmacen As String = "") + Private Sub CargaAlmacenes(CveSubProyecto As Integer, Optional CveTiposAlmacen As String = "", Optional CveTipoCompra As Integer = -1) Dim StrAlmacenes As String = "" If UsuarioActual.CveSubProyecto = 8804 Then 'AGS @@ -467,6 +467,10 @@ Partial Class Inventarios_RecepcionAlmacen StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,6,14")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}" End If + If CveTipoCompra = 10 Then + StrAlmacenes = $"Modalidad = 0" + End If + DdlAlmacen.Items.Clear() DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) @@ -854,13 +858,18 @@ Partial Class Inventarios_RecepcionAlmacen CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero If TipoMovimiento = 3 Then - CargaAlmacenes(-1, "21,2") + CargaAlmacenes(-1, "21,2", CveTipoCompra) End If If CveTipoCompra = 9 Then - CargaAlmacenes(-1, "21") + CargaAlmacenes(-1, "21", CveTipoCompra) End If + If CveTipoCompra = 10 Then + CargaAlmacenes(-1, CveTipoCompra:=CveTipoCompra) + End If + + RecibidaCompleta = False @@ -879,9 +888,9 @@ Partial Class Inventarios_RecepcionAlmacen CargaSoloUsados = True DtRecepcion = ObjInventario.DtResultados.Copy() If UsuarioActual.CveRol = 1 Then - CargaAlmacenes(-1, "22,24") + CargaAlmacenes(-1, "22,24", CveTipoCompra) Else - CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22") + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra) End If Else DtRecepcion = ObjInventario.DtResultados.Copy() @@ -952,9 +961,9 @@ Partial Class Inventarios_RecepcionAlmacen Else LtAdvertencia.Text = "La mercancía sera traspasada ha apartados" If CargaSoloUsados Then - CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22") + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra) Else - CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero) + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, CveTipoCompra:=CveTipoCompra) End If End If End If @@ -2113,7 +2122,8 @@ Partial Class Inventarios_RecepcionAlmacen Next IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacen}").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=EsContabilizable) Then + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then Retorno = False End If @@ -2734,7 +2744,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePoliza > 0 Then - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen, Contabilizable:=EsContabilizable) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveSubProyecto:=CveSubProyecto, CveOC:=CveOCSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then 'AGREGA POR CONCEPTO POR CVEOCDETALLE If CveOCSurtir > 0 Then @@ -2906,7 +2916,7 @@ Partial Class Inventarios_RecepcionAlmacen CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen-NC", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) If CvePrePoliza > 0 Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalNC, SerieFolio, CveConceptoContableNC, SerieFolio, Fecha, IdCtaContableNC, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalNC, Contabilizable:=EsContabilizable) Then - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, CveCuenta:=CveCuentaAlmacen, Contabilizable:=EsContabilizable) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, CveCuenta:=CveCuentaAlmacen, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then If DifCostoNC <> 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, CveCuenta:=CveCuentaClasificacion, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True @@ -3198,7 +3208,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim PorcentajeRecepcionCompras As Decimal = TotalCosto / DtTempCompras.SUMD("SubTotalTC") Dim ConceptoPartida As String = String.Format("{0}- Inv#{1}", HLFolio.Text, InvFolio) - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveCuenta:=CveCuentaAlmacen, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then 'se recorren las facturas a descontar el recepción If DtTempCompras IsNot Nothing AndAlso DtTempCompras.Rows.Count > 0 Then diff --git a/OI/CatDocumentoCategoria.aspx b/OI/CatDocumentoCategoria.aspx index e935eec64..96ca36b67 100644 --- a/OI/CatDocumentoCategoria.aspx +++ b/OI/CatDocumentoCategoria.aspx @@ -14,7 +14,7 @@
  • - +
  • @@ -25,8 +25,8 @@ - - + + @@ -44,7 +44,7 @@
    diff --git a/OI/DocumentoDetalle.aspx b/OI/DocumentoDetalle.aspx index fd583dbd4..43ef51987 100644 --- a/OI/DocumentoDetalle.aspx +++ b/OI/DocumentoDetalle.aspx @@ -29,8 +29,8 @@
    - - +
    +

    @@ -47,18 +47,9 @@

    -
    +
    -
    -
    -
    - - - - - -
    -
    +
    @@ -83,7 +74,7 @@
    - +
    @@ -104,7 +95,7 @@ @@ -144,6 +135,7 @@ +
    diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index a2119cdbb..f16ec0e2b 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -11,11 +11,12 @@ using System.Text; public partial class OI_DocumentoDetalle : ClsPaginas { + #region "PROPIEDADES" private int CveUsuarioResponsable { get { - return ViewState["CveUsuarioResponsable"].ToString().ToEntero(); + return ViewState["CveUsuarioResponsable"] == null ? -1 : ViewState["CveUsuarioResponsable"].ToString().ToEntero(); } set @@ -96,6 +97,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas Cargar(); } } + #endregion + #region "CARGAS" private void CargarCveDocumento() { @@ -107,6 +110,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas else { this.CveDocumento = -1; + this.CveUsuarioResponsable = -1; } } @@ -124,6 +128,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas case "Publicado": Alert("Documento publicado"); break; + case "Rechazado": + Alert("Documento rechazado"); + break; } } @@ -157,8 +164,11 @@ public partial class OI_DocumentoDetalle : ClsPaginas foreach (GridViewRow Usuario in UsuariosEnGrid) { int CveUsuario = Usuario.DataKey("CveUsuario").ToEntero(); - string FechaAprobacion = Usuarios.FiltroPrimeroValor("FechaAprobacion", string.Format("CveUsuario = {0}", CveUsuario)); + string Filtro = string.Format("CveUsuario = {0}", CveUsuario); + string FechaAprobacion = Usuarios.FiltroPrimeroValor("FechaAprobacion", Filtro); Usuario.FCCheckBox("ChkAprobar").Checked = FechaAprobacion != "" || (UsuarioActual.CveUsuario == CveUsuarioResponsable && CveUsuario == UsuarioActual.CveUsuario); + string Adjunto = Usuarios.FiltroPrimeroValor("Adjunto", Filtro); + Usuario.FCLinkButton("LkbDescargarPropuesta").Visible = Adjunto != ""; } } } @@ -207,7 +217,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas DdlCategoria.SelectedValue = Documento["CveCategoria"].ToString(); CargarSubCategoria(); DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString(); - DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString(); + LblEstatus.Text =$"Estatus: {Documento["Estatus"].ToString()}"; TxtVersion.Text = Documento["Version"].ToString(); TxtResponsable.Text = Documento["Responsable"].ToString(); TxtObs.InnerText = Documento["Observacion"].ToString(); @@ -220,6 +230,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas }else { this.CveDocumento = -1; + Alert("No se encontró el Documento", ModExtensiones.TipoMensaje.MsgAdvertencia); } } ObjOI.Dispose(); @@ -246,7 +257,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { LkbGuardar.Visible = false; LkbActualizar.Visible = true; - LkbPublicar.Visible = true; + LkbPublicar.Visible = VerificarAprobaciónParticipantes() && UsuarioActual.CveUsuario == CveUsuarioResponsable; GvUsuarios.Columns[1].Visible = false; GvUsuarios.Columns[2].Visible = true; GvUsuarios.Columns[3].Visible = true; @@ -273,7 +284,6 @@ public partial class OI_DocumentoDetalle : ClsPaginas { TxtDescripcion.Enabled = false; DdlSubCategoria.Enabled = false; - DdlEstatus.Enabled = false; TxtVersion.Enabled = false; TxtResponsable.Enabled = false; TxtObs.Disabled = true; @@ -284,8 +294,11 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void ConfigurarSegunEstatus() { - bool MostrarSegunAprobado = (DdlEstatus.SelectedValue == "2"); - DivBotonesAcciones.Visible = !MostrarSegunAprobado; + bool MostrarSegunAprobado = (LblEstatus.Text == "Estatus: Aprobado"); + bool MostrarSegunRechazado = (LblEstatus.Text == "Estatus: Rechazado"); + bool MostrarSegunEnProceso = (LblEstatus.Text == "Estatus: En Proceso"); + LkbActualizar.Visible = !(MostrarSegunRechazado) && (UsuarioActual.CveUsuario == this.CveUsuarioResponsable); + DivBotonesAcciones.Visible = !(MostrarSegunAprobado || MostrarSegunRechazado); UpAgregar.Visible = MostrarSegunAprobado; } @@ -310,12 +323,9 @@ public partial class OI_DocumentoDetalle : ClsPaginas } } - private void EstatusMostrar(bool Mostrar) + private void MostrarBotonRechazar() { - DivEstatus.Visible = Mostrar; - brEstatus.Visible = Mostrar; - DivEstatusInicial.Visible = !Mostrar; - brEstatusInicial.Visible = !Mostrar; + LkbRechazar.Visible = (LblEstatus.Text == "Estatus: En Proceso" && this.CveUsuarioResponsable == UsuarioActual.CveUsuario); } private void Cargar() @@ -326,7 +336,6 @@ public partial class OI_DocumentoDetalle : ClsPaginas CargarUsuarios(); if (this.CveDocumento > 0) { - EstatusMostrar(true); if (CargarDocumentoYaExistente()) { CargarUsuariosParticipantes(); @@ -335,6 +344,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas ConfigurarGridUsuariosParticipantes(); ConfigurarCamposDetalleSegunUsuario(); CargarMensajeNuevoEditado(); + MostrarBotonRechazar(); } } ConfigurarSegunEstatus(); @@ -344,39 +354,45 @@ public partial class OI_DocumentoDetalle : ClsPaginas #region "GENERAR DOCUMENTO" protected void LblGuardar_Click(object sender, EventArgs e) { - ClsOIEventos ObjOI = new ClsOIEventos(); - ObjOI.IniciaTransacSQL(); - bool TieneError = false; - - //Esta variable es requerida más adelante - int CveDocumento = 0; - string RutaArchivo = "-1"; - string CorreosNotificacion = ""; - byte[] ArchivoNotifiacion = null; - - CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento - if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado - if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento - if (!TieneError) + if(TxtDocumentoFile.Text != "[]") { - ArchivoNotifiacion = GenerarArchivoByte(CveDocumento, RutaArchivo); - NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion); - } + ClsOIEventos ObjOI = new ClsOIEventos(); + ObjOI.IniciaTransacSQL(); + bool TieneError = false; - //Gestión de errores y resultados - if (!TieneError) + //Esta variable es requerida más adelante + int CveDocumento = 0; + string RutaArchivo = "-1"; + string CorreosNotificacion = ""; + byte[] ArchivoNotifiacion = null; + + CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento + if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado + if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento + if (!TieneError) + { + ArchivoNotifiacion = GenerarArchivoByte(CveDocumento, RutaArchivo); + NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion, CveDocumento); + } + + //Gestión de errores y resultados + if (!TieneError) + { + ObjOI.Commit(); + string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "NuevaVersion";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); + } + else + { + ObjOI.RollBack(); + Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); + UpCliente.Update(); + } + ObjOI.Dispose(); + }else { - ObjOI.Commit(); - string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "NuevaVersion";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página - Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje)); + Alert("Es necesario cargar un Documento",ModExtensiones.TipoMensaje.MsgAdvertencia); } - else - { - ObjOI.RollBack(); - Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError); - UpCliente.Update(); - } - ObjOI.Dispose(); } private int GuardarDocumento(ref ClsOIEventos ObjOI, ref bool TieneError) @@ -444,6 +460,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas { string Archivo = ActualizarArchivoEnDirectorio(); ActualizarDocumentoYaExistente(Archivo); + TxtDocumentoFile.Text = ""; Cargar(); UpCliente.Update(); Alert("Documento actualizado"); @@ -468,8 +485,8 @@ public partial class OI_DocumentoDetalle : ClsPaginas private void ActualizarDocumentoYaExistente(string ArchivoFisico) { ClsOIEventos ObjOI = new ClsOIEventos(); - if (!ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(), - ArchivoFisico, UsuarioActual.Nombre, ModExtensiones.MinFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (!ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 1, ArchivoFisico, + UsuarioActual.Nombre, ModExtensiones.MinFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { Alert("Error al actualizar", ModExtensiones.TipoMensaje.MsgError); } @@ -554,9 +571,21 @@ public partial class OI_DocumentoDetalle : ClsPaginas #endregion #region "NOTIFICACIONES CORREO" - private void NotificarPorCorreo(string Para, string NombreArchivo, byte[] Adjunto) + private string GenerarCuerpoCorreo(int CveDocumento) { - string Descripcion = TxtDescripcion.Text; + string URL = string.Format("{0}/OI/DocumentoDetalle.aspx?CveDocumento={1}", HttpContext.Current.Request.Url.Host,CveDocumento); + StringBuilder body = new StringBuilder(); + body.Append("Ha sido invitado a revisar la generación de un documento
    "); + body.Append($"Documento: {TxtDescripcion.Text},
    "); + body.Append($"Categoria: {DdlCategoria.SelectedItem.Text},
    "); + body.Append($"Subcategoria: {DdlSubCategoria.SelectedItem.Text},
    "); + body.Append($"Detalles del Documento"); + return body.ToString(); + } + + private void NotificarPorCorreo(string Para, string NombreArchivo, byte[] Adjunto, int CveDocumento) + { + string Descripcion = GenerarCuerpoCorreo(CveDocumento); string Asunto = "Se le ha agregado como participante en el desarrollo de un Documento"; string a = string.Format("{0} -- {1} --- {2}", Descripcion, Para, ""); a.GuardaLog(); @@ -658,7 +687,16 @@ public partial class OI_DocumentoDetalle : ClsPaginas { string Archivo = SubirPropuestaEnDirectorio(this.CveUsuarioSeleccionado); - ActualizarUsuario(this.CveAsignacion, Archivo); + bool UsuarioActualizado = ActualizarUsuario(this.CveAsignacion, Archivo); + if (UsuarioActualizado) + { + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarPropuesta")); + Alert("La propuesta se realizó correctamente"); + CargarUsuariosParticipantes(); + CargarUsuariosAutorizo(); + ConfigurarGridUsuariosParticipantes(); + UpDatosUsuarios.Update(); + } } private string SubirPropuestaEnDirectorio(int CveUsuario) @@ -671,6 +709,12 @@ public partial class OI_DocumentoDetalle : ClsPaginas { try { + string AdjuntoYaCargado = GetUsuarioParticipante(CveUsuario)["Adjunto"] == null ? "": GetUsuarioParticipante(CveUsuario)["Adjunto"].ToString(); + string RutaBuscar = string.Format(@"{0}DocumentosRepo\{1}\{2}", UsuarioActual.Empresa.Ruta, this.CveDocumento, AdjuntoYaCargado); + if (File.Exists(RutaBuscar)) + { + File.Delete(RutaBuscar); + } string NombreArchivo = fileItem.filenameO; fileNameReturn = string.Format("{0}_{1}", CveUsuario, NombreArchivo); string RutaDestino = string.Format(@"{0}DocumentosRepo\{1}\{2}_{3}", UsuarioActual.Empresa.Ruta, this.CveDocumento, CveUsuario, NombreArchivo); @@ -685,14 +729,16 @@ public partial class OI_DocumentoDetalle : ClsPaginas return fileNameReturn; } - private void ActualizarUsuario(int CveAutorizacion, string Archivo) + private bool ActualizarUsuario(int CveAutorizacion, string Archivo) { ClsOIEventos ObjOI = new ClsOIEventos(); if (!ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, this.CveDocumento, TxtComentarios.InnerText, Archivo, ModExtensiones.MinFecha)) { Alert("Error al actualizar el archivo subido propuesto por el usuario"); + return false; } ObjOI.Dispose(); + return true; } #endregion @@ -705,6 +751,10 @@ public partial class OI_DocumentoDetalle : ClsPaginas DataRow Usuario = GetUsuarioParticipante(CveUsuario); AprobacionDeUsuario(Usuario, SelectedCheckBox.Checked); + + LkbPublicar.Visible = VerificarAprobaciónParticipantes() && UsuarioActual.CveUsuario == CveUsuarioResponsable; + UpCliente.Update(); + } private void AprobacionDeUsuario(DataRow Usuario, bool Autorizar) @@ -728,7 +778,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas ObjOI.Dispose(); } - protected void LkbPublicar_Click(object sender, EventArgs e) + private bool VerificarAprobaciónParticipantes() { GridViewRowCollection Usuarios = GvUsuarios.Rows; bool Aprobado = true; @@ -740,6 +790,12 @@ public partial class OI_DocumentoDetalle : ClsPaginas break; } } + return Aprobado; + } + + protected void LkbPublicar_Click(object sender, EventArgs e) + { + bool Aprobado = VerificarAprobaciónParticipantes(); if (Aprobado) { @@ -771,8 +827,21 @@ public partial class OI_DocumentoDetalle : ClsPaginas GvUsuarios.Columns[1].Visible = true; GvUsuarios.Columns[2].Visible = false; GvUsuarios.Columns[3].Visible = false; - EstatusMostrar(false); UpCliente.Update(); } #endregion + + #region "Rechazar" + protected void LkbRechazar_Click(object sender, EventArgs e) + { + ClsOIEventos ObjOI = new ClsOIEventos(); + if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 3, "-1", TxtResponsable.Text, + DateTime.Now, -1, -1, UsuarioActual.CveEmpresa)) + { + Alert("Documento cancelado"); + } + ObjOI.Dispose(); + Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", this.CveDocumento, "Rechazado")); + } + #endregion } \ No newline at end of file diff --git a/OI/Documentos.aspx b/OI/Documentos.aspx index 5e37a8679..2e54f8905 100644 --- a/OI/Documentos.aspx +++ b/OI/Documentos.aspx @@ -14,13 +14,13 @@
  • - +
  • - Imprimir PDF + PDF
  • - Imprimir Excel + Excel
  • @@ -32,13 +32,14 @@ EmptyDataText="No se encontraron Documentos Registrados" ToolTip="Listado de Documentos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None" OnRowDataBound="GvDatos_RowDataBound"> - + - - - + + + - + + diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index e6ef26273..16c1ca692 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -69,6 +69,7 @@ + @@ -799,13 +800,13 @@ <%---2020/02/06 - Auditoria--%> - + -
    +
    diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index fe6e0251c..4b1f46663 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -284,8 +284,16 @@ Partial Class Portal_PortalProveedor ' CargaUsuariosPortal() End If + + If UsuarioActual.TienePermisoProceso(305) Then + + TabAuditoria.Visible = True + + End If + 'CARGA TAB CONTRASENIA PARA TODOS LOS USUARIOS If UsuarioActual.CvePlataforma = 7 Then TabContraseña.Visible = True + End If End Sub @@ -647,289 +655,289 @@ Partial Class Portal_PortalProveedor GvCxPHistorial.DataBind() ' UpDatos.Update() - End Sub - + End Sub + #End Region - - + + #Region "Usuarios Portal" - - 'Private Sub CargaUsuariosPortal() - ' Dim ObjUsrs As New ClsSisUsuarios() - ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' Dim dtUsr As DataTable = ObjUsrs.DtResultados - ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) - ' 'If dr IsNot Nothing Then - - ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" - ' ' If True Then TabCxP.Visible = True - ' ' If True Then TabAnticipos.Visible = True - ' ' If True Then TabBancos.Visible = True - ' ' If True Then TabSistema.Visible = True - - ' 'End If - - ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - - ' ViewState("OrdenUsuarios") = "" - ' GvUsuariosPortal.DataSource = dtUsr - ' ViewState("DTUsuariosProveedor") = dtUsr - ' Else - ' GvUsuariosPortal.DataSource = Nothing - ' ViewState("DTUsuariosProveedor") = Nothing - ' End If - ' ObjUsrs.Dispose() - ' GvUsuariosPortal.DataBind() - 'End Sub - - - 'Private Sub CargaGridUsuarios(Orden As String) - ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then - ' If Orden <> String.Empty Then - ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) - ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' DV.Dispose() - ' Else - ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - ' End If - ' GvUsuariosPortal.DataBind() - ' UPPUsuarios.Update() - 'End Sub - - ''ajustar el tamaño de las celdas de la GvUsuarios Portal - 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - - ' 'El usuario Admin no se puede editar ni eliminar - ' If e.Row.DataKey("Nombre") = "Admin" Then - ' e.Row.FCLinkButton("imgE").Visible = False - ' e.Row.FCLinkButton("imgD").Visible = False - ' e.Row.FCLinkButton("imgC").Visible = False - ' End If - - ' If e.Row.RowIndex = 0 Then - ' '' e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(1).Width = Unit.Pixel(150) - ' 'e.Row.Cells(2).Width = Unit.Pixel(55) - ' 'e.Row.Cells(3).Width = Unit.Pixel(55) - ' 'e.Row.Cells(4).Width = Unit.Pixel(55) - ' 'e.Row.Cells(5).Width = Unit.Pixel(55) - ' 'e.Row.Cells(6).Width = Unit.Pixel(55) - ' 'e.Row.Cells(7).Width = Unit.Pixel(55) - - ' 'e.Row.Cells(8).Width = Unit.Pixel(75) - ' 'e.Row.Cells(9).Width = Unit.Pixel(100) - ' 'e.Row.Cells(10).Width = Unit.Pixel(150) - ' End If - ' End If - 'End Sub - - ''Editar usuarios - 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing - ' GvUsuariosPortal.EditIndex = e.NewEditIndex - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim Nombre, Correo As String - ' Dim Estatus As Boolean - ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) - - ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim - ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim - ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim - ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked - - ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero - ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero - - ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados - ' End If - ' ObjUsuario.Dispose() - - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - - 'End Sub - - ''Cancelar Edición - 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit - ' GvUsuariosPortal.EditIndex = -1 - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Restablecer contraseña - 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand - - ' If e.CommandName = "RestablecerContraseña" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") - ' End If - ' End If - ' Usuario.Dispose() - ' End If - - ' If e.CommandName = "ReenviarCorreo" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' Usuario.IniciaTransacSQL() - ' Dim TieneError = False - - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS - ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' TieneError = True - ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ' End If - - ' 'MANDA CORREO ACTIVACION - ' If Not TieneError Then - ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) - ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" - ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) - - ' Dim ObjMail As New ClsSisMail() - - ' If dr("Correo").ToString <> "" Then - ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) - ' Dim Texto = "" - ' For Each Correo As String In Correos - ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) - ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then - ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then - ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) - ' TieneError = True - ' Exit For - ' End If - ' Next - - ' Else - ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) - ' TieneError = True - ' End If - ' End If - - ' If Not TieneError Then - ' Usuario.Commit() - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) - ' Else - ' Usuario.RollBack() - ' End If - - ' End If - ' Usuario.Dispose() - ' End If - - 'End Sub - - ''Eliminar Usuarios - 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' End If - ' Usuario.Dispose() - ' Alert("Usuario Eliminado") - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Agregar Usuario - 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim CvePlataforma As Integer = 7 - - ' ObjUsuario.IniciaTransacSQL() - - ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - ' If CveUsuario > 0 Then - ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then - ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - - ' TxtNombrePortal.Text = "" - ' TxtCorreo.Text = "" - ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") - ' ObjUsuario.Commit() - ' Else - ' ObjUsuario.RollBack() - ' End If - ' Else - ' ObjUsuario.RollBack() - ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") - ' End If - - ' ObjUsuario.Dispose() - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - + + 'Private Sub CargaUsuariosPortal() + ' Dim ObjUsrs As New ClsSisUsuarios() + ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' Dim dtUsr As DataTable = ObjUsrs.DtResultados + ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) + ' 'If dr IsNot Nothing Then + + ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" + ' ' If True Then TabCxP.Visible = True + ' ' If True Then TabAnticipos.Visible = True + ' ' If True Then TabBancos.Visible = True + ' ' If True Then TabSistema.Visible = True + + ' 'End If + + ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + + ' ViewState("OrdenUsuarios") = "" + ' GvUsuariosPortal.DataSource = dtUsr + ' ViewState("DTUsuariosProveedor") = dtUsr + ' Else + ' GvUsuariosPortal.DataSource = Nothing + ' ViewState("DTUsuariosProveedor") = Nothing + ' End If + ' ObjUsrs.Dispose() + ' GvUsuariosPortal.DataBind() + 'End Sub + + + 'Private Sub CargaGridUsuarios(Orden As String) + ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then + ' If Orden <> String.Empty Then + ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) + ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' DV.Dispose() + ' Else + ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + ' End If + ' GvUsuariosPortal.DataBind() + ' UPPUsuarios.Update() + 'End Sub + + ''ajustar el tamaño de las celdas de la GvUsuarios Portal + 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' 'El usuario Admin no se puede editar ni eliminar + ' If e.Row.DataKey("Nombre") = "Admin" Then + ' e.Row.FCLinkButton("imgE").Visible = False + ' e.Row.FCLinkButton("imgD").Visible = False + ' e.Row.FCLinkButton("imgC").Visible = False + ' End If + + ' If e.Row.RowIndex = 0 Then + ' '' e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(1).Width = Unit.Pixel(150) + ' 'e.Row.Cells(2).Width = Unit.Pixel(55) + ' 'e.Row.Cells(3).Width = Unit.Pixel(55) + ' 'e.Row.Cells(4).Width = Unit.Pixel(55) + ' 'e.Row.Cells(5).Width = Unit.Pixel(55) + ' 'e.Row.Cells(6).Width = Unit.Pixel(55) + ' 'e.Row.Cells(7).Width = Unit.Pixel(55) + + ' 'e.Row.Cells(8).Width = Unit.Pixel(75) + ' 'e.Row.Cells(9).Width = Unit.Pixel(100) + ' 'e.Row.Cells(10).Width = Unit.Pixel(150) + ' End If + ' End If + 'End Sub + + ''Editar usuarios + 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing + ' GvUsuariosPortal.EditIndex = e.NewEditIndex + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim Nombre, Correo As String + ' Dim Estatus As Boolean + ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) + + ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim + ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim + ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim + ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked + + ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero + ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero + + ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados + ' End If + ' ObjUsuario.Dispose() + + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + + 'End Sub + + ''Cancelar Edición + 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit + ' GvUsuariosPortal.EditIndex = -1 + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Restablecer contraseña + 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand + + ' If e.CommandName = "RestablecerContraseña" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") + ' End If + ' End If + ' Usuario.Dispose() + ' End If + + ' If e.CommandName = "ReenviarCorreo" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' Usuario.IniciaTransacSQL() + ' Dim TieneError = False + + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS + ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' TieneError = True + ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) + ' End If + + ' 'MANDA CORREO ACTIVACION + ' If Not TieneError Then + ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) + ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" + ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) + + ' Dim ObjMail As New ClsSisMail() + + ' If dr("Correo").ToString <> "" Then + ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) + ' Dim Texto = "" + ' For Each Correo As String In Correos + ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) + ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then + ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then + ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) + ' TieneError = True + ' Exit For + ' End If + ' Next + + ' Else + ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) + ' TieneError = True + ' End If + ' End If + + ' If Not TieneError Then + ' Usuario.Commit() + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) + ' Else + ' Usuario.RollBack() + ' End If + + ' End If + ' Usuario.Dispose() + ' End If + + 'End Sub + + ''Eliminar Usuarios + 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' End If + ' Usuario.Dispose() + ' Alert("Usuario Eliminado") + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Agregar Usuario + 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim CvePlataforma As Integer = 7 + + ' ObjUsuario.IniciaTransacSQL() + + ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + ' If CveUsuario > 0 Then + ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then + ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + + ' TxtNombrePortal.Text = "" + ' TxtCorreo.Text = "" + ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") + ' ObjUsuario.Commit() + ' Else + ' ObjUsuario.RollBack() + ' End If + ' Else + ' ObjUsuario.RollBack() + ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") + ' End If + + ' ObjUsuario.Dispose() + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + #End Region - - + + #Region "O R D E N A M I E N T O" - 'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) - ' Dim Orden As String = "" - ' Dim Campo As String = "" - ' Dim Literal As Literal = Nothing - ' Const OrdenInicial As String = "" - ' Dim Arg(2) As String - - ' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) - ' Campo = Arg(0) - ' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) - - ' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) - ' Literal.Text = String.Format("") - ' Else - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) - ' Literal.Text = String.Format("") - ' End If - ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString - ' ViewState("Orden") = Orden - ' CargaGridUsuarios(Orden) - 'End Sub - + 'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs) + ' Dim Orden As String = "" + ' Dim Campo As String = "" + ' Dim Literal As Literal = Nothing + ' Const OrdenInicial As String = "" + ' Dim Arg(2) As String + + ' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c) + ' Campo = Arg(0) + ' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal) + + ' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo) + ' Literal.Text = String.Format("") + ' Else + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) + ' Literal.Text = String.Format("") + ' End If + ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString + ' ViewState("Orden") = Orden + ' CargaGridUsuarios(Orden) + 'End Sub + #End Region - - + + #Region " BANCOS" Protected Sub BtnExcelGvBancosCuentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteGvBancosCuentas("EXCEL") diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 71897ac72..25ab45b50 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -2378,6 +2378,7 @@ Archivos + @@ -2385,6 +2386,7 @@ Reenviar Complemento + <%-- diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index d9da7cfae..d2e4de5ff 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -2013,6 +2013,7 @@ Partial Class Clientes ObjBancos.Dispose() End If e.Row.BackColor = Drawing.Color.LightGray + e.Row.Font.Bold = True End If If e.Row.DBCampo("CveVenta") = "" And e.Row.DBCampo("Banco") = "" Then @@ -6328,6 +6329,7 @@ Partial Class Clientes Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("AgrupadoPor", String.Format("Cliente: {0}", TxtNombreComercial.Text))) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) If Imagen.Exists Then diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 24724ab95..ade3b1824 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3771,6 +3771,7 @@ Partial Class Ventas InicializaDTAnticiposAmortizacion() ChkAplicaNCAnticipo.Enabled = False Else + ChkAplicaNCAnticipo.Enabled = False ChkAplicaNCAnticipo.Checked = False End If 'If DbRowVenta("SaldoAnticipo").ToString().ToDouble <= 0 Then ChkAplicaNCAnticipo.Checked = False : ChkAplicaNCAnticipo.Enabled = False @@ -25937,39 +25938,39 @@ Partial Class Ventas If CveVenta <= 0 OrElse EsCreaApartirDe Then If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 Then - For Each RowServicio As DataRow In TmpDT.Rows - Dim tClienteRetIVA = ClienteRetIVA - If tClienteRetIVA <= 0 Then - If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then - tClienteRetIVA = 0.106667D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then - tClienteRetIVA = 0.04D - ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then - tClienteRetIVA = 0.06D - End If - ViewState("ClienteRetIVA") = tClienteRetIVA + For Each RowServicio As DataRow In TmpDT.Rows + Dim tClienteRetIVA = ClienteRetIVA + If tClienteRetIVA <= 0 Then + If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then + tClienteRetIVA = 0.106667D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then + tClienteRetIVA = 0.04D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then + tClienteRetIVA = 0.06D End If - - Dim TotalCalculableImpuestos As Decimal = (RowServicio("Cantidad").ToString().ToDecimal() * RowServicio("PU").ToString().ToDecimal()) - RowServicio("Descuento").ToString().ToDecimal() - RowServicio("ImporteRetIVA") = (TotalCalculableImpuestos * ClienteRetIVA).RoundSQL() - RowServicio("PorcentajeRetIVA") = ClienteRetIVA - - Next - TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2) - Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) - LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) - If PorcentajeRetIVA > 0 Then - TrRetIVA.Style.Add("display", "") - UsuarioActual.Empresa.MostrarRetIVA = True - DdlTipoRetencion.Visible = True + ViewState("ClienteRetIVA") = tClienteRetIVA End If - GvPS.DataSource = TmpDT - GvPS.DataBind() - + Dim TotalCalculableImpuestos As Decimal = (RowServicio("Cantidad").ToString().ToDecimal() * RowServicio("PU").ToString().ToDecimal()) - RowServicio("Descuento").ToString().ToDecimal() + RowServicio("ImporteRetIVA") = (TotalCalculableImpuestos * ClienteRetIVA).RoundSQL() + RowServicio("PorcentajeRetIVA") = ClienteRetIVA + Next + TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").ToDecimal().FormatoNumero(2) + Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) + LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2) + If PorcentajeRetIVA > 0 Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True + DdlTipoRetencion.Visible = True End If + GvPS.DataSource = TmpDT + GvPS.DataBind() + + + End If + End If UpPS.Update() @@ -26166,7 +26167,7 @@ Partial Class Ventas Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveVenta As Integer) Dim ObjMovtos As New ClsMovimientos() If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveVenta) Then - DtDatos = ObjMovtos.DtResultados + DTDatos = ObjMovtos.DtResultados GVAuxiliar.DataSource = ObjMovtos.DtResultados Else GVAuxiliar.DataSource = Nothing