Globales
This commit is contained in:
@@ -5852,6 +5852,71 @@ Public Class ClsContabilidad
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region "Globales"
|
||||
Public Function GetCuentasGlobales(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_CuentasGlobalesGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
Me.OnError("Ocurrió un error al obtener el catálogo de cuentas globales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddCuentasGlobales(CveConceptoContable As Integer, CveCuenta As Integer, TipoGlobal As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_CuentasGlobalesAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@TipoGlobal", SqlDbType.Int).Value = TipoGlobal
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
Me.OnError("Ocurrió un error al eliminar el catálogo de cuentas asignación", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveCuentasGlobales(CveConceptoContable As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_CuentasGlobalesDelete")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
Me.OnError("Ocurrió un error al eliminar el catálogo de globales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Public Function GetContaEjercicio(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarMotivoD" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Cuenta Asignación"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarAsignacion" data-toggle="tooltip" data-placement="left" title="Agregar Cuenta" Text="<i class='fa fa-plus'></i>Agregar Cuenta Asignación"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarGlobal" data-toggle="tooltip" data-placement="left" title="Agregar Global" Text="<i class='fa fa-plus'></i>Agregar Global"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
@@ -86,6 +89,27 @@
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<asp:GridView runat="server" ID="GvGlobal" EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover ScrollAD"
|
||||
DataKeyNames="CveEmpresa,CveCuenta,CveConceptoContable" AutoGenerateColumns="False"
|
||||
Style=" width:100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ConceptoContable" ItemStyle-Width="150px" HeaderText="Concepto Contable" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:BoundField DataField="CuentaCodigo" ItemStyle-Width="100px" HeaderText="Código Cuenta" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:BoundField DataField="CuentaNombre" HeaderText="Nombre Cuenta" ItemStyle-HorizontalAlign="Left"/>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="49px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaModulo" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="49px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgEliminar" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="EliminarRowGlobal" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal">
|
||||
@@ -171,6 +195,53 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UppModalGlobal">
|
||||
<ContentTemplate>
|
||||
<div id="ModalGlobal" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UppGlobal2" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal1" runat="server">Cuentas Globales</asp:Literal>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="text-align:center">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1" style="width:50%;text-align:left">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:HiddenField ID="HiddenField1" runat="server" />
|
||||
<asp:DropDownList ID="DdlConceptoGlobal" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Width="240px" ValidationGroup="GrpModulo2" ></asp:DropDownList>
|
||||
<label for="<%= DdlConceptoGlobal.ClientID.ToString()%>">Concepto Contable: </label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlCuentaGlobal" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpModulo2"></asp:DropDownList>
|
||||
<label for="<%= DdlCuentaGlobal.ClientID.ToString()%>">Cuenta Contable: </label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="div3" runat="server" >
|
||||
<asp:DropDownList ID="DdlTipoGlobal" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" Width="240px" ValidationGroup="GrpModulo2" >
|
||||
<asp:ListItem Text="Mayor" Value="1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoGlobal.ClientID.ToString()%>">Tipo Global: </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LBAgregaGlobal" runat="server" class="btn btn-success" Text="Agregar" OnClick="LBAgregaGlobal_Click" ValidationGroup="GrpModulo2" />
|
||||
<button id="Button1" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
<asp:CheckBox ID="CheckBox1" Checked="true" Text="Seguir Registrando" runat="server" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -40,8 +40,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
||||
If ObjConta.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjConta.DtResultados
|
||||
End If
|
||||
|
||||
If ObjConta.GetCuentasGlobales(UsuarioActual.CveEmpresa) Then
|
||||
GvGlobal.DataSource = ObjConta.DtResultados
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
GvDatos.DataBind()
|
||||
GvGlobal.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
@@ -53,10 +59,12 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
||||
|
||||
If ObjConta.GetConta_ConceptosContables() Then
|
||||
DdlCconceptosContables.DataSource = ObjConta.DtResultados
|
||||
DdlConceptoGlobal.DataSource = ObjConta.DtResultados.FiltraParametros("EsCuentaUnica = false AND EsSistema = True AND EsGlobal = True")
|
||||
End If
|
||||
|
||||
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
|
||||
DdlCuenta.DataSource = ObjConta.DtResultados
|
||||
DdlCuentaGlobal.DataSource = ObjConta.DtResultados
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
@@ -79,7 +87,9 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
||||
|
||||
DdlCuentaBancaria.DataBind()
|
||||
DdlCconceptosContables.DataBind()
|
||||
DdlConceptoGlobal.DataBind()
|
||||
DdlCuenta.DataBind()
|
||||
DdlCuentaGlobal.DataBind()
|
||||
DdlProveedor.DataBind()
|
||||
'DdlPersonal.DataBind()
|
||||
DdlClasificacion.DataBind()
|
||||
@@ -145,6 +155,11 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
||||
End If
|
||||
End If
|
||||
|
||||
If Dr("AplicaImpuesto").ToString = "True" Then
|
||||
divPorcentajeIVA.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
If Dr("AplicaClasificacion").ToString = "True" Then
|
||||
divClasificacion.Visible = True
|
||||
End If
|
||||
@@ -184,7 +199,24 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
||||
ObjConta.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click
|
||||
Protected Sub BtnAgregarGlobal_Click(sender As Object, e As EventArgs) Handles BtnAgregarGlobal.Click
|
||||
|
||||
UppModalGlobal.Update()
|
||||
RegistraScript("$('#ModalGlobal').modal();")
|
||||
End Sub
|
||||
|
||||
Protected Sub EliminarRowGlobal(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
If ObjConta.RemoveCuentasGlobales(GvRow.DataKey("CveConceptoContable").ToEntero, GvRow.DataKey("CveEmpresa").ToEntero) Then
|
||||
Alert("se elimino correctamente")
|
||||
End If
|
||||
CargaDatosSistema()
|
||||
UpDatos.Update()
|
||||
ObjConta.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarAsignacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarAsignacion.Click
|
||||
LimpiarDatos()
|
||||
|
||||
LbAgregar.Text = "Agregar"
|
||||
@@ -238,4 +270,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
||||
CargaDatosSistema()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LBAgregaGlobal_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ErrorString As String = ""
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
If Not ObjConta.AddCuentasGlobales(DdlConceptoGlobal.SelectedValue.ToEntero, DdlCuentaGlobal.SelectedValue.ToEntero, DdlTipoGlobal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
ErrorString = "Error al agregar"
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
If ErrorString.Length > 0 Then
|
||||
Alert(ErrorString)
|
||||
Else
|
||||
Alert("Agregado correctamente")
|
||||
End If
|
||||
CargaDatosSistema()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user