Compras decimales retenciones, popcambairta empresa

This commit is contained in:
Oscar Irigoyen
2023-06-02 09:22:13 -07:00
parent ba640b53ec
commit 7dc9f46e5b
5 changed files with 56 additions and 17 deletions

View File

@@ -2966,6 +2966,7 @@ Public Class ClsBancos
SqlAdapter.SelectCommand.Parameters.Add("@CveCredito", SqlDbType.Int).Value = CveCredito SqlAdapter.SelectCommand.Parameters.Add("@CveCredito", SqlDbType.Int).Value = CveCredito
Try Try
SqlAdapter.SelectCommand.CommandTimeout = 0
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = True Retorno = True
Catch Ex1 As SqlException Catch Ex1 As SqlException

View File

@@ -8082,7 +8082,7 @@ Partial Class Compras_Compras
End If End If
Else 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 Respuesta = False
End If End If
Else Else
@@ -8169,7 +8169,7 @@ Partial Class Compras_Compras
End If End If
Else 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 Respuesta = False
End If End If
Else Else
@@ -8259,7 +8259,7 @@ Partial Class Compras_Compras
End If End If
Else 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 Respuesta = False
End If End If
Else Else
@@ -16696,9 +16696,9 @@ Partial Class Compras_Compras
TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 2) TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 6)
TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 2) TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 6)
TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 2) TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 6)
ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble
ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble
@@ -16901,14 +16901,14 @@ Partial Class Compras_Compras
End If End If
If TxtIEPSModal.Text = "" Then If TxtIEPSModal.Text = "" Then
TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 2) TxtIEPSModal.Text = FormatoNumero(PS("IEPSPorcentaje").ToString.ToDecimal * 100, 6)
End If End If
ViewState("IEPSPSIVA") = If(PS("IEPSGrabaIVA").ToString = "True", PS("IEPSPorcentaje").ToString.ToDouble, 0) ViewState("IEPSPSIVA") = If(PS("IEPSGrabaIVA").ToString = "True", PS("IEPSPorcentaje").ToString.ToDouble, 0)
'TxtIVAModal.Text = FormatoNumero(ViewState("IVAPS").ToString().ToDouble * 100, 0) 'TxtIVAModal.Text = FormatoNumero(ViewState("IVAPS").ToString().ToDouble * 100, 0)
TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 2) TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 6)
TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 2) 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 If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then

View File

@@ -16,7 +16,10 @@ Partial Class PopUpSeleccionarEmpresa
End If End If
End Sub 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) Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
If Dt IsNot Nothing Then If Dt IsNot Nothing Then
@@ -87,7 +90,9 @@ Partial Class PopUpSeleccionarEmpresa
RegistraScript("Ir3();") RegistraScript("Ir3();")
End If End If
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
End If End If

View File

@@ -1385,6 +1385,7 @@ Partial Class Sistemas_UsuarioDetalle
GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
GlobalDTUsuarios(CveEmpresa:=-1) = Nothing GlobalDTUsuarios(CveEmpresa:=-1) = Nothing
'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then 'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then
' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados ' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
' Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0") ' Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0")

View File

@@ -2750,7 +2750,7 @@ Partial Class Clientes
End If End If
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 ErrorProceso = True
End If 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 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 CuentaContable = DirectCast(sender, Button).CommandArgument.ToString()
Dim Button = DirectCast(sender, Button) Dim Button = DirectCast(sender, Button)
Dim CodigoCuentaAltaCompaq As String = ""
Dim NombreCuentaCuentaAltaCompaq As String = ""
Dim IdCuentaAltaCompaq As Integer = -1
Select Case CuentaContable Select Case CuentaContable
Case "Clientes" Case "Clientes"
AgregarCuentaContable(Button, DdlCtaContableClientes, "", "", -1) AgregarCuentaContable(Button, DdlCtaContableClientes, "", "", -1)
Case "Anticipos" Case "Anticipos"
AgregarCuentaContable(Button, DdlCtaContableAnticipos, "", "", -1)
AgregarCuentaContable(Button, DdlCtaContableAnticipos, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq)
AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 3)
Case "RetIVA" Case "RetIVA"
AgregarCuentaContable(Button, DdlCtaContableRetIVA, "", "", -1) AgregarCuentaContable(Button, DdlCtaContableRetIVA, "", "", -1)
Case "RetISR" Case "RetISR"
AgregarCuentaContable(Button, DdlCtaContableRetISR, "", "", -1) AgregarCuentaContable(Button, DdlCtaContableRetISR, "", "", -1)
@@ -3957,14 +3968,23 @@ Partial Class Clientes
Return ProcesoCorrecto Return ProcesoCorrecto
End Function 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 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 UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then
Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero
If CvePadre > 0 Then 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) Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq)
If CvecuentaNueva > 0 Then 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 Respuesta = True
End If End If
End If End If
@@ -3982,6 +4002,18 @@ Partial Class Clientes
Respuesta = True Respuesta = True
End If 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 Return Respuesta
End Function End Function