From a2b5f31f4c89a2213c144e5f1a6bdd48c221162e Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 29 Apr 2020 11:59:20 -0700 Subject: [PATCH 01/25] Compras Biatico Comprobacion Clasificaiones --- App_Code/ClsClasificaciones.vb | 28 +++++-- Ashx/SIGWeb.ashx | 61 ++++++++++++++- Compras/Compras.aspx.vb | 136 ++++++++++++++++++++++++++++++++- 3 files changed, 214 insertions(+), 11 deletions(-) diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 2be1a8152..ec598938a 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -112,12 +112,12 @@ Public Class ClsClasificaciones Public Sub Commit() If SqlTransacc IsNot Nothing Then SqlTransacc.Commit() SqlTransacc = Nothing - End Sub - - + End Sub + + #Region "C L A S I F I C A C I O N E S" - - + + Public Function GetClasificaciones(Optional CveEmpresa As Integer = -1, Optional Tipo As Integer = 1) As Boolean Dim Retorno As Boolean = False @@ -134,6 +134,24 @@ Public Class ClsClasificaciones OnError("Ocurrió un error al consultar las Clasificaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try + Return Retorno + End Function + + Public Function GetClasificacionesComprobaciones(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_ClasificacionesComprobacionesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar las Clasificaciones de comprobaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 6b81beb8a..c4c0f3fcb 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -365,7 +365,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim i As Integer = 0 While i < objInv.DtResultados.Columns.Count - If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then + If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion", "CveClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then objInv.DtResultados.Columns.RemoveAt(i) Else i = i + 1 @@ -460,8 +460,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable Try - DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"}) - + DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion", "CveClasificacion"}) Catch ex As Exception DtPSRetorno = Nothing End Try @@ -469,7 +468,61 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End If DTPS = Nothing End If + + + + + + If (usuario.TienePermisoProceso(300) Or usuario.TienePermisoProceso(301)) And (DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0) Then + + Dim ObjClasificaciones As New ClsClasificaciones() + Dim DTClasificacionesComprobaciones As DataTable + + Dim DTTmp As DataTable = DtPSRetorno.Clone + + + If ObjClasificaciones.GetClasificacionesComprobaciones(usuario.CveEmpresa) Then + + If usuario.TienePermisoProceso(300) And usuario.TienePermisoProceso(301) Then + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados + ElseIf usuario.TienePermisoProceso(300) Then 'TipoComprobacion 1 Biaticos + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 1") + Else 'TipoComprobacion 2 Compreobacines + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 2") + End If + + For Each pRow As DataRow In DtPSRetorno.Rows + + For Each drow As DataRow In DTClasificacionesComprobaciones.Rows + If pRow("CveClasificacion").ToString.ToEntero = drow("CveClasificacion").ToString.ToEntero Then + + Dim nRow As DataRow = DTTmp.NewRow + nRow("CvePS") = pRow("CvePS") + nRow("PSCodigo") = pRow("PSCodigo") + nRow("PSCodigoClasificacion") = pRow("PSCodigoClasificacion") + nRow("CveClasificacion") = pRow("CveClasificacion") + DTTmp.Rows.Add(nRow) + + + End If + Next + + Next + + DtPSRetorno = DTTmp.Copy + + Else + 'no regresar datos herror al consultar + DtPSRetorno.Clear() + End If + + End If + + + If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then + + DtPSRetorno.Columns("CvePS").ColumnName = "id" DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text" If PSCodigoDescripcion = "PSCodigo" Then @@ -477,8 +530,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Else DtPSRetorno.Columns().Remove("PSCodigo") End If + retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString context.Response.Write(retorno) + Else context.Response.Write("[]") End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index c3321d047..f2c5ad2e7 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1008,6 +1008,7 @@ Partial Class Compras_Compras ViewState("CveFlete") = value End Set End Property + Private Property FleteImportacionOpcion As Integer Get Return IfNull(ViewState("FleteImportacionOpcion"), -1).ToString.ToEntero @@ -1017,6 +1018,22 @@ Partial Class Compras_Compras End Set End Property + Private Property DTClasificacionesComprobaciones As DataTable + Get + + If ViewState("DTClasificacionesComprobaciones") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTClasificacionesComprobaciones"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DTClasificacionesComprobaciones") = value + End Set + End Property + + #End Region #Region " PROPIEDADES DE TOTALES " @@ -1603,6 +1620,10 @@ Partial Class Compras_Compras InicializaDevolucionAlmacen() HabilitaEdicionManualAgregar() InicializaActualizarTC() + + + + End If @@ -3412,6 +3433,7 @@ Partial Class Compras_Compras End Function Private Sub CargaPSAlias() + DdlPSAlias2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") If UsuarioActual.CveEmpresa = 66 Then @@ -3424,9 +3446,39 @@ Partial Class Compras_Compras DdlPSAlias2.ddlWS.Attributes.Add("data-pagina", "Compras2") End If End If + If Not DdlPSAlias2.UsaWebService AndAlso CType(DdlPSAlias2.DataSource, DataTable) Is Nothing Then - DdlPSAlias2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) - DdlPSAlias2.DataBind() + + If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then + + Dim DTTemp As New DataTable + DTTemp.Columns.Add("CvePS", GetType(Integer)) + DTTemp.Columns.Add("PSCodigoClasificacion", GetType(String)) + + For Each dRow As DataRow In GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).Rows + For Each drowCla As DataRow In DTClasificacionesComprobaciones.Rows + + If drowCla("CveClasificacion").ToString.ToEntero = dRow("CveClasificacion").ToString.ToEntero Then + + Dim InRow As DataRow = DTTemp.NewRow + InRow("CvePS") = dRow("CvePS").ToString.ToEntero + InRow("PSCodigoClasificacion") = dRow("PSCodigoClasificacion").ToString + DTTemp.Rows.Add(InRow) + + End If + Next + Next + + + DdlPSAlias2.DataSource = DTTemp + DdlPSAlias2.DataBind() + + Else + DdlPSAlias2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + DdlPSAlias2.DataBind() + End If + + End If End Sub @@ -3763,6 +3815,37 @@ Partial Class Compras_Compras 'DtPSTemp.Dispose() End Sub + + + Private Sub CargaClasificacionesComprobaciones() + + If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then + + Dim ObjClasificaciones As New ClsClasificaciones() + + If ObjClasificaciones.GetClasificacionesComprobaciones(UsuarioActual.CveEmpresa) Then + + If UsuarioActual.TienePermisoProceso(300) And UsuarioActual.TienePermisoProceso(301) Then + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados + Else + + If UsuarioActual.TienePermisoProceso(300) Then 'TipoComprobacion = 1 Biaticos + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 1") + ElseIf UsuarioActual.TienePermisoProceso(301) Then 'TipoComprobacion = 2 Comprobaciones + DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 2") + End If + + End If + End If + + ObjClasificaciones.Dispose() + + End If + + End Sub + + + #End Region #Region "Vinculacion De Servcios" @@ -11165,6 +11248,7 @@ Partial Class Compras_Compras 'CargaEstatus() CargaTiposAF() CargaProyectoAsignado() + CargaClasificacionesComprobaciones() CargaClasificaciones() CargaPS(-1) CargaProyecto() @@ -17134,6 +17218,7 @@ Partial Class Compras_Compras UPPClasificacion.Update() End Sub Private Sub CargaPS(CveClasificacion As Integer) + DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then @@ -17142,7 +17227,41 @@ Partial Class Compras_Compras DdlPS.SelectedValue = "-1" Else DdlPS.ddl.Items.Clear() - DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion) + + 'DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion) + + If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then + + Dim DTTemp As New DataTable + DTTemp.Columns.Add("CvePS", GetType(Integer)) + DTTemp.Columns.Add("PSCodigo", GetType(String)) + DTTemp.Columns.Add("CveClasificacion", GetType(Integer)) + + For Each dRow As DataRow In GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).Rows + For Each drowCla As DataRow In DTClasificacionesComprobaciones.Rows + + If drowCla("CveClasificacion").ToString.ToEntero = dRow("CveClasificacion").ToString.ToEntero Then + + Dim InRow As DataRow = DTTemp.NewRow + InRow("CvePS") = dRow("CvePS").ToString.ToEntero + InRow("PSCodigo") = dRow("PSCodigo").ToString + InRow("CveClasificacion") = dRow("CveClasificacion").ToString.ToEntero + DTTemp.Rows.Add(InRow) + + End If + Next + Next + + + DdlPS.DataSource = If(CveClasificacion > 0, DTTemp.FiltraParametros($"CveClasificacion = {CveClasificacion}"), DTTemp) + + Else + DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + + End If + + + DdlPS.ddl.DataBind() DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1")) End If @@ -17670,13 +17789,24 @@ Partial Class Compras_Compras #Region " RECLASIFICA PARTIDAS - CLASIFICACION - SUBPROYECTO " Private Sub CargaClasificaciones() + If UsuarioActual.Empresa.UsaAC Then DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlAplicaClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") Else + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") DdlAplicaClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion") + + If UsuarioActual.TienePermisoProceso(300) Or UsuarioActual.TienePermisoProceso(301) Then + DdlClasificacion.DataSource = DTClasificacionesComprobaciones.FiltraParametros("", Orderby:="Clasificacion") + DdlAplicaClasificacion.DataSource = DTClasificacionesComprobaciones.FiltraParametros("", Orderby:="Clasificacion") + End If + End If + + + DdlClasificacion.DataBind() DdlAplicaClasificacion.DataBind() End Sub From eaa3cdcefb3960b99ad0d9a6797cbfbfcb1d7629 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Apr 2020 15:35:51 -0700 Subject: [PATCH 02/25] Filtros de fecha en RepReembolsos comprobaciones --- App_Code/ClsMovimientos.vb | 12 +- Compras/RepRembolsoComprobaciones.aspx | 482 ++++++++++++---------- Compras/RepRembolsoComprobaciones.aspx.vb | 5 +- 3 files changed, 272 insertions(+), 227 deletions(-) diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 85846866e..fe4714eff 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -851,14 +851,16 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetChequesFYE(CveEmpresa As Integer) As Boolean + Public Function GetChequesFYE(CveEmpresa As Integer, Optional FechaI As DateTime = ModExtensiones.MinFecha, Optional FechaF As DateTime = ModExtensiones.MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_ReporteChequesFYEGet") With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF End With Try @@ -1278,14 +1280,16 @@ Public Class ClsMovimientos Return Retorno End Function - Public Function GetCxPPersonalCajaChica(CveEmpresa As Integer, CvePersonal As Integer, CveCajaChica As Integer, NumeroReembolso As String) As Boolean + Public Function GetCxPPersonalCajaChica(CveEmpresa As Integer, CvePersonal As Integer, CveCajaChica As Integer, NumeroReembolso As String, Optional FechaI As DateTime = ModExtensiones.MinFecha, Optional FechaF As DateTime = ModExtensiones.MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CxPPersonalCajaChica") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveCajaChica", SqlDbType.Int).Value = CveCajaChica - .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso + .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso + .Add("@FechaI", SqlDbType.DateTime).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF End With Try diff --git a/Compras/RepRembolsoComprobaciones.aspx b/Compras/RepRembolsoComprobaciones.aspx index 7d3509703..53a762efd 100644 --- a/Compras/RepRembolsoComprobaciones.aspx +++ b/Compras/RepRembolsoComprobaciones.aspx @@ -1,241 +1,279 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepRembolsoComprobaciones.aspx.vb" Inherits="Compras_RepRembolsoComprobaciones" %> - - - - - - - - Reembolsos / Comprobaciones - - - - - - -
  • +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepRembolsoComprobaciones.aspx.vb" Inherits="Compras_RepRembolsoComprobaciones" %> + + + + + + + + Reembolsos / Comprobaciones + + + + + + +
  • Exportar Excel - -
  • -
  • + +
  • +
  • Imprimir Reembolso - -
  • -
  • -
    - - - - -
    -
    - - - - - - -
    -
    -
    - - -
    -
    -
    - -
    - - - - - - - -
    - -
    -
    - -
    -
    - - - - - - - - - - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    - - -
    - -
    - - -
    - - -
    - -
    + + +
  • + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + + + + + + + +
    +
    +
    + +
    +
    + + + + + + + + + + + +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    + + + +
    +
    + + +
    + +
    + + +
    + + +
    + +
    Unificar - -
    - -
    - -
    - -
    -
    - -
    -
    - - -
    + +
    + +
    + +
    + +
    +
    + +
    +
    + + +
    +
    - - - - - - Compra - - - - - - Proveedor - -
    - -
    -
    -
    - - Fecha Compra - - - - - - Proyecto - - - - - - # R - + + + + + + Compra + + + + + + Proveedor + +
    + +
    +
    +
    + + Fecha Compra + + + + + + Proyecto + + + + + + # R +   - - - - Monto Compra (Saldo Orig.) - + + + + + Monto Compra (Saldo Orig.) +   - - - - Abonado - + + + + + Abonado +   - - - - Saldo - + + + + + Saldo +   - - - - - Excedente - + + + + + + Excedente +   - - - - - - Auxiliar - - - - - - CveCompra - - - - - - CveProveedor - - - - - - IdCtaContProveedores - - - - - -
    -
    -
    -
    - -
    - + + + + + + + Auxiliar + + + + + + CveCompra + + + + + + CveProveedor + + + + + + IdCtaContProveedores + + + + + + + + + + + + - - + + + diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb index 77316d8e8..ea7151c62 100644 --- a/Compras/RepRembolsoComprobaciones.aspx.vb +++ b/Compras/RepRembolsoComprobaciones.aspx.vb @@ -257,7 +257,10 @@ Partial Class Compras_RepRembolsoComprobaciones GvCxP.Visible = True - ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim)) + Dim FechaI As DateTime = If(String.IsNullOrEmpty(txtFechaI.Text.Trim()), ModExtensiones.MinFecha, txtFechaI.Text.ToDateTime()) + Dim FechaF As DateTime = If(String.IsNullOrEmpty(txtFechaF.Text.Trim()), ModExtensiones.MaxFecha, txtFechaF.Text.ToDateTime()) + + ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim), FechaI:=FechaI, FechaF:=FechaF) DtDatos = ObjMovtos.DtResultados GvCxP.DataSource = DtDatos From a719d101cbd0f39dc2687b963cc5f0dfb9bf9b21 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Apr 2020 15:36:39 -0700 Subject: [PATCH 03/25] Validaciones correctas como en PV.aspx --- Inventarios/RecepcionUsados.aspx | 106 +++++++++++++++++++--------- Inventarios/RecepcionUsados.aspx.vb | 10 +++ 2 files changed, 81 insertions(+), 35 deletions(-) diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 2a14c8eac..0a80a9302 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -353,13 +353,15 @@
    + +
    - + @@ -380,8 +382,8 @@
    - - + <%-- + --%>
    @@ -398,7 +400,7 @@
    - + <%----% <%----%> @@ -408,7 +410,7 @@
    - +
    @@ -419,7 +421,7 @@
    - + <%----%> <%----%> @@ -434,7 +436,7 @@ - +
    @@ -443,7 +445,7 @@
    - + <%----%> <%----%> @@ -452,7 +454,7 @@
    - + @@ -464,7 +466,7 @@
    - +
    @@ -472,7 +474,7 @@
    - + @@ -481,7 +483,7 @@
    - + @@ -500,15 +502,15 @@
    - +
    - - + +
    @@ -969,8 +971,7 @@