diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 254b0477c..81d76146e 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -2966,6 +2966,7 @@ Public Class ClsBancos SqlAdapter.SelectCommand.Parameters.Add("@CveCredito", SqlDbType.Int).Value = CveCredito Try + SqlAdapter.SelectCommand.CommandTimeout = 0 SqlAdapter.Fill(Data) Retorno = True Catch Ex1 As SqlException diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index cbeea38ae..fdf190806 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -8082,7 +8082,7 @@ Partial Class Compras_Compras End If Else - Alert("existe una diferencia de más de 0.05 entre el IVA de la compra y los detalles.", TipoMensaje.MsgAdvertencia) + Alert($"existe una diferencia de {DiferenciaIVas} entre el IVA de la compra y los detalles.", TipoMensaje.MsgAdvertencia) Respuesta = False End If Else @@ -8169,7 +8169,7 @@ Partial Class Compras_Compras End If Else - Alert("existe una diferencia de más de 0.05 entre el RetIVA de la compra y los detalles.", TipoMensaje.MsgAdvertencia) + Alert($"existe una diferencia de {DiferenciaRetIVA} entre el RetIVA de la compra y los detalles.", TipoMensaje.MsgAdvertencia) Respuesta = False End If Else @@ -8259,7 +8259,7 @@ Partial Class Compras_Compras End If Else - Alert("existe una diferencia de más de 0.05 entre el RetISR de la compra y los detalles.", TipoMensaje.MsgAdvertencia) + Alert($"existe una diferencia de {DiferenciaRetISR} entre el RetISR de la compra y los detalles.", TipoMensaje.MsgAdvertencia) Respuesta = False End If Else @@ -16696,9 +16696,9 @@ Partial Class Compras_Compras - TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 2) - TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 2) - TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 2) + TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 6) + TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 6) + TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 6) ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble @@ -16901,14 +16901,14 @@ Partial Class Compras_Compras End If If TxtIEPSModal.Text = "" Then - TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 2) + TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 6) End If ViewState("IEPSPSIVA") = If(PS("IEPSGrabaIVA").ToString = "True", PS("IEPSPorcentaje").ToString.ToDouble, 0) 'TxtIVAModal.Text = FormatoNumero(ViewState("IVAPS").ToString().ToDouble * 100, 0) - TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 2) - TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 2) + TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 6) + TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 6) If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb index 684dd4553..4e7e19c10 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb @@ -16,7 +16,10 @@ Partial Class PopUpSeleccionarEmpresa End If End Sub - Private Sub GetEmpresas() + Private Sub GetEmpresas() + + + GlobalDTUsuarios(-1, -1) = Nothing 'Esto es por los cambios de contaseña Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario) If Dt IsNot Nothing Then @@ -87,7 +90,9 @@ Partial Class PopUpSeleccionarEmpresa RegistraScript("Ir3();") End If End If - dt.Dispose() + dt.Dispose() + Else + Alert($"Usuario Nulo {gvr.DataKey("Usuario")} , {gvr.DataKey("Contraseña")}, {IMEI}, {gvr.DataKey("CveEmpresa").ToEntero}", TipoMensaje.MsgAdvertencia) End If End If diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 8cdcf4ad9..663ea64a8 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -1385,6 +1385,7 @@ Partial Class Sistemas_UsuarioDetalle GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing GlobalDTUsuarios(CveEmpresa:=-1) = Nothing + 'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then ' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados ' Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0") diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index a30689857..43a0427be 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -2750,7 +2750,7 @@ Partial Class Clientes End If End If - If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, ObjClientes.IniciaTransacSQL) Then + If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 1, ObjClientes.IniciaTransacSQL) Then ErrorProceso = True End If @@ -3843,12 +3843,23 @@ Partial Class Clientes Public Sub BtnAgregaCuentaContable(sender As Object, e As EventArgs) Handles BtnActivaRegistroClientes.Click, BtnActivaRegistroAnticipos.Click, BtnActivaRegistroIVA.Click, BtnActivaRegistroISR.Click Dim CuentaContable = DirectCast(sender, Button).CommandArgument.ToString() Dim Button = DirectCast(sender, Button) + + + Dim CodigoCuentaAltaCompaq As String = "" + Dim NombreCuentaCuentaAltaCompaq As String = "" + Dim IdCuentaAltaCompaq As Integer = -1 + + Select Case CuentaContable Case "Clientes" AgregarCuentaContable(Button, DdlCtaContableClientes, "", "", -1) Case "Anticipos" - AgregarCuentaContable(Button, DdlCtaContableAnticipos, "", "", -1) + + AgregarCuentaContable(Button, DdlCtaContableAnticipos, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq) + AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 3) + Case "RetIVA" + AgregarCuentaContable(Button, DdlCtaContableRetIVA, "", "", -1) Case "RetISR" AgregarCuentaContable(Button, DdlCtaContableRetISR, "", "", -1) @@ -3957,14 +3968,23 @@ Partial Class Clientes Return ProcesoCorrecto End Function - Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, Transaccion As SqlTransaction) As Boolean + Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, CveConceptoContable As Integer, Optional Transaccion As SqlTransaction = Nothing) As Boolean - Dim ObjContabilidad As New ClsContabilidad(Transaccion) Dim Respuesta As Boolean = False + Dim DisposeClases As Boolean = False + + Dim ObjContabilidad As ClsContabilidad + + If Transaccion Is Nothing Then + ObjContabilidad = New ClsContabilidad + DisposeClases = True + Else + ObjContabilidad = New ClsContabilidad(Transaccion) + DisposeClases = False + End If If UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then - If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero If CvePadre > 0 Then @@ -3972,7 +3992,7 @@ Partial Class Clientes Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq) If CvecuentaNueva > 0 Then - If ObjContabilidad.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CvecuentaNueva, CveCliente:=CveCliente) Then + If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, UsuarioActual.CveEmpresa, CvecuentaNueva, CveCliente:=CveCliente, PorcentajeIVA:=0) Then Respuesta = True End If End If @@ -3982,6 +4002,18 @@ Partial Class Clientes Respuesta = True End If + If DisposeClases Then + ObjContabilidad.Dispose() + + If Not Respuesta Then + Alert("Se presento un error al agregar y asignar la cuenta (Conta SIG).", TipoMensaje.MsgAdvertencia) + End If + + End If + + + + Return Respuesta End Function