diff --git a/AF/AF.aspx b/AF/AF.aspx index eba0ec925..663a605f5 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -54,7 +54,9 @@ - + + +
@@ -211,6 +213,9 @@
+
+ +
@@ -311,17 +316,23 @@
- -
+ +
+ + + + + + + + + + + + - - - - - - - -
+
+
@@ -628,6 +639,44 @@
+ + +
+
@@ -1011,6 +1060,7 @@ + @@ -1409,7 +1459,7 @@ - + diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 5db814ec3..257f9a37d 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -932,8 +932,8 @@ Partial Class AF_AF TxtCodigo.Text = ObjActivoFijo.Codigo TxtValorCompra.Text = ObjActivoFijo.ValorCompra.ToString.FormatoNumero TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString - - + TxtValorCompraMN.Text = ObjActivoFijo.ValorCompraMN.ToString.FormatoNumero + If ObjActivoFijo.ValorCompra <> ObjActivoFijo.ValorCompraMN Then DivValorCompraMN.visible = True TxtFechaBaja.Text = If(ObjActivoFijo.FechaBaja = New Date(1900, 1, 1), "", ObjActivoFijo.FechaBaja.ToString("dd/MM/yyyy")) @@ -3152,13 +3152,15 @@ Partial Class AF_AF Private Sub CargaCuentasConceptos() Dim ObjConta As New ClsContabilidad If ObjConta.GetCuentasConceptos(10, UsuarioActual.CveEmpresa, CveAF:=CveActivoFijo) Then + BtnVincularCuenta.Visible = ObjConta.DtResultados.Rows.Count = 0 GvCta.DataSource = ObjConta.DtResultados divCuentas.Visible = True End If ObjConta.Dispose() GvCta.DataBind() - End Sub + End Sub + Private Sub ActivarRegistroCuentaAF() If DdlCtaContable.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(221).ToEntero > 0 Then BtnCtaContable.Visible = True @@ -4878,15 +4880,10 @@ Partial Class AF_AF DT_PlgaEfermedad.AcceptChanges() - - End If ErrorProceso = False End If - - - If Not ErrorProceso Then RegistraScript("$('#DVModalPlagaEnfermedad').modal('hide');") Alert("Plaga Enfermedad guardada Correctamente.") @@ -4895,9 +4892,51 @@ Partial Class AF_AF End Sub + Private Sub BtnVincularCuenta_Click(sender As Object, e As EventArgs) Handles BtnVincularCuenta.Click + RegistraScript("$('#ModalContaCuenta').modal('show');") + DdlContaCuenta.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1) + DdlContaCuenta.DataBind() + End Sub + #End Region + Protected Sub BtnCuentaAsociar_Click(sender As Object, e As EventArgs) + Dim ObjConta As New ClsContabilidad + ObjConta.IniciaTransacSQL() + Dim ErrorString As String = "" + If HdnCveCuentaAsignacion.Value.ToEntero <= 0 Then + If Not ObjConta.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, DdlContaCuenta.SelectedValue.ToEntero, CveActivoFijo:=CveActivoFijo) Then + ErrorString = "Error al agregar" + End If + ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then + If Not ObjConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 49, DdlContaCuenta.SelectedValue.ToEntero, CveActivoFijo:=CveActivoFijo) Then + ErrorString = "Error al actualizar" + End If + End If + If ErrorString.Length > 0 Then + ObjConta.RollBack() + Alert(ErrorString) + Else + ObjConta.Commit() + CargaCuentasConceptos() + UPG.Update() + RegistraScript("$('#ModalContaCuenta').modal('hide');") + Alert("Agregado correctamente") + End If + ObjConta.Dispose() + End Sub + Protected Sub ActualizaContaCuenta(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim CveConceptoContable As Integer = GvRow.DataKey("CveConceptoContable").ToString.ToEntero + HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString + DdlContaCuenta.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1) + DdlContaCuenta.DataBind() + DdlContaCuenta.SelectedValue = GvRow.DataKey("CveCuenta").ToString + + RegistraScript("$('#ModalContaCuenta').modal('show');") + + End Sub End Class \ No newline at end of file diff --git a/AF/CatAF.aspx b/AF/CatAF.aspx index c7a483fa0..34ad4ee76 100644 --- a/AF/CatAF.aspx +++ b/AF/CatAF.aspx @@ -207,26 +207,25 @@ - - + - + - + - + @@ -244,7 +243,7 @@ - + @@ -260,14 +259,7 @@ - - - - - - - - +