-
This commit is contained in:
@@ -157,6 +157,11 @@ Partial Class Bancos_DepositosCaja
|
||||
|
||||
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
||||
|
||||
|
||||
If Not Validaciones() Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim TotalImporte As Decimal = 0
|
||||
Dim TotalImportePrePoliza As Decimal
|
||||
Dim Comision As Decimal = TxtComision.Text.ToDecimal
|
||||
@@ -465,8 +470,58 @@ Partial Class Bancos_DepositosCaja
|
||||
lblValorTotalSeleccionado.Text = "0.0"
|
||||
CargaDatos()
|
||||
ObjConta.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function Validaciones() As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
If Not ValidaCobranza() Then
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Private Function ValidaCobranza() As Boolean
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(195) Then
|
||||
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
Dim FechaI, FechaF As Date
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
|
||||
|
||||
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, FechaI, FechaF) Then
|
||||
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND (CveUsuarioCobranza IS NULL OR CveUsuarioCobranza = {UsuarioActual.CveUsuario}) AND TipoDocto IN ('Ing','Rem')")
|
||||
'Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario} ")
|
||||
'If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
|
||||
|
||||
If dtt.Rows.Count = 0 Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
Alert("Se detectaron cobros pendientes.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia)
|
||||
Respuesta = False
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
|
||||
Else
|
||||
Respuesta = True
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub ObtenerTotalImporta()
|
||||
|
||||
Dim Total As Double = 0
|
||||
|
||||
@@ -110,7 +110,7 @@ Partial Class Bancos_RepCortes
|
||||
e.Row.CssClass = "SubTotales2"
|
||||
If DtCortes IsNot Nothing Then
|
||||
e.Row.FCLiteral("LtlImporteInicial").Text = DtCortes.SUMD("ImporteInicial").FormatoNumero(2)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
If e.Row.DBCampo("VentasCorte").ToDecimal.RoundSQL <> e.Row.DBCampo("VentaTotalIngreso").ToDecimal + e.Row.DBCampo("VentaTotalRemision").ToDecimal.RoundSQL Then
|
||||
@@ -192,39 +192,62 @@ Partial Class Bancos_RepCortes
|
||||
CveCorte = gvr.DataKey("CveCorte").ToString.ToEntero
|
||||
Dim Finalizado As Integer = gvr.DataKey("Finalizado").ToString.ToEntero
|
||||
Fecha = gvr.DataKey("FechaInicial").ToString
|
||||
Nombre = gvr.DataKey("Nombre").ToString
|
||||
Nombre = gvr.DataKey("Nombre").ToString
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then
|
||||
' DtCortesVentas = ObjPuntoVenta.DtResultados.Copy()
|
||||
' GvD.DataSource = DtCortesVentas
|
||||
|
||||
' divDetalle.Visible = True
|
||||
'End If
|
||||
|
||||
'If ObjVentas.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
' GvP.DataSource = ObjVentas.DtResultados
|
||||
' DtCortesVentasResumen = ObjVentas.DtResultados
|
||||
'End If
|
||||
|
||||
'If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
|
||||
' DivIVA.Visible = True
|
||||
' If ObjVentas.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
' GvPorIVA.DataSource = ObjVentas.DtResultados
|
||||
' End If
|
||||
'End If
|
||||
|
||||
Dim ObjPuntoVenta As New ClsPuntoVenta
|
||||
If ObjPuntoVenta.GetVta_ReporteCortesDetalle(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then
|
||||
Dim DsDatos = ObjPuntoVenta.DataSetResultados.Copy()
|
||||
If DsDatos IsNot Nothing Then
|
||||
'DESGLOSE
|
||||
DtCortesVentas = DsDatos.Tables(0)
|
||||
GvD.DataSource = DtCortesVentas
|
||||
|
||||
If ObjVentas.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvP.DataSource = ObjVentas.DtResultados
|
||||
DtCortesVentasResumen = ObjVentas.DtResultados
|
||||
End If
|
||||
divDetalle.Visible = True
|
||||
'RESUMEN
|
||||
DtCortesVentasResumen = DsDatos.Tables(1)
|
||||
GvP.DataSource = DtCortesVentasResumen
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
|
||||
DivIVA.Visible = True
|
||||
If ObjVentas.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvPorIVA.DataSource = ObjVentas.DtResultados
|
||||
'RESUMEN - IVA
|
||||
If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
|
||||
DivIVA.Visible = True
|
||||
GvPorIVA.DataSource = DsDatos.Tables(2)
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjPuntoVenta.GetVta_MovimientosCajasReporte(CveCorte, -1) Then
|
||||
GvIngresosRetiros.DataSource = ObjPuntoVenta.DtResultados.Copy()
|
||||
End If
|
||||
ObjPuntoVenta.Dispose()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(140, 141) AndAlso ObjVentas.GetCortesDetalleDepositosCaja(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDep.DataSource = ObjVentas.DtResultados
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
DivDep.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjVentas.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then
|
||||
DtCortesVentas = ObjVentas.DtResultados.Copy()
|
||||
GvD.DataSource = DtCortesVentas
|
||||
|
||||
divDetalle.Visible = True
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVta_MovimientosCajasReporte(CveCorte, -1) Then
|
||||
GvIngresosRetiros.DataSource = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If (DtCortesVentasResumen IsNot Nothing AndAlso DtCortesVentasResumen.Rows.Count > 0) Or (DtCortesVentas IsNot Nothing AndAlso DtCortesVentas.Rows.Count > 0) Then
|
||||
HplDownPDF.Visible = True
|
||||
@@ -235,22 +258,13 @@ Partial Class Bancos_RepCortes
|
||||
HplDownPDF.Visible = False
|
||||
HplDownEXCEL.Visible = False
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
|
||||
|
||||
GvD.DataBind()
|
||||
GvP.DataBind()
|
||||
GvDep.DataBind()
|
||||
GvPorIVA.DataBind()
|
||||
GvIngresosRetiros.DataBind()
|
||||
|
||||
|
||||
GvD.DataBind()
|
||||
GvP.DataBind()
|
||||
GvDep.DataBind()
|
||||
GvPorIVA.DataBind()
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) Then
|
||||
DivAnexo.Visible = True
|
||||
Dim CveCuenta As Integer = 0
|
||||
|
||||
Reference in New Issue
Block a user