Crear apartir de
This commit is contained in:
@@ -90,11 +90,17 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportaSobrantes" runat="server"><i class="fa fa-ad-excel"></i> Exporta Sobrantes</asp:LinkButton>
|
||||
</li>--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<asp:UpdatePanel runat="server" id="UPAcciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="btnFin" runat="server" Text="Finalizar" data-toggle="confirmation" data-popout="true" data-original-title="Finalizar el inventario" data-btn-ok-label="si" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkCrear" runat="server"><i class=""></i> Crear a partir de</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkGuardar" runat="server" Visible="false" > <i class="fa fa-floppy-o" style="font-weight:bold;"></i> Guardar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="btnFin" />
|
||||
@@ -177,13 +183,17 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label style="font-size: 16px"><b>Productos que Faltan</b></label>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div class="row">
|
||||
<div class="col-md-4" align="left" id="divRegistradosFaltan" runat="server">
|
||||
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosFaltan" runat="server"></asp:Literal></b></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-8" align="right" id="DivBuscadorFaltan" runat="server">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvF.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -191,8 +201,16 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvF" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;"
|
||||
GridLines="None">
|
||||
GridLines="None" DataKeyNames="CvePS">
|
||||
<Columns>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="ChkAllFaltante" runat="server"/>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkPSFaltante" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="#">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblC" runat="server" Font-Size="6pt"></asp:Label>
|
||||
@@ -213,21 +231,34 @@
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label style="font-size: 16px"><b>Productos que Sobran</b></label>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
<div class="row">
|
||||
<div class="col-md-4" align="left" id="divRegistradosSobran" runat="server">
|
||||
<asp:Label runat="server">Número de registros: <b><asp:Literal ID="LtlTotalRegistrosSobran" runat="server"></asp:Literal></b></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-8" align="right" id="DivBuscadorSobran" runat="server">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpdateGvS" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvS" data-sort="true" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None" DataKeyNames="CvePS">
|
||||
<Columns>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="ChkAllSobrante" runat="server"/>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkPSSobrante" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="#">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblC" runat="server" Font-Size="6pt"></asp:Label>
|
||||
@@ -250,13 +281,50 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
|
||||
<div id="ModalGuardar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Actualizar Fechas</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpFecha" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTitulo" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTitulos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTitulo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTitulo.ClientID.ToString()%>">Titulo:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnCrear" runat="server" ClientIDMode="Static" Text="Crear" CssClass="btn btn-primary" ValidationGroup="Actualiza" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script src="/Scripts/DataTables.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function SeleccionarTodosFaltante(chk) {
|
||||
$("#C_GvF input:checkbox").attr("checked", chk.checked);
|
||||
}
|
||||
function SeleccionarTodosSobrante(chk) {
|
||||
$("#C_GvS input:checkbox").attr("checked", chk.checked);
|
||||
}
|
||||
function pageLoad(sender, e) {
|
||||
$(document).ready(function () {
|
||||
$('a[class="ajax__tab_tab"]').click(function () {
|
||||
|
||||
@@ -167,15 +167,19 @@ Partial Class Inventarios_RepAnomalias
|
||||
GvF.UseAccessibleHeader = True
|
||||
GvF.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
Script = "OrdenarGVF();"
|
||||
divRegistradosFaltan.Visible = True
|
||||
LtlTotalRegistrosFaltan.Text = GvF.Rows.Count.ToString
|
||||
End If
|
||||
|
||||
If (GvS.Rows.Count > 0) Then
|
||||
GvS.UseAccessibleHeader = True
|
||||
GvS.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
Script += "OrdenarGVS();"
|
||||
divRegistradosSobran.Visible = True
|
||||
LtlTotalRegistrosSobran.Text = GvS.Rows.Count.ToString
|
||||
End If
|
||||
|
||||
|
||||
PSIguales()
|
||||
RegistraScript(Script)
|
||||
|
||||
UPAnomalias.Update()
|
||||
@@ -207,17 +211,13 @@ Partial Class Inventarios_RepAnomalias
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound, GvS.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("Costo") = "-1" Then
|
||||
e.Row.Cells(8).Text = "0"
|
||||
End If
|
||||
|
||||
If e.Row.Cells(7).Text = MinFecha.ToString Then
|
||||
e.Row.Cells(7).Text = ""
|
||||
End If
|
||||
|
||||
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -301,4 +301,135 @@ Partial Class Inventarios_RepAnomalias
|
||||
Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
End Sub
|
||||
|
||||
Private Sub LnkCrear_Click(sender As Object, e As EventArgs) Handles LnkCrear.Click
|
||||
If GvF.Rows.Count > 0 Then
|
||||
GvF.Columns(0).Visible = True
|
||||
LnkGuardar.Visible = True
|
||||
LnkCrear.Visible = False
|
||||
GvF.HeaderRow.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);")
|
||||
End If
|
||||
|
||||
If GvS.Rows.Count > 0 Then
|
||||
GvS.Columns(0).Visible = True
|
||||
LnkGuardar.Visible = True
|
||||
LnkCrear.Visible = False
|
||||
GvS.HeaderRow.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);")
|
||||
End If
|
||||
UPAnomalias.Update()
|
||||
UpdateGvS.Update()
|
||||
UPAcciones.Update()
|
||||
End Sub
|
||||
Private Sub LnkGuardar_Click(sender As Object, e As EventArgs) Handles LnkGuardar.Click
|
||||
RegistraScript("$('#ModalGuardar').modal('show')")
|
||||
End Sub
|
||||
|
||||
Private Sub BtnCrear_Click(sender As Object, e As EventArgs) Handles BtnCrear.Click
|
||||
Dim ErrorClasif As Boolean = False
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim CveInventarioFisicoNew As Integer
|
||||
Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor As DataTable
|
||||
DtAlmacen = Nothing
|
||||
DtClasificacion = Nothing
|
||||
DtClasificacionExcluida = Nothing
|
||||
DtProveedor = Nothing
|
||||
ObjInventario.IniciaTransacSQL()
|
||||
If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto) Then
|
||||
CveInventarioFisicoNew = ObjInventario.CveInventarioFisico
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
DtAlmacen = ObjInventario.DtResultados
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
DtClasificacion = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
|
||||
DtClasificacionExcluida = ObjInventario.DtResultados.FiltraParametros("Incluye = 0")
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
DtProveedor = ObjInventario.DtResultados.FiltraParametros("Incluye = 1")
|
||||
End If
|
||||
|
||||
For Each Gvr As DataRow In DtAlmacen.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisicoNew, Gvr("CveAlmacen").ToString.ToEntero) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As DataRow In DtClasificacion.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisicoNew, Gvr("CveClasificacion").ToString.ToEntero, UsuarioActual.CveUsuario, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
For Each Gvr As DataRow In DtClasificacionExcluida.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoClasificaciones(CveInventarioFisicoNew, Gvr("CveClasificacion").ToString.ToEntero, UsuarioActual.CveUsuario, False) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As GridViewRow In GvF.Rows
|
||||
If Gvr.FCCheckBox("ChkPSFaltante").Checked Then
|
||||
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisicoNew, Gvr.DataKey("CvePS").ToString.ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
For Each Gvr As GridViewRow In GvS.Rows
|
||||
If Gvr.FCCheckBox("ChkPSSobrante").Checked Then
|
||||
If Not ObjInventario.AddInventarioFisicoProductosServicios(CveInventarioFisicoNew, Gvr.DataKey("CvePS").ToString.ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ErrorClasif = False Then
|
||||
For Each Gvr As DataRow In DtProveedor.Rows
|
||||
If Not ObjInventario.AddInventarioFisicoProveedores(CveInventarioFisicoNew, Gvr("CveProveedor").ToString.ToEntero, True) Then
|
||||
ErrorClasif = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
If ErrorClasif = False And CveInventarioFisicoNew > 0 Then
|
||||
ObjInventario.Commit()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalGuardar"))
|
||||
GvF.Columns(0).Visible = False
|
||||
GvS.Columns(0).Visible = False
|
||||
LnkGuardar.Visible = False
|
||||
LnkCrear.Visible = True
|
||||
CargaDatos(CveInventarioFisico)
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub PSIguales()
|
||||
Dim contadorF As Integer = 0
|
||||
Dim contadorS As Integer = 0
|
||||
For Each dtF As GridViewRow In GvF.Rows
|
||||
contadorS = 0
|
||||
For Each dtS As GridViewRow In GvS.Rows
|
||||
If dtS.DataKey("CvePS") = dtF.DataKey("CvePS") Then
|
||||
GvS.Rows(contadorS).BackColor = Drawing.Color.FromArgb(202, 52, 52)
|
||||
GvF.Rows(contadorF).BackColor = Drawing.Color.FromArgb(202, 52, 52)
|
||||
End If
|
||||
contadorS += 1
|
||||
Next
|
||||
contadorF += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user