--validaciones de prestamos para empresa agrícola
This commit is contained in:
@@ -754,6 +754,11 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If TxtPrestamoImporte.Text.ToDecimal <> 0 AndAlso DdlPrestamo.SelectedValue = "-1" Then
|
||||||
|
Alert("Debe seleccionar un préstamo al especificar un valor.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
'valida que no exceda lo seleccionado. con el valor del ie
|
'valida que no exceda lo seleccionado. con el valor del ie
|
||||||
If (RblTipoPago.SelectedValue = "3" AndAlso HdnIngresoImporte.Value.ToDecimal < TxtTotal.Text.ToDecimal) Then
|
If (RblTipoPago.SelectedValue = "3" AndAlso HdnIngresoImporte.Value.ToDecimal < TxtTotal.Text.ToDecimal) Then
|
||||||
Alert("Importe excedido para la aplicación", TipoMensaje.MsgAdvertencia)
|
Alert("Importe excedido para la aplicación", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -767,6 +772,11 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
For Each gvr As GridViewRow In GvCxC.Rows
|
For Each gvr As GridViewRow In GvCxC.Rows
|
||||||
If gvr.FCCheckBox("Chk").Checked Then
|
If gvr.FCCheckBox("Chk").Checked Then
|
||||||
seleccion += 1
|
seleccion += 1
|
||||||
|
'si hay liquidación-
|
||||||
|
If gvr.FCDropDownList("DdlAnti").SelectedValue = "-1" AndAlso gvr.FCTextBox("TxtAmort").Text.ToDecimal <> 0 Then
|
||||||
|
Alert("Importe de anticipo especificado y no seleccionado. F: " & gvr.DataKey("SerieFolio"), TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -884,13 +894,23 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Dim ImportePrestamo As Decimal = 0
|
Dim ImportePrestamo As Decimal = 0
|
||||||
Dim TCPrestamo As Decimal = 0
|
Dim TCPrestamo As Decimal = 0
|
||||||
|
|
||||||
|
If CveSubProyectoMaximo <= 0 Then 'sino se seleccionó del combo, busca en el listado el primero
|
||||||
|
|
||||||
|
For Each Gvr As GridViewRow In GvCxC.Rows
|
||||||
|
If Gvr.FCCheckBox("Chk").Checked Then
|
||||||
|
CveSubProyecto = Gvr.DataKey("CveSubProyecto").ToEntero
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
If TxtPrestamoImporte.Text.ToDecimal <> 0 Then 'amortización del préstamo
|
If TxtPrestamoImporte.Text.ToDecimal <> 0 Then 'amortización del préstamo
|
||||||
ImportePrestamo = TxtPrestamoImporte.Text.ToDecimal
|
ImportePrestamo = TxtPrestamoImporte.Text.ToDecimal
|
||||||
Dim tCveProv As Integer = DtPrestamos.FiltroPrimeroValor("CveProveedor", "CveIE=" & DdlPrestamo.SelectedValue)
|
Dim tCveProv As Integer = DtPrestamos.FiltroPrimeroValor("CveProveedor", "CveIE=" & DdlPrestamo.SelectedValue).ToEntero
|
||||||
Dim tFechaIE As Date = DtPrestamos.FiltroPrimeroValor("FechaDocumento", "CveIE=" & DdlPrestamo.SelectedValue).ToDate
|
Dim tFechaIE As Date = DtPrestamos.FiltroPrimeroValor("FechaDocumento", "CveIE=" & DdlPrestamo.SelectedValue).ToDate
|
||||||
TCPrestamo = DtPrestamos.FiltroPrimeroValor("TipoCambio", "CveIE=" & DdlPrestamo.SelectedValue).ToDecimal
|
TCPrestamo = DtPrestamos.FiltroPrimeroValor("TipoCambio", "CveIE=" & DdlPrestamo.SelectedValue).ToDecimal
|
||||||
If CveMoneda = 1 Then
|
If CveMoneda = 1 Then
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 57, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=tipoCambioPago, CveProveedor:=tCveProv) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 57, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyectoMaximo, TipoCambio:=tipoCambioPago, CveProveedor:=tCveProv) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
@@ -901,11 +921,11 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 349, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 349, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyectoMaximo, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ((ImportePrestamo * TCPrestamo) - ImportePrestamo).RoundSQL, 350, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ((ImportePrestamo * TCPrestamo) - ImportePrestamo).RoundSQL, 350, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyectoMaximo, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -915,7 +935,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then
|
If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then
|
||||||
tipoCambioPago = If(TxtTCDolares.Visible, TxtTCDolares.Text.ToDecimal, TxtTCDolaresDolares.Text.ToDecimal)
|
tipoCambioPago = If(TxtTCDolares.Visible, TxtTCDolares.Text.ToDecimal, TxtTCDolaresDolares.Text.ToDecimal)
|
||||||
Dim ImporteIntereses As Decimal = (TxtPrestamoIntereses.Text.ToDecimal * tipoCambioPago).RoundSQL
|
Dim ImporteIntereses As Decimal = (TxtPrestamoIntereses.Text.ToDecimal * tipoCambioPago).RoundSQL
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteIntereses, ImporteIntereses, 51, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=11881, TipoCambio:=tipoCambioPago, CveClasificacion:=21927) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteIntereses, ImporteIntereses, 51, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyectoMaximo, TipoCambio:=tipoCambioPago, CveClasificacion:=21927) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -1122,6 +1142,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Case 134 'Pago Intermediario
|
' Case 134 'Pago Intermediario
|
||||||
|
|||||||
Reference in New Issue
Block a user