This commit is contained in:
2024-06-29 07:32:21 -07:00
4 changed files with 44 additions and 29 deletions

View File

@@ -3625,13 +3625,15 @@ Public Class ClsVentas
' Return Retorno ' Return Retorno
'End Function 'End Function
Public Function GetVta_MovimientosCajas(CveCorte As Integer, TipoMovimiento As Integer) As Boolean Public Function GetVta_MovimientosCajas(CveCorte As Integer, TipoMovimiento As Integer, Optional CveSubProyecto As Integer = -1, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MovimientosCajasGet") DataAdapter("PA_Vta_MovimientosCajasGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With End With
Try Try
@@ -3644,13 +3646,15 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetVta_MovimientosCajasReporte(CveCorte As Integer, TipoMovimiento As Integer) As Boolean Public Function GetVta_MovimientosCajasReporte(CveCorte As Integer, TipoMovimiento As Integer, Optional CveSubProyecto As Integer = -1, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_MovimientosCajasRepGet") DataAdapter("PA_Vta_MovimientosCajasRepGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With End With
Try Try
@@ -3686,7 +3690,7 @@ Public Class ClsVentas
' Return Retorno ' Return Retorno
'End Function 'End Function
Public Function GetCortesDetalleDepositosCaja(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Public Function GetCortesDetalleDepositosCaja(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional FechaConsulta As Date = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_CortesDetalleDepositosCajaGet") DataAdapter("PA_Vta_CortesDetalleDepositosCajaGet")
@@ -3695,6 +3699,7 @@ Public Class ClsVentas
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaConsulta", SqlDbType.Date).Value = FechaConsulta
End With End With
Try Try

View File

@@ -131,7 +131,7 @@
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal> <asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LBDescripcion" CommandName="CargaDetalle" CommandArgument='<%# Eval("CveCorte") %>' OnClick="LbDescripcion_Click" runat="server" Text='<%# Eval("FechaInicial", "{0:g}") %>'></asp:LinkButton> <asp:LinkButton ID="LBDescripcion" CommandName="CargaDetalle" CommandArgument='<%# Eval("CveCorte") %>' OnClick="LbDescripcion_Click" runat="server" Text='<%# If(UsuarioActual.Empresa.Funcionalidad(382) = "1", Eval("FechaInicial", "{0:dd/MM/yyyy}"), Eval("FechaInicial", "{0:g}")) %>'></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>

View File

@@ -253,12 +253,12 @@ Partial Class Bancos_RepCortes
End If End If
If CveCorte > 0 Then If CveCorte > 0 Then
If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1) Then If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero(), FechaConsulta:=FechaConsulta) Then
GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy() GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy()
End If End If
End If End If
If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, FechaConsulta:=FechaConsulta) Then
GvDep.DataSource = ObjVentas.DtResultados GvDep.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
DivDep.Visible = True DivDep.Visible = True
@@ -269,8 +269,8 @@ Partial Class Bancos_RepCortes
If (DtCortesVentasResumen IsNot Nothing AndAlso DtCortesVentasResumen.Rows.Count > 0) Or (DtCortesVentas IsNot Nothing AndAlso DtCortesVentas.Rows.Count > 0) Then If (DtCortesVentasResumen IsNot Nothing AndAlso DtCortesVentasResumen.Rows.Count > 0) Or (DtCortesVentas IsNot Nothing AndAlso DtCortesVentas.Rows.Count > 0) Then
HplDownPDF.Visible = True HplDownPDF.Visible = True
HplDownEXCEL.Visible = True HplDownEXCEL.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}", CveCorte, "PDF", DdlSubProyectos.SelectedValue.ToEntero))) HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}&FECHA={3}", CveCorte, "PDF", DdlSubProyectos.SelectedValue.ToEntero, FechaConsulta.ToString("yyyy-MM-dd"))))
HplDownEXCEL.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}", CveCorte, "EXCEL", DdlSubProyectos.SelectedValue.ToEntero))) HplDownEXCEL.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}&CVESUBPROYECTO={2}&FECHA={3}", CveCorte, "EXCEL", DdlSubProyectos.SelectedValue.ToEntero, FechaConsulta.ToString("yyyy-MM-dd"))))
Else Else
HplDownPDF.Visible = False HplDownPDF.Visible = False
HplDownEXCEL.Visible = False HplDownEXCEL.Visible = False

View File

@@ -1381,12 +1381,17 @@ Partial Class PopUpVerFactura
If UrlParametros("OP").ToString = "CORT" Then If UrlParametros("OP").ToString = "CORT" Then
If UrlParametros("CVECORTE") IsNot Nothing AndAlso UrlParametros("CVECORTE").ToString.ToEntero > 0 Then If (UrlParametros("CVECORTE") IsNot Nothing AndAlso UrlParametros("CVECORTE").ToString.ToEntero > 0) OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
Dim CveSubProyecto As Integer = -1 Dim CveSubProyecto As Integer = -1
Dim FechaConsulta As Date = ModExtensiones.MaxFecha
If UrlParametros("CVESUBPROYECTO") IsNot Nothing Then If UrlParametros("CVESUBPROYECTO") IsNot Nothing Then
CveSubProyecto = UrlParametros("CVESUBPROYECTO").ToString.ToEntero CveSubProyecto = UrlParametros("CVESUBPROYECTO").ToString.ToEntero
End If End If
ImprimeCorte(UrlParametros("CVECORTE").ToString.ToEntero, UrlParametros("FORMATO").ToString, CveSubProyecto) If UrlParametros("FECHA") IsNot Nothing Then
FechaConsulta = UrlParametros("FECHA").ToString.ToDate()
End If
ImprimeCorte(UrlParametros("CVECORTE").ToString.ToEntero, UrlParametros("FORMATO").ToString, CveSubProyecto, FechaConsulta)
End If End If
End If End If
@@ -1554,7 +1559,7 @@ Partial Class PopUpVerFactura
#Region "OP = CORT - IMPRIMIR CORTE" #Region "OP = CORT - IMPRIMIR CORTE"
Private Sub ImprimeCorte(CveCorte As Integer, Formato As String, Optional CveSubProyecto As Integer = -1) Private Sub ImprimeCorte(CveCorte As Integer, Formato As String, Optional CveSubProyecto As Integer = -1, Optional FechaConsulta As Date = ModExtensiones.MaxFecha)
Dim DtCortesVentasResumen As DataTable = Nothing Dim DtCortesVentasResumen As DataTable = Nothing
Dim DtCortesVentas As DataTable = Nothing Dim DtCortesVentas As DataTable = Nothing
Dim DtReporteCorte As DataTable = Nothing Dim DtReporteCorte As DataTable = Nothing
@@ -1565,9 +1570,15 @@ Partial Class PopUpVerFactura
Dim OpcionDetallado As Integer = 1 Dim OpcionDetallado As Integer = 1
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then OpcionDetallado = 2 If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then OpcionDetallado = 2
Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1"
If ConsultaPorSucursal Then
CveCorte = -1
End If
Dim ObjVenta As New ClsVentas Dim ObjVenta As New ClsVentas
If ObjVenta.GetVta_ReporteCortesDetalle(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, 2) Then If ObjVenta.GetVta_ReporteCortesDetalle(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, 2, ConsultaIVA:=UsuarioActual.CveEmpresa.Contiene(190, 192), FechaConsulta:=FechaConsulta) Then
Dim DsDatos = ObjVenta.DataSetResultados.Copy() Dim DsDatos = ObjVenta.DataSetResultados.Copy()
If DsDatos IsNot Nothing Then If DsDatos IsNot Nothing Then
DtCortesVentas = DsDatos.Tables(0) DtCortesVentas = DsDatos.Tables(0)
@@ -1575,19 +1586,7 @@ Partial Class PopUpVerFactura
DtCortesVentasResumen = DsDatos.Tables(1) DtCortesVentasResumen = DsDatos.Tables(1)
End If End If
End If End If
' If ObjVenta.GetCortesDetalleVentasResumen(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
' DtCortesVentasResumen = ObjVenta.DtResultados.Copy()
'End If
'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, OpcionDetallado) Then
' DtCortesVentas = ObjPuntoVenta.DtResultados.Copy()
' If DtCortesVentas.Rows.Count > 0 Then
' Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
' Fecha = RowInfo("FechaInicial").ToString
' Nombre = RowInfo("Nombre").ToString
' End If
'End If
If DtCortesVentas.Rows.Count > 0 Then If DtCortesVentas.Rows.Count > 0 Then
Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0") Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
@@ -1600,16 +1599,23 @@ Partial Class PopUpVerFactura
End If End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then If ConsultaPorSucursal Then
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0") If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto) Then
Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "") DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
Fecha = FechaConsulta.ToString("dd/MM/yyyy")
End If
Else
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")
Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "")
End If
End If End If
If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1) Then If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1, CveSubProyecto:=CveSubProyecto, FechaConsulta:=FechaConsulta) Then
DtIngresosRetiros = ObjVenta.DtResultados.Copy() DtIngresosRetiros = ObjVenta.DtResultados.Copy()
End If End If
If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVenta.GetCortesDetalleDepositosCaja(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa) Then If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVenta.GetCortesDetalleDepositosCaja(CveCorte, CveSubProyecto, UsuarioActual.CveEmpresa, FechaConsulta:=FechaConsulta) Then
DtDepositos = ObjVenta.DtResultados.Copy() DtDepositos = ObjVenta.DtResultados.Copy()
End If End If
End If End If
@@ -1618,6 +1624,10 @@ Partial Class PopUpVerFactura
Dim FechaCorte As String = $"&emsp;<b>Fecha fin</b> {Fecha}" Dim FechaCorte As String = $"&emsp;<b>Fecha fin</b> {Fecha}"
If ConsultaPorSucursal Then
FechaCorte = $"&emsp;<b>Fecha: </b> {Fecha}"
End If
Dim Usuario As String = $"&emsp;<b>Usuario</b> {Nombre}" Dim Usuario As String = $"&emsp;<b>Usuario</b> {Nombre}"
If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then
Dim lrds As New List(Of ReportDataSource) Dim lrds As New List(Of ReportDataSource)