This commit is contained in:
2024-05-31 19:36:36 -07:00
26 changed files with 621 additions and 401 deletions

View File

@@ -628,14 +628,14 @@
function txtSumaCuentaRetorno(txt) {
debugger;
var comision2 = ToDouble($('#C_TxtCuentaRetorno').val());
if (comision2 > ValorTotalSeleccionado) {
$('#C_TxtCuentaRetorno').val(descuento)
alert("No es posible poner un IVA superior a lo seleccionado")
} else {
//if (comision2 > ValorTotalSeleccionado) {
// $('#C_TxtCuentaRetorno').val(descuento)
// alert("No es posible poner un IVA superior a lo seleccionado")
//} else {
saldo = ValorTotalSeleccionado - comision2 + comision - IVA - ComisionIntermediario;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
descuento = ToDouble($('#C_TxtCuentaRetorno').val())
}
//}
}

View File

@@ -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
@@ -172,13 +177,13 @@ Partial Class Bancos_DepositosCaja
Exit Sub
End If
Dim tContador As Integer = 0
For Each Gvr As GridViewRow In GvFacturas.Rows
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
Next
If TotalImporte = 0 Then
Alert("Seleccion una factura para realizar el depósito", TipoMensaje.MsgAdvertencia)
If TotalImporte = 0 AndAlso CuentaRetorno <> 0 Then
Alert("Seleccione una factura para realizar el depósito", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -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