From 4834ce7fe136e2016addab75acc6711334e6e308 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 4 Mar 2022 18:16:45 -0700 Subject: [PATCH] MoviminetosSUA filtro Resgistro patronal, Reporte Cancelaciones Ventas --- App_Code/ClsNominas.vb | 3 +- App_Code/ClsPaginas.vb | 2 + App_Code/ClsVentas.vb | 24 +++++ Nomina/MovimientosSUA.aspx | 14 ++- Nomina/MovimientosSUA.aspx.cs | 27 ++++- Ventas/RepCancelacionesVentas.aspx | 142 ++++++++++++++++++++++++++ Ventas/RepCancelacionesVentas.aspx.vb | 124 ++++++++++++++++++++++ 7 files changed, 331 insertions(+), 5 deletions(-) create mode 100644 Ventas/RepCancelacionesVentas.aspx create mode 100644 Ventas/RepCancelacionesVentas.aspx.vb diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 90ca3f680..409c84a51 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -338,7 +338,7 @@ Public Class ClsNominas Return retorno End Function - Public Function SUAMovmientosAfiliatoriosGET(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer) As Boolean + Public Function SUAMovmientosAfiliatoriosGET(cveEmpresa As Integer, FechaInicio As DateTime, FechaFin As DateTime, CveTipoPeriodo As Integer, Optional CveRegistroPatronal As Integer = -1) As Boolean Dim retorno As Boolean = False DTSet = New DataSet() DataAdapter("[PA_Nom_SUAMovmientosAfiliatoriosGET]", CommandType.StoredProcedure) @@ -347,6 +347,7 @@ Public Class ClsNominas .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@TipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo + .Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal End With Try SqlAdapter.Fill(DTSet) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0726f8f60..d921cbd71 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5517,6 +5517,8 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatAutorizacionLimites.aspx".ToUpper(), 781) PaginaDict.Add("/Ventas/RepComisionesServec.aspx".ToUpper(), 782) PaginaDict.Add("/Ventas/RepComisionesServecDetalle.aspx".ToUpper(), 782) + PaginaDict.Add("/Ventas/RepCancelacionesVentas.aspx".ToUpper(), 1325) + #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 7a0d213fc..1aea48386 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5391,6 +5391,30 @@ Public Class ClsVentas End Function + Public Function GetRepCancelacionVentas(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveCliente As Integer, CveMotivoCancelacion As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RepCancelacionesVentasGet") + With SqlAdapter.SelectCommand.Parameters + + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion + .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 obtener las ventas canceladas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + #Region "C L I E N T E S V E N D E D O R E S S U B P R O Y E C T O S" Public Function GetClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean diff --git a/Nomina/MovimientosSUA.aspx b/Nomina/MovimientosSUA.aspx index 1ecd6f58d..c3f2edcd9 100644 --- a/Nomina/MovimientosSUA.aspx +++ b/Nomina/MovimientosSUA.aspx @@ -30,14 +30,14 @@
-
+
-
+
@@ -47,7 +47,7 @@
-
+
@@ -56,7 +56,15 @@
+ +
+ + +
+ + +
diff --git a/Nomina/MovimientosSUA.aspx.cs b/Nomina/MovimientosSUA.aspx.cs index 83e1797aa..729e74b05 100644 --- a/Nomina/MovimientosSUA.aspx.cs +++ b/Nomina/MovimientosSUA.aspx.cs @@ -27,9 +27,33 @@ public partial class Nomina_MovimientosSUA : ClsPaginas { TxtRpdFechaInicio.Text = string.Format(" {0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).FirstDayOfMonth()); TxtRpdFechaFin.Text = string.Format(" {0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth()); + CargaCombos(); CargaTiposPeriodo(); } } + + private void CargaCombos() + { + + ClsRH ObjRH = new ClsRH(); + + + if (ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, -1)) + { + DdlRegistroPatronal.DataSource = ObjRH.DtResultados; + } + else + { + DdlRegistroPatronal.DataSource = null; + } + + ObjRH.Dispose(); + DdlRegistroPatronal.DataBind(); + + DdlRegistroPatronal.Items.Insert(0, new ListItem("Todos","-1")); + + } + private void CargaTiposPeriodo() { DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); @@ -45,7 +69,8 @@ public partial class Nomina_MovimientosSUA : ClsPaginas { using (ClsNominas onom = new ClsNominas()) { - if (onom.SUAMovmientosAfiliatoriosGET(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDateTime(), TxtRpdFechaFin.Text.ToDateTime(), DdlTipoPeriodo.SelectedValue.ToEntero()) + + if (onom.SUAMovmientosAfiliatoriosGET(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDateTime(), TxtRpdFechaFin.Text.ToDateTime(), DdlTipoPeriodo.SelectedValue.ToEntero(), CveRegistroPatronal:DdlRegistroPatronal.SelectedValue.ToEntero()) && onom.DTSetResultados.Tables.Count > 3) { GVAsistencia.DataSource = onom.DTSetResultados.Tables[0]; diff --git a/Ventas/RepCancelacionesVentas.aspx b/Ventas/RepCancelacionesVentas.aspx new file mode 100644 index 000000000..70797cb45 --- /dev/null +++ b/Ventas/RepCancelacionesVentas.aspx @@ -0,0 +1,142 @@ +<%@ Page Title="Rep. Cancelación Ventas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCancelacionesVentas.aspx.vb" Inherits="Compras_RepCancelacionesVentas" %> + + + + + + + + Rep. Cancelación Ventas + + + + + + + + + + + +
  • + Excel +
  • +
    + + + +
    +
    +
    +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    Fecha Inicio:
    +
    +
    + + + + + + + + +
    +
    +
    Fecha Fin:
    +
    +
    + + + + + + + + +
    +
    + + SubProyecto: +
    + + +
    + + +
    + + +
    + +
    +
    +
    +
    > +
    + +
    + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/Ventas/RepCancelacionesVentas.aspx.vb b/Ventas/RepCancelacionesVentas.aspx.vb new file mode 100644 index 000000000..a42833c13 --- /dev/null +++ b/Ventas/RepCancelacionesVentas.aspx.vb @@ -0,0 +1,124 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Compras_RepCancelacionesVentas + Inherits ClsPaginas + + 'Private Property DTComplemntos As DataTable + ' Get + ' If ViewState("DTComplemntos") Is Nothing Then + ' Return New DataTable + ' Else + ' Return DirectCast(ViewState("DTComplemntos"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' ViewState("DTComplemntos") = value + ' End Set + 'End Property + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + + InicializaValores() + + End If + End Sub + +#Region " INICIALIZA VALORES " + Private Sub InicializaValores() + + TxtFiltrosFechaInicio.Text = Now.FirstDayOfMonth.ToShortDateString + TxtFiltrosFechaFin.Text = Now.ToShortDateString + + + + Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + If EsWS Then + DdlClientes.setEsWebService(True) + Else + DdlClientes.setEsWebService(False) + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlClientes.DataBind() + DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + End If + + + + DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion IN (2,3)") + DdlMotivoCancelacion.DataBind() + + DdlMotivoCancelacion.Items.Insert(0, New ListItem("Todos", "-1")) + + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto) + + GvDatos.Columns(4).HeaderText = LblSubProyecto.Text + + + UpFiltros.Update() + End Sub +#End Region + + +#Region " CARGA DATOS " + Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + Private Sub CargaDatos() + + LnkExcel.Visible = False + + Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) + Dim FechaInicio = If(IsDate(TxtFiltrosFechaInicio.Text), TxtFiltrosFechaInicio.Text.ToDate, MinFecha) + Dim FechaFin = If(IsDate(TxtFiltrosFechaFin.Text), TxtFiltrosFechaFin.Text.ToDate, MaxFecha) + + + Dim ObjVentas As New ClsVentas + If ObjVentas.GetRepCancelacionVentas(FechaInicio, FechaFin, DdlSubProyecto.SelectedValue.ToEntero, CveCliente, DdlMotivoCancelacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjVentas.DtResultados + + If ObjVentas.DtResultados.Rows.Count > 0 Then + LnkExcel.Visible = True + End If + Else + GvDatos.DataSource = Nothing + End If + + ObjVentas.Dispose() + + GvDatos.DataBind() + + UpAcciones.Update() + UpDatos.Update() + + + End Sub + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + End Sub +#End Region + + + + +#Region "IMPRESION" + + Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) + GeneraImpresion() + End Sub + + Private Sub GeneraImpresion() + + GvDatos.ExportToExcel2("RepCancelacionVentas.xlsx") + + End Sub +#End Region +End Class