diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index dc2e3754d..ba0735df4 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1568,6 +1568,7 @@ Partial Class Bancos_ProveedoresAbonar End If If gvr.FCTextBox("TxtComision").Text.ToDecimal < 0 Then + ConceptoContable = 78 TipoMovimiento = True ImporteMovimiento = ImporteMovimiento * -1 importeMX = importeMX * -1 @@ -1577,8 +1578,8 @@ Partial Class Bancos_ProveedoresAbonar IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToEntero() End If - ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) - importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) + ImporteMovimiento = ImporteMovimiento.RoundSQL + importeMX = importeMX.RoundSQL TipoCambioGeneral = TipoCambioPago End If @@ -2862,14 +2863,20 @@ Partial Class Bancos_ProveedoresAbonar End If Saldo = Saldo - IEPS - End If ' se manda al ot ingresos, los impuestos por acreditar - If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, 78, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then - MsgError = "Ocurrio un error al saldar el movimiento" + If MsgError = "" Then + Dim tcvecon As Integer = 78 + If Saldo < 0 Then + tcvecon = 211 + End If + If MsgError = "" AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Saldo, gr.DataKey("SerieFolio").ToString, tcvecon, ConceptoPartida, Now, IdCtaContable:=UsuarioActual.Empresa.IdCuentaOtrosIngresos, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=If(CveMoneda = 1, Saldo, Saldo * TCPago), TipoCambio:=TCCompra, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then + MsgError = "Ocurrio un error al saldar el movimiento" + End If End If + 'fluctuación. If CveMoneda > 1 Then Dim ImporteFluctuacion As Decimal = 0 @@ -2879,7 +2886,6 @@ Partial Class Bancos_ProveedoresAbonar MsgError = "No se pudo obtener el sub proyecto o centro de costo" End If - If TCCompra > TCPago Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then MsgError = "Ocurrio un error al saldar el movimiento" @@ -2889,12 +2895,8 @@ Partial Class Bancos_ProveedoresAbonar MsgError = "Ocurrio un error al saldar el movimiento" End If End If - - End If - - If MsgError = "" AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If ObjConta.ValorPolizaDescuadre > 0 Then MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia @@ -2906,7 +2908,6 @@ Partial Class Bancos_ProveedoresAbonar If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) - Else 'Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico"