From a6048e855ad837b1b45185439cc6a7944848dc5e Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 10 Feb 2020 10:45:51 -0700 Subject: [PATCH 01/32] se actualizo la manera en la que se recarga el global de subproyectos --- Planeacion/CatSubProyectos.aspx.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 217c9a811..f2d679fd2 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -83,8 +83,8 @@ Partial Class CatSubProyectos Private Sub RecargaGlobal() Dim ObjSubProyectos As New ClsSubProyectos - If ObjSubProyectos.GetSubProyectos() Then - GlobalDTSubProyectos(-1) = ObjSubProyectos.DtResultados + If ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa) Then + GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjSubProyectos.DtResultados End If ObjSubProyectos.Dispose() End Sub @@ -400,6 +400,7 @@ Partial Class CatSubProyectos RecargaGlobal() Else ObjSubproyectos.RollBack() + RecargaGlobal() End If 'se regeneran los subproyectos From 22b0e0231128942d6aec0a6b47702e011c7e6388 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 10 Feb 2020 18:11:15 -0700 Subject: [PATCH 02/32] =?UTF-8?q?Documnetaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsEdocumentacion.vb | 78 +- App_Code/ClsPaginas.vb | 14 +- Compras/Compras.aspx.vb | 9 +- Compras/RepDocumentacionProveedor.aspx | 322 ++++++ Compras/RepDocumentacionProveedor.aspx.vb | 380 +++++++ Edoc/CatDocumentos.aspx | 353 +++++++ Edoc/CatDocumentos.aspx.vb | 414 ++++++++ Edoc/CatDocumentosContratos.aspx | 468 +++++++++ Edoc/CatDocumentosContratos.aspx.vb | 116 +++ Edoc/CatTipoContratos.aspx | 165 +++ Edoc/CatTipoContratos.aspx.vb | 116 +++ General/CatDocumentacionTipo.aspx | 3 +- PortalProveedor/PortalProveedor.aspx | 188 +++- PortalProveedor/PortalProveedor.aspx.vb | 1102 +++++++++++++++------ 14 files changed, 3373 insertions(+), 355 deletions(-) create mode 100644 Compras/RepDocumentacionProveedor.aspx create mode 100644 Compras/RepDocumentacionProveedor.aspx.vb create mode 100644 Edoc/CatDocumentos.aspx create mode 100644 Edoc/CatDocumentos.aspx.vb create mode 100644 Edoc/CatDocumentosContratos.aspx create mode 100644 Edoc/CatDocumentosContratos.aspx.vb create mode 100644 Edoc/CatTipoContratos.aspx create mode 100644 Edoc/CatTipoContratos.aspx.vb diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index a5d44ff83..6b96bae06 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -153,7 +153,7 @@ Public Class ClsEdocumentacion Public Function DocumentacionAdd(Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, - DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer) As Boolean + DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer, Optional Periodicidad As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionAdd") @@ -169,6 +169,7 @@ Public Class ClsEdocumentacion .Add("@DiasLimite", SqlDbType.Int).Value = DiasLimite .Add("@AplicaDiasLimite", SqlDbType.Bit).Value = AplicaDiasLimite .Add("@AplicaFechaVencimiento", SqlDbType.Bit).Value = AplicaFechaVencimiento + .Add("@Periodicidad", SqlDbType.Int).Value = Periodicidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -187,7 +188,7 @@ Public Class ClsEdocumentacion End Function - Public Function DocumentacionUpdate(CveDocumentacion As Integer, Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer) As Boolean + Public Function DocumentacionUpdate(CveDocumentacion As Integer, Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer, Optional Periodicidad As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionUpdate") @@ -204,6 +205,7 @@ Public Class ClsEdocumentacion .Add("@DiasLimite", SqlDbType.Int).Value = DiasLimite .Add("@AplicaDiasLimite", SqlDbType.Bit).Value = AplicaDiasLimite .Add("@AplicaFechaVencimiento", SqlDbType.Bit).Value = AplicaFechaVencimiento + .Add("@Periodicidad", SqlDbType.Int).Value = Periodicidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With @@ -452,35 +454,61 @@ Public Class ClsEdocumentacion End Try Return Retorno - End Function + 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 + Dim Retorno As Boolean = False + DataAdapter("PA_Edoc_DocumentacionElectronicaAuditoriaGet") - 'Public Function DocumentacionGet(CveDocumentacionTipo As Integer, CveEmpresa As Integer) As Boolean + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Modulo", SqlDbType.Int).Value = Modulo + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With - ' Dim Retorno As Boolean = False + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los registros de documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - ' DataAdapter("PA_Edoc_DocumentacionGet") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo - ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al consultar la documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - - ' Return Retorno - ' End Function + Return Retorno + End Function + + + + 'Public Function DocumentacionGet(CveDocumentacionTipo As Integer, CveEmpresa As Integer) As Boolean + + ' Dim Retorno As Boolean = False + + ' DataAdapter("PA_Edoc_DocumentacionGet") + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar la documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + + ' Return Retorno + ' End Function #End Region - - - + + + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not disposedValue Then If disposing Then diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ea02be437..d85c936bf 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3956,6 +3956,9 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) PaginaDict.Add("/Compras/RepReqOCCompraInv.aspx".ToUpper(), 689) PaginaDict.Add("/Compras/RepComprasPrecios.aspx".ToUpper(), 690) + PaginaDict.Add("/Compras/RepDocumentacionProveedor.aspx".ToUpper(), 1206) + + #End Region 'CONTABILIDAD @@ -4661,9 +4664,13 @@ Public Class ClsPaginas 'Portal Cliente/Proveedor PaginaDict.Add("/PortalCliente/PortalCliente.aspx".ToUpper(), 1101) - PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201) - - 'Portal + PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201) + + PaginaDict.Add("/Edoc/CatDocumentos.aspx".ToUpper(), 1205) + PaginaDict.Add("/Edoc/CatTipoContratos.aspx".ToUpper(), -1) + PaginaDict.Add("/Edoc/CatDocumentosContratos.aspx".ToUpper(), -1) + + 'Portal PaginaDict.Add("/AIMMGM/ConsultaCliente.aspx".ToUpper(), -1) PaginaDict.Add("/Portal/ConsultaCliente.aspx".ToUpper(), -1) PaginaDict.Add("/Proveedores/PortalProveedor.aspx".ToUpper(), -1) @@ -4680,6 +4687,7 @@ Public Class ClsPaginas + 'Orden Produccion' 'RMA diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 14fe93b5f..fd2af8bf0 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -10090,19 +10090,22 @@ Partial Class Compras_Compras EmisorRFC = ValorXML(node, "RFC") 'EmisorNombre = ValorXML(node, "nombre") End If - node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + + node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then ReceptorRFC = ValorXML(node, "RFC") End If - If UsuarioActual.CveEmpresa.Contiene(119) Then + If UsuarioActual.CveEmpresa.Contiene(119, 7) Then node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then If ValorXML(node, "TipoRelacion").ToString.Contiene("04", "07") Then Dim nodeDocumentosRelacionados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionado", Prefijo), namespaces) For Each documento As XmlNode In nodeDocumentosRelacionados If documento.Attributes("UUID").Value <> "" Then - 'ListaDocumentos.Add(documento.Attributes("UUID").Value) + ListaDocumentos.Add(documento.Attributes("UUID").Value) End If Next End If diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx new file mode 100644 index 000000000..ad4776c3d --- /dev/null +++ b/Compras/RepDocumentacionProveedor.aspx @@ -0,0 +1,322 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepDocumentacionProveedor.aspx.vb" Inherits="Proveedores_RepDocumentacionProveedor" %> + + + + + + + + + Reporte documentación + + + + + + + + +
  • + +
  • + +
    + + + +
    + +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    Proveedor:
    +
    + + +
    + +
    Fecha Inicio
    +
    +
    + + + + +
    + + + + + + + + + +
    + +
    Fecha Fin
    +
    +
    + + + + +
    + <%-- --%> + + + + + + + + +
    + + +
    Estatus
    + +
    + + + Todos + Pendiente + Entregado + Completado + + +
    + + +
    + +
    +
    +
    > + + + +
    +
    +
    +
    + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + + + --%> + + + +
    + + +
    +
    +
    + + + +
    +
    + + +
    + + + + + diff --git a/Compras/RepDocumentacionProveedor.aspx.vb b/Compras/RepDocumentacionProveedor.aspx.vb new file mode 100644 index 000000000..d89519107 --- /dev/null +++ b/Compras/RepDocumentacionProveedor.aspx.vb @@ -0,0 +1,380 @@ +Option Strict On + + +Imports System.Data +Imports System.IO +Imports Extensiones +Imports GemBox.Spreadsheet + + + + +Partial Class Proveedores_RepDocumentacionProveedor + Inherits ClsPaginas + + Private Property DTDatos As DataTable + Get + If ViewState("DTDatos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDatos"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTDatos") = value + End Set + End Property + + + Private Property DTHeaders As DataTable + Get + If ViewState("DTHeaders") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTHeaders"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTHeaders") = value + End Set + End Property + + + Private Sub Proveedores_RepDocumentacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + 'TxtFechaI.Text = Now.AddMonths(-3).ToString("dd/MM/yyyy") + 'TxtFechaF.Text = Now.ToString("dd/MM/yyyy") + + TxtFechaI.Text = "" + TxtFechaF.Text = "" + + LnkDescargarExcel.Visible = False + End If + 'ExportaExcel() + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Todos" + DdlProveedores.SelectedValue = "-1" + + End Sub + + + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click + CargaDocumentacion() + End Sub + + + Private Sub CargaDocumentacion() + + Dim CveProveedor As Integer = -1 + + Dim FechaInicio As Date + Dim FechaFin As Date + + If TxtFechaI.Text = "" Then + FechaInicio = MinFecha + Else + FechaInicio = TxtFechaI.Text.ToDate + End If + + If TxtFechaF.Text = "" Then + FechaFin = MaxFecha + Else + FechaFin = TxtFechaF.Text.ToDate + End If + + If DdlProveedores.txtValue.Value.ToEntero > 0 Then + CveProveedor = DdlProveedores.txtValue.Value.ToEntero + End If + + Dim obEDoc As New ClsEdocumentacion + + If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then + GvDocumentos.DataSource = obEDoc.DtResultados + Else + GvDocumentos.DataSource = Nothing + End If + + obEDoc.Dispose() + + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + + + End Sub + + + + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired") + Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite") + Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia") + Dim Documentacion As String = e.Row.DataKey("Documentacion") + + Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar") + + Dim ImgAceptar As LinkButton = e.Row.FCLinkButton("ImgAceptar") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + 'Dim RDBAcptar As RadioButton = e.Row.FCRadioButton("RDBAcptar") + 'Dim RDBRechazar As RadioButton = e.Row.FCRadioButton("RDBRechazar") + + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + txtFechaVigencia.ForeColor = Drawing.Color.Red + End If + End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + 'If e.Row.DBCampo("Estatus").ToString.ToEntero = 3 Then + ' RDBAcptar.Checked = True + 'Else + ' chkEstatus.Checked = False + 'End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion) + End If + + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2, 3) Then + ImgRechazar.Visible = True + End If + + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2) Then + ImgAceptar.Visible = True + End If + + 'If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + 'End If + + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + Protected Sub ImgRechazar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim Obsebaciones As String = GvRow.FCTextBox("TxtObservaciones").Text + If Obsebaciones.Trim.Length = 0 Then + Alert("Debe de proporcionar una obserbación o motivo de rechazo.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim Correo As String = GvRow.DataKey("ContactoMail") + Dim Documentacion As String = GvRow.DataKey("Documentacion") + Dim Obserbaciones As String = GvRow.FCTextBox("TxtObservaciones").Text + + Dim Adjunto As String = GvRow.DataKey("Adjunto") + Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero + Dim Archivo As String = UsuarioActual.Empresa.Ruta & $"Edoc\Proveedor\{CveProveedor}\{Adjunto}" + + + Dim objEdoc As New ClsEdocumentacion + Dim ErrorProceso As Boolean = False + + objEdoc.IniciaTransacSQL() + + If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 1, + If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", + UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then + + Try + File.Delete(Archivo) + Catch ex As Exception + ErrorProceso = True + End Try + + If Not ErrorProceso Then + + Dim Cuerpo As String = $"

    Por medio del presente correo se le notifica que el documento {Documentacion}   ha sido rechazado por la siguiente causa: {Obserbaciones}  por favor ingrese nuevamente al portal  y agréguelo nuevamente. 

    +

    Atentamente:

    +

    Saludos.

    " + + If Not MandaCorreo(Correo, $"{ UsuarioActual.Empresa.Empresa } documento Rechazado", Cuerpo) Then + ErrorProceso = True + End If + + Alert($"El documento {GvRow.DataKey("Documentacion") } fue rechazado.") + + End If + + + Else + ErrorProceso = True + End If + + If ErrorProceso Then + objEdoc.RollBack() + Else + objEdoc.Commit() + End If + + objEdoc.Dispose() + + CargaDocumentacion() + + End Sub + + Protected Sub ImgAceptar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim objEdoc As New ClsEdocumentacion + + If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 3, + "", "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then + Alert("Dcumento Aceptado.") + End If + + + objEdoc.Dispose() + + CargaDocumentacion() + End Sub + + Private Function MandaCorreo(Para As String, Asunto As String, Body As String) As Boolean + Dim Respuesta As Boolean = False + + Dim Mail As New ClsSisMail() + + Para = If(Para IsNot Nothing, Para, "") + Asunto = If(Asunto IsNot Nothing, Asunto, "") + Body = If(Body IsNot Nothing, Body, "") + + Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail) + + If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then + Respuesta = True + End If + + Return Respuesta + + + End Function + + + + 'Protected Sub BrnProcesar_Click(sender As Object, e As EventArgs) + + ' Dim objEdoc As New ClsEdocumentacion + ' objEdoc.IniciaTransacSQL() + + ' Dim ErrorProceso As Boolean = False + + ' For Each GvRow As GridViewRow In GvDocumentos.Rows + + ' Dim RDBAcptar As RadioButton = GvRow.FCRadioButton("RDBAcptar") + ' Dim RDBRechazar As RadioButton = GvRow.FCRadioButton("RDBRechazar") + ' Dim ContactoMail As String = GvRow.DataKey("ContactoMail") + + ' If RDBAcptar.Checked Or RDBRechazar.Checked Then + + ' Dim Estatus As Integer = If(RDBAcptar.Checked, 3, 1) + ' Dim Obsebaciones As String = If(RDBAcptar.Checked, "", GvRow.FCTextBox("TxtObservaciones").Text) + + + + ' If Not objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, Estatus, + ' If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, + ' GvRow.DataKey("FechaVigencia").ToDate) Then + ' ErrorProceso = True + ' Exit For + ' Else + + ' If Estatus = 1 Then + ' 'Enviar correo rechazo con obserbación + ' End If + ' End If + + ' Else + ' 'Enviar correo archivo pediente + ' End If + + ' Next + + ' If ErrorProceso Then + ' objEdoc.RollBack() + ' Else + ' objEdoc.Commit() + ' Alert("Proceso Terminado correctamente.") + ' End If + + ' objEdoc.Dispose() + + + 'End Sub + + + +End Class diff --git a/Edoc/CatDocumentos.aspx b/Edoc/CatDocumentos.aspx new file mode 100644 index 000000000..eaa6a2fed --- /dev/null +++ b/Edoc/CatDocumentos.aspx @@ -0,0 +1,353 @@ +<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentos.aspx.vb" Inherits="RH_CatDocumentos" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + Catálogo de Documentos + + + + +
  • + +
  • + <%--
  • + Etiquetas +
  • --%> +
    +
    +
    + + + + + + + + + +
    +
    +
    + + Documentación +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    + + + +
    + + +
    +
    + + + + + + + + + + + + + + + +
    + + + diff --git a/Edoc/CatDocumentos.aspx.vb b/Edoc/CatDocumentos.aspx.vb new file mode 100644 index 000000000..2858a24c0 --- /dev/null +++ b/Edoc/CatDocumentos.aspx.vb @@ -0,0 +1,414 @@ + + +Imports System.Data +Imports System.Linq +Imports Extensiones +Imports System.IO + +Partial Class RH_CatDocumentos + Inherits ClsPaginas + + Private Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTDocumentacion") = value + End Set + End Property + + + Property Documentacion As String + Get + If ViewState("Documentacion") Is Nothing Then + Return "-1" + Else + Return ViewState("Documentacion").ToString + End If + End Get + Set(value As String) + ViewState("Documentacion") = value + End Set + End Property + Property CveDocumentacion As Integer + Get + If ViewState("CveDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CveDocumentacion") = value + End Set + End Property + + Private Property DocumentacionTipo As String + Get + If ViewState("DocumentacionTipo") Is Nothing Then + Return "" + Else + Return ViewState("DocumentacionTipo").ToString + End If + End Get + Set(value As String) + + End Set + End Property + + + Private Property CveDocumentacionTipo As Integer + Get + If ViewState("CveDocumentacionTipo") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacionTipo"), Integer) + End If + End Get + + Set(value As Integer) + ViewState("CveDocumentacionTipo") = value + End Set + End Property + + + Property ActualizarDocumentacion As Boolean + Get + If ViewState("ActualizarDocumentacion") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("ActualizarDocumentacion") = value + End Set + End Property + + Property Estatus As Boolean + Get + If ViewState("Estatus") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("Estatus"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("Estatus") = value + End Set + End Property + + + Property DocumentacionFormato As String + Get + If ViewState("DocumentacionFormato") Is Nothing Then + Return "" + Else + Return ViewState("DocumentacionFormato").ToString + End If + End Get + Set(value As String) + ViewState("DocumentacionFormato") = value + End Set + End Property + + Property Requerido As Boolean + Get + If ViewState("Requerido") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("Requerido"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("Requerido") = value + End Set + End Property + + + Property Orden As Integer + Get + If ViewState("Orden") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("Orden"), Integer) + End If + End Get + Set(value As Integer) + ViewState("Orden") = value + End Set + End Property + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaDocumentacion() + CargaComboDocumentacion() + End If + End Sub + + +#Region "D O C U M E N T A C I O N" + + Protected Sub BtnAgregarDocumento_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumento.Click + ResetFormDocumentacion() + RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});") + End Sub + + Private Sub ResetFormDocumentacion() + + Txtdocumentacion.Text = "" + TxtOrden.Text = "" + TxtPeriodicidad.Text = "" + TxtDiasLimite.Text = "" + BtnAgregarDocumentoModal.Text = "Agregar" + LtlTituloModalDocumentacion.Text = "Agregar documentación" + 'TxtDocumentacionFormato.Text = "" + DdlDocumentacionTipo.SelectedIndex = 0 + chkEstatus.Checked = True + chkRequerido.Checked = True + + ActualizarDocumentacion = False + UpModalDocumentacion.Update() + End Sub + + Private Sub CargaDocumentacion() + + Dim objRH As New ClsEdocumentacion + + If objRH.DocumentacionGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then + + DTDocumentacion = objRH.DtResultados + GvDocumentos.DataSource = objRH.DtResultados + Else + DTDocumentacion = Nothing + GvDocumentos.DataSource = Nothing + End If + + objRH.Dispose() + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + End Sub + + Private Sub CargaComboDocumentacion() + Dim objDocumentacion As New ClsEdocumentacion + + If objDocumentacion.DocumentacionTipoGet(UsuarioActual.CveEmpresa) Then + + DdlDocumentacionTipo.DataSource = objDocumentacion.DtResultados + + End If + + objDocumentacion.Dispose() + DdlDocumentacionTipo.DataBind() + DdlDocumentacionTipo.Items.Insert(0, New ListItem("Seleccione un tipo", "-1")) + End Sub + + Public Sub Edit_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + CveDocumentacion = GvRow.DataKey("CveDocumentacion") + Documentacion = GvRow.DataKey("Documentacion") + DocumentacionFormato = GvRow.DataKey("DocumentacionFormato") + CveDocumentacionTipo = GvRow.DataKey("CveDocumentacionTipo") + DocumentacionTipo = GvRow.DataKey("DocumentacionTipo") + Orden = GvRow.DataKey("Orden") + Estatus = GvRow.DataKey("Estatus") + Requerido = GvRow.DataKey("Requerido") + + + Txtdocumentacion.Text = Documentacion + TxtOrden.Text = Orden + + TxtDiasLimite.Text = GvRow.DataKey("DiasLimite") + ChkAplicaDiasLimite.Checked = GvRow.DataKey("AplicaDiasLimite") + TxtPeriodicidad.Text = GvRow.DataKey("Periodicidad") + + ChkAplicaFechaVencimiento.Checked = GvRow.DataKey("AplicaFechaVencimiento") + + DdlDocumentacionTipo.SelectedValueExist(CveDocumentacionTipo) + chkEstatus.Checked = Estatus + chkRequerido.Checked = Requerido + + + LtlTituloModalDocumentacion.Text = "Actualizar Documento: " & Documentacion + BtnAgregarDocumentoModal.Text = "Actualizar" + + UpModalDocumentacion.Update() + ActualizarDocumentacion = True + + RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});") + + End Sub + + Private Function GuardarArchivo(_CveDocumentacion As Integer) As String + + Dim respuesta As String = "" + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + + For Each fileItem As Archivo In Filesgral + Try + respuesta = fileItem.filenameO + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + Dim tempArray() As String + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) + + Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & fileItem.filenameO + Dim docAnterior As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & DocumentacionFormato + + If DocumentacionFormato.Trim.Length > 0 Then + If File.Exists(docAnterior) Then + File.Delete(docAnterior) + End If + End If + + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "\Formatos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "\Formatos") + + End If + + If System.IO.File.Exists(rutaDestino) Then + System.IO.File.Delete(rutaDestino) + End If + + System.IO.File.Move(fileItem.FileUrl, rutaDestino) + + Catch ex As Exception + OnError("Error al cargar archivo", ex) + End Try + TxtFileDocumentacion.Text = "" + UpModalDocumentacion.Update() + Next + + + Return respuesta + End Function + + Public Sub Remove_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion") + Dim _documetacionFormato As String = GvRow.DataKey("DocumentacionFormato") + + + + Dim objEdoc As New ClsEdocumentacion + + If objEdoc.DocumentacionRemove(_CveDocumentacion, UsuarioActual.Empresa.CveEmpresa) Then + EliminarDocumentoDisco(_documetacionFormato) + Alert("Documento eliminado correctamente", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + End Sub + + Private Sub EliminarDocumentoDisco(documento As String) + + Dim archivo As String = UsuarioActual.Empresa.Ruta & "Formatos\" & documento + + If File.Exists(archivo) Then + File.Delete(archivo) + End If + + End Sub + + + Protected Sub BtnAgregarDocumentoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentoModal.Click + + Dim objRH As New ClsEdocumentacion + Dim intCompleto As Integer = 0 + Dim _estatus As Integer = 0 + Dim _requerido As Integer = 0 + Dim _formato As String = "" + + + If chkEstatus.Checked Then + _estatus = 1 + End If + + If chkRequerido.Checked Then + _requerido = 1 + End If + + If ActualizarDocumentacion Then + + _formato = GuardarArchivo(CveDocumentacion) + If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, + TxtPeriodicidad.Text.ToEntero) Then + + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion")) + Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + + Else + If objRH.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, TxtPeriodicidad.Text.ToEntero) Then + + CveDocumentacion = objRH.DtResultados(0)(0).ToString.ToEntero + _formato = GuardarArchivo(CveDocumentacion) + If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, + TxtPeriodicidad.Text.ToEntero) Then + + End If + + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion")) + Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + End If + + ActualizarDocumentacion = False + + End Sub + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero + Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim separado As Char() = {"."} + Dim array() As String = DocumetacionFormato.Split(separado) + Dim extencion As String = "" + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If DocumetacionFormato.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + End If + + End Sub + +#End Region + + +End Class + diff --git a/Edoc/CatDocumentosContratos.aspx b/Edoc/CatDocumentosContratos.aspx new file mode 100644 index 000000000..25f611602 --- /dev/null +++ b/Edoc/CatDocumentosContratos.aspx @@ -0,0 +1,468 @@ +<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentosContratos.aspx.vb" Inherits="Edoc_CatDocumentosContratos" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Documentos Contratos + + + + <%-- +
  • + +
  • + +
    --%> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tipo de contratoDocumentoRequerido
    SubContratosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA) +
    +
    SubContratosIDENTIFICACION REPRESENTANTE LEGAL
    SubContratosPODER REPRESENTANTE LEGAL
    SubContratosREGISTRO PATRONAL IMSS
    SubContratosREGISTRO ANTE EL SAT
    SubContratosPAGOS PROVSIONALES
    SubContratosPAGO DEL IMSS
    SubContratosPAGO DEL ESTADO
    SubContratosOPINION DE CUMPLIMIENTO SAT
    SubContratosCARTA DE NO ADEUDO IMSS
    SubContratosRELACION DE PERSONAL
    SubContratosRECIBOS XML NOMINA
    SubContratosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    AcarreosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    AcarreosIDENTIFICACION REPRESENTANTE LEGAL
    AcarreosPODER REPRESENTANTE LEGAL
    AcarreosREGISTRO PATRONAL IMSS
    AcarreosREGISTRO ANTE EL SAT
    AcarreosPAGOS PROVSIONALES
    AcarreosPAGO DEL IMSS
    AcarreosPAGO DEL ESTADO
    AcarreosOPINION DE CUMPLIMIENTO SAT
    AcarreosCARTA DE NO ADEUDO IMSS
    AcarreosRELACION DE PERSONAL
    AcarreosRECIBOS XML NOMINA
    AcarreosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    LimpiezaACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    LimpiezaIDENTIFICACION REPRESENTANTE LEGAL
    LimpiezaPODER REPRESENTANTE LEGAL
    LimpiezaREGISTRO PATRONAL IMSS
    LimpiezaREGISTRO ANTE EL SAT
    LimpiezaPAGOS PROVSIONALES
    LimpiezaPAGO DEL IMSS
    LimpiezaPAGO DEL ESTADO
    LimpiezaOPINION DE CUMPLIMIENTO SAT
    LimpiezaCARTA DE NO ADEUDO IMSS
    LimpiezaRELACION DE PERSONAL
    LimpiezaRECIBOS XML NOMINA
    LimpiezaREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    MaterialesACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    MaterialesIDENTIFICACION REPRESENTANTE LEGAL
    MaterialesPODER REPRESENTANTE LEGAL
    MaterialesREGISTRO PATRONAL IMSS
    MaterialesREGISTRO ANTE EL SAT
    MaterialesPAGOS PROVSIONALES
    MaterialesPAGO DEL IMSS
    MaterialesPAGO DEL ESTADO
    MaterialesOPINION DE CUMPLIMIENTO SAT
    MaterialesCARTA DE NO ADEUDO IMSS
    MaterialesRELACION DE PERSONAL
    MaterialesRECIBOS XML NOMINA
    MaterialesREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    AcarreosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    AcarreosIDENTIFICACION REPRESENTANTE LEGAL
    AcarreosPODER REPRESENTANTE LEGAL
    AcarreosREGISTRO PATRONAL IMSS
    AcarreosREGISTRO ANTE EL SAT
    AcarreosPAGOS PROVSIONALES
    AcarreosPAGO DEL IMSS
    AcarreosPAGO DEL ESTADO
    AcarreosOPINION DE CUMPLIMIENTO SAT
    AcarreosCARTA DE NO ADEUDO IMSS
    AcarreosRELACION DE PERSONAL
    AcarreosRECIBOS XML NOMINA
    AcarreosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    + + + <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    +
    + + + +
    + + + + + +
    + + +
    --%> + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/CatDocumentosContratos.aspx.vb b/Edoc/CatDocumentosContratos.aspx.vb new file mode 100644 index 000000000..fdf7d0d87 --- /dev/null +++ b/Edoc/CatDocumentosContratos.aspx.vb @@ -0,0 +1,116 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Edoc_CatDocumentosContratos + Inherits ClsPaginas + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + End If + + End Sub + + + 'Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click + ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) + 'End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click + + + + End Sub + +#Region "G V D A T O S" + + 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(250) + ' e.Row.Cells(1).Width = Unit.Pixel(100) + ' e.Row.Cells(2).Width = Unit.Pixel(100) + ' e.Row.Cells(3).Width = Unit.Pixel(100) + ' e.Row.Cells(4).Width = Unit.Pixel(100) + ' e.Row.Cells(5).Width = Unit.Pixel(61) + ' End If + ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting + ' Dim ObjGenero As New ClsRH + ' If ObjGenero.RemoveGenero(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("El Género se eliminó correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit + ' GvDatos.EditIndex = -1 + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowUpdating(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click + ' Dim ObjGenero As New ClsRH + ' Dim Genero As String = GeneroTxt.Text.Trim + ' Dim Estatus As Boolean = ChkEstatus.Checked + ' Dim CveGenero As Integer = CveGeneroAEditar + + ' If ObjGenero.UpdateGenero(Genero, Estatus, CveGenero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) + ' BtnAgregarTiposDModal.Visible = False + ' BtnEditarTiposDModal.Visible = True + ' CheckActiveSection.Visible = True + ' saltoDeLinea.Visible = True + + ' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar + ' GeneroTxt.Text = GvRow.DataKey("Genero") + ' ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) + ' CveGeneroAEditar = Convert.ToInt32(GvRow.DataKey("CveGenero")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating" + + ' UpDatos.Update() + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + 'End Sub +#End Region + + +End Class diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx new file mode 100644 index 000000000..77164873c --- /dev/null +++ b/Edoc/CatTipoContratos.aspx @@ -0,0 +1,165 @@ +<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoContratos.aspx.vb" Inherits="Edoc_CatTipoContrato" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo Tipos de Contrato + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tipo de ContratoEstatusUsuarioComandos
    SubContratosActivoSistema
    AcarreosActivoSistema
    LimpiezaActivoSistema
    MaterialesActivoSistema
    + <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    +
    + + + +
    + + + + + +
    + + +
    --%> + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/CatTipoContratos.aspx.vb b/Edoc/CatTipoContratos.aspx.vb new file mode 100644 index 000000000..f153a181b --- /dev/null +++ b/Edoc/CatTipoContratos.aspx.vb @@ -0,0 +1,116 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Edoc_CatTipoContrato + Inherits ClsPaginas + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + End If + + End Sub + + + Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) + End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click + + + + End Sub + +#Region "G V D A T O S" + + 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(250) + ' e.Row.Cells(1).Width = Unit.Pixel(100) + ' e.Row.Cells(2).Width = Unit.Pixel(100) + ' e.Row.Cells(3).Width = Unit.Pixel(100) + ' e.Row.Cells(4).Width = Unit.Pixel(100) + ' e.Row.Cells(5).Width = Unit.Pixel(61) + ' End If + ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting + ' Dim ObjGenero As New ClsRH + ' If ObjGenero.RemoveGenero(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("El Género se eliminó correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit + ' GvDatos.EditIndex = -1 + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowUpdating(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click + ' Dim ObjGenero As New ClsRH + ' Dim Genero As String = GeneroTxt.Text.Trim + ' Dim Estatus As Boolean = ChkEstatus.Checked + ' Dim CveGenero As Integer = CveGeneroAEditar + + ' If ObjGenero.UpdateGenero(Genero, Estatus, CveGenero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) + ' BtnAgregarTiposDModal.Visible = False + ' BtnEditarTiposDModal.Visible = True + ' CheckActiveSection.Visible = True + ' saltoDeLinea.Visible = True + + ' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar + ' GeneroTxt.Text = GvRow.DataKey("Genero") + ' ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) + ' CveGeneroAEditar = Convert.ToInt32(GvRow.DataKey("CveGenero")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating" + + ' UpDatos.Update() + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + 'End Sub +#End Region + + +End Class diff --git a/General/CatDocumentacionTipo.aspx b/General/CatDocumentacionTipo.aspx index 3cffb0787..dba6be481 100644 --- a/General/CatDocumentacionTipo.aspx +++ b/General/CatDocumentacionTipo.aspx @@ -100,7 +100,8 @@ Catalogo Documentacion Tipo Seleccione uno Recursos Humanos - Clientes + Clientes + Proveedor diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index ad0b81226..4c0b7fd38 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -798,10 +798,184 @@ + <%---2020/02/06 - Auditoria--%> + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + +
    + + +
    +
    +
    + + + + +
    +
    +
    +
    + - + @@ -853,6 +1027,16 @@ }); }); + + + function RestrictSpace() { + + if (event.keyCode == 32) { + event.returnValue = false; + return false; + } + } + - e + diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index fbc7a3673..fb21bc792 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -2,12 +2,13 @@ Option Strict On Imports System.Data +Imports System.IO Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Portal_PortalProveedor - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "PROPIEDADES" Private Property CveProveedor As Integer Get @@ -102,10 +103,10 @@ Partial Class Portal_PortalProveedor Set(value As DataTable) ViewState("DTGvAH") = value End Set - End Property - + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -114,8 +115,9 @@ Partial Class Portal_PortalProveedor ViewState("Orden") = "" CargaDatos() - - 'CARGAN PESTANIAS SEGUN PERMISOS + CargaDocumentacion() + + 'CARGAN PESTANIAS SEGUN PERMISOS If UsuarioActual.TienePermisoProceso(236) Then ' CARGA TAB HISTORIAL DE VENTAS TabHistorial.Visible = True CargaHistorial("-1", 20) @@ -147,11 +149,11 @@ Partial Class Portal_PortalProveedor If UsuarioActual.CvePlataforma = 7 Then TabContraseña.Visible = True End If - End Sub - - + End Sub + + #Region "C A R G A - D A T O S" - + Protected Sub CargaDatos() GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}") Dim ObjProveedor As New ClsCompProveedores() @@ -169,8 +171,8 @@ Partial Class Portal_PortalProveedor End If ObjProveedor.Dispose() - End Sub - + End Sub + #Region "CARGA GRIDS" Private Sub CargaHistorial(SerieSucursal As String, SelectTop As Integer) Dim ObjProveedores As New ClsCompProveedores() @@ -308,9 +310,9 @@ Partial Class Portal_PortalProveedor GvBancosCuentas.DataBind() UpCuentasBancos.Update() - End Sub + End Sub #End Region - + #Region "ROW DATA BOUND" Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -448,13 +450,13 @@ Partial Class Portal_PortalProveedor End If Archivo = Nothing Alert("No se encontro el documento") - End Sub + End Sub #End Region - - + + #End Region - - + + #Region " BTNS VER MÁS" Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs) @@ -506,289 +508,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") @@ -898,12 +900,12 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function + End Function #End Region - - + + #Region "Crédito por Aplicar Impresión" - + Protected Sub BtnExcelCredito_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimeReporteNTPorAplicar("EXCEL") If retorno IsNot Nothing Then @@ -1019,14 +1021,14 @@ Partial Class Portal_PortalProveedor Return retorno - End Function - - + End Function + + #End Region - - + + #Region "Historial de Ventas IMPRESION" - + Protected Sub BtnExcelVentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteVentas("EXCEL") If retorno IsNot Nothing Then @@ -1086,11 +1088,11 @@ Partial Class Portal_PortalProveedor End If ObjProveedores.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "CxP Pagadas IMPRESION" Protected Sub BtnExcelPagadas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteCxPPagadas("EXCEL") @@ -1149,13 +1151,13 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "CxCActivas IMPRESION" - + Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteCxCHistorial("EXCEL") If retorno IsNot Nothing Then @@ -1217,11 +1219,11 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function + End Function #End Region - + #Region "TAB CONTRASENIA" - + Protected Sub BtnGuardarContraseña_Click(sender As Object, e As EventArgs) Handles BtnGuardarContraseña.Click If Decripta(UsuarioActual.Contraseña) = TxtContraseniaActual.Text Then @@ -1244,7 +1246,465 @@ Partial Class Portal_PortalProveedor Alert("La Contraseña Actual es incorrecta.", TipoMensaje.MsgAdvertencia) End If - End Sub + End Sub #End Region + + +#Region "AUDITORIA" + + Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + + End Set + + End Property + + Private Sub CargaDocumentacion() + Dim ObjEDoc As New ClsEdocumentacion + + 'If objRH.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.Empresa.CveEmpresa, -1, -1, 3) Then + + If ObjEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, 3, -1) Then + + + DTDocumentacion = ObjEDoc.DtResultados + GvDocumentos.DataSource = ObjEDoc.DtResultados + Else + DTDocumentacion = Nothing + GvDocumentos.DataSource = Nothing + End If + + ObjEDoc.Dispose() + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + End Sub + + + Property CveDocumentacionElectronica As Integer + Get + If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CvePersonalClienteDocumentacion") = value + End Set + End Property + + Property CveDocumentacion As Integer + Get + If ViewState("CveDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CveDocumentacion") = value + End Set + End Property + + Property Documentacion As String + Get + If ViewState("Documentacion") Is Nothing Then + Return "-1" + Else + Return ViewState("Documentacion").ToString + End If + End Get + Set(value As String) + ViewState("Documentacion") = value + End Set + End Property + + Property AdjuntoDocumentacion As String + Get + If ViewState("AdjuntoDocumentacion") Is Nothing Then + Return "" + Else + Return ViewState("AdjuntoDocumentacion").ToString + End If + End Get + Set(value As String) + ViewState("AdjuntoDocumentacion") = value + End Set + End Property + + + + Property DiasVigencia As Integer + Get + If ViewState("DiasVigencia") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("DiasVigencia"), Integer) + End If + End Get + Set(value As Integer) + ViewState("DiasVigencia") = value + End Set + End Property + + Property AplicaFechaVencimiento As Boolean + Get + If ViewState("AplicaFechaVencimiento") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("AplicaFechaVencimiento") = value + End Set + End Property + + Private Property FechaVigencia As Date + Get + If ViewState("FechaVigencia") Is Nothing Then + Return Nothing + Else + Return ViewState("FechaVigencia").ToString.ToDate + End If + End Get + Set(value As Date) + ViewState("FechaVigencia") = value + End Set + End Property + + Property Estatus As Integer + Get + If ViewState("Estatus") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("Estatus"), Integer) + End If + End Get + Set(value As Integer) + ViewState("Estatus") = value + End Set + End Property + + Property ObservacionDocumentacion As String + Get + If ViewState("ObservacionDocumentacion") Is Nothing Then + Return "" + Else + Return ViewState("ObservacionDocumentacion").ToString + End If + End Get + Set(value As String) + ViewState("ObservacionDocumentacion") = value + End Set + End Property + + Private Property FechaLimite As Date + Get + If ViewState("FechaLimite") Is Nothing Then + Return Date.Now.AddDays(15) + Else + Return ViewState("FechaLimite").ToString.ToDate + End If + End Get + Set(value As Date) + ViewState("FechaLimite") = value + End Set + + End Property + + Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + ' Dim chkEstatus As CheckBox + CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero + Documentacion = GvRow.DataKey("Documentacion") + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + + 'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero + Dim x As String = GvRow.DataKey("AplicaFechaVencimiento") + If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False + + If GvRow.DataKey("Adjunto").ToString.Length > 0 Then + FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate + Else + FechaVigencia = Nothing + End If + + + Estatus = GvRow.DataKey("Estatus").ToEntero + + 'If chkEstatus.Checked Then + ' Estatus = 1 + 'Else + ' Estatus = 0 + 'End If + + ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper + FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate + + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + LtlModalUploadTitulo.Text = "Subir " & Documentacion + + UpModalTitleUploadDocumento.Update() + + RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});") + + End Sub + + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgUpload As LinkButton = e.Row.FCLinkButton("ImgUpload") + Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired") + Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite") + Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia") + Dim Documentacion As String = e.Row.DataKey("Documentacion") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + + 'If AplicaFechaVencimiento And e.Row.DataKey("DiasVigencia").ToString.ToEntero > 0 Then + ' txtFechaVigencia.Enabled = False + 'End If + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + txtFechaVigencia.ForeColor = Drawing.Color.Red + End If + End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + ImgUpload.Visible = False + Else + 'chkEstatus.Checked = False + End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + + Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + + If AplicaFechaVencimiento And DiasVigencia > 0 Then + FechaVigencia = DateTime.Today.AddDays(DiasVigencia) + End If + + For Each fileItem As Archivo In Filesgral + + Try + + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + Dim tempArray() As String + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) + + Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension + Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion + + If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then + System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") + End If + + If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then + File.Delete(rutaAdjuntoAnterior) + End If + + If System.IO.File.Exists(rutaDestino) Then + System.IO.File.Delete(rutaDestino) + End If + + System.IO.File.Move(fileItem.FileUrl, rutaDestino) + + + Dim objEdoc As New ClsEdocumentacion + + If CveDocumentacionElectronica = -1 Then + If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then + + End If + Else + If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then + + End If + End If + + objEdoc.Dispose() + + 'GuardarDocumentos(CveDocumentacion) + CargaDocumentacion() + + TxtFileDocumentacion.Text = "" + UPModalUploadDoc.Update() + + + Alert("Archivo cargado correctamente.") + Catch ex As Exception + OnError("Error al cargar archivo", ex) + End Try + + Next + + RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3") + + End Sub + + Private Sub GuardarDocumentos(Optional _CveDocumentacionExcluir As Integer = -1) + + Dim hasError As Boolean = True + Dim objDocumentos As New ClsEdocumentacion + + For Each dRow As GridViewRow In GvDocumentos.Rows + + Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero + Dim _Adjunto As String = dRow.DataKey("Adjunto") + Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones") + Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite") + Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia") + + Dim _FechaVigencia As Date + Dim _FechaLimite As Date + + Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus") + Dim _estatus As Integer + + If chkEstatus.Checked Then + _estatus = 1 + Else + _estatus = 0 + End If + + Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + If _TxtFechaVigencia.Text.Length = 10 Then + _FechaVigencia = _TxtFechaVigencia.Text.ToDate + Else + _FechaVigencia = Nothing + End If + + If Not AplicaDiasLimite Then + _FechaLimite = MinFecha + Else + _FechaLimite = _TxtFechaLimite.Text.ToDate + End If + + If Not AplicaFechaVencimiento Then + _FechaVigencia = MinFecha + End If + + If Not _CveDocumentacionExcluir = _CveDocumentacion Then + Try + If _CveDocumentacionElectronica = -1 Then + + If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, -1, -1, CveProveedor, -1, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then + Else + hasError = True + Exit For + End If + + Else + If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, -1, -1, CveProveedor, -1, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then + Else + hasError = True + Exit For + End If + End If + + + hasError = False + Catch ex As Exception + hasError = True + Exit For + End Try + End If + Next + + CargaDocumentacion() + objDocumentos.Dispose() + End Sub + +#End Region + + End Class \ No newline at end of file From e610d01cd7f5feec88311f91d7c0053250acbd99 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 10 Feb 2020 18:13:33 -0700 Subject: [PATCH 03/32] commit general local oscar --- .../RepEntradasUsadosClientes.aspx.vb | 15 +- App_Code/ClsBancos.vb | 3 +- App_Code/ClsContabilidad.vb | 5 +- App_Code/ClsEdocumentacion.vb | 4 +- App_Code/ClsPaginas.vb | 8 +- App_Code/Modelos.vb | 4 +- Bancos/FluctuacionCambiaria.aspx.vb | 3 + Bancos/IE.aspx.vb | 12 +- Bancos/PagoElectronico.aspx.vb | 2 +- Compras/ProveedoresAuxiliar.aspx | 8 + Compras/ProveedoresAuxiliar.aspx.vb | 2 +- Contabilidad/RegPoliza.aspx.vb | 4 +- Contabilidad/RegPrePoliza.aspx.vb | 21 +- Empresas/57/Formatos/Factura.rdlc | 34 +- Empresas/72/Formatos/Factura.rdlc | 22 +- GPS/Rastreo.aspx | 2548 +++++++++-------- GPS/Rastreo.aspx.vb | 300 +- GPS/Rastreo/JS/Geocercas.js | 139 + 18 files changed, 1798 insertions(+), 1336 deletions(-) create mode 100644 GPS/Rastreo/JS/Geocercas.js diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb index f20abeef3..8925785f9 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb +++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb @@ -61,11 +61,18 @@ Partial Class Acumuladores_RepEntradasUsadosClientes Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" Then - e.Row.CssClass = "SubTotales2" - End If - + 'If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" Then + ' e.Row.CssClass = "SubTotales2" + 'End If + If e.Row.DBCampo("TipoHeader").ToString = "1" Then + e.Row.CssClass = "Totales" + ElseIf e.Row.DBCampo("TipoHeader").ToString = "2" Then + e.Row.CssClass = "SubTotales" + ElseIf e.Row.DBCampo("TipoHeader").ToString = "3" Then + e.Row.CssClass = "SubTotales2" + End If End If + End Sub Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index dddbce407..8113ab863 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -1597,7 +1597,7 @@ Public Class ClsBancos Return Retorno End Function - Public Function CancelarBancos_IE(CveUsuario As Integer, CveIE As Integer, MesAnterior As Boolean, IdPoliza As Integer, Optional FechaCancelacion As Date = MinFecha, Optional TipoMovimiento As Integer = 1) As Boolean + Public Function CancelarBancos_IE(CveUsuario As Integer, CveIE As Integer, MesAnterior As Boolean, IdPoliza As Integer, FolioPoliza As Integer, Optional FechaCancelacion As Date = MinFecha, Optional TipoMovimiento As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_IECancelar") @@ -1607,6 +1607,7 @@ Public Class ClsBancos .Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@MesAnterior", SqlDbType.Bit).Value = MesAnterior .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza + .Add("@FolioPoliza", SqlDbType.Int).Value = FolioPoliza .Add("@FechaCancelacion", SqlDbType.Date).Value = FechaCancelacion .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento End With diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 4f7e0a8e2..e5a748ea3 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -388,7 +388,7 @@ Public Class ClsContabilidad Public Function GetProveedoresAuxiliar(CveProveedor As Integer, CveConceptoContable As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, - Optional Opcion As Integer = 1, Optional CveTipoProveedor As Integer = -1) As Boolean + Optional Opcion As Integer = 1, Optional CveTipoProveedor As Integer = -1, Optional Contabilizable As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_ProveedoresAuxiliar") @@ -402,6 +402,7 @@ Public Class ClsContabilidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor + .Add("@Contabilizable", SqlDbType.Int).Value = Contabilizable End With Try @@ -1477,7 +1478,7 @@ Public Class ClsContabilidad Catch ex As Exception - ObjConta.RollBack() + If Not ContaCompartida Then ObjConta.RollBack() OnError("Ocurrió un error al intentar contabilizar la PrePoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) 'Alert("Ocurrió un error al guardar la póliza", TipoMensaje.MsgAdvertencia) Retorno = False diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index 6b96bae06..b850d1078 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -128,7 +128,7 @@ Public Class ClsEdocumentacion #Region "D O C U M E N T A C I O N " - Public Function DocumentacionGet(CveDocumentacion As Integer, CveDocumentacionTipo As Integer, Estatus As Integer, CveEmpresa As Integer, Optional Modulo As Integer = 1) As Boolean + Public Function DocumentacionGet(CveDocumentacion As Integer, CveDocumentacionTipo As Integer, Estatus As Integer, CveEmpresa As Integer, Optional Modulo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionGet") @@ -435,7 +435,7 @@ Public Class ClsEdocumentacion Return Retorno End Function - Public Function DocumentacionTipoGet(CveEmpresa As Integer, Optional Modulo As Integer = 1) As Boolean + Public Function DocumentacionTipoGet(CveEmpresa As Integer, Optional Modulo As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d85c936bf..56ef2a7dd 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4565,8 +4565,10 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/Clientes.aspx".ToUpper(), 5) PaginaDict.Add("/Ventas/CatClientes.aspx".ToUpper(), 5) PaginaDict.Add("/Ventas/CatClientesClasificaciones.aspx".ToUpper(), 408) - PaginaDict.Add("/Ventas/Ventas.aspx".ToUpper(), 6) - PaginaDict.Add("/Ventas/RepVentas.aspx".ToUpper(), 9) + PaginaDict.Add("/Ventas/Ventas.aspx".ToUpper(), 6) + PaginaDict.Add("/Ventas/Ventas.aspx?Op=Cot".ToUpper(), 366) + PaginaDict.Add("/Ventas/RepVentas.aspx".ToUpper(), 9) + PaginaDict.Add("/Ventas/RepVentas.aspx?Op=Cot".ToUpper(), 367) PaginaDict.Add("/Ventas/RepRemisiones.aspx".ToUpper(), 430) PaginaDict.Add("/Ventas/RepRemisionesDetalle.aspx".ToUpper(), 430) PaginaDict.Add("/Ventas/RepCotizaciones.aspx".ToUpper(), 430) @@ -4644,7 +4646,7 @@ Public Class ClsPaginas 'PaginaDict.Add("/Ventas/Ventas.aspx".ToUpper(), 2016) 'PaginaDict.Add("/Ventas/Clientes.aspx".ToUpper(), 2017) PaginaDict.Add("/Ventas/Ventas.aspx?Op=Rem".ToUpper(), 2018) - PaginaDict.Add("/Ventas/Ventas.aspx?Op=Cot".ToUpper(), 2019) + 'PaginaDict.Add("/Ventas/Ventas.aspx?Op=Cot".ToUpper(), 2019) PaginaDict.Add("/Ventas/VentasH.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/ClientesAbonarH.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/PVRaul.aspx".ToUpper(), -1) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 447ab3844..3a75dc1df 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -3061,7 +3061,7 @@ Namespace Modelos CveCuentaContabilizacion = 0 End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambio) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambio, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True Else ObjFactura.SeGuardoPrePoliza = True @@ -4375,7 +4375,7 @@ Namespace Modelos Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" - If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "NC") Then + If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then AutoConta = False End If diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 1855b24b4..00b3f2881 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -430,6 +430,7 @@ Partial Class Bancos_FluctuacionCambiaria If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then SeContabilizo = True Else + ErrorRegistrar = True Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) End If End If @@ -437,10 +438,12 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar And SeContabilizo Then Conta.Commit() + ObjContPaq.Commit() Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) CargaDatosCuentas() Else Conta.RollBack() + ObjContPaq.Dispose() End If Conta.Dispose() End Sub diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 1027f7906..e56e4f732 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -3878,7 +3878,7 @@ Partial Class Bancos_IE 'CANCELA IE If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If @@ -3909,7 +3909,7 @@ Partial Class Bancos_IE 'CANCELA IE If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If @@ -3932,13 +3932,13 @@ Partial Class Bancos_IE ' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then If TxtFechaDocumento.Text.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'CANCELA IE MES ANTERIOR - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ANTERIOR" End If Else 'CANCELA IE MES ACTUAL - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then + If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ACTUAL" End If @@ -4107,7 +4107,7 @@ Partial Class Bancos_IE 'genera nuevo IE contrario If Not ErrorCancelar Then - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then + If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then ErrorCancelar = True End If End If @@ -4123,7 +4123,7 @@ Partial Class Bancos_IE Else 'siempre se hace una cancelación - If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then + If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then ErrorCancelar = True End If diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb index 4a70aa2a1..93a64cde4 100644 --- a/Bancos/PagoElectronico.aspx.vb +++ b/Bancos/PagoElectronico.aspx.vb @@ -1582,7 +1582,7 @@ Partial Class Bancos_PagoElectronico Else 'Cuando salio NO exitoso cancelamos el IE - If Not ObjIE.CancelarBancos_IE(UsuarioActual.CveUsuario, ArrayCveIEs(index).ToEntero, False, -1) Then + If Not ObjIE.CancelarBancos_IE(UsuarioActual.CveUsuario, ArrayCveIEs(index).ToEntero, False, -1, -1) Then ErrorDB = True End If End If diff --git a/Compras/ProveedoresAuxiliar.aspx b/Compras/ProveedoresAuxiliar.aspx index 8afae6a37..4ef950a21 100644 --- a/Compras/ProveedoresAuxiliar.aspx +++ b/Compras/ProveedoresAuxiliar.aspx @@ -131,6 +131,14 @@ + +
    + + + + + +
    diff --git a/Compras/ProveedoresAuxiliar.aspx.vb b/Compras/ProveedoresAuxiliar.aspx.vb index 9b727b010..926764dfe 100644 --- a/Compras/ProveedoresAuxiliar.aspx.vb +++ b/Compras/ProveedoresAuxiliar.aspx.vb @@ -81,7 +81,7 @@ Partial Class Compras_ProveedoresAuxiliar 'Falta PA If ObjConta.GetProveedoresAuxiliar(DdlProveeedores.SelectedValue.ToEntero, -1, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, - DdlOpcion.SelectedValue.ToEntero, DdlTipoProveedor.SelectedValue.ToEntero) Then + DdlOpcion.SelectedValue.ToEntero, DdlTipoProveedor.SelectedValue.ToEntero, DdlOpcionContabilizable.SelectedValue.ToEntero) Then If DdlOpcion.SelectedValue.ToEntero = 2 Then GvP.DataSource = ObjConta.DtResultados.FiltraParametros($" IIF(ISNULL(CveConceptoContable,0) = 5 AND Importe >= 0,0,1) = 1 ") Else diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 443aa6d68..25dbcc116 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -1702,7 +1702,9 @@ Partial Class RegPoliza If ObjConta.RemovePoliza(IDPoliza) Then If ObjMov.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then - If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, TxtDescripcion.Text, "Polizas", TxtNumeroPoliza.Text, DdlTipoPoliza.SelectedValue.ToEntero) Then + If ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, TxtDescripcion.Text, "Polizas", TxtNumeroPoliza.Text, DdlTipoPoliza.SelectedValue.ToEntero) Then + + Else ErrorTrans = True End If Else diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index d89078102..071e8c784 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -1341,11 +1341,30 @@ Partial Class ContabilidadC_RegPrePoliza Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click Dim ObjContabilidad As New ClsContabilidad - + ObjContabilidad.IniciaTransacSQL() + Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + ObjConta.IniciaTransacSQL() + Dim TieneError As Boolean = False + If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then + If IdPoliza > 0 Then + If Not ObjConta.RemovePoliza(IdPoliza) Then + TieneError = True + End If + End If + Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion) Else Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError) + TieneError = True + End If + + If Not TieneError Then + ObjContabilidad.Commit() + ObjConta.Commit() + Else + ObjContabilidad.RollBack() + ObjConta.RollBack() End If ObjContabilidad.Dispose() diff --git a/Empresas/57/Formatos/Factura.rdlc b/Empresas/57/Formatos/Factura.rdlc index d09c31329..b7edb3bc0 100644 --- a/Empresas/57/Formatos/Factura.rdlc +++ b/Empresas/57/Formatos/Factura.rdlc @@ -816,8 +816,15 @@ Normal + + + + + - =Parameters!RFC.Value + GOTE811117236 @@ -1304,7 +1311,7 @@ Textbox19 1.53208in - 0.04514in + 0.05471in 0.23611in 0.85387in 17 @@ -1379,9 +1386,8 @@ - Cuidad + Ciudad @@ -1391,7 +1397,7 @@ Textbox19 1.7682in - 0.04514in + 0.05471in 0.25in 0.85387in 19 diff --git a/Empresas/72/Formatos/Factura.rdlc b/Empresas/72/Formatos/Factura.rdlc index c01f96238..cc919a0a0 100644 --- a/Empresas/72/Formatos/Factura.rdlc +++ b/Empresas/72/Formatos/Factura.rdlc @@ -3375,7 +3375,15 @@ - Scotiabank CTA. 0686 4074 CLABE 0447 7011 006 8640 743 + CONVENIO CIE Bancomer: 001598120 Referencia: + + + + =Parameters!ClienteCodigo.Value - - - =Parameters!Referencia.Value + Scotiabank CTA. 0686 4074 CLABE 0447 7011 006 8640 743 + + + + + + Textbox6 + + + + + + Gray + 2pt + 2pt + 2pt + 1pt + + + + @@ -57,9 +97,6 @@ 3.17009cm - - 6.13624cm - @@ -135,41 +172,6 @@ - - - - true - - - - - =Fields!TipoAlmacen.Value - - - - - - - TipoAlmacen - - - =IIF(Fields!Almacen.Value="Total","#67809F","White") - 2pt - 2pt - 1pt - 1pt - - - - @@ -256,46 +258,6 @@ - - - 0.3751cm - - - true - true - - - - - Tipo Almacén - - - - - - - Textbox42 - - - Gray - 2pt - 2pt - 2pt - 1pt - - - - - @@ -344,6 +306,44 @@ + + + + 6.13624cm + + + true + true + + + + + =Fields!TipoAlmacen.Value + + + + + + =IIF(Fields!Almacen.Value="Total","#67809F","White") + 2pt + 2pt + 1pt + 1pt + + + + + + @@ -371,11 +371,13 @@ - Filtros - 0.17638cm + 0.20788cm 0.6cm 18.70841cm 1 @@ -676,6 +678,7 @@ + 0cm 0cm 19.26933cm 5 diff --git a/Inventarios/RepAlmacen.aspx b/Inventarios/RepAlmacen.aspx index 5d4b16180..3edf19640 100644 --- a/Inventarios/RepAlmacen.aspx +++ b/Inventarios/RepAlmacen.aspx @@ -161,6 +161,11 @@ <%# Eval("Almacen") %> + + + + + @@ -171,11 +176,6 @@ - - - - - diff --git a/Inventarios/RepAlmacen.aspx.vb b/Inventarios/RepAlmacen.aspx.vb index 0285cdfd0..57284f8ca 100644 --- a/Inventarios/RepAlmacen.aspx.vb +++ b/Inventarios/RepAlmacen.aspx.vb @@ -85,10 +85,10 @@ Partial Class Inventarios_RepAlmacen Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim StrFiltro As New StringBuilder - If TxtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", TxtFechaI.Text.ToDate.ToShortDateString) - If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", TxtFechaF.Text.ToDate.ToShortDateString) - If DdlTipoAlmacen.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Almacen: {0}", DdlTipoAlmacen.GetSelectedText) - If DdlModalidadFiltro.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Modalidad: {0}", DdlModalidadFiltro.SelectedItem) + If TxtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", TxtFechaI.Text.ToDate.ToShortDateString) Else StrFiltro.AppendFormat(" Fecha Inicio : Sin Considerar") + If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", TxtFechaF.Text.ToDate.ToShortDateString) Else StrFiltro.AppendFormat(" Fecha Fin : Sin Considerar") + If DdlTipoAlmacen.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Almacen: {0}", DdlTipoAlmacen.GetSelectedText) Else StrFiltro.AppendFormat(" Tipo Almacen: Todos") + If DdlModalidadFiltro.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Modalidad: {0}", DdlModalidadFiltro.SelectedItem) Else StrFiltro.AppendFormat(" Modalidad: Todas") Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) From aeee23fd814ff73599fc27e277a46c85b7e1e674 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 11 Feb 2020 21:03:12 -0700 Subject: [PATCH 06/32] Acumulado en reporte de comisiones --- Ventas/RepComisiones.aspx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Ventas/RepComisiones.aspx b/Ventas/RepComisiones.aspx index 293384f61..bedffe731 100644 --- a/Ventas/RepComisiones.aspx +++ b/Ventas/RepComisiones.aspx @@ -107,19 +107,23 @@ - <%----%> - <%----%> - + - <%-- - --%> - - - + + + + + + + + + + <%----%> + From 173de6ebe4b7138a03a06aa1d254594815974d38 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 11 Feb 2020 21:03:42 -0700 Subject: [PATCH 07/32] Refacturacion con anticipos y NC --- Ventas/Ventas.aspx | 24 +++++++++++++++----- Ventas/Ventas.aspx.vb | 51 +++++++++++++++++++++++++++++++------------ vwd.webinfo | 36 +++++++++++++++--------------- 3 files changed, 74 insertions(+), 37 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 0847b5a8f..7d7216312 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -6515,14 +6515,26 @@ } function LimitaSaldoRNCChk(TxtImporte, Saldo) { var Importe = 0; - if (TxtImporte.value != '') { - Importe = parseFloat(TxtImporte.value); + + if (TxtImporte.value.includes('.')) { + return; + } + if (TxtImporte.value.includes(',')) { + return; } - if (Importe > Saldo) { - TxtImporte.value = FormatoNumero(Saldo, 2); - } else { - TxtImporte.value = FormatoNumero(Importe, 2);; + var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$"); + + if (regex.test(TxtImporte.value)) { + if (TxtImporte.value != '') { + Importe = parseFloat(TxtImporte.value); + } + + if (Importe > Saldo) { + TxtImporte.value = FormatoNumero(Saldo, 2); + } else { + TxtImporte.value = FormatoNumero(Importe, 2);; + } } } diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3699d95db..f22ae9243 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6771,19 +6771,25 @@ Partial Class Ventas TieneAnticipo = True CveAnticipoPadre = row2.DataKey("CveVenta").ToEntero - ObjFactura.CveVentaRelacion = CveAnticipoPadre 'relaciona al anticipo CveAnticipo = CveAnticipoPadre - ObjFactura.ImporteRelacion = row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal - FolioFiscalRelacionado = row2.DataKey("FolioFiscal") - ObjFactura.CveVentaPadre = row2.DataKey("CveVenta").ToEntero + 'CUANDO ES REFACTURACION DEBE RELACIONAR CON LA FACTURA REFACTURADA + If NuevaFactura <> 1 Then + ObjFactura.CveVentaRelacion = CveAnticipoPadre 'relaciona al anticipo + ObjFactura.ImporteRelacion = row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal + FolioFiscalRelacionado = row2.DataKey("FolioFiscal") + ObjFactura.CveVentaPadre = row2.DataKey("CveVenta").ToEntero + Else + ObjFactura.CveVentaRelacion = CveDevolucion + End If End If actualindex = actualindex + 1 Next End If + Dim EsNCAmortizacion As Boolean = False - If DdlTipoComprobante.SelectedValue = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then + If ObjFactura.TipoDocto = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then EsNCAmortizacion = True End If @@ -6847,7 +6853,14 @@ Partial Class Ventas ' cambiar la condicion para saber si hay seleccionado If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then Try - CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveAnticipoPadre, NCDescuento:=NCDescuento) + Dim CveVentaRelacionada As Integer = -1 + If NuevaFactura = 1 Then + CveVentaRelacionada = ObjFactura.CveVenta + Else + CveVentaRelacionada = CveAnticipoPadre + End If + + CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento) If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, Nothing, Nothing, NCDescuento:=NCDescuento) Then Obj2.Add(ObjFacturaDevolucion) @@ -7524,13 +7537,16 @@ Partial Class Ventas End If End If - If DtVentasNC Is Nothing Then InicializaDTVentasNC() - Dim Drt = DtVentasNC.NewRow - Drt("CveVenta") = ObjFactura.CveVenta - Drt("Importe") = 0 - Drt("FolioFiscal") = ObjFactura.FolioFiscal - DtVentasNC.Rows.Add(Drt) - DtVentasNC.AcceptChanges() + 'SI NO ES REFACTURACION + If NuevaFactura <> 1 Then + If DtVentasNC Is Nothing Then InicializaDTVentasNC() + Dim Drt = DtVentasNC.NewRow + Drt("CveVenta") = ObjFactura.CveVenta + Drt("Importe") = 0 + Drt("FolioFiscal") = ObjFactura.FolioFiscal + DtVentasNC.Rows.Add(Drt) + DtVentasNC.AcceptChanges() + End If End Sub @@ -7648,7 +7664,14 @@ Partial Class Ventas factura.RetIVA = TotalRetIVA factura.RetISR = TotalRetISR factura.Total = Total - factura.CveVentaPadre = CveVentaP + + 'SI ES REFACTURACION DEBE RELACIONAR CON LA VENTA NUEVA + If NuevaFactura = 1 Then + factura.CveVentaPadre = ObjFactura.CveVenta + Else + factura.CveVentaPadre = CveVentaP + End If + If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then DtVentasNC.Rows(0)("Importe") = Total diff --git a/vwd.webinfo b/vwd.webinfo index 8a63d860e..5155bd0b4 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -1,18 +1,20 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file From 03e565a333195c37e25371fcce91eaa8a2fc462b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 12 Feb 2020 11:33:01 -0700 Subject: [PATCH 08/32] nuevo catalogo de paqueteria guia tipo --- App_Code/ClsGenerales.vb | 48 ++++++++++++ Compras/CatPaqueteriasGuiasTipo.aspx | 98 +++++++++++++++++++++++++ Compras/CatPaqueteriasGuiasTipo.aspx.vb | 82 +++++++++++++++++++++ 3 files changed, 228 insertions(+) create mode 100644 Compras/CatPaqueteriasGuiasTipo.aspx create mode 100644 Compras/CatPaqueteriasGuiasTipo.aspx.vb diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 3e035cf13..bb08cf310 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -384,6 +384,54 @@ Public Class ClsGenerales Return Retorno End Function + + Public Function AddGralPaqueteriasGuiasTipo(PaqueteriaGuiaTipo As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_PaqueteriasGuiasTipoAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@PaqueteriaGuiaTipo", SqlDbType.VarChar).Value = PaqueteriaGuiaTipo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveGralPaqueteriasGuiasTipo(CvePaqueteriaGuiaTipo As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_PaqueteriasGuiasTipoDelete") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaqueteriaGuiaTipo", SqlDbType.Int).Value = CvePaqueteriaGuiaTipo + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function UpdateGralPaqueteriasGuiasTipo(CvePaqueteriaGuiaTipo As Integer, PaqueteriaGuiaTipo As String) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_PaqueteriasGuiasTipoUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePaqueteriaGuiaTipo", SqlDbType.Int).Value = CvePaqueteriaGuiaTipo + .Add("@PaqueteriaGuiaTipo", SqlDbType.VarChar).Value = PaqueteriaGuiaTipo + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar en el Catálogo de Paqueterias Guias Tipos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function #End Region #Region "P L A N T I L L A S C O N T R A T O S" diff --git a/Compras/CatPaqueteriasGuiasTipo.aspx b/Compras/CatPaqueteriasGuiasTipo.aspx new file mode 100644 index 000000000..7345ed5c3 --- /dev/null +++ b/Compras/CatPaqueteriasGuiasTipo.aspx @@ -0,0 +1,98 @@ +<%@ Page Title="Compras - Catálogo de Paquetería" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPaqueteriasGuiasTipo.aspx.vb" Inherits="Comp_CatPaqueteriasGuiasTipo" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Paqueterías + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    +
    + + + +
    + + + + + +
    + + +
    + + + +
    +
    +
    + + \ No newline at end of file diff --git a/Compras/CatPaqueteriasGuiasTipo.aspx.vb b/Compras/CatPaqueteriasGuiasTipo.aspx.vb new file mode 100644 index 000000000..b606e5df0 --- /dev/null +++ b/Compras/CatPaqueteriasGuiasTipo.aspx.vb @@ -0,0 +1,82 @@ +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Comp_CatPaqueteriasGuiasTipo + Inherits ClsPaginas + + Private Property CvePaqueteriaGuiaTipo() As Integer 'Guardamos el ID de registro para saber cual registro Editar + Get + Return If(IsNothing(ViewState("CvePaqueteriaGuiaTipo")), -1, CInt(ViewState("CvePaqueteriaGuiaTipo"))) + End Get + Set + ViewState("CvePaqueteriaGuiaTipo") = 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() + End If + End Sub + + Public Sub CargaDatos() + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetGralPaqueteriasGuiasTipo(UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjGenerales.DtResultados + End If + ObjGenerales.Dispose() + GvDatos.DataBind() + End Sub + + Protected Sub BtnAgregarPaqueteria_Click(sender As Object, e As EventArgs) Handles BtnAgregarPaqueteria.Click + BtnEditarTiposDModal.Visible = False + BtnAgregarTiposDModal.Visible = True + UpModalTiposD.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + End Sub + + Protected Sub BtnAgregarTiposDModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarTiposDModal.Click + Dim ObjGeneral As New ClsGenerales + If ObjGeneral.AddGralPaqueteriasGuiasTipo(TxtPaqueteria.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + CargaDatos() + UpDatos.Update() + Alert("Agregado Correctamente") + End If + ObjGeneral.Dispose() + End Sub + + Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting + Dim ObjGeneral As New ClsGenerales + If ObjGeneral.RemoveGralPaqueteriasGuiasTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then + CargaDatos() + UpDatos.Update() + Alert("Eliminado con exito") + End If + ObjGeneral.Dispose() + End Sub + + Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) + BtnEditarTiposDModal.Visible = True + BtnAgregarTiposDModal.Visible = False + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar + TxtPaqueteria.Text = GvRow.DataKey("PaqueteriaGuiaTipo") + CvePaqueteriaGuiaTipo = GvRow.DataKey("CvePaqueteriaGuiaTipo") + + UpModalTiposD.Update() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + End Sub + + Protected Sub BtnEditarTiposDModal_Click(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click + Dim ObjGeneral As New ClsGenerales + If ObjGeneral.UpdateGralPaqueteriasGuiasTipo(CvePaqueteriaGuiaTipo, TxtPaqueteria.Text) Then + CargaDatos() + UpDatos.Update() + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + Alert("Actualizado con exito") + End If + ObjGeneral.Dispose() + End Sub +End Class From 73ea8aa561b743409814367c398a5dc613ab1c56 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 12 Feb 2020 18:04:18 -0700 Subject: [PATCH 09/32] Cancelar ingresos amortizados --- App_Code/Modelos.vb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 3a75dc1df..e0d5d3f62 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -449,7 +449,6 @@ Namespace Modelos Private Sub IniciaValoresVentas(Optional EsCancelacion As Boolean = False) If CveVenta > 0 AndAlso CveEmpresa > 0 Then Me.DtAnticipos = New DataTable() - Me.DtAntNCVinculadas = New DataTable() Me.DtPagos = New DataTable() Me.DtRemisiones = New DataTable() Me.DtInventario = New DataTable() @@ -483,7 +482,7 @@ Namespace Modelos If TipoDocto.Contiene("Ing", "Ant", "Rem") Then 'carga as notas de credito vinculadas If ObjVentas.GetVentasAntNC(CveVenta, -1) Then - Me.DtAntNCVinculadas = ObjVentas.DtResultados.Copy() + Me.DtAnticipos = ObjVentas.DtResultados.Copy() End If End If @@ -493,7 +492,7 @@ Namespace Modelos End If If TipoDocto.Contiene("Ant") AndAlso EsCancelacion Then - EsNCAmortizacion = True + Me.EsNCAmortizacion = True End If If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then @@ -2418,9 +2417,18 @@ Namespace Modelos CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos CveSubProyectoContabilizar = CveSubProyectoVenta + Dim CveVenta As Integer = ObjFactura.CveVenta + Dim CveVentaAmortizacion As Integer = row2("CveVenta").ToString().ToEntero + + 'SI ES FACTURA EN 0 Y TIENE ANTICIPOS + If (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing")) AndAlso row2("TipoDocto").ToString() = "Ant" Then + CveVenta = row2("CveVenta").ToString().ToEntero + CveVentaAmortizacion = ObjFactura.CveVenta + End If + If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, - CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=row2("CveVenta").ToString().ToEntero, CveCliente:=ObjFactura.CveCliente, + CveVenta:=CveVenta, CveVentaAmortizacion:=CveVentaAmortizacion, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -5213,8 +5221,7 @@ Namespace Modelos Public Property DtDeduccion As Data.DataTable Public Property DtFirmas As Data.DataTable Public Property DtDesgloseImpuestos As Data.DataTable - Public Property DtDocumentosRelacionados As Data.DataTable - Public Property DtAntNCVinculadas As Data.DataTable + Public Property DtDocumentosRelacionados As Data.DataTable Public Property DtNCVinculadas As Data.DataTable Public Property DtAnticipos As Data.DataTable From 7d907ebb3e861566a4bc6756b2676f5dfa4eb159 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 12 Feb 2020 18:04:34 -0700 Subject: [PATCH 10/32] Error al consultar cliente --- Ventas/PV.aspx.vb | 294 +++++++++++++++++++++++----------------------- 1 file changed, 149 insertions(+), 145 deletions(-) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index c35541b2a..00f7d2cbd 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1579,161 +1579,165 @@ Partial Class PV End Sub Private Sub CargaCliente(CveCliente As Integer, Optional Estatus As Integer = 1) - Dim ObjCliente As New ClsClientes() + Try + If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + TxtCodigo.Text = ObjCliente.Codigo - If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - TxtCodigo.Text = ObjCliente.Codigo - - LblCliente.Text = String.Format("{1}", CveCliente, ObjCliente.Nombre) - ViewState("NombreCliente") = ObjCliente.Nombre - LtlCliente.Text = ObjCliente.Nombre - ChkEnviarFactura.Checked = ObjCliente.EnviarFactura - ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail) - ViewState("MailCC") = ObjCliente.NotificarA - LblDireccion.Text = ObjCliente.Direccion - LblColonia.Text = ObjCliente.Colonia - LblCiudad.Text = ObjCliente.Ciudad - LblEstado.Text = ObjCliente.Estado - LblCP.Text = ObjCliente.CP - LblRFC.Text = ObjCliente.RFC - LblTelefono.Text = ObjCliente.Telefono - LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5) - LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5) - ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 - ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 - ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes - If ObjCliente.RetieneIVAFletes Then - TrRetIVA.Style.Add("display", "") - UsuarioActual.Empresa.MostrarRetIVA = True - End If - - ViewState("Vendedor") = ObjCliente.Vendedor - ViewState("CtaContable") = ObjCliente.CuentaContable - ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes - ViewState("IdCtaContMonedaExtranjera") = ObjCliente.IdCtaContMonedaExtranjera - ViewState("IdCtaContComplementaria") = ObjCliente.IdCtaContComplementaria - ViewState("IdCtaContAnticipos") = ObjCliente.IdCtaContAnticipos - ViewState("IdCtaContRetIVA") = ObjCliente.IdCtaContRetIVA - ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR - ViewState("CodCliente") = ObjCliente.Codigo - ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS - - If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then - TrEsDistribuidor.Visible = True - LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}") - Else - TrEsDistribuidor.Visible = False - End If - - ViewState("CliNoExt") = ObjCliente.NoExt - ViewState("CliNoInt") = ObjCliente.NoInt - ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) - ViewState("CliPais") = ObjCliente.Pais - - 'ViewState("NumCtaPago") = ObjCliente.NumCtaPago - EnviarCorreoCliente = ObjCliente.EnviarFactura - ChkEnviarFactura.Visible = True - ChkEnviarFactura.Checked = EnviarCorreoCliente - LblEnviarMail.Visible = True - - Dim dr As DataRow = Nothing - dr = GlobalDTSubProyectos(-1).FiltroPrimero("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) - If dr IsNot Nothing Then - ViewState("MatCalle") = dr("Calle") - ViewState("MatNoExt") = dr("NoExt") - ViewState("MatNoInt") = dr("NoInt") - ViewState("MatColonia") = dr("Colonia") - ViewState("MatLocalidad") = dr("Localidad") - ViewState("MatMunicipio") = dr("Municipio") - ViewState("MatEstado") = dr("Estado") - ViewState("MatPais") = dr("Pais") - ViewState("MatCP") = dr("CP") - End If - - If CveVenta <= 0 Then - CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero - DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString) - DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString) - DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33.ToString) - 'DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString) - DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty) - - DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString) - 'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString) - DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString) - End If - TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString - - - If ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero > 0 Then - DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero) - End If - - If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then - DdlVendedor.Enabled = False - End If - - EstatusCliente = ObjCliente.Estatus - - If Not EstatusCliente Then - BtnEmitirImprimir.Enabled = False - Alert("El Cliente seleccionado no esta activo", TipoMensaje.MsgAdvertencia) - Else - BtnEmitirImprimir.Enabled = True - End If - - UpFacturar.Update() - - If UsuarioActual.Empresa.UsaInventarios Then - RblTipo.Items.Remove(RblTipo.Items.FindByValue("1")) - RblTipo.Items.Remove(RblTipo.Items.FindByValue("2")) - End If - UpnTools.Update() - - - If Not CveVenta > 0 Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - If UsuarioActual.TienePermisoProceso(152) Then - DdlSubProyectoDatos.SelectedValueExist(UsuarioActual.CveSubProyecto) - DdlSubProyectoDatos.Enabled = False - Else - DdlSubProyectoDatos.SelectedValueExist(ObjCliente.CveSubProyecto) - End If - 'RECARGA LOS VALORES DE LA SUCURSAL - CambiaSucursal() - UpParametros.Update() + LblCliente.Text = String.Format("{1}", CveCliente, ObjCliente.Nombre) + ViewState("NombreCliente") = ObjCliente.Nombre + LtlCliente.Text = ObjCliente.Nombre + ChkEnviarFactura.Checked = ObjCliente.EnviarFactura + ViewState("Mail") = If(DdlTipoComprobante.SelectedValue = "Cot", ObjCliente.MailCotizacion, ObjCliente.Mail) + ViewState("MailCC") = ObjCliente.NotificarA + LblDireccion.Text = ObjCliente.Direccion + LblColonia.Text = ObjCliente.Colonia + LblCiudad.Text = ObjCliente.Ciudad + LblEstado.Text = ObjCliente.Estado + LblCP.Text = ObjCliente.CP + LblRFC.Text = ObjCliente.RFC + LblTelefono.Text = ObjCliente.Telefono + LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5) + LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5) + ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 + ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 + ViewState("RetIVAFletes") = ObjCliente.RetieneIVAFletes + If ObjCliente.RetieneIVAFletes Then + TrRetIVA.Style.Add("display", "") + UsuarioActual.Empresa.MostrarRetIVA = True End If - End If - If ObjCliente.GetSucursales(CveCliente) Then - DdlSucursalCliente.DataSource = ObjCliente.DtResultados - If ObjCliente.DtResultados.Rows.Count > 0 Then - trsucursalciente.Visible = True + ViewState("Vendedor") = ObjCliente.Vendedor + ViewState("CtaContable") = ObjCliente.CuentaContable + ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes + ViewState("IdCtaContMonedaExtranjera") = ObjCliente.IdCtaContMonedaExtranjera + ViewState("IdCtaContComplementaria") = ObjCliente.IdCtaContComplementaria + ViewState("IdCtaContAnticipos") = ObjCliente.IdCtaContAnticipos + ViewState("IdCtaContRetIVA") = ObjCliente.IdCtaContRetIVA + ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR + ViewState("CodCliente") = ObjCliente.Codigo + ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS + + If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then + TrEsDistribuidor.Visible = True + If Not String.IsNullOrEmpty(ObjCliente.Vendedor) Then + LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}") + End If + Else + TrEsDistribuidor.Visible = False + End If + + ViewState("CliNoExt") = ObjCliente.NoExt + ViewState("CliNoInt") = ObjCliente.NoInt + ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) + ViewState("CliPais") = ObjCliente.Pais + + 'ViewState("NumCtaPago") = ObjCliente.NumCtaPago + EnviarCorreoCliente = ObjCliente.EnviarFactura + ChkEnviarFactura.Visible = True + ChkEnviarFactura.Checked = EnviarCorreoCliente + LblEnviarMail.Visible = True + + Dim dr As DataRow = Nothing + dr = GlobalDTSubProyectos(-1).FiltroPrimero("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa) + If dr IsNot Nothing Then + ViewState("MatCalle") = dr("Calle") + ViewState("MatNoExt") = dr("NoExt") + ViewState("MatNoInt") = dr("NoInt") + ViewState("MatColonia") = dr("Colonia") + ViewState("MatLocalidad") = dr("Localidad") + ViewState("MatMunicipio") = dr("Municipio") + ViewState("MatEstado") = dr("Estado") + ViewState("MatPais") = dr("Pais") + ViewState("MatCP") = dr("CP") + End If + + If CveVenta <= 0 Then + CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero + DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString) + DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString) + DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33.ToString) + 'DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString) + DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty) + + DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString) + 'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString) + DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString) + End If + TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString + + + If ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero > 0 Then + DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero) + End If + + If DdlVendedor.SelectedValue.ToEntero > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then + DdlVendedor.Enabled = False + End If + + EstatusCliente = ObjCliente.Estatus + + If Not EstatusCliente Then + BtnEmitirImprimir.Enabled = False + Alert("El Cliente seleccionado no esta activo", TipoMensaje.MsgAdvertencia) + Else + BtnEmitirImprimir.Enabled = True + End If + + UpFacturar.Update() + + If UsuarioActual.Empresa.UsaInventarios Then + RblTipo.Items.Remove(RblTipo.Items.FindByValue("1")) + RblTipo.Items.Remove(RblTipo.Items.FindByValue("2")) + End If + UpnTools.Update() + + + If Not CveVenta > 0 Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + If UsuarioActual.TienePermisoProceso(152) Then + DdlSubProyectoDatos.SelectedValueExist(UsuarioActual.CveSubProyecto) + DdlSubProyectoDatos.Enabled = False + Else + DdlSubProyectoDatos.SelectedValueExist(ObjCliente.CveSubProyecto) + End If + 'RECARGA LOS VALORES DE LA SUCURSAL + CambiaSucursal() + UpParametros.Update() + End If + End If + + If ObjCliente.GetSucursales(CveCliente) Then + DdlSucursalCliente.DataSource = ObjCliente.DtResultados + If ObjCliente.DtResultados.Rows.Count > 0 Then + trsucursalciente.Visible = True + Else + trsucursalciente.Visible = False + End If Else trsucursalciente.Visible = False + DdlSucursalCliente.DataSource = Nothing End If + DdlSucursalCliente.DataBind() + + + LbAgregar.Enabled = True + UpEstatus.Update() + UpPS.Update() + UpParametros.Update() + UPCondicionesPago.Update() + UpComplementos.Update() + + CargarAlmacenes() + CargaFacturasAjuste() Else - trsucursalciente.Visible = False - DdlSucursalCliente.DataSource = Nothing + Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError) End If - DdlSucursalCliente.DataBind() - - - LbAgregar.Enabled = True - UpEstatus.Update() - UpPS.Update() - UpParametros.Update() - UPCondicionesPago.Update() - UpComplementos.Update() - - CargarAlmacenes() - CargaFacturasAjuste() - Else - Alert("El cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgError) End If - End If + Catch ex As Exception + OnError("Ocurrió un error al asignar el cliente", ex) + End Try ObjCliente.Dispose() UPCondicionesPago.Update() End Sub From 6fc5f29b71ad8fd1f847cd88321d47bf552c1dd3 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 12 Feb 2020 18:05:10 -0700 Subject: [PATCH 11/32] Error al timbrar la primera vez un ingreso cuando tiene impuestos locales --- Ventas/Ventas.aspx.vb | 64 +++++++++++++++++++++++++------------------ vwd.webinfo | 2 ++ 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f22ae9243..fa5270557 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -7444,8 +7444,8 @@ Partial Class Ventas For Each gvr As GridViewRow In GvImpuestosLocales2.Rows If gvr.RowType = DataControlRowType.DataRow Then Dim Orden As Integer = 80 - If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble > 0 Then - DR("ImpuestoLocal") = gvr.DataKey("ImpuestoLocal").ToString : DR("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble : DR("Orden") = Orden : DR("Porcentaje") = gvr.DataKey("Porcentaje").ToString : DR("TipoImpuesto") = gvr.DataKey("TipoImpuesto").ToString : DR("IdCtaContable") = gvr.DataKey("IdCtaContable").ToString.ToEntero : TmpDTImpuestos.Rows.Add(DR) + If gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal > 0 Then + DR("ImpuestoLocal") = gvr.DataKey("ImpuestoLocal").ToString : DR("Importe") = gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal.RoundSQL(2) : DR("Orden") = Orden : DR("Porcentaje") = gvr.DataKey("Porcentaje").ToString : DR("TipoImpuesto") = gvr.DataKey("TipoImpuesto").ToString : DR("IdCtaContable") = gvr.DataKey("IdCtaContable").ToString.ToEntero : TmpDTImpuestos.Rows.Add(DR) DR = TmpDTImpuestos.NewRow() Orden = Orden + 1 End If @@ -8266,7 +8266,12 @@ Partial Class Ventas For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 1").Rows If DrImpuestosLocales("Importe").ToString.ToDecimal > 0 Then - Dim ret As New CFDIRetencionesLocales With {.TasaRetencion = DrImpuestosLocales("Porcentaje").ToString.ToDecimal, .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString, .Importe = DrImpuestosLocales("Importe").ToString.ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1))} + Dim ret As New CFDIRetencionesLocales With + { + .TasaRetencion = DrImpuestosLocales("Porcentaje").ToString.ToDecimal, + .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString, + .Importe = DrImpuestosLocales("Importe").ToString.ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1)).RoundSQL(2) + } ObjFactura.Timbre.RetencionesLocales.Add(ret) End If Next @@ -18429,39 +18434,44 @@ Partial Class Ventas 'Else 'End If - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs", "RNC") Then - Dim sb As New StringBuilder() - sb.Append("La factura se encuentra en el siguiente estatus del SAT:
    ") - Dim TotalT As Decimal = TxtTotal.Text.ToDecimal - Dim RFCReceptor As String = LblRFC.Text.Trim - Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) - If Vigencia IsNot Nothing Then - If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then - Alert("Esta factura no es cancelable.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - If String.IsNullOrEmpty(Vigencia.EsCancelable) Then - If Not String.IsNullOrEmpty(FolioFiscal) Then - Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia) + 'SI ES PRODUCCION VERIFICA EL ESTATUS ANTE EL SAT + If UsuarioActual.Empresa.FacturaProduccion AndAlso Not FolioFiscal.Contains("test") Then + Dim sb As New StringBuilder() + sb.Append("La factura se encuentra en el siguiente estatus del SAT:
    ") + + Dim TotalT As Decimal = TxtTotal.Text.ToDecimal + Dim RFCReceptor As String = LblRFC.Text.Trim + Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True) + If Vigencia IsNot Nothing Then + If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then + Alert("Esta factura no es cancelable.", TipoMensaje.MsgAdvertencia) Exit Sub End If - sb.Append("No encontrado
    ") + If String.IsNullOrEmpty(Vigencia.EsCancelable) Then + If Not String.IsNullOrEmpty(FolioFiscal) Then + Alert("No se pudo encontrar el estatus de la factura en el SAT.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + sb.Append("No encontrado
    ") + Else + sb.AppendFormat("{0}
    ", Vigencia.EsCancelable) + End If Else - sb.AppendFormat("{0}
    ", Vigencia.EsCancelable) + sb.Append("No encontrado
    ") End If + + sb.Append("Está seguro de cancelar el documento?.") + + LblCancelarDocumento.Text = sb.ToString() + + RegistraScript("$('#ModalCancelarDocumento').modal();") + UpCancelarDocumento.Update() Else - sb.Append("No encontrado
    ") + CancelarDocumento() End If - sb.Append("Está seguro de cancelar el documento?.") - - LblCancelarDocumento.Text = sb.ToString() - - RegistraScript("$('#ModalCancelarDocumento').modal();") - UpCancelarDocumento.Update() - Else CancelarDocumento() End If diff --git a/vwd.webinfo b/vwd.webinfo index 5155bd0b4..824b76cb0 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -15,6 +15,8 @@ + +
    \ No newline at end of file From 47bab18fd3cd85badfed8b5836decac43b569cba Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Thu, 13 Feb 2020 09:53:11 -0700 Subject: [PATCH 12/32] documentacion proveedor para pago electronico General --- App_Code/ClsCompProveedores.vb | 137 ++++++++++ Edoc/CatDocumentosContratos.aspx | 411 ++-------------------------- Edoc/CatDocumentosContratos.aspx.vb | 106 ++----- Edoc/CatTipoContratos.aspx | 103 ++----- Edoc/CatTipoContratos.aspx.vb | 173 ++++++------ vwd.webinfo | 36 +-- 6 files changed, 325 insertions(+), 641 deletions(-) diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 56585d092..b439b1ff9 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -1549,6 +1549,143 @@ Public Class ClsCompProveedores #End Region +#Region "TIPOS CONTRATOS" + + Public Function GetTiposContratos(CveTipoContrato As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With + + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el los tipos de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function AddTiposContratos(TipoContrato As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@TipoContrato", SqlDbType.VarChar).Value = TipoContrato + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function UpdateTiposContratos(CveTipoContrato As Integer, TipoContrato As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@CveTipoContrato", SqlDbType.VarChar).Value = TipoContrato + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function RemoveTiposContratos(CveTipoContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetTiposContratosDcumentos(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosDocumentosGet") + + 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 eliminar el tipo de contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function UpdateTiposContratosDocumentos(CveTipoContrato As Integer, CveDocumentacion As Integer, Requerido As Boolean) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Prov_SAT_CatTipoContratosDocumentosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato + .Add("@CveDocumentacion", SqlDbType.Int).Value = CveDocumentacion + .Add("@Requerido", SqlDbType.Bit).Value = Requerido + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al Obtener los actualizar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + ' IDisposable #Region " IDisposable Support " diff --git a/Edoc/CatDocumentosContratos.aspx b/Edoc/CatDocumentosContratos.aspx index 25f611602..96906ac70 100644 --- a/Edoc/CatDocumentosContratos.aspx +++ b/Edoc/CatDocumentosContratos.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentosContratos.aspx.vb" Inherits="Edoc_CatDocumentosContratos" %> +<%@ Page Title="Documentos Contratos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentosContratos.aspx.vb" Inherits="Edoc_CatDocumentosContratos" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> @@ -27,394 +27,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Tipo de contratoDocumentoRequerido
    SubContratosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA) -
    -
    SubContratosIDENTIFICACION REPRESENTANTE LEGAL
    SubContratosPODER REPRESENTANTE LEGAL
    SubContratosREGISTRO PATRONAL IMSS
    SubContratosREGISTRO ANTE EL SAT
    SubContratosPAGOS PROVSIONALES
    SubContratosPAGO DEL IMSS
    SubContratosPAGO DEL ESTADO
    SubContratosOPINION DE CUMPLIMIENTO SAT
    SubContratosCARTA DE NO ADEUDO IMSS
    SubContratosRELACION DE PERSONAL
    SubContratosRECIBOS XML NOMINA
    SubContratosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    AcarreosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    AcarreosIDENTIFICACION REPRESENTANTE LEGAL
    AcarreosPODER REPRESENTANTE LEGAL
    AcarreosREGISTRO PATRONAL IMSS
    AcarreosREGISTRO ANTE EL SAT
    AcarreosPAGOS PROVSIONALES
    AcarreosPAGO DEL IMSS
    AcarreosPAGO DEL ESTADO
    AcarreosOPINION DE CUMPLIMIENTO SAT
    AcarreosCARTA DE NO ADEUDO IMSS
    AcarreosRELACION DE PERSONAL
    AcarreosRECIBOS XML NOMINA
    AcarreosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    LimpiezaACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    LimpiezaIDENTIFICACION REPRESENTANTE LEGAL
    LimpiezaPODER REPRESENTANTE LEGAL
    LimpiezaREGISTRO PATRONAL IMSS
    LimpiezaREGISTRO ANTE EL SAT
    LimpiezaPAGOS PROVSIONALES
    LimpiezaPAGO DEL IMSS
    LimpiezaPAGO DEL ESTADO
    LimpiezaOPINION DE CUMPLIMIENTO SAT
    LimpiezaCARTA DE NO ADEUDO IMSS
    LimpiezaRELACION DE PERSONAL
    LimpiezaRECIBOS XML NOMINA
    LimpiezaREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    MaterialesACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    MaterialesIDENTIFICACION REPRESENTANTE LEGAL
    MaterialesPODER REPRESENTANTE LEGAL
    MaterialesREGISTRO PATRONAL IMSS
    MaterialesREGISTRO ANTE EL SAT
    MaterialesPAGOS PROVSIONALES
    MaterialesPAGO DEL IMSS
    MaterialesPAGO DEL ESTADO
    MaterialesOPINION DE CUMPLIMIENTO SAT
    MaterialesCARTA DE NO ADEUDO IMSS
    MaterialesRELACION DE PERSONAL
    MaterialesRECIBOS XML NOMINA
    MaterialesREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    AcarreosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    AcarreosIDENTIFICACION REPRESENTANTE LEGAL
    AcarreosPODER REPRESENTANTE LEGAL
    AcarreosREGISTRO PATRONAL IMSS
    AcarreosREGISTRO ANTE EL SAT
    AcarreosPAGOS PROVSIONALES
    AcarreosPAGO DEL IMSS
    AcarreosPAGO DEL ESTADO
    AcarreosOPINION DE CUMPLIMIENTO SAT
    AcarreosCARTA DE NO ADEUDO IMSS
    AcarreosRELACION DE PERSONAL
    AcarreosRECIBOS XML NOMINA
    AcarreosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    - - <%-- + +
    + - + + - - - - - - - - - - - - - - - + + - - - + + + - - - - + + + + + - - - -
    - -   -
    -
    - - - -
    - - - - - -
    - - -
    --%> + + + + + +
    + + + + + diff --git a/Edoc/CatDocumentosContratos.aspx.vb b/Edoc/CatDocumentosContratos.aspx.vb index fdf7d0d87..9d9e86c54 100644 --- a/Edoc/CatDocumentosContratos.aspx.vb +++ b/Edoc/CatDocumentosContratos.aspx.vb @@ -11,106 +11,42 @@ Partial Class Edoc_CatDocumentosContratos Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then + CargaDatos() End If End Sub - 'Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click - ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) - 'End Sub - - Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click + Private Sub CargaDatos() + Dim ObjProv As New ClsCompProveedores + If ObjProv.GetTiposContratosDcumentos(UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjProv.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjProv.Dispose() + + GvDatos.DataBind() End Sub -#Region "G V D A T O S" - 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - ' If e.Row.RowIndex = 0 Then - ' e.Row.Cells(0).Width = Unit.Pixel(250) - ' e.Row.Cells(1).Width = Unit.Pixel(100) - ' e.Row.Cells(2).Width = Unit.Pixel(100) - ' e.Row.Cells(3).Width = Unit.Pixel(100) - ' e.Row.Cells(4).Width = Unit.Pixel(100) - ' e.Row.Cells(5).Width = Unit.Pixel(61) - ' End If - ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left - ' End If - 'End Sub + Protected Sub ChkRequerido_CheckedChanged(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, CheckBox).NamingContainer, GridViewRow) - 'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting - ' Dim ObjGenero As New ClsRH - ' If ObjGenero.RemoveGenero(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then - ' GvDatos.EditIndex = -1 - ' ViewState("DTGenero") = ObjGenero.DtResultados - ' GlobalDTGenero = ObjGenero.DtResultados - ' Alert("El Género se eliminó correctamente.", TipoMensaje.MsgInformacion) - ' End If + Dim CveTipoContrato As Integer = GvRow.DataKey("CveTipoContrato").ToEntero + Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToEntero + Dim ChkRequerido As CheckBox = GvRow.FCCheckBox("ChkRequerido") - ' ObjGenero.Dispose() + Dim ObjProv As New ClsCompProveedores - ' If ViewState("Orden").ToString() <> String.Empty Then - ' CargaGrid(ViewState("Orden").ToString()) - ' Else - ' CargaGrid("") - ' End If - 'End Sub + ObjProv.UpdateTiposContratosDocumentos(CveTipoContrato, CveDocumentacion, ChkRequerido.Checked) - 'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit - ' GvDatos.EditIndex = -1 - ' If ViewState("Orden").ToString() <> String.Empty Then - ' CargaGrid(ViewState("Orden").ToString()) - ' Else - ' CargaGrid("") - ' End If - 'End Sub - - 'Protected Sub GvDatos_RowUpdating(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click - ' Dim ObjGenero As New ClsRH - ' Dim Genero As String = GeneroTxt.Text.Trim - ' Dim Estatus As Boolean = ChkEstatus.Checked - ' Dim CveGenero As Integer = CveGeneroAEditar - - ' If ObjGenero.UpdateGenero(Genero, Estatus, CveGenero) Then - ' GvDatos.EditIndex = -1 - ' ViewState("DTGenero") = ObjGenero.DtResultados - ' GlobalDTGenero = ObjGenero.DtResultados - ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - ' End If - - ' ObjGenero.Dispose() - - ' If ViewState("Orden").ToString() <> String.Empty Then - ' CargaGrid(ViewState("Orden").ToString()) - ' Else - ' CargaGrid("") - ' End If - 'End Sub - - 'Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) - ' BtnAgregarTiposDModal.Visible = False - ' BtnEditarTiposDModal.Visible = True - ' CheckActiveSection.Visible = True - ' saltoDeLinea.Visible = True - - ' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar - ' GeneroTxt.Text = GvRow.DataKey("Genero") - ' ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) - ' CveGeneroAEditar = Convert.ToInt32(GvRow.DataKey("CveGenero")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating" - - ' UpDatos.Update() - ' If ViewState("Orden").ToString() <> String.Empty Then - ' CargaGrid(ViewState("Orden").ToString()) - ' Else - ' CargaGrid("") - ' End If - ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) - 'End Sub -#End Region + ObjProv.Dispose() + End Sub End Class diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx index 77164873c..422b85b15 100644 --- a/Edoc/CatTipoContratos.aspx +++ b/Edoc/CatTipoContratos.aspx @@ -13,7 +13,7 @@
  • - +
  • @@ -28,97 +28,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Tipo de ContratoEstatusUsuarioComandos
    SubContratosActivoSistema
    AcarreosActivoSistema
    LimpiezaActivoSistema
    MaterialesActivoSistema
    - <%-- +
    + - + + - - - - - - - - - - - - - - - + + - + + + + + + + - + + - - -
    - -   -
    -
    + - + - + - + -
    - - -
    --%> - + + + +
    +