- cambios Seccion Almacen, Serie,Lote, Caducidad

This commit is contained in:
rrene
2020-05-13 12:37:19 -07:00
parent 552154d81d
commit f60e230d98
3 changed files with 480 additions and 435 deletions

View File

@@ -1201,7 +1201,7 @@ Partial Class Contratos_Default
If DdlMoneda.SelectedIndex > 0 Then
If TxtTipoCambio.Text.Trim.Length = 0 Or TxtTipoCambio.Text.Trim.ToDouble = 0.0 Then
Alert("Cuando seleccione una moneda diferencte a peso debe especificar el tipo de cambio.", TipoMensaje.MsgAdvertencia)
Alert("Cuando seleccione una moneda diferente a peso debe especificar el tipo de cambio.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If

View File

@@ -542,99 +542,12 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" class="Widthall grides" cellspacing="0">
<tbody>
<tr class="Titulos">
<th style="width: 28px">#</th>
<th style="width: 63px">Cant</th>
<th style="width: 200px">Clasificación<br />
Producto </th>
<th width="73px">U.M.</th>
<th width="63px" id="tdPU" runat="server" visible="false">P.U.</th>
<th width="63px" id="ThTotal" runat="server" visible="false">Total</th>
<th width="63px" id="tdPUExtranjero" runat="server" visible="false">PU Extran</th>
<th width="63px" id="tdCI" runat="server" visible="false">CI</th>
<th width="63px" id="ThAF" runat="server" visible="false">Activo Fijo</th>
<th style="width: 88px" runat="server" id="TrSerieLote2" visible="false">
<asp:Label runat="server" ID="LblSerieLote" Visible="false">Serie - Lote</asp:Label></th>
<th style="width: 88px" runat="server" id="TrLote2" visible="false">Lote</th>
<th style="width: 88px" runat="server" id="TrBatch2" visible="false">Batch</th>
<th style="width: 88px" runat="server" id="TrSeccionAlmacen2" visible="false">Sección Almacén</th>
<th style="width: 90px;">Observaciones</th>
<th style="width: 73px;"></th>
</tr>
<tr align="center">
<td></td>
<td>
<asp:TextBox ID="txtCantidad" CssClass="form-control input-sm" Width="55px" MaxLength="15" runat="server" ValidationGroup="GprAgregaPS"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="txtCantidad" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="txtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:CustomValidator ID="CVCantidad" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> no tiene el formato correcto (6 decimales). Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GprAgregaPS"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="CVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center;">
<div class="psagregar">
<div class="comboxes">
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" Class="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<br />
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
</div>
</td>
<td>
<asp:DropDownList ID="DdlUnidad" runat="server" Class="table-group-action-input form-control input-inline input-sm" Style="width: 75px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"></asp:DropDownList>
<asp:CompareValidator ID="CVUnidad" runat="server" ControlToValidate="ddlUnidad" Type="Integer" Operator="GreaterThan" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad Medida''</b> es necesario, por favor selecione una." Display="None" ValueToCompare="0" ValidationGroup="GprAgregaPS"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CVUnidad" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td id="tdTxtPU" runat="server" visible="false">
<asp:TextBox ID="txtPrecio" CssClass="form-control input-sm" runat="server" Width="55px" Visible="false"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="txtPrecio" FilterType="Custom, Numbers" ValidChars="+-.," />
</td>
<td id="TdTotal" runat="server" visible="false"></td>
<td id="tdPUExtranjero2" runat="server" visible="false"></td>
<td id="tdCI2" runat="server" visible="false"></td>
<td id="tdAF" runat="server" align="center" visible="false">
<asp:UpdatePanel ID="UPPNumEcon" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button Text="VinculaAF" Style="display: none;" OnClick="BtnVinculaAF_Click" ClientIDMode="Static" ID="BtnVinculaAF" runat="server" />
<asp:HiddenField ID="HdnCveActivoFijo" Value="-1" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCodigoAF" Value="-1" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="LblCodigo" runat="server" Text="" onkeyup="EnterAF(event);" onblur="AFBlur();" ClientIDMode="Static" Width="40px"></asp:TextBox>
<asp:HyperLink ID="HplMaq" runat="server" ClientIDMode="Static"><img alt="Activo Fijo" width="20px" height="20px" src="/Imagenes/Maquinaria.jpg" style="cursor:pointer;" onclick="AbrirVentana('/AF/PopUpBuscarAF.aspx?OPCION=OC',950,600,'N');"/></asp:HyperLink>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td runat="server" id="TrSerieLote" visible="false">
<asp:Panel runat="server" DefaultButton="BtnSerieAddNew">
<asp:TextBox ID="TxtnSerieLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" id="TrLote" visible="false">
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td runat="server" id="TrBatch" visible="false">
<asp:TextBox ID="TxtnBatch" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td runat="server" id="TrSeccionAlmacen" visible="false">
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" AppendDataBoundItems="true" DataValueField="CveSeccion" CssClass="select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="TxtObservacionesdetalle" CssClass="form-control input-sm" runat="server" MaxLength="200"></asp:TextBox>
</td>
<td align="center">
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="btn btn-default" ValidationGroup="GprAgregaPS" Text="Agregar" />
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-md-12" align="Right">
<asp:LinkButton ID="LkAgregar" runat="server" CssClass="btn btn-default" Text="Agregar Producto" />
</div>
</div>
<br />
<div class="row">
<div class="col-md-12" align="right">
@@ -649,7 +562,7 @@
<asp:Button ID="BtnVinculaAFEdit" ClientIDMode="Static" OnClick="BtnVinculaAFEdit_Click" Style="display: none;" runat="server" />
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="tabla_correcto grides Widthall mysmallbtn" ShowHeader="False" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,Cantidad" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="tabla_correcto grides Widthall mysmallbtn" ShowHeader="True" EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,CveSeccionAlmacen" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
<EditItemTemplate>
@@ -670,7 +583,7 @@
</ItemTemplate>
<ItemStyle Width="43px"></ItemStyle>
</asp:TemplateField>
<asp:BoundField HeaderText="Producto" ReadOnly="true" DataField="CodigoPS" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" ReadOnly="true" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Unidad">
<ItemTemplate>
<asp:Literal ID="lbUnidad" runat="server" Text='<%# Eval("UnidadMedida")%>'></asp:Literal>
@@ -735,12 +648,12 @@
</ItemTemplate>
<ItemStyle Width="60px" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="SerieLote" Visible="false">
<asp:TemplateField HeaderText="Serie" Visible="false">
<EditItemTemplate>
<asp:TextBox ID="TxtSerieLote" CssClass="form-control input-sm" runat="server" Width="80px" Text='<%# Eval("SerieLote")%>' Style="text-align: right;"></asp:TextBox>
<asp:TextBox ID="TxtSerie" CssClass="form-control input-sm" runat="server" Width="80px" Text='<%# Eval("Serie")%>' Style="text-align: right;"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Literal ID="lbSerieLote" runat="server" Text='<%# Eval("SerieLote")%>'></asp:Literal>
<asp:Literal ID="lbSerie" runat="server" Text='<%# Eval("Serie")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right"></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
@@ -754,16 +667,11 @@
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right"></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Batch" Visible="false">
<EditItemTemplate>
<asp:TextBox ID="TxtBatch" CssClass="form-control input-sm" runat="server" Width="80px" Text='<%# Eval("Batch")%>' Style="text-align: right;"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:Literal ID="LbBatch" runat="server" Text='<%# Eval("Batch")%>'></asp:Literal>
<asp:Literal ID="LbCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right"></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sección Almacén" Visible="false">
<EditItemTemplate>
@@ -786,11 +694,7 @@
<ItemStyle Width="90px" HorizontalAlign="Right"></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<center>
@@ -1401,6 +1305,108 @@
</asp:UpdatePanel>
</div>
</div>
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpAgregar" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="Literal3" Text="Detalles" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div runat="server" id="divCantidad" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="txtCantidad" CssClass="form-control input-sm" Width="50%" MaxLength="15" runat="server" ValidationGroup="GprAgregaPS"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="txtCantidad" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="txtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:CustomValidator ID="CVCantidad" runat="server" ClientValidationFunction="ValidaDecimal6digits" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> no tiene el formato correcto (6 decimales). Por favor rectifique y vuelva a intentar." ValidateEmptyText="True" ValidationGroup="GprAgregaPS"></asp:CustomValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="CVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= txtCantidad.ClientID.ToString()%>">Cant</label>
<br />
</div>
<div runat="server" id="divClasificacionProducto" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" Class="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<br />
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<label for="<%= DdlProducto2.ClientID.ToString()%>">Clasificación Producto</label>
<br />
</div>
<div runat="server" id="divUnidadMedida" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlUnidad" runat="server" Class="form-control input-sm select2me" Style="width: 100px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"></asp:DropDownList>
<label for="<%= DdlUnidad.ClientID.ToString()%>">U.M.</label>
<br />
</div>
<div runat="server" id="divPrecio" class="form-group form-md-line-input input-iconright" visible="false">
<asp:TextBox ID="txtPrecio" CssClass="form-control input-sm" runat="server" Width="50%" Visible="false"></asp:TextBox>
<label for="<%= txtPrecio.ClientID.ToString()%>">P.U.</label>
<br />
</div>
<div runat="server" id="divSerie" class="form-group form-md-line-input input-iconright" visible="false">
<asp:TextBox ID="TxtnSerie" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
<label for="<%= TxtnSerie.ClientID.ToString()%>">Serie Lote</label>
<br />
</div>
<div runat="server" id="divLote" class="form-group form-md-line-input input-iconright" visible="false">
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
<label for="<%= TxtnLote.ClientID.ToString()%>">Lote</label>
<br />
</div>
<div runat="server" id="divSeccionAlmacen" class="form-group form-md-line-input input-iconright" visible="false">
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" AppendDataBoundItems="true" DataValueField="CveSeccion" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlSeccionAlmacen.ClientID.ToString()%>">Sección Almacén</label>
</div>
<br />
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtObservacionesdetalle" CssClass="form-control input-sm" runat="server" MaxLength="200"></asp:TextBox>
<label for="<%= TxtObservacionesdetalle.ClientID.ToString()%>">Observaciones</label>
<br />
</div>
<div runat="server" id="tdPUExtranjero" class="form-group form-md-line-input input-iconright" visible="false">
<label for="<%= tdPUExtranjero2.ClientID.ToString()%>">PU Extranjero</label>
<label id="tdPUExtranjero2" runat="server" visible="false"></label>
</div>
<div runat="server" id="tdCI" class="form-group form-md-line-input input-iconright" visible="false">
<label id="tdCI2" runat="server" visible="false"></label>
<label for="<%= tdCI2.ClientID.ToString()%>">CI</label>
</div>
<div runat="server" id="ThAF" class="form-group form-md-line-input input-iconright" visible="false">
<label for="tdAF">AF</label>
<asp:Literal ID="tdAF" runat="server" Visible="false"></asp:Literal>
<asp:UpdatePanel ID="UPPNumEcon" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button Text="VinculaAF" Style="display: none;" OnClick="BtnVinculaAF_Click" ClientIDMode="Static" ID="BtnVinculaAF" runat="server" />
<asp:HiddenField ID="HdnCveActivoFijo" Value="-1" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCodigoAF" Value="-1" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="LblCodigo" runat="server" Text="" onkeyup="EnterAF(event);" onblur="AFBlur();" ClientIDMode="Static" Width="40px"></asp:TextBox>
<asp:HyperLink ID="HplMaq" runat="server" ClientIDMode="Static"><img alt="Activo Fijo" width="20px" height="20px" src="/Imagenes/Maquinaria.jpg" style="cursor:pointer;" onclick="AbrirVentana('/AF/PopUpBuscarAF.aspx?OPCION=OC',950,600,'N');"/></asp:HyperLink>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div runat="server" id="ThTotal" class="form-group form-md-line-input input-iconright" visible="false">
<label for="<%= TdTotal.ClientID.ToString()%>">Total</label>
<asp:Literal ID="TdTotal" runat="server" Visible="false"></asp:Literal>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LkAgregarDetalle" runat="server" CssClass="btn btn-primary" Text="Agregar"></asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="divDescripcion" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDescripcion" UpdateMode="Conditional">
@@ -1429,63 +1435,7 @@
</asp:UpdatePanel>
</div>
<%--SECCION DE ALMACEN--%>
<div id="DModalSeccionAlmacen" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalSeccionAlmacen" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="LtlSeccionAlmacen" Text="Sección Almacen" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSeccionAlmacenModal" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvSeccionAlmacen" runat="server" ControlToValidate="DdlSeccionAlmacen" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlSeccionAlmacen.ClientID.ToString()%>">Sección Almacen:</label>
</div>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAddSeccionAlmacen" data-toggle="tooltip" CssClass="btn btn-default btn-circle btn-xs " OnClick="LnkAddSeccionAlmacen_Click" data-placement="top" ToolTip="Agregar Sección Almacen" runat="server" ValidationGroup="VgmSeccion"><i class="fa fa-plus" style="color:black" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvSeccionAlmacen" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
DataKeyNames="Consec">
<Columns>
<asp:BoundField DataField="CantidadSeccionAlmacen" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.##}" />
<asp:BoundField DataField="SeccionAlmacen" HeaderText="Sección Almacen" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarSeccion" runat="server" OnClick="LnkEliminarSeccion_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la sección?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -204,14 +204,6 @@ Partial Class Inventarios_EntradasSalidas
End Set
End Property
Private Property DtSeccionAlmacen As DataTable
Get
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtSeccionAlmacen") = value
End Set
End Property
Private Property IndexSeccionAlmacen As Integer
Get
Return CType(ViewState("IndexSeccionAlmacen"), Integer)
@@ -261,6 +253,23 @@ Partial Class Inventarios_EntradasSalidas
End Set
End Property
Public Property CveMovimientoDetalleEdit() As Integer
Get
Return ViewState("CveMovimientoDetalleEdit").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMovimientoDetalleEdit") = value
End Set
End Property
Public Property CveAFEdit() As Integer
Get
Return ViewState("CveAFEdit").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveAFEdit") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -279,13 +288,11 @@ Partial Class Inventarios_EntradasSalidas
CargaCombos()
TxtFecha.Text = Now.ToShortDateString
RVFecha.MaximumValue = Now.ToShortDateString
InicializaClientes()
CantidadTotal = 0
IndexSeccionAlmacen = 0
Tipo = 0
CreaDtSeccionAlmacen()
CargaDdlAlmacen()
'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos
Select Case UsuarioActual.Empresa.Funcionalidad(103)
@@ -315,6 +322,7 @@ Partial Class Inventarios_EntradasSalidas
End If
End If
InicializaClientes()
InicializaBitacoraTemporal()
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
@@ -325,9 +333,6 @@ Partial Class Inventarios_EntradasSalidas
ActivaConsumoInterno()
End If
'SECCION ALMACEN EXISTENCIAS
GvM.Columns(14).Visible = UsuarioActual.Empresa.Funcionalidad(563).ToString = "1" AndAlso Not CveMovimiento > 0
'BLOQUEA PERMISOS
BtnGuardar.Enabled = PermiteGuardar()
BtnEliminar.Enabled = PermiteEliminar()
@@ -361,14 +366,14 @@ Partial Class Inventarios_EntradasSalidas
Return If(UsuarioActual.TienePermisoProceso(184) Or EsConsumoInterno, True, False)
End Function
Private Sub ActivaPermisoSeccionAlmacen()
GvM.Columns(12).Visible = UsuarioActual.Empresa.Funcionalidad(147) = "1"
TrSeccionAlmacen.Visible = UsuarioActual.Empresa.Funcionalidad(147) = "1"
TrSeccionAlmacen2.Visible = UsuarioActual.Empresa.Funcionalidad(147) = "1"
If CveMovimiento <= 0 Then
GvM.Columns(11).Visible = UsuarioActual.Empresa.Funcionalidad(147) = "1"
End If
End Sub
Private Sub PermisoVerImportes()
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
tdPU.Visible = TienePermisoImportes
tdTxtPU.Visible = TienePermisoImportes
' tdPU.Visible = TienePermisoImportes
' tdTxtPU.Visible = TienePermisoImportes
GvM.Columns(4).Visible = TienePermisoImportes
ThTotal.Visible = TienePermisoImportes
@@ -432,7 +437,7 @@ Partial Class Inventarios_EntradasSalidas
dt.Columns.Add("CveAF")
dt.Columns.Add("SerieLote", Type.GetType("System.String"))
dt.Columns.Add("Lote", Type.GetType("System.String"))
dt.Columns.Add("Batch", Type.GetType("System.String"))
dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
dt.Columns.Add("Observaciones")
dt.Columns.Add("CountMovimientoEntradaDetalle")
@@ -458,11 +463,11 @@ Partial Class Inventarios_EntradasSalidas
End If
DdlClasificacion.DataBind()
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccion.DataBind()
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
DdlSeccionAlmacen.DataBind()
'Llenar el dropdownlist de monedas
@@ -773,7 +778,7 @@ Partial Class Inventarios_EntradasSalidas
'Carga Cliente y ClienteSucursal
If Mov.CveCliente > 0 Then
If DdlClientes.Items.FindByValue(Mov.CveCliente.ToString()) Is Nothing Then
Dim dr As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCliente = {0}", Mov.CveCliente))
Dim dr As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=Mov.CveCliente).FiltroPrimero("")
If dr IsNot Nothing Then
DdlClientes.Items.Insert(0, New ListItem(dr("NombreComercial").ToString, dr("CveCliente").ToString))
End If
@@ -810,6 +815,13 @@ Partial Class Inventarios_EntradasSalidas
TxtPedidoContrato.Enabled = False
TxtPedidoContrato.Text = Mov.PedidoContrato
If Mov.CveProveedor > 0 Then
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, Mov.CveProveedor)
DdlProveedor.DataBind()
DdlProveedor.SelectedValueExist(Mov.CveProveedor)
DdlProveedor.Enabled = False
TrProveedor.Visible = True
End If
'cargar también los movimentos detalle
If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
@@ -830,13 +842,7 @@ Partial Class Inventarios_EntradasSalidas
PermisoVerImportes()
If DtMov.Rows(0)("CveProveedor").ToString.ToEntero > 0 Then
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedor.DataBind()
DdlProveedor.SelectedValueExist(DtMov.Rows(0)("CveProveedor").ToString)
DdlProveedor.Enabled = False
TrProveedor.Visible = True
End If
Else
Alert("Movimiento No encontrado", TipoMensaje.MsgError)
@@ -1014,7 +1020,6 @@ Partial Class Inventarios_EntradasSalidas
DdlClasificacion.SelectedValue = "-1"
txtCantidad.Text = ""
TxtnLote.Text = ""
TxtnBatch.Text = ""
TxtObservacionesdetalle.Text = ""
End Sub
@@ -1131,16 +1136,16 @@ Partial Class Inventarios_EntradasSalidas
#Region " AGREGAR - GUARDAR "
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional SerieLote As String = "-1", Optional Lote As String = "-1", Optional Batch As String = "-1") As Double
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Double
Dim Inv As New ClsInventarios
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, -1, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), SerieLote:=SerieLote, Lote:=Lote, Batch:=Batch)
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
Inv.Dispose()
Return Existencia
End Function
Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
AgregarPS()
End Sub
'Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
' AgregarPS()
'End Sub
Protected Sub BtnSerieAddNew_Click(sender As Object, e As EventArgs)
AgregarPS()
End Sub
@@ -1151,14 +1156,13 @@ Partial Class Inventarios_EntradasSalidas
Exit Sub
End If
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble, txtPrecio.Text.ToDouble, TxtnSerieLote.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text, TxtnLote.Text.Trim, TxtnBatch.Text.Trim, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble, txtPrecio.Text.ToDouble, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text, TxtnLote.Text.Trim, MinFecha, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
LimpiarAgregar()
txtCantidad.Text = ""
TxtnLote.Text = ""
TxtnBatch.Text = ""
LblCodigo.Text = ""
TxtnSerieLote.Text = ""
TxtnSerie.Text = ""
HdnCodigoAF.Value = "-1"
HdnCveActivoFijo.Value = "-1"
RegistraScript("CodigoAF = "";")
@@ -1174,7 +1178,7 @@ Partial Class Inventarios_EntradasSalidas
End Sub
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, Batch As String, CveSeccionAlmacen As Integer, SeccionAlmacen As String)
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String)
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
Dim Valido As Boolean = True
@@ -1191,9 +1195,9 @@ Partial Class Inventarios_EntradasSalidas
'salida
If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), If(Batch = "", "-1", Batch))
LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND SerieLote = '{SerieLote}'", "")}") < 0 Then
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidad)
' LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND Serie = '{SerieLote}'", "")}") < 0 Then
If Existencia <= 0 Then
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -1242,7 +1246,7 @@ Partial Class Inventarios_EntradasSalidas
registro.Item("CveAF") = CveAF
registro.Item("SerieLote") = If(SerieLote <> "", SerieLote, "")
registro.Item("Lote") = If(Lote <> "", Lote, "")
registro.Item("Batch") = If(Batch <> "", Batch, "")
registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("Observaciones") = Observaciones
DtMovimientos.Rows.Add(registro)
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
@@ -1330,14 +1334,14 @@ Partial Class Inventarios_EntradasSalidas
Else
If GlobalDTInvConceptos.FiltraParametros(String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue.ToEntero)).Rows.Count > 0 AndAlso GlobalDTInvConceptos.FiltraParametros(String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue.ToEntero)).Rows(0)("Origen").ToString.ToEntero < 0 Then
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), SerieLote:=If(Dr("SerieLote").ToString = "", "-1", Dr("SerieLote").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), Batch:=If(Dr("Batch").ToString = "", "-1", Dr("Batch").ToString)) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("SerieLote").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString)) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
Else
If UsuarioActual.TienePermisoProceso(114) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("SerieLote").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1347,7 +1351,7 @@ Partial Class Inventarios_EntradasSalidas
End If
End If
Else
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1438,13 +1442,6 @@ Partial Class Inventarios_EntradasSalidas
End If
Dim TotalCantidad As Double = DtMovimientos.SUMD("Cantidad")
If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then
If TotalCantidad <> DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") Then
ObjInventario.RollBack()
Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, obs, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
@@ -1461,40 +1458,40 @@ Partial Class Inventarios_EntradasSalidas
Dim Cont As Integer = 0
If DdlConcepto.SelectedValue.Contiene({"3", "11", "13", "21", "30", "31"}) Then
For Each Dr As DataRow In DtMovimientos.Rows
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), SerieLote:=If(Dr("SerieLote").ToString = "", "-1", Dr("SerieLote").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), Batch:=If(Dr("Batch").ToString = "", "-1", Dr("Batch").ToString)) >= Dr("Cantidad").ToString.ToDouble Then
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("SerieLote").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal * Tipo) Then
ErrorMovInv = True
Mensaje = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
'Else
'If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
' For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
' If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal * Tipo) Then
' ErrorMovInv = True
' Mensaje = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
' Exit For
' End If
' Next
'End If
End If
Else
If UsuarioActual.TienePermisoProceso(114) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal * Tipo) Then
ErrorMovInv = True
Mensaje = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
'Else
'If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
' For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
' If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal * Tipo) Then
' ErrorMovInv = True
' Mensaje = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
' Exit For
' End If
' Next
'End If
End If
Else
Mensaje = String.Format("No hay existencias suficientes del producto: {0}", Dr("PS"))
@@ -1515,20 +1512,20 @@ Partial Class Inventarios_EntradasSalidas
ImporteConcepto = Dr("PU").ToString.ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
Else
If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal * Tipo) Then
ErrorMovInv = True
Mensaje = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
Exit For
End If
Next
End If
'Else
' If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
' For Each Dr2 As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {Cont}").Rows
' If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr2("CveSeccionAlmacen").ToString.ToEntero, Dr2("CantidadSeccionAlmacen").ToString.ToDecimal * Tipo) Then
' ErrorMovInv = True
' Mensaje = "Ocurrió un error al procesar las secciones de almacen. Por favor vuelva a intentar."
' Exit For
' End If
' Next
' End If
End If
Cont += 1
Next
@@ -1767,7 +1764,7 @@ Partial Class Inventarios_EntradasSalidas
Else
LimpiarMovimiento()
End If
DtSeccionAlmacen.Rows.Clear()
RegistraScript("playsonidito('beep-07.wav')")
Else
ObjInventario.RollBack()
@@ -1891,7 +1888,7 @@ Partial Class Inventarios_EntradasSalidas
CveMovimiento = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, 1, TxtFecha.Text.ToDate, TxtFolio.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
End If
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, SerieLote:=SerieLote)
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote)
ObjInv.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa)
DtMovimientos = ObjInv.DtResultados.FiltraParametros("", "CveMovimientoDetalle DESC").AsEnumerable.Take(25).CopyToDataTable
ObjInv.Dispose()
@@ -2083,8 +2080,8 @@ Partial Class Inventarios_EntradasSalidas
End Sub
Private Sub VisualizaPU(Opcion As Boolean)
tdPU.Visible = Opcion
tdTxtPU.Visible = Opcion
'tdPU.Visible = Opcion
'tdTxtPU.Visible = Opcion
txtPrecio.Visible = Opcion
GvM.Columns(4).Visible = Opcion
@@ -2142,30 +2139,34 @@ Partial Class Inventarios_EntradasSalidas
ElProductoChange()
End Sub
Private Sub ElProductoChange()
TxtnSerieLote.Visible = False
TxtnSerie.Visible = False
divSerie.Visible = False
TxtnLote.Visible = False
TxtnBatch.Visible = False
divLote.Visible = False
EscondeColumnasGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
If DdlProducto2.SelectedValue.ToEntero > 0 Then
Dim MetodoInventario As Integer = GlobalDTPS(UsuarioActual.CveEmpresa, DdlProducto2.SelectedValue.ToEntero).FiltroPrimeroValor("Inv_CveMetodoInventario", "").ToEntero ' ("Inv_CveMetodoInventario = 6", "PS")
If MetodoInventario = 5 Then
LblSerieLote.Visible = True
TxtnSerieLote.Visible = True
TrSerieLote.Visible = True
TrSerieLote2.Visible = True
'LblSerieLote.Visible = True
TxtnSerie.Visible = True
divSerie.Visible = True
'TrSerieLote.Visible = True
'TrSerieLote2.Visible = True
GvM.Columns(9).Visible = True
End If
If MetodoInventario = 6 Then
TxtnLote.Visible = True
TrLote.Visible = True
TrLote2.Visible = True
divLote.Visible = True
'TrLote.Visible = True
'TrLote2.Visible = True
GvM.Columns(10).Visible = True
TxtnBatch.Visible = True
TrBatch.Visible = True
TrBatch2.Visible = True
'TrBatch2.Visible = True
GvM.Columns(11).Visible = True
End If
End If
@@ -2186,10 +2187,10 @@ Partial Class Inventarios_EntradasSalidas
EscondeColumnasGVM(DtTemp)
End Sub
Private Sub EscondeColumnasGVM(DtTemp As DataTable)
LblSerieLote.Visible = False
TxtnSerieLote.Visible = False
TrSerieLote.Visible = False
TrSerieLote2.Visible = False
'LblSerie.Visible = False
TxtnSerie.Visible = False
'TrSerieLote.Visible = False
'TrSerieLote2.Visible = False
GvM.Columns(9).Visible = False
'PERMISO SOLO PARA EDITAR SERIELOTE
@@ -2198,14 +2199,14 @@ Partial Class Inventarios_EntradasSalidas
End If
TxtnLote.Visible = False
TrLote.Visible = False
TrLote2.Visible = False
'TrLote.Visible = False
'TrLote2.Visible = False
GvM.Columns(10).Visible = False
TxtnBatch.Visible = False
TrBatch.Visible = False
TrBatch2.Visible = False
GvM.Columns(11).Visible = False
'TxtnBatch.Visible = False
'TrBatch.Visible = False
'TrBatch2.Visible = False
'GvM.Columns(11).Visible = False
Dim TienePermisoImportes = UsuarioActual.TienePermisoProceso(201)
tdPUExtranjero.Visible = False
@@ -2216,38 +2217,57 @@ Partial Class Inventarios_EntradasSalidas
tdCI2.Visible = False
GvM.Columns(7).Visible = False
If DtTemp.SUM("PUExtranjero") > 0 Then
tdPUExtranjero.Visible = TienePermisoImportes
tdPUExtranjero2.Visible = TienePermisoImportes
GvM.Columns(6).Visible = TienePermisoImportes
End If
If DtTemp.SUM("CostoIndirecto") > 0 Then
tdCI.Visible = TienePermisoImportes
tdCI2.Visible = TienePermisoImportes
GvM.Columns(7).Visible = TienePermisoImportes
End If
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
If DtTemp.MAX("SerieLote").ToString <> "" Then
LblSerieLote.Visible = True
TxtnSerieLote.Visible = True
TrSerieLote.Visible = True
TrSerieLote2.Visible = True
If DtTemp.MAX("Serie").ToString <> "" Then
'LblSerie.Visible = True
TxtnSerie.Visible = True
'TrSerieLote.Visible = True
'TrSerieLote2.Visible = True
GvM.Columns(9).Visible = True
End If
If DtTemp.MAX("Lote").ToString <> "" Then
TxtnLote.Visible = True
TrLote.Visible = True
TrLote2.Visible = True
'TrLote.Visible = True
'TrLote2.Visible = True
GvM.Columns(10).Visible = True
TxtnBatch.Visible = True
TrBatch.Visible = True
TrBatch2.Visible = True
'TxtnBatch.Visible = True
'TrBatch.Visible = True
'TrBatch2.Visible = True
'GvM.Columns(11).Visible = True
End If
If DtTemp.MAX("FechaCaducidad").ToString <> "" Then
GvM.Columns(11).Visible = True
'TxtnBatch.Visible = True
'TrBatch.Visible = True
'TrBatch2.Visible = True
'GvM.Columns(11).Visible = True
End If
If DtTemp.SUM("PUExtranjero") > 0 Then
tdPUExtranjero.Visible = TienePermisoImportes
tdPUExtranjero2.Visible = TienePermisoImportes
GvM.Columns(6).Visible = TienePermisoImportes
If DtTemp.MAX("CveSeccionAlmacen").ToString <> "" Then
'TxtnBatch.Visible = True
'TrBatch.Visible = True
'TrBatch2.Visible = True
GvM.Columns(12).Visible = True
End If
If DtTemp.SUM("CostoIndirecto") > 0 Then
tdCI.Visible = TienePermisoImportes
tdCI2.Visible = TienePermisoImportes
GvM.Columns(7).Visible = TienePermisoImportes
End If
End If
End Sub
@@ -2280,18 +2300,18 @@ Partial Class Inventarios_EntradasSalidas
e.Row.FCTextBox("LblEditCodigo").Attributes.Add("onblur", String.Format("AFBlurEdit(this,{0},{1});", e.Row.FCHiddenField("HdnCveActivoFijo").ClientID, e.Row.FCHiddenField("HdnCodigoAF").ClientID))
e.Row.FCImage("ImgAF").Attributes.Add("onclick", String.Format("AbrirVentana('/AF/PopUpBuscarAF.aspx?OPCION=OCE&RI={0}',950,600,'N');", e.Row.RowIndex))
If UsuarioActual.Empresa.Funcionalidad(147) = "1" Then
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
e.Row.FCDropDownList("DdlSeccionAlmacen").SelectedValueExist(e.Row.DBCampo("CveSeccionAlmacen"))
End If
'If UsuarioActual.Empresa.Funcionalidad(147) = "1" Then
' e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
' e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
' e.Row.FCDropDownList("DdlSeccionAlmacen").SelectedValueExist(e.Row.DBCampo("CveSeccionAlmacen"))
'End If
'PERMISO SOLO PARA EDITAR OBSERVACIONES
If PermiteGuardarObservacionDetalle() Then
e.Row.FCTextBox("txtPrecio").Enabled = False
e.Row.FCTextBox("LblEditCodigo").Enabled = False
e.Row.FCTextBox("TxtSerieLote").Enabled = False
e.Row.FCTextBox("TxtSerie").Enabled = False
e.Row.FCTextBox("TxtLote").Enabled = False
e.Row.FCTextBox("TxtBatch").Enabled = False
e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False
@@ -2302,13 +2322,12 @@ Partial Class Inventarios_EntradasSalidas
If (CveMovimiento > 0) Or (TieneRelacionado > 0 Or CveMovimientoRelacionado > 0) Then 'CveMovimiento > 0 And e.Row.DBCampo("TienePrePoliza").ToEntero > 0
e.Row.FCTextBox("txtPrecio").Enabled = False
e.Row.FCTextBox("LblEditCodigo").Enabled = False
e.Row.FCTextBox("TxtSerieLote").Enabled = False
e.Row.FCTextBox("TxtSerie").Enabled = False
e.Row.FCTextBox("TxtLote").Enabled = False
e.Row.FCTextBox("TxtBatch").Enabled = False
e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False
e.Row.FCTextBox("txtPrecio").Enabled = False
End If
e.Row.FCTextBox("TxtSerieLote").Enabled = True
e.Row.FCTextBox("TxtSerie").Enabled = True
End If
If EsNuevoMov Then
@@ -2362,22 +2381,58 @@ Partial Class Inventarios_EntradasSalidas
End If
End If
If DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {e.Row.RowIndex}").SUMD("CantidadSeccionAlmacen") > 0 Then
e.Row.FCLinkButton("imgE").Visible = False
e.Row.FCLinkButton("imgE").ToolTip = "Cuenta con sección almacen"
e.Row.FCLinkButton("lnkRemove").Visible = False
e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
e.Row.FCLinkButton("lnkDividir").Visible = False
e.Row.FCLinkButton("lnkDividir").ToolTip = "Cuenta con sección almacen"
End If
End If
End Sub
Protected Sub GvM_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvM.RowEditing
GvM.EditIndex = e.NewEditIndex
Dim Gv As GridView = DirectCast(sender, GridView)
Dim GvRow As GridViewRow = Gv.Rows(0)
If CveMovimiento > 0 Then
CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero
divCantidad.Visible = False
divClasificacionProducto.Visible = False
divUnidadMedida.Visible = False
End If
txtCantidad.Text = GvRow.DataKey("Cantidad").ToEntero().ToString
DdlProducto2.SelectedValue = GvRow.DataKey("CvePS")
DdlProducto2.SelectedText = GvRow.DataKey("CodigoPS")
ElProductoChange()
DdlUnidad.SelectedValue = GvRow.DataKey("CveUM")
CveAFEdit = GvRow.DataKey("CveAF").ToEntero
txtPrecio.Text = GvRow.DataKey("PU").ToDouble.FormatoNumero
TxtnSerie.Text = GvRow.DataKey("Serie")
TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones")
DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen"))
LkAgregarDetalle.Text = "Actualizar"
UpAgregar.Update()
RegistraScript("$('#ModalAgregar').modal()")
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
End Sub
Protected Sub EditPS(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
If CveMovimiento > 0 Then
CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero
divCantidad.Visible = False
divClasificacionProducto.Visible = False
divUnidadMedida.Visible = False
End If
txtCantidad.Text = GvRow.DataKey("Cantidad").ToEntero().ToString
DdlProducto2.SelectedValue = GvRow.DataKey("CvePS")
DdlProducto2.SelectedText = GvRow.DataKey("CodigoPS")
ElProductoChange()
DdlUnidad.SelectedValue = GvRow.DataKey("CveUM")
CveAFEdit = GvRow.DataKey("CveAF").ToEntero
txtPrecio.Text = GvRow.DataKey("PU").ToDouble.FormatoNumero
TxtnSerie.Text = GvRow.DataKey("SerieLote")
TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones")
DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen"))
LkAgregarDetalle.Text = "Actualizar"
UpAgregar.Update()
RegistraScript("$('#ModalAgregar').modal()")
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
End Sub
Protected Sub GvM_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvM.RowCancelingEdit
GvM.EditIndex = -1
@@ -2387,7 +2442,7 @@ Partial Class Inventarios_EntradasSalidas
Dim Precio As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDouble
Dim No As Integer = GvM.Rows(e.RowIndex).DataKey("No").ToEntero
Dim serielote As String = GvM.Rows(e.RowIndex).FCTextBox("TxtSerieLote").Text.Replace(" ", String.Empty)
Dim serie As String = GvM.Rows(e.RowIndex).FCTextBox("TxtSerie").Text.Replace(" ", String.Empty)
Dim Observaciones As String = GvM.Rows(e.RowIndex).FCTextBox("TxtObservaciones").Text
Dim CveSeccionAlmacen As Integer = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
Dim SeccionAlmacen As String = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedItem.Text
@@ -2399,7 +2454,7 @@ Partial Class Inventarios_EntradasSalidas
Drs(0)("PU") = Precio
Drs(0)("Total") = Drs(0)("Cantidad").ToString.ToDouble * Precio
Drs(0)("Estatus") = "U"
Drs(0)("SerieLote") = serielote
Drs(0)("Serie") = serie
Drs(0)("Observaciones") = Observaciones
Drs(0)("CveSeccionAlmacen") = CveSeccionAlmacen
Drs(0)("SeccionAlmacen") = SeccionAlmacen
@@ -2591,7 +2646,7 @@ Partial Class Inventarios_EntradasSalidas
LblCodigo.Text = HdnCodigoAF.Value
End If
LbAgregar.Focus()
'LbAgregar.Focus()
UPDatos.Update()
End Sub
@@ -2900,7 +2955,7 @@ Partial Class Inventarios_EntradasSalidas
Exit Sub
End If
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", "", -1, "")
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, -1, "")
TxtCodigoPS.Text = ""
TxtCodigoPS.Focus()
@@ -2912,7 +2967,7 @@ Partial Class Inventarios_EntradasSalidas
Exit Sub
End If
AddNew(CvePSSerieLote, PSSerieLote, CveUMSerieLote, UMSerieLote, 1, 0, TxtSeriePS.Text.Trim, "", "", "", "", "", "", -1, "")
AddNew(CvePSSerieLote, PSSerieLote, CveUMSerieLote, UMSerieLote, 1, 0, TxtSeriePS.Text.Trim, "", "", "", "", "", MinFecha, -1, "")
TdSeriePSAdd.Visible = False
TxtSeriePS.Text = ""
@@ -3226,7 +3281,7 @@ Partial Class Inventarios_EntradasSalidas
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
Private Sub InicializaClientes()
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
If UsuarioActual.CveEmpresa.Contiene(72, 80) AndAlso CveMovimiento <= 0 Then
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
DdlClientes.DataBind()
@@ -4021,124 +4076,164 @@ Partial Class Inventarios_EntradasSalidas
LnkAgregarNuevoMov.Visible = False
End Sub
#Region "SECCION ALMACEN"
Private Sub CreaDtSeccionAlmacen()
DtSeccionAlmacen = New DataTable
DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
'#Region "SECCION ALMACEN"
' Private Sub CreaDtSeccionAlmacen()
' DtSeccionAlmacen = New DataTable
' DtSeccionAlmacen.Columns.Add("CantidadSeccionAlmacen", GetType(Decimal))
' DtSeccionAlmacen.Columns.Add("IndexSeccionAlmacen", GetType(Integer))
' DtSeccionAlmacen.Columns.Add("CveSeccionAlmacen", GetType(Integer))
' DtSeccionAlmacen.Columns.Add("SeccionAlmacen", GetType(String))
' DtSeccionAlmacen.Columns.Add("Consec", GetType(Integer))
' End Sub
' Private Sub CargaDdlAlmacen()
' DdlSeccionAlmacenModal.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero)
' DdlSeccionAlmacenModal.Items.Insert(0, New ListItem("Seleccione", "-1"))
' DdlSeccionAlmacenModal.DataBind()
' End Sub
' Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
' If Not DdlConcepto.SelectedValue.ToEntero > 0 Then
' Alert("Tiene que seleccionar un concepto", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' Tipo = GlobalDTInvConceptos().FiltroPrimeroValor("Origen", $"CveConcepto = {DdlConcepto.SelectedValue}").ToEntero
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
' CantidadTotal = gvRow.DataKey("Cantidad").ToDecimal
' IndexSeccionAlmacen = gvRow.RowIndex
' CargaSeccionAlmacen()
' RegistraScript("$('#DModalSeccionAlmacen').modal()")
' End Sub
' Private Sub CargaSeccionAlmacen()
' Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
' GvSeccionAlmacen.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
' GvSeccionAlmacen.DataBind()
' TxtCantidadSeccion.Text = ""
' DdlSeccionAlmacenModal.SelectedIndex = 0
' Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
' If CantidadRestante = 0 Then
' RVTxtCantidad.MaximumValue = "1"
' TxtCantidadSeccion.Enabled = False
' Else
' RVTxtCantidad.MaximumValue = CantidadRestante.ToString
' TxtCantidadSeccion.Enabled = True
' End If
' If CantidadTotalSeccion > 0 Then
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").Visible = False
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").ToolTip = "Cuenta con sección almacen"
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = False
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").Visible = False
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").ToolTip = "Cuenta con sección almacen"
' Else
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").Visible = True
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").ToolTip = ""
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = True
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = ""
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").Visible = True
' GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").ToolTip = ""
' End If
' If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 AndAlso Tipo = -1 Then
' DdlAlmacen.Enabled = False
' DdlAlmacen.ToolTip = "Cuenta con sección almacen"
' Else
' DdlAlmacen.Enabled = True
' DdlAlmacen.ToolTip = ""
' End If
' UpModalSeccionAlmacen.Update()
' UppGrid.Update()
' End Sub
' Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
' If Tipo = -1 Then
' Dim ObjInv As New ClsInventarios
' Dim CantidadDisponible As Decimal = 0
' If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacenModal.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero,
' CvePS, UsuarioActual.CveEmpresa) Then
' If ObjInv.DtResultados.Rows.Count > 0 Then
' CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
' End If
' End If
' ObjInv.Dispose()
' CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacen = {DdlSeccionAlmacenModal.SelectedValue}").SUMD("CantidadSeccionAlmacen")
' If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
' Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' End If
' Dim Row As DataRow = Nothing
' DtSeccionAlmacen.AcceptChanges()
' Row = DtSeccionAlmacen.NewRow
' Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
' Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
' Row("CveSeccionAlmacen") = DdlSeccionAlmacenModal.SelectedValue.ToEntero
' Row("SeccionAlmacen") = DdlSeccionAlmacenModal.SelectedItem.Text
' Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
' DtSeccionAlmacen.Rows.Add(Row)
' DtSeccionAlmacen.AcceptChanges()
' CargaSeccionAlmacen()
' End Sub
' Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
' Dim Index As Integer = 0
' For Each Dr As DataRow In DtSeccionAlmacen.Rows
' If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
' Exit For
' End If
' Index += 1
' Next
' DtSeccionAlmacen.Rows.RemoveAt(Index)
' DtSeccionAlmacen.AcceptChanges()
' CargaSeccionAlmacen()
' End Sub
'#End Region
Protected Sub LkAgregar_Click() Handles LkAgregar.Click
limpiarModalDetalle()
UpAgregar.Update()
RegistraScript("$('#ModalAgregar').modal()")
End Sub
Private Sub CargaDdlAlmacen()
DdlSeccionAlmacenModal.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
DdlSeccionAlmacenModal.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlSeccionAlmacenModal.DataBind()
End Sub
Protected Sub LnkSeccionAlmacen_Click(sender As Object, e As EventArgs)
If Not DdlConcepto.SelectedValue.ToEntero > 0 Then
Alert("Tiene que seleccionar un concepto", TipoMensaje.MsgAdvertencia)
Exit Sub
Private Sub ActualizarPS()
Dim ObjInventario As New ClsInventarios
If Not ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDouble, DdlUnidad.ToEntero, DdlProducto2.SelectedValue.ToEntero, txtPrecio.Text.ToDouble, CveAFEdit,
CveMovimientoDetalleEdit, DdlSeccionAlmacen.SelectedValue.ToEntero, TxtnSerie.Text, TxtObservacionesdetalle.Text,
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Error al Actualizar los movimientos")
End If
Tipo = GlobalDTInvConceptos().FiltroPrimeroValor("Origen", $"CveConcepto = {DdlConcepto.SelectedValue}").ToEntero
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CantidadTotal = gvRow.DataKey("Cantidad").ToDecimal
IndexSeccionAlmacen = gvRow.RowIndex
CargaSeccionAlmacen()
RegistraScript("$('#DModalSeccionAlmacen').modal()")
ObjInventario.Dispose()
End Sub
Private Sub CargaSeccionAlmacen()
Dim CantidadTotalSeccion As Decimal = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}").SUMD("CantidadSeccionAlmacen")
GvSeccionAlmacen.DataSource = DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {IndexSeccionAlmacen}")
GvSeccionAlmacen.DataBind()
Private Sub limpiarModalDetalle()
TxtCantidadSeccion.Text = ""
DdlSeccionAlmacenModal.SelectedIndex = 0
Dim CantidadRestante As Decimal = CantidadTotal - CantidadTotalSeccion
If CantidadRestante = 0 Then
RVTxtCantidad.MaximumValue = "1"
TxtCantidadSeccion.Enabled = False
divCantidad.Visible = True
divClasificacionProducto.Visible = True
divUnidadMedida.Visible = True
txtCantidad.Text = ""
DdlProducto2.SelectedValue = "-1"
DdlProducto2.SelectedText = ""
ElProductoChange()
txtPrecio.Text = ""
TxtnSerie.Text = ""
TxtObservacionesdetalle.Text = ""
DdlSeccionAlmacen.SelectedValue = "-1"
LkAgregarDetalle.Text = "Agregar"
If DdlMonedaTC.SelectedValue.ToEntero = 2 Then
VisualizaPUExtranjero(UsuarioActual.TienePermisoProceso(201))
Else
RVTxtCantidad.MaximumValue = CantidadRestante.ToString
TxtCantidadSeccion.Enabled = True
VisualizaPUExtranjero(False)
End If
If CantidadTotalSeccion > 0 Then
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").Visible = False
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").ToolTip = "Cuenta con sección almacen"
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = False
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").Visible = False
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").ToolTip = "Cuenta con sección almacen"
Else
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").Visible = True
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("imgE").ToolTip = ""
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").Visible = True
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkRemove").ToolTip = ""
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").Visible = True
GvM.Rows(IndexSeccionAlmacen).FCLinkButton("lnkDividir").ToolTip = ""
End If
If DtSeccionAlmacen.SUMD("CantidadSeccionAlmacen") > 0 AndAlso Tipo = -1 Then
DdlAlmacen.Enabled = False
DdlAlmacen.ToolTip = "Cuenta con sección almacen"
Else
DdlAlmacen.Enabled = True
DdlAlmacen.ToolTip = ""
End If
UpModalSeccionAlmacen.Update()
UppGrid.Update()
UpAgregar.Update()
End Sub
Protected Sub LnkAddSeccionAlmacen_Click(sender As Object, e As EventArgs)
If Tipo = -1 Then
Dim ObjInv As New ClsInventarios
Dim CantidadDisponible As Decimal = 0
If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlSeccionAlmacenModal.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero,
CvePS, UsuarioActual.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CantidadDisponible = ObjInv.DtResultados.Rows(0)("CantidadRestante").ToString.ToDecimal
End If
End If
ObjInv.Dispose()
CantidadDisponible -= DtSeccionAlmacen.FiltraParametros($"CvePS = {CvePS} AND CveSeccionAlmacen = {DdlSeccionAlmacenModal.SelectedValue}").SUMD("CantidadSeccionAlmacen")
If TxtCantidadSeccion.Text.ToDecimal > CantidadDisponible Then
Alert($"No tiene cantidad de producto suficiente en esta seccion de almacen, su cantidad restante es: <b>{CantidadDisponible}</b>", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Dim Row As DataRow = Nothing
DtSeccionAlmacen.AcceptChanges()
Row = DtSeccionAlmacen.NewRow
Row("CantidadSeccionAlmacen") = TxtCantidadSeccion.Text.ToDecimal
Row("IndexSeccionAlmacen") = IndexSeccionAlmacen
Row("CveSeccionAlmacen") = DdlSeccionAlmacenModal.SelectedValue.ToEntero
Row("SeccionAlmacen") = DdlSeccionAlmacenModal.SelectedItem.Text
Row("Consec") = DtSeccionAlmacen.Rows.Count + 1
DtSeccionAlmacen.Rows.Add(Row)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
Protected Sub LnkEliminarSeccion_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim Index As Integer = 0
For Each Dr As DataRow In DtSeccionAlmacen.Rows
If Dr("Consec").ToString.ToEntero = gvRow.DataKey("Consec").ToEntero() Then
Exit For
End If
Index += 1
Next
DtSeccionAlmacen.Rows.RemoveAt(Index)
DtSeccionAlmacen.AcceptChanges()
CargaSeccionAlmacen()
End Sub
#End Region
End Class