-- ajustes para cmbiar la cuenta contable el tipoconta=1
This commit is contained in:
74
AF/AF.aspx
74
AF/AF.aspx
@@ -54,7 +54,9 @@
|
||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%">
|
||||
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UPG" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light xspadding bordered ">
|
||||
@@ -211,6 +213,9 @@
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" style="padding-top: 10px;" runat="server" id="DivValorCompraMN" visible="False">
|
||||
<asp:TextBox CssClass="form-control input-sm" ID="TxtValorCompraMN" runat="server" MaxLength="13"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding-top: 10px;" runat="server" id="DivCompra" visible="False">
|
||||
<asp:HyperLink ID="HLCompra" Target="_blank" Text="Ver Compra" runat="server" />
|
||||
</div>
|
||||
@@ -311,17 +316,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="divCuentas" runat="server" visible="false">
|
||||
|
||||
<div id="divCuentas" runat="server" visible="false">
|
||||
<asp:Button ID="BtnVincularCuenta" runat="server" CssClass="btn btn-primary btn-sm" Text="+ Cuenta" Visible="false" />
|
||||
<asp:GridView ID="GvCta" runat="server" DataKeyNames="CveCuentaAsignacion,CveConceptoContable,CveCuenta,ConceptoContable,NombreCuenta" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Historial de Ventas" CssClass="table table-striped table-advance table-hover" Style=" width: 100%;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Concepto Contable" DataField="ConceptoContable" />
|
||||
<asp:BoundField HeaderText="Nombre Cuenta" DataField="NombreCuenta" />
|
||||
<asp:TemplateField ItemStyle-Width="49px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaContaCuenta" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<asp:GridView ID="GvCta" runat="server" DataKeyNames="ConceptoContable,NombreCuenta" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Historial de Ventas" CssClass="table table-striped table-advance table-hover" Style=" width: 100%;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Concepto Contable" DataField="ConceptoContable" />
|
||||
<asp:BoundField HeaderText="Nombre Cuenta" DataField="NombreCuenta" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" runat="server" id="trCuentaContable" visible="False">
|
||||
<div class="col-md-4 ">
|
||||
<label class=" control-label">Cuenta Contable:</label>
|
||||
@@ -628,6 +639,44 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ModalContaCuenta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Cuenta</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div>
|
||||
<asp:HiddenField ID="HdnCveCuentaAsignacion" runat="server" />
|
||||
<asp:DropDownList ID="DdlContaCuenta" CssClass="form-control input-sm input-small select2me" runat="server" AppendDataBoundItems="True" Width="80%" DataTextField="CtaCodigo" DataValueField="CveCuenta">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Button ID="Button2" runat="server" CssClass="btn btn-primary btn-sm" Text="+" Visible="False" />
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCuentaAsociar" Text="Vincular Cuenta" runat="server" ClientIDMode="Static" OnClick="BtnCuentaAsociar_Click" CssClass="btn btn-primary" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
@@ -1011,6 +1060,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
@@ -1409,7 +1459,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="upGaleria" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
@@ -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
|
||||
@@ -207,26 +207,25 @@
|
||||
<asp:HyperLink ID="Hpl" runat="server" Text='<%# Eval("Codigo") %>' NavigateUrl='<%# Eval("CveActivoFijo", "/AF/AF.aspx?CveActivoFijo={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Descripción">
|
||||
<ItemStyle Width="140px" />
|
||||
<asp:TemplateField HeaderText="Descripción">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Descripcion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Tipo Act. Fijo">
|
||||
<ItemStyle Width="90px" />
|
||||
<ItemStyle Width="125px" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoActivoFijo" runat="server" Text='<%# Eval("TipoActivoFijo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sub Tipo Act. Fijo">
|
||||
<ItemStyle Width="110px" />
|
||||
<ItemStyle Width="125px" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubTIpoActivoFijo" runat="server" Text='<%# Eval("SubTIpoActivoFijo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Responsable">
|
||||
<ItemStyle Width="105px" />
|
||||
<ItemStyle Width="125px" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlResponsable" runat="server" Text='<%# Eval("Responsable")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -244,7 +243,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="SubProyecto">
|
||||
<ItemStyle Width="90px" />
|
||||
<ItemStyle Width="110px" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -260,14 +259,7 @@
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usuario">
|
||||
<ItemStyle Width="80px" />
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
|
||||
Reference in New Issue
Block a user