From 7e57e718ee22d34d443f578c7e8838ad4a5e02dc Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 30 Apr 2021 10:36:24 -0700 Subject: [PATCH] Asignacion de cuentas bancarias en catalgo de cuentas contables --- App_Code/ClsContabilidad.vb | 6 ++- Contabilidad2/CatCuentasAsignaciones.aspx | 6 ++- Contabilidad2/CatCuentasAsignaciones.aspx.vb | 50 +++++++++++++------- 3 files changed, 43 insertions(+), 19 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index bde65432e..2959aba4a 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5726,7 +5726,7 @@ Public Class ClsContabilidad Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, - Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1) As Boolean + Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesAdd") @@ -5743,6 +5743,7 @@ Public Class ClsContabilidad .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA .Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina + .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta End With Try @@ -5777,7 +5778,7 @@ Public Class ClsContabilidad Public Function UpdateCuentasAsignaciones(CveConceptoAsignacion As Integer, Optional CveConceptoContable As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, - Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1) As Boolean + Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Conta_CuentasAsignacionesUpdate") @@ -5794,6 +5795,7 @@ Public Class ClsContabilidad .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA .Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina + .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta End With Try diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index f326424ab..2ba7351cd 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -24,7 +24,7 @@ @@ -87,6 +87,10 @@
+
+ + +
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 323a90ca7..886765323 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -42,7 +42,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then DdlCuenta.DataSource = ObjConta.DtResultados End If - + ObjConta.Dispose() DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlClientes.setEsWebService(True) @@ -51,17 +51,25 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa) - - ObjConta.Dispose() - + DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa) + + + + Dim ObjBancos As New ClsBancos + If ObjBancos.GetBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) Then + DdlCuentaBancaria.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + End If + ObjBancos.Dispose() + + DdlCuentaBancaria.DataBind() DdlCconceptosContables.DataBind() DdlCuenta.DataBind() DdlProveedor.DataBind() 'DdlPersonal.DataBind() DdlClasificacion.DataBind() - DdlAlmacen.DataBind() - + DdlAlmacen.DataBind() + + DdlCuentaBancaria.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCconceptosContables.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -71,16 +79,20 @@ Partial Class Contabilidad2_CatCuentasAsignaciones End Sub Protected Sub ActualizaModulo(sender As Object, e As EventArgs) + LimpiarDatos() + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero DdlCconceptosContables.SelectedValue = GvRow.DataKey("CveConceptoContable").ToEntero DdlCuenta.SelectedValue = GvRow.DataKey("CveCuenta").ToEntero - DdlConceptoNomina.SelectedValueexist(GvRow.DataKey("CveConceptoNomina").ToEntero) + DdlConceptoNomina.SelectedValueExist(GvRow.DataKey("CveConceptoNomina").ToEntero) DdlProveedor.SelectedValue = GvRow.DataKey("CveProveedor").ToEntero DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion").ToEntero DdlAlmacen.SelectedValue = GvRow.DataKey("CveAlmacen").ToEntero TxtIdCuentaContable.Text = GvRow.DataKey("IdCuenta") TxtPorcentajeIVA.Text = GvRow.DataKey("PorcentajeIVA") + DdlCuentaBancaria.SelectedValueExist(GvRow.DataKey("CveBancoCuenta")) + Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero @@ -120,14 +132,23 @@ Partial Class Contabilidad2_CatCuentasAsignaciones ObjConta.Dispose() End Sub - Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click + Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click + LimpiarDatos() + + LbAgregar.Text = "Agregar" + UpModalModulos.Update() + RegistraScript("$('#ModalCat').modal();") + End Sub + + Private Sub LimpiarDatos() CveConceptoAsignacion = -1 DdlCconceptosContables.SelectedValue = -1 DdlCuenta.SelectedValue = -1 DdlProveedor.SelectedValue = -1 DdlClasificacion.SelectedValue = -1 DdlAlmacen.SelectedValue = -1 - DdlConceptoNomina.SelectedValue = -1 + DdlConceptoNomina.SelectedValue = -1 + DdlCuentaBancaria.SelectedValueExist("-1") TxtIdCuentaContable.Text = "" TxtPorcentajeIVA.Text = "" DdlClientes.ddl.DataSource = "" @@ -135,10 +156,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones DdlClientes.setEsWebService(True) DdlPersonal.ddl.DataSource = "" DdlPersonal.ddl.DataBind() - DdlPersonal.setEsWebService(True) - LbAgregar.Text = "Agregar" - UpModalModulos.Update() - RegistraScript("$('#ModalCat').modal();") + DdlPersonal.setEsWebService(True) End Sub Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click @@ -147,13 +165,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones If LbAgregar.Text = "Agregar" Then If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then ErrorString = "Error al agregar" End If ElseIf LbAgregar.Text = "Actualizar" Then If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, - DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal) Then + DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then ErrorString = "Error al actualizar" End If End If