From f4cbe8c25d8ae9d3f6399b55f70ff4e82ad6d97c Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 25 May 2023 17:44:14 -0700 Subject: [PATCH] -- tipoconta=1, que haga la asignacion --- Ventas/CatClasificaciones.aspx | 3 ++- Ventas/CatClasificaciones.aspx.vb | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Ventas/CatClasificaciones.aspx b/Ventas/CatClasificaciones.aspx index d8fbfc59d..2c1ca0012 100644 --- a/Ventas/CatClasificaciones.aspx +++ b/Ventas/CatClasificaciones.aspx @@ -76,7 +76,7 @@
+ DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto,CveCuentaAsignacionGasto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> @@ -230,6 +230,7 @@
+
diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index 36276040b..bdcc4cb97 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -157,6 +157,7 @@ Partial Class CatClasificaciones Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click Dim ObjClasificaciones As New ClsClasificaciones + Dim objConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL) Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0) If HdnModalidadClasificacion.Value = "A" Then @@ -168,7 +169,11 @@ Partial Class CatClasificaciones RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") - + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(6, UsuarioActual.CveEmpresa, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) + If DdlCuentaCostos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(69, UsuarioActual.CveEmpresa, DdlCuentaCostos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) + If DdlCuentaIngresos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(4, UsuarioActual.CveEmpresa, DdlCuentaIngresos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion) + End If TxtClasificacion.Text = "" TxtPrecioBaseCosto.Text = "" DdlCuentaGasto.SelectedValueExist("0") @@ -191,11 +196,18 @@ Partial Class CatClasificaciones Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 6, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=CveClasificacion) + + End If + + ObjClasificaciones.Commit() RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) + ObjClasificaciones.RollBack() End If End If @@ -403,6 +415,7 @@ Partial Class CatClasificaciones ChkRequiereAFCompra.Checked = If(GvRow.DataKey("RequiereAFCompra") = "True", True, False) ChkRequiereAFInsumo.Checked = If(GvRow.DataKey("RequiereAFInsumo") = "True", True, False) ChkRequierePersonal.Checked = If(GvRow.DataKey("RequierePersonal") = "True", True, False) + HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacionGasto") If CuentaGasto.Length > 1 And CargaGastos Then DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString))