-- limpiar globaldtcuentas

This commit is contained in:
2023-07-07 09:50:57 -07:00
parent c56750bc66
commit b05ecc77ea

View File

@@ -261,7 +261,7 @@ Partial Class Contabilidad2_CatCuentas
Tnombre.Text = dr("Nombre").ToString() Tnombre.Text = dr("Nombre").ToString()
DTcuenta.SelectedValue = dr("Tipo").ToString() DTcuenta.SelectedValue = dr("Tipo").ToString()
DcuentaMayor.SelectedValue = dr("CtaMayor").ToString DcuentaMayor.SelectedValue = dr("CtaMayor").ToString
DdlMoneda.SelectedValue = dr("CveMoneda").ToString DdlMoneda.SelectedValue = If(dr("CveMoneda").ToString = "", "1", dr("CveMoneda").ToString)
Using objconta As New ClsContabilidad Using objconta As New ClsContabilidad
objconta.GetConta_CuentasDataContabilidad(IDSelected, UsuarioActual.CveEmpresa) objconta.GetConta_CuentasDataContabilidad(IDSelected, UsuarioActual.CveEmpresa)
If objconta.DtResultados.Rows.Count > 0 Then If objconta.DtResultados.Rows.Count > 0 Then
@@ -362,36 +362,36 @@ Partial Class Contabilidad2_CatCuentas
CveProveedor:=CveProveedor, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeImpuesto, CveProveedor:=CveProveedor, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeImpuesto,
CveBancoCuenta:=CveBancoCuenta, CveAlmacen:=CveAlmacen, Codigo:=TxtCuenta.Text.Replace("-", ""), CvePadre:=DdlCuentaContable.SelectedValue.ToEntero) Then CveBancoCuenta:=CveBancoCuenta, CveAlmacen:=CveAlmacen, Codigo:=TxtCuenta.Text.Replace("-", ""), CvePadre:=DdlCuentaContable.SelectedValue.ToEntero) Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then 'If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim ObjContaEmpresa As New ClsContPAQi(UsuarioActual.Empresa) ' Dim ObjContaEmpresa As New ClsContPAQi(UsuarioActual.Empresa)
If Not ObjContaEmpresa.UpdateCuenta(IDSelected.ToEntero, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, ' If Not ObjContaEmpresa.UpdateCuenta(IDSelected.ToEntero, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero,
DdlMoneda.SelectedValue.ToEntero, DdlAgrupadorSAT.SelectedValue.ToEntero, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then ' DdlMoneda.SelectedValue.ToEntero, DdlAgrupadorSAT.SelectedValue.ToEntero, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
ObjContaEmpresa.Dispose() ' ObjContaEmpresa.Dispose()
ObjConta.Dispose() ' ObjConta.Dispose()
Exit Sub ' Exit Sub
End If ' End If
End If 'End If
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
If UsuarioActual.Empresa.TipoContabilidad = 2 Then 'If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa) ' Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta2.GetCuentas(-1, "-1", -1) Then ' If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero ' Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
Dim IdAgrupador As Integer ' Dim IdAgrupador As Integer
If ObjConta2.GetAgrupadoresSAT() Then ' If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero ' IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If ' End If
If Id > 0 Then ' If Id > 0 Then
If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then ' If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
End If ' End If
End If ' End If
End If ' End If
End Using ' End Using
End If 'End If
Dim customerRow As Data.DataRow Dim customerRow As Data.DataRow
customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0) customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0)
@@ -408,7 +408,7 @@ Partial Class Contabilidad2_CatCuentas
LimpiarCampos() LimpiarCampos()
'RegistraScript("$get('BtnCambiaAgrupadorSAT').click();") 'RegistraScript("$get('BtnCambiaAgrupadorSAT').click();")
updatos.Update() updatos.Update()
GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa) = Nothing
Alert("La cuenta se guardo correctamente") Alert("La cuenta se guardo correctamente")
End If End If
@@ -596,7 +596,7 @@ Partial Class Contabilidad2_CatCuentas
If Not TieneError Then If Not TieneError Then
ObjConta.Commit() ObjConta.Commit()
GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa) = Nothing
CargaDatos() CargaDatos()
LimpiarCampos() LimpiarCampos()
updatos.Update() updatos.Update()
@@ -669,6 +669,7 @@ Partial Class Contabilidad2_CatCuentas
ObjConta2.Dispose() ObjConta2.Dispose()
End If End If
GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa) = Nothing
Else Else
Alert("La Cuenta no pudo ser eliminada", TipoMensaje.MsgError) Alert("La Cuenta no pudo ser eliminada", TipoMensaje.MsgError)