This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-03-19 17:37:41 -07:00
parent 7e92fac836
commit c708f20fb8
8 changed files with 87 additions and 28 deletions

View File

@@ -151,7 +151,7 @@
</div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="15%" HeaderText="Almacen">
<ItemTemplate>
@@ -233,7 +233,7 @@
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAlmacen" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAlmacen" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAlmacen" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtAlmacen.ClientID.ToString()%>">Almacen:</label>
<asp:Label AssociatedControlID="TxtAlmacen" runat="server" Text="Almacen:"></asp:Label>
</div>
<div class="row">
<div class="col-md-6">
@@ -244,13 +244,13 @@
</div>--%>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpObligatorio" Width="100%" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
<asp:Label AssociatedControlID="DdlSubProyecto" runat="server" Text="SubProyecto:"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoAlmacen" runat="server" AppendDataBoundItems="true" DataValueField="CveTipoAlmacen" DataTextField="TipoAlmacen" ValidationGroup="GrpObligatorio" Width="100%" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlTipoAlmacen.ClientID.ToString()%>">Tipo de Almacen:</label>
<asp:Label AssociatedControlID="DdlTipoAlmacen" runat="server" Text="Tipo de Almacen:"></asp:Label>
</div>
</div>
</div>
@@ -261,14 +261,21 @@
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Selected="True" Text="Solo Existencia" Value="0"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlModalidad.ClientID.ToString()%>">Modalidad:</label>
<asp:Label AssociatedControlID="DdlModalidad" runat="server" Text="Modalidad:"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" id="divddlcc" visible="false" runat="server">
<asp:DropDownList ID="DdlCuentasContables" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="100%" ValidationGroup="GrpObligatorio" CssClass="form-control input-sm select2me"></asp:DropDownList>
<label for="<%= DdlCuentasContables.ClientID.ToString()%>">Cuenta Contable:</label>
</div>
<asp:Panel CssClass="" ID="divddlcc" Visible="false" runat="server">
<asp:Panel CssClass="form-group form-md-line-input input-iconright" ID="divCuentasCompac" Visible="false" runat="server">
<asp:DropDownList ID="DdlCuentasContables" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="100%" ValidationGroup="GrpObligatorio" CssClass="form-control input-sm select2me"></asp:DropDownList>
<asp:Label AssociatedControlID="DdlCuentasContables" runat="server" Text="Cuenta Contable:"></asp:Label>
</asp:Panel>
<asp:Panel CssClass="form-group form-md-line-input input-iconright" ID="pnlCuentassig" Visible="false" runat="server">
<asp:DropDownList ID="DdlCuentasSig" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="CveCuenta" Width="100%" ValidationGroup="GrpObligatorio" CssClass="form-control input-sm select2me"></asp:DropDownList>
<asp:Label AssociatedControlID="DdlCuentasSig" runat="server" Text="Cuenta Contable:"></asp:Label>
</asp:Panel>
</asp:Panel>
</div>
</div>
<div class="row">
@@ -278,14 +285,14 @@
<asp:ListItem Selected="True" Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlInventariable.ClientID.ToString()%>">Inventariable:</label>
<asp:Label AssociatedControlID="DdlInventariable" runat="server" Text="Inventariable:"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" style="width: 250px!important">
<asp:TextBox ID="TxtOrden" CssClass="form-control " Width="250px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtOrden" runat="server" ControlToValidate="TxtOrden" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
<asp:Label AssociatedControlID="TxtOrden" runat="server" Text="Orden:"></asp:Label>
<i></i>
</div>
</div>
@@ -293,7 +300,7 @@
<br />
<div class="form-group form-md-line-input input-iconright" id="divEstatus" runat="server">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:Label AssociatedControlID="ChkEstatus" runat="server" Text="Estatus:"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -84,17 +84,33 @@ Partial Class Inventarios_CatAlmacenes
End Sub
Private Sub CargaCuentasContables()
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
DtCuentasContables = ObjContabilidad.DtResultados
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
divCuentasCompac.Visible = False
pnlCuentassig.Visible = True
Using ObjContabilidad As New ClsContabilidad
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.CuentasContablesSigGet(UsuarioActual.CveEmpresa) Then
DdlCuentasSig.DataSource = ObjContabilidad.DtResultados
DdlCuentasSig.DataBind()
DdlCuentasSig.Items.Insert(0, New ListItem("Selecione", "-1"))
End If
End Using
Else
DtCuentasContables = Nothing
divCuentasCompac.Visible = True
pnlCuentassig.Visible = False
Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
DtCuentasContables = ObjContabilidad.DtResultados
Else
DtCuentasContables = Nothing
End If
End Using
DdlCuentasContables.DataSource = DtCuentasContables
DdlCuentasContables.DataBind()
End If
ObjContabilidad.Dispose()
DdlCuentasContables.DataSource = DtCuentasContables
DdlCuentasContables.DataBind()
UpAddAlmacen.Update()
End Sub
@@ -207,12 +223,17 @@ Partial Class Inventarios_CatAlmacenes
Dim TieneError = False
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
Dim CuentaContable = DdlCuentasContables.SelectedValue.ToEntero
If divddlcc.Visible = False Then
CuentaContable = 0
Dim CuentaContable As Integer = 0
Dim CveCuenta As Integer = 0
If divddlcc.Visible Then
If pnlCuentassig.Visible Then
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
Else
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
End If
End If
If HdnModalidad.Value = "A" Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero) Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta) Then
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -222,7 +243,7 @@ Partial Class Inventarios_CatAlmacenes
Else
TieneError = True
End If
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero) Then
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta) Then
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -280,6 +301,8 @@ Partial Class Inventarios_CatAlmacenes
DdlModalidad.SelectedValue = If((GvRow.DataKey("Modalidad")) = "Solo Existencia", 0, 1)
divddlcc.Visible = If((DdlModalidad.SelectedValue) = 1, True, False)
DdlCuentasContables.SelectedValueExist(GvRow.DataKey("IdCtaContable"))
DdlCuentasSig.SelectedValueExist(-1)
DdlCuentasSig.SelectedValueExist(GvRow.DataKey("CveCuenta"))
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoAlmacen.SelectedValueExist(GvRow.DataKey("CveTipoAlmacen"))
TxtAlmacen.Text = GvRow.DataKey("Almacen")