Globales
This commit is contained in:
@@ -5852,6 +5852,71 @@ Public Class ClsContabilidad
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
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
|
Public Function GetContaEjercicio(CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno = False
|
Dim Retorno = False
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<li>
|
<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>
|
</li>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -86,6 +89,27 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</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>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal">
|
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal">
|
||||||
@@ -171,6 +195,53 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</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>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -40,8 +40,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
|||||||
If ObjConta.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero) Then
|
If ObjConta.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero) Then
|
||||||
GvDatos.DataSource = ObjConta.DtResultados
|
GvDatos.DataSource = ObjConta.DtResultados
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ObjConta.GetCuentasGlobales(UsuarioActual.CveEmpresa) Then
|
||||||
|
GvGlobal.DataSource = ObjConta.DtResultados
|
||||||
|
End If
|
||||||
|
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
|
GvGlobal.DataBind()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -53,10 +59,12 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
|||||||
|
|
||||||
If ObjConta.GetConta_ConceptosContables() Then
|
If ObjConta.GetConta_ConceptosContables() Then
|
||||||
DdlCconceptosContables.DataSource = ObjConta.DtResultados
|
DdlCconceptosContables.DataSource = ObjConta.DtResultados
|
||||||
|
DdlConceptoGlobal.DataSource = ObjConta.DtResultados.FiltraParametros("EsCuentaUnica = false AND EsSistema = True AND EsGlobal = True")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
|
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
|
||||||
DdlCuenta.DataSource = ObjConta.DtResultados
|
DdlCuenta.DataSource = ObjConta.DtResultados
|
||||||
|
DdlCuentaGlobal.DataSource = ObjConta.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||||
@@ -79,7 +87,9 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
|||||||
|
|
||||||
DdlCuentaBancaria.DataBind()
|
DdlCuentaBancaria.DataBind()
|
||||||
DdlCconceptosContables.DataBind()
|
DdlCconceptosContables.DataBind()
|
||||||
|
DdlConceptoGlobal.DataBind()
|
||||||
DdlCuenta.DataBind()
|
DdlCuenta.DataBind()
|
||||||
|
DdlCuentaGlobal.DataBind()
|
||||||
DdlProveedor.DataBind()
|
DdlProveedor.DataBind()
|
||||||
'DdlPersonal.DataBind()
|
'DdlPersonal.DataBind()
|
||||||
DdlClasificacion.DataBind()
|
DdlClasificacion.DataBind()
|
||||||
@@ -145,6 +155,11 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Dr("AplicaImpuesto").ToString = "True" Then
|
||||||
|
divPorcentajeIVA.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Dr("AplicaClasificacion").ToString = "True" Then
|
If Dr("AplicaClasificacion").ToString = "True" Then
|
||||||
divClasificacion.Visible = True
|
divClasificacion.Visible = True
|
||||||
End If
|
End If
|
||||||
@@ -184,7 +199,24 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
|||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
End Sub
|
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()
|
LimpiarDatos()
|
||||||
|
|
||||||
LbAgregar.Text = "Agregar"
|
LbAgregar.Text = "Agregar"
|
||||||
@@ -238,4 +270,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
|
|||||||
CargaDatosSistema()
|
CargaDatosSistema()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
End Sub
|
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
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user