-- al Saldar, que tom el valor del txt
This commit is contained in:
@@ -1436,7 +1436,7 @@ Partial Class Bancos_ProveedoresAbonar
|
|||||||
|
|
||||||
For Each gr As GridViewRow In GvCxP.Rows
|
For Each gr As GridViewRow In GvCxP.Rows
|
||||||
If gr.FCCheckBox("Chk").Checked Then
|
If gr.FCCheckBox("Chk").Checked Then
|
||||||
Dim Saldo As Decimal = gr.DataKey("Saldo").ToDecimal
|
Dim Saldo As Decimal = gr.FCTextBox("TxtAbonar").Text.ToDecimal 'gr.DataKey("Saldo").ToDecimal
|
||||||
Dim TCCompra As Decimal = gr.DataKey("TipoCambio").ToDecimal
|
Dim TCCompra As Decimal = gr.DataKey("TipoCambio").ToDecimal
|
||||||
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).ToDecimal
|
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).ToDecimal
|
||||||
Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
|
Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
|
||||||
@@ -1474,7 +1474,7 @@ Partial Class Bancos_ProveedoresAbonar
|
|||||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("TotalOriginal").ToDecimal
|
Dim PorcentajePago As Decimal = Saldo / gr.DataKey("TotalOriginal").ToDecimal
|
||||||
|
|
||||||
If MsgError = "" AndAlso gr.DataKey("IVA").ToDecimal > 0 Then
|
If MsgError = "" AndAlso gr.DataKey("IVA").ToDecimal > 0 Then
|
||||||
Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal
|
Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal
|
||||||
@@ -1512,9 +1512,7 @@ Partial Class Bancos_ProveedoresAbonar
|
|||||||
Dim ImporteFluctuacion As Decimal = 0
|
Dim ImporteFluctuacion As Decimal = 0
|
||||||
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
|
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
|
||||||
|
|
||||||
If CveSubProyecto <= 0 Then
|
If CveSubProyecto <= 0 Then MsgError = "No se pudo obtener el sub proyecto o centro de costo"
|
||||||
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
|
|
||||||
End If
|
|
||||||
|
|
||||||
If TCCompra > TCPago Then
|
If TCCompra > TCPago Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, TipoCambio:=TCCompra, TipoCambioPago:=TCPago, Contabilizable:=EsContabilizable) Then
|
||||||
@@ -1535,23 +1533,27 @@ Partial Class Bancos_ProveedoresAbonar
|
|||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
|
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
|
||||||
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If MsgError = "" Then
|
If MsgError = "" Then
|
||||||
ObjConta.Commit()
|
ObjConta.Commit()
|
||||||
CargaDatos(CveMoneda)
|
CargaDatos(CveMoneda)
|
||||||
RegistraScript("$('#ModalSaldarCuentaSinPagar').modal('hide')")
|
RegistraScript("$('#ModalSaldarCuentaSinPagar').modal('hide')")
|
||||||
Alert("Los movimientos se saldaron correctamente.")
|
Dim Msg As New StringBuilder
|
||||||
|
Msg.Append("Los movimientos se saldaron correctamente.</br>")
|
||||||
|
|
||||||
|
If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros
|
||||||
|
Msg.AppendFormat("<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={0}"">Ver Póliza</a> ", CvePrePoliza)
|
||||||
|
End If
|
||||||
|
Alert(Msg.ToString)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ObjConta.RollBack()
|
ObjConta.RollBack()
|
||||||
Alert(MsgError, TipoMensaje.MsgError)
|
Alert(MsgError, TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'BtnSaldar.Visible = False
|
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user