Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<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 Clas. Porcentaje"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarClas" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Clas. Porcentaje"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
@@ -23,15 +23,19 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="Clasificacion,CveClasificacionPorcentaje,CveEmpresa,CveClasificacion,PorcentajeIVA,IdCtaIVAXAcreditar,IdCtaIVAAcreditable,IdCtaIVAXTrasladar,IdCtaIVATrasladado,IdCtaIVANoAcreditable" EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveClasificacionPorcentaje,Clasificacion,CveEmpresa,CveClasificacion,PorcentajeIVA,
|
||||
CuentaXAcreditar,CuentaAcreditable,CuentaXTrasladar,CuentaTrasladado,IdCtaIVAXAcreditar,IdCtaIVAAcreditable,IdCtaIVAXTrasladar,IdCtaIVATrasladado,IdCtaIVANoAcreditable"
|
||||
EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;
|
||||
text-align: center; width: 100%" GridLines="None">
|
||||
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificacion" />
|
||||
<asp:BoundField DataField="PorcentajeIVA" HeaderText="PorcentajeIVA" />
|
||||
<asp:BoundField DataField="IdCtaIVAXAcreditar" HeaderText="IdCtaIVAXAcreditar" />
|
||||
<asp:BoundField DataField="IdCtaIVAAcreditable" HeaderText="IdCtaIVAAcreditable" />
|
||||
<asp:BoundField DataField="IdCtaIVAXTrasladar" HeaderText="IdCtaIVAXTrasladar" />
|
||||
<asp:BoundField DataField="IdCtaIVATrasladado" HeaderText="IdCtaIVATrasladado" />
|
||||
<asp:BoundField DataField="IdCtaIVANoAcreditable" HeaderText="IdCtaIVANoAcreditable" />
|
||||
<asp:BoundField DataField="CuentaXAcreditar" HeaderText="C. Por Acreditar" />
|
||||
<asp:BoundField DataField="CuentaAcreditable" HeaderText="C. Acreditable" />
|
||||
<asp:BoundField DataField="CuentaXTrasladar" HeaderText="C. Por trasladar" />
|
||||
<asp:BoundField DataField="CuentaTrasladado" HeaderText="C. Trasladado" />
|
||||
<%--<asp:BoundField DataField="IdCtaIVANoAcreditable" HeaderText="IdCtaIVANoAcreditable" />--%>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
@@ -40,7 +44,7 @@
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgE" runat="server" OnClick="GvDatos_RowEditing" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
@@ -60,23 +64,59 @@
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Motivos de baja</asp:Literal></h4>
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Clasificación porcentaje</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="MotivoTxt" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTiposD" runat="server" ControlToValidate="MotivoTxt" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Motivo:</label>
|
||||
<asp:dropdownlist runat="server" ID="DdlClasificaciones" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" AppendDataBoundItems="true" Width="100%" DataTextField="Clasificacion" DataValueField="CveClasificacion"></asp:dropdownlist>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlClasificaciones" runat="server" ControlToValidate="DdlClasificaciones" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="MotivoTxt">Clasificación:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br id="saltoDeLinea" runat="server" />
|
||||
<div id="CheckActiveSection" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Activo:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPorcentajeIva" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTiposD" runat="server" ControlToValidate="TxtPorcentajeIva" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtPorcentajeIva">Porcentaje IVA:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:dropdownlist runat="server" ID="DdlIdCtaIVAXAcreditar" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" AppendDataBoundItems="true" Width="100%" DataTextField="Nombre" DataValueField="Id"></asp:dropdownlist>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlIdCtaIVAXAcreditar" runat="server" ControlToValidate="DdlIdCtaIVAXAcreditar" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="DdlIdCtaIVAXAcreditar">Cuenta IVA por acreditar:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:dropdownlist runat="server" ID="DdlIdCtaIVAAcreditable" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" AppendDataBoundItems="true" Width="100%" DataTextField="Nombre" DataValueField="Id"></asp:dropdownlist>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlIdCtaIVAAcreditable" runat="server" ControlToValidate="DdlIdCtaIVAAcreditable" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="DdlIdCtaIVAAcreditable">Cuenta IVA acreditable:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:dropdownlist runat="server" ID="DdlIdCtaIVAXTrasladar" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" AppendDataBoundItems="true" Width="100%" DataTextField="Nombre" DataValueField="Id"></asp:dropdownlist>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlIdCtaIVAXTrasladar" runat="server" ControlToValidate="DdlIdCtaIVAXTrasladar" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="DdlIdCtaIVAXTrasladar">Cuenta IVA por trasladar:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:dropdownlist runat="server" ID="DdlIdCtaIVATrasladado" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" AppendDataBoundItems="true" Width="100%" DataTextField="Nombre" DataValueField="Id"></asp:dropdownlist>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlIdCtaIVATrasladado" runat="server" ControlToValidate="DdlIdCtaIVATrasladado" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="DdlIdCtaIVATrasladado">Cuenta IVA Traslado:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:dropdownlist runat="server" ID="DdlIdCtaIVANoAcreditable" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" AppendDataBoundItems="true" Width="100%" DataTextField="Nombre" DataValueField="Id"></asp:dropdownlist>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlIdCtaIVANoAcreditable" runat="server" ControlToValidate="DdlIdCtaIVANoAcreditable" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="DdlIdCtaIVANoAcreditable">Cuenta IVA no acreditable:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -5,10 +5,29 @@ Imports Microsoft.Reporting.WebForms
|
||||
Partial Class Contabilidad_CatClasificacionPorcentaje
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtClasificacionPorcentaje As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtClasificacionPorcentaje"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtClasificacionPorcentaje") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveClasificacion As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveClasificacion"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClasificacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaDatos()
|
||||
CargaContPaq()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -17,8 +36,115 @@ Partial Class Contabilidad_CatClasificacionPorcentaje
|
||||
Dim ObjGenerales As New ClsGenerales
|
||||
If ObjGenerales.GetClasificacionPorcentaje(UsuarioActual.CveEmpresa, CveClasificacionPorcentaje:=-1, CveClasificacion:=-1, PorcentajeIVA:=-1, Opcion:=2) Then
|
||||
GvDatos.DataSource = ObjGenerales.DtResultados
|
||||
DtClasificacionPorcentaje = ObjGenerales.DtResultados
|
||||
End If
|
||||
ObjGenerales.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
DdlClasificaciones.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificaciones.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaContPaq()
|
||||
Dim Empresa As DataTable = GlobalDTEmpresas(UsuarioActual.CveEmpresa)
|
||||
Dim Servidor As String = Empresa.FiltroPrimeroValor("ServerContPAQi")
|
||||
Dim BD As String = Empresa.FiltroPrimeroValor("BDContPAQi")
|
||||
Dim Usuario As String = Empresa.FiltroPrimeroValor("UsrContPAQi")
|
||||
Dim Contra As String = Empresa.FiltroPrimeroValor("PwdContPAQi")
|
||||
|
||||
Dim ObjPaq As New ClsContPAQi(Servidor, BD, Usuario, Contra)
|
||||
|
||||
DdlIdCtaIVAXAcreditar.Items.Add(New ListItem("Seleccione una cuenta", "-1"))
|
||||
DdlIdCtaIVAAcreditable.Items.Add(New ListItem("Seleccione una cuenta", "-1"))
|
||||
DdlIdCtaIVAXTrasladar.Items.Add(New ListItem("Seleccione una cuenta", "-1"))
|
||||
DdlIdCtaIVATrasladado.Items.Add(New ListItem("Seleccione una cuenta", "-1"))
|
||||
DdlIdCtaIVANoAcreditable.Items.Add(New ListItem("Seleccione una cuenta", "-1"))
|
||||
|
||||
If ObjPaq.GetCuentas(-1, "-1", -1, IdPadre:=-1) Then
|
||||
DdlIdCtaIVAXAcreditar.DataSource = ObjPaq.DtResultados
|
||||
DdlIdCtaIVAAcreditable.DataSource = ObjPaq.DtResultados
|
||||
DdlIdCtaIVAXTrasladar.DataSource = ObjPaq.DtResultados
|
||||
DdlIdCtaIVATrasladado.DataSource = ObjPaq.DtResultados
|
||||
DdlIdCtaIVANoAcreditable.DataSource = ObjPaq.DtResultados
|
||||
End If
|
||||
ObjPaq.Dispose()
|
||||
DdlIdCtaIVAXAcreditar.DataBind()
|
||||
DdlIdCtaIVAAcreditable.DataBind()
|
||||
DdlIdCtaIVAXTrasladar.DataBind()
|
||||
DdlIdCtaIVATrasladado.DataBind()
|
||||
DdlIdCtaIVANoAcreditable.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarClas.Click
|
||||
BtnAgregarTiposDModal.Text = "Agregar"
|
||||
BtnEditarTiposDModal.Visible = False
|
||||
BtnAgregarTiposDModal.Visible = True
|
||||
TxtPorcentajeIva.Text = ""
|
||||
UpModalTiposD.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click 'esta funcion es la que agrega un nuevo motivo de baja se activa con el boton "Agregar" de la ventana modal"
|
||||
Dim ObjGenerales As New ClsGenerales
|
||||
If BtnAgregarTiposDModal.Text = "Agregar" Then
|
||||
If ObjGenerales.AddClasificacionPorcentaje(DdlClasificaciones.SelectedValue, TxtPorcentajeIva.Text.ToDouble, DdlIdCtaIVAXAcreditar.SelectedValue, DdlIdCtaIVAAcreditable.SelectedValue,
|
||||
DdlIdCtaIVAXTrasladar.SelectedValue, DdlIdCtaIVATrasladado.SelectedValue, UsuarioActual.CveEmpresa) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
|
||||
Alert("Clasificación porcentaje agregado correctamente")
|
||||
If ObjGenerales.GetClasificacionPorcentaje(-1) Then
|
||||
GlobalDTClasificacionPorcentaje(-1) = ObjGenerales.DtResultados
|
||||
End If
|
||||
CargaDatos()
|
||||
CargaContPaq()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
ElseIf BtnAgregarTiposDModal.Text = "Actualizar" Then
|
||||
If ObjGenerales.UpdateClasificacionPorcentaje(CveClasificacion, DdlClasificaciones.SelectedValue, TxtPorcentajeIva.Text.ToDouble, DdlIdCtaIVAXAcreditar.SelectedValue,
|
||||
DdlIdCtaIVAAcreditable.SelectedValue, DdlIdCtaIVAXTrasladar.SelectedValue, DdlIdCtaIVATrasladado.SelectedValue) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
|
||||
Alert("Clasificación porcentaje actualizado correctamente")
|
||||
If ObjGenerales.GetClasificacionPorcentaje(-1) Then
|
||||
GlobalDTClasificacionPorcentaje(-1) = ObjGenerales.DtResultados
|
||||
End If
|
||||
CargaDatos()
|
||||
CargaContPaq()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End If
|
||||
ObjGenerales.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim objgenerales As New ClsGenerales
|
||||
If objgenerales.RemoveClasificacionPorcentaje(GvDatos.DataKeys(e.RowIndex).Value.ToString) Then
|
||||
Alert("la clasificación porcentaje se eliminó correctamente")
|
||||
If objgenerales.GetClasificacionPorcentaje(-1) Then
|
||||
GlobalDTClasificacionPorcentaje(-1) = objgenerales.DtResultados
|
||||
End If
|
||||
CargaDatos()
|
||||
CargaContPaq()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
objgenerales.Dispose()
|
||||
End Sub
|
||||
|
||||
Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs)
|
||||
BtnAgregarTiposDModal.Text = "Actualizar"
|
||||
|
||||
Dim renglon As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
DdlClasificaciones.SelectedValue = If(renglon.DataKey("CveClasificacion").ToString IsNot "", renglon.DataKey("CveClasificacion"), "-1")
|
||||
TxtPorcentajeIva.Text = renglon.DataKey("PorcentajeIVA")
|
||||
DdlIdCtaIVAXAcreditar.SelectedValue = If(renglon.DataKey("IdCtaIVAXAcreditar").ToString IsNot "", renglon.DataKey("IdCtaIVAXAcreditar"), "-1")
|
||||
DdlIdCtaIVAAcreditable.SelectedValue = If(renglon.DataKey("IdCtaIVAAcreditable").ToString IsNot "", renglon.DataKey("IdCtaIVAAcreditable"), "-1")
|
||||
DdlIdCtaIVAXTrasladar.SelectedValue = If(renglon.DataKey("IdCtaIVAXTrasladar").ToString IsNot "", renglon.DataKey("IdCtaIVAXTrasladar"), "-1")
|
||||
DdlIdCtaIVATrasladado.SelectedValue = If(renglon.DataKey("IdCtaIVATrasladado").ToString IsNot "", renglon.DataKey("IdCtaIVATrasladado"), "-1")
|
||||
DdlIdCtaIVANoAcreditable.SelectedValue = If(renglon.DataKey("IdCtaIVANoAcreditable").ToString IsNot "", renglon.DataKey("IdCtaIVANoAcreditable"), "-1")
|
||||
|
||||
BtnEditarTiposDModal.Visible = False
|
||||
BtnAgregarTiposDModal.Visible = True
|
||||
UpModalTiposD.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"))
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user