AF Pendientes, entradaSalida

This commit is contained in:
rakcsle
2022-03-26 15:40:59 -07:00
parent f273cac4e4
commit 0589b1d7b0
7 changed files with 1167 additions and 116 deletions

View File

@@ -218,21 +218,21 @@
<div class="row">
<div class="col-md-4 ">
<label class=" control-label">Fecha de Compra:</label>
<label class=" control-label"><asp:Label runat="server" ID="LblFechaCompra">Fecha de Compra:</asp:Label></label>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 100px; padding: 5px 0px;">
<asp:TextBox ID="TxtFechaCompra" runat="server" CausesValidation="True" CssClass="form-control input-sm"></asp:TextBox>
<asp:TextBox ID="TxtFechaCompra" runat="server" CausesValidation="True" CssClass="form-control input-sm" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaCompra" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MEEFecha" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaCompra" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" BehaviorID="_content_Calendario"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaCompra" runat="server" ControlToValidate="TxtFechaCompra" Display="None" ErrorMessage="El campo <b>''Fecha de Compra''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaCompra" runat="server" ControlToValidate="TxtFechaCompra" Display="None" ErrorMessage="El campo <b>''Fecha de Compra''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="RFVFechaCompra" runat="server" ControlToValidate="TxtFechaCompra" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaCompra" runat="server" ControlToValidate="TxtFechaCompra" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaCompra1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaCompra" Width="350px" BehaviorID="_content_VCOFechaCompra1"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaCompra2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCompra" Width="350px" BehaviorID="_content_VCOFechaCompra2"></ajax:ValidatorCalloutExtender>
<i></i>
@@ -248,6 +248,35 @@
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 ">
<label class=" control-label"><asp:Label runat="server" ID="LblFechaBaja">Fecha de Baja:</asp:Label></label>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 100px; padding: 5px 0px;">
<asp:TextBox ID="TxtFechaBaja" runat="server" CausesValidation="True" CssClass="form-control input-sm" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaBaja" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="METxtFechaBaja" runat="server" TargetControlID="TxtFechaBaja" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MEEFecha" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtFechaBaja" runat="server" TargetControlID="TxtFechaBaja" PopupButtonID="LnkTxtFechaBaja" PopupPosition="BottomRight" BehaviorID="_content_Calendario"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVTxtFechaBaja" runat="server" ControlToValidate="TxtFechaBaja" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender32" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaBaja" Width="350px" BehaviorID="_content_VCOFechaCompra1"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender33" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaBaja" Width="350px" BehaviorID="_content_VCOFechaCompra2"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
</div>
</div>
<div class="row">
@@ -1156,65 +1185,79 @@
<ajax:TabPanel ID="TabServyMant" runat="server" HeaderText="Servicios y Mto">
<ContentTemplate>
<asp:Literal ID="Literal2" runat="server"></asp:Literal>
<div class="portlet box blue-hoki" style="width: 100%;">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cog"></i>Servicios
<asp:UpdatePanel runat="server" ID="UpMantenimientos" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-tasks font-green"></i>
<span class="caption-subject bold uppercase">Mantenimientos</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm blue" data-original-title="Agregar Mantenimiento" title="Agregar Mantenimiento" ID="LnkAgregarMantenimiento" OnClick="LnkAgregarMantenimiento_Click" style="font-size:13px!important"><i class="fa fa-plus-circle" aria-hidden="true"></i>Agregar</asp:LinkButton>
</div>
</div>
<div class="tools">
<%-- <a href="" class="collapse" data-original-title="" title=""></a>
<a href="" class="reload" data-original-title="" title=""></a>
<a href="" class="fullscreen" data-original-title="" title=""></a>
<a href="" class="remove" data-original-title="" title=""></a>--%>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom label12">
<div class="form-body">
<hr />
<asp:GridView ID="GvMantenimientos" runat="server" GridLines="None" BorderWidth="0px" CssClass="table table-striped table-hover table-advance Widthall" OnRowDataBound="GvMantenimientos_RowDataBound"
AutoGenerateColumns="False" DataKeyNames="CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion,Usuario,Archivo" ShowHeader="true">
<Columns>
<asp:BoundField DataField="Mantenimiento" HeaderText="Mantenimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Observaciones" HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="35px" >
<ItemTemplate>
<asp:LinkButton ID="LnkDescargaArcgivo" Visible="false" runat="server" AlternateText="DescargaArchivo" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="LnkDescargaArcgivo_Click" Text="<i class='fa fa-download'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Opciones" ItemStyle-Width="90px">
<ItemTemplate>
<asp:LinkButton ID="LnkGvMantenimientoEdit" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="LnkGvMantenimientoEdit_Click" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="LnkGvMantenimientoRemove" runat="server" AlternateText="Eliminar" OnClick="LnkGvMantenimientoRemove_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
</div>
<asp:UpdatePanel ID="UpServMant" class="portlet-body" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="Button2" runat="server" ClientIDMode="Static" Text="Resfrecar Servicios" Style="display: none;" />
<asp:GridView ID="GvServiciosMant" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover Widthall"
Style="text-align: center;" GridLines="None" runat="server" BorderWidth="0px" AutoGenerateColumns="False" EmptyDataText="No se encontraron Servicios registrados." ToolTip="Listado de Servicios">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Tipo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTipo" runat="server" Text='<%# Eval("Tipo") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Proveedor</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplProveedor" runat="server" Target="_blank" Text='<%# Eval("Proveedor") %>' NavigateUrl='<%# Eval("CveProveedor", "/Compras/Proveedores.aspx?CveProveedor={0}")%>'></asp:HyperLink>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" runat="server" Target="_blank" Text='<%# Eval("Factura") %>' NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>'></asp:HyperLink>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Odometro/Horometro</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlOdHorometro" runat="server" Text='<%# Eval("OdHorometro", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Observaciones</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlObservaciones" runat="server" Text='<%# Eval("Observaciones") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
@@ -2076,7 +2119,87 @@
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabProduccion" runat="server" HeaderText="Producción" Visible="false">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpProduccion" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-tasks font-green"></i>
<span class="caption-subject bold uppercase">Producción</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm blue" data-original-title="Agregar Producción" title="Agregar Producción" ID="LnkAgregarProduccion" OnClick="LnkAgregarProduccion_Click" style="font-size:13px!important"><i class="fa fa-plus-circle" aria-hidden="true"></i>Agregar</asp:LinkButton>
</div>
</div>
<div class="tools">
<%-- <a href="" class="collapse" data-original-title="" title=""></a>
<a href="" class="reload" data-original-title="" title=""></a>
<a href="" class="fullscreen" data-original-title="" title=""></a>
<a href="" class="remove" data-original-title="" title=""></a>--%>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom label12">
<div class="form-body">
<asp:GridView ID="GvProduccion" runat="server" GridLines="None" BorderWidth="0px" CssClass="table table-striped table-hover table-advance Widthall"
AutoGenerateColumns="False" DataKeyNames="CveProduccion, CveActivoFijo, CveCultivoCuadroDetalle, Cantidad, Fecha, CveUsuario, FechaIng, Codigo, Descripcion, Usuario, Cuadro" ShowHeader="true">
<Columns>
<asp:BoundField DataField="Cuadro" HeaderText="Cuadro" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:n2}" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Opciones">
<ItemTemplate>
<asp:LinkButton ID="LnkGvProduccionEdit" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="LnkGvProduccionEdit_Click" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="LnkGvProduccionRemove" runat="server" AlternateText="Eliminar" OnClick="LnkGvProduccionRemove_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
@@ -3106,6 +3229,200 @@
</div>
</div>
<%--MODAL PRODUCCION--%>
<div id="DVModalProduccion" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalProduccion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="H4" runat="server"><asp:Label runat="server" ID="LblModaProduccionTitulo"></asp:Label></h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpdatePanel4" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div runat="server" id="DVCultivosCuadro" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModalCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpProduccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalCultivosCuadro" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModalCultivosCuadro"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El Cuadro <b>''Cuadro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpProduccion">
</asp:RequiredFieldValidator>
<label runat="server" for="<%= DdlModalCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtModalProduccionCantidad" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtModalProduccionCantidad" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtModalProduccionCantidad"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpProduccion">
</asp:RequiredFieldValidator>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtModalProduccionCantidad" FilterType="Custom" ValidChars="1234567890." />
<label for="<%= TxtModalProduccionCantidad.ClientID.ToString()%>">Cantidad:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label for="<%= TxtModalProduccionFecha.ClientID.ToString()%>">Fecha:</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtModalProduccionFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalProduccionFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="METxtModalProduccionFecha" runat="server" TargetControlID="TxtModalProduccionFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtModalProduccionFecha" TargetControlID="TxtModalProduccionFecha" PopupButtonID="LnkTxtModalProduccionFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtModalProduccionFecha" runat="server" ControlToValidate="TxtModalProduccionFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpProduccion"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVOTxtModalProduccionFecha" runat="server" ControlToValidate="TxtModalProduccionFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpProduccion"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender28" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalProduccionFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender29" runat="server" HighlightCssClass="vco" TargetControlID="CVOTxtModalProduccionFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:LinkButton ID="LnkModalAgregarProduccion" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpProduccion" OnClick="LnkModalAgregarProduccion_Click"> <i class='material-icons'>done_all</i>Agregar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%--MODAL MANTENIMIENTO--%>
<div id="DVModalMantenimiento" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalMantenimiento" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="H5" runat="server"><asp:Label runat="server" ID="LblModaMantenimientoTitulo"></asp:Label></h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpdatePanel5" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtModalMantenimiento" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtModalMantenimiento" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtModalMantenimiento"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mantenimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMantenimiento">
</asp:RequiredFieldValidator>
<label for="<%= TxtModalMantenimiento.ClientID.ToString()%>">Mantenimiento:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtModalMantenimientoObservaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="200"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtModalMantenimientoObservaciones" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtModalMantenimientoObservaciones"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Observaciones''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMantenimiento">
</asp:RequiredFieldValidator>
<label for="<%= TxtModalMantenimientoObservaciones.ClientID.ToString()%>">Observaciones:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label for="<%= TxtModalMantenimientoFecha.ClientID.ToString()%>">Fecha:</label>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtModalMantenimientoFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalMantenimientoFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="METxtModalMantenimientoFecha" runat="server" TargetControlID="TxtModalMantenimientoFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtModalMantenimientoFecha" TargetControlID="TxtModalMantenimientoFecha" PopupButtonID="LnkTxtModalMantenimientoFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtModalMantenimientoFecha" runat="server" ControlToValidate="TxtModalMantenimientoFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMantenimiento"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVOTxtModalMantenimientoFecha" runat="server" ControlToValidate="TxtModalMantenimientoFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpMantenimiento"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender30" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalMantenimientoFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender31" runat="server" HighlightCssClass="vco" TargetControlID="CVOTxtModalMantenimientoFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtArchivoMantenimiento" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
<br />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:LinkButton ID="LnkModalAgregarMantenimiento" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpMantenimiento" OnClick="LnkModalAgregarMantenimiento_Click">
<i class='material-icons'>done_all</i>Agregar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -245,6 +245,31 @@ Partial Class AF_AF
#End Region
Private Property CveProduccion As Integer
Get
If ViewState("CveProduccion") Is Nothing Then
ViewState("CveProduccion") = -1
End If
Return ViewState("CveProduccion").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProduccion") = value
End Set
End Property
Private Property CveMantenimiento As Integer
Get
If ViewState("CveMantenimiento") Is Nothing Then
ViewState("CveMantenimiento") = -1
End If
Return ViewState("CveMantenimiento").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMantenimiento") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -260,9 +285,11 @@ Partial Class AF_AF
ViewState("CveActivoFijo") = Request("CveActivoFijo")
CargaDatos()
CargaEventos()
CargaActividades()
'Configuración de Modalidad Update
CargaActividades()
CargaProduccion()
CargaMantenimento()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Activo Fijo:"
@@ -271,8 +298,9 @@ Partial Class AF_AF
HlEvento.NavigateUrl = String.Format("/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveActivoFijo=" & CveActivoFijo & "&TB_iframe=true&height=370&width=600;")
Else
ViewState("CveActivoFijo") = -1
CargaCombos()
'Configuración de Modalidad Insert
CargaCombos()
'Configuración de Modalidad Insert
ImgAddObs.Visible = False
LblFechaCaptura.Text = Now.ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
@@ -288,6 +316,13 @@ Partial Class AF_AF
CargaAFInv()
cargaOrdenesdeservicio()
If Request("Op") IsNot Nothing Then
ModalidadesPaginaAF(Request("Op").ToString)
End If
End If
End Sub
Private Sub cargaOrdenesdeservicio()
@@ -373,6 +408,20 @@ Partial Class AF_AF
CveEmpresaActual = UsuarioActual.CveEmpresa
End Sub
Private Sub ModalidadesPaginaAF(Op As String)
Select Case Op
Case "AR" 'Arbol Frutal etc
LblFechaCompra.Text = "Fecha de Nacimiento"
LblFechaBaja.Text = "Fecha de Muerte"
TabProduccion.Visible = True
Exit Select
Case Else
Exit Select
End Select
End Sub
#Region " CARGA COMBOS "
Private Sub CargaCombos()
@@ -398,6 +447,8 @@ Partial Class AF_AF
DdlResponsable.Enabled = False
End If
CargaCultivos()
End Sub
Private Sub CargaTipoActivoFijo()
DdlTipoActivoFijo.DataSource = GlobalDTTipoActivoFijo(CveEmpresaActual).FiltraParametros("", "TipoActivoFijo")
@@ -476,6 +527,11 @@ Partial Class AF_AF
' DdlClientes.DataBind()
'End Sub
Private Sub CargaCultivos()
DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlModalCultivosCuadro.DataBind()
DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
End Sub
@@ -562,6 +618,13 @@ Partial Class AF_AF
DdlModelos.DataBind()
DdlModelos.Items.Insert(0, New ListItem("-", "-1"))
End Sub
Private Sub CargaProduccionCuadros()
DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlModalCultivosCuadro.DataBind()
DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
#End Region
Private Sub CargaDatos()
@@ -579,7 +642,13 @@ Partial Class AF_AF
TxtDescripcion.Text = ObjActivoFijo.Descripcion
TxtCodigo.Text = ObjActivoFijo.Codigo
TxtValorCompra.Text = ObjActivoFijo.ValorCompra.ToString.FormatoNumero
TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString
TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString
TxtFechaBaja.Text = If(ObjActivoFijo.FechaBaja = New Date(1900, 1, 1), "", ObjActivoFijo.FechaBaja.ToString("dd/MM/yyyy"))
DdlTipoActivoFijo.SelectedValue = ObjActivoFijo.CveTipoActivoFijo.ToString
CargaSubTipoActivoFijo()
DdlSubTipoActivoFijo.SelectedValue = ObjActivoFijo.CveSubTipoActivoFijo.ToString
@@ -654,8 +723,8 @@ Partial Class AF_AF
CargaPlacas()
CargaLicencias()
CargaSeguros()
CargaServicios()
CargaSeguros()
CargaFallas()
CargaAccidentes()
@@ -1062,31 +1131,22 @@ Partial Class AF_AF
#End Region
#Region "S E R V I C I O S - M A N T E M I E N T O"
Public Sub CargaServicios()
Dim TmpServicios As New DataTable
TmpServicios.Columns.Add("CveProveedor", GetType(Integer))
TmpServicios.Columns.Add("CveCompra", GetType(Integer))
TmpServicios.Columns.Add("Tipo", GetType(String))
TmpServicios.Columns.Add("Fecha", GetType(Date))
TmpServicios.Columns.Add("Proveedor", GetType(String))
TmpServicios.Columns.Add("Factura", GetType(String))
TmpServicios.Columns.Add("OdHorometro", GetType(Double))
TmpServicios.Columns.Add("Observaciones", GetType(String))
'Dim Row As DataRow = TmpServicios.NewRow
'Row("CveProveedor") = 3100
'Row("CveCompra") = 181656
'Row("Tipo") = "Preventivo"
'Row("Fecha") = "01/02/2016"
'Row("Proveedor") = "EMPRESAS MATCO, S.A. DE C.V."
'Row("Factura") = "HERAA-158591"
'Row("OdHorometro") = "198,567"
'Row("Observaciones") = "Servicio Preventivo 200,000 Kilometros - Servicio Completo"
'TmpServicios.Rows.Add(Row)
GvServiciosMant.DataSource = TmpServicios
GvServiciosMant.DataBind()
End Sub
'Public Sub CargaServicios()
' Dim TmpServicios As New DataTable
' TmpServicios.Columns.Add("CveProveedor", GetType(Integer))
' TmpServicios.Columns.Add("CveCompra", GetType(Integer))
' TmpServicios.Columns.Add("Tipo", GetType(String))
' TmpServicios.Columns.Add("Fecha", GetType(Date))
' TmpServicios.Columns.Add("Proveedor", GetType(String))
' TmpServicios.Columns.Add("Factura", GetType(String))
' TmpServicios.Columns.Add("OdHorometro", GetType(Double))
' TmpServicios.Columns.Add("Observaciones", GetType(String))
' GvServiciosMant.DataSource = TmpServicios
' GvServiciosMant.DataBind()
'End Sub
#End Region
#Region "F A L L A S"
@@ -2106,6 +2166,8 @@ Partial Class AF_AF
Dim ObjContabilidad As New ClsContabilidad(ObjAF.IniciaTransacSQL())
Dim ErrorGuardar As Boolean = False
Dim FechaBaja As Date = If(TxtFechaBaja.Text = "", MinFecha, TxtFechaBaja.Text.ToDate)
If CveActivoFijo <= 0 Then
'SALIDA DE ALMACEN PARA IMPORTACION
@@ -2123,12 +2185,15 @@ Partial Class AF_AF
End If
If Not ErrorGuardar Then
If ObjAF.AddActivosFijos(TxtCodigo.Text.Trim, TxtDescripcion.Text.Trim, TxtValorCompra.Text.Trim.ToDouble, TxtFechaCompra.Text.Trim.ToDate, DdlSubTipoActivoFijo.SelectedValue.ToEntero,
DdlResponsable.SelectedValue.ToEntero, TxtNoSerie.Text.Trim, TxtAño.Text.Trim.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.Trim.ToEntero,
DdlEstadoActivoFijo.SelectedValue.ToEntero, DdlCtaContableDepreciacion.SelectedValue.ToEntero, TxtPorDepreciacion.Text.Trim.ToDouble,
TxtObservaciones.Text.Trim, DdlClientes.SelectedValue.ToEntero, CveMovimientoSalidaInv, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero,
CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero) > 0 Then
TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, CveMovimientoSalidaInv, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero,
CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero,
FechaBaja:=FechaBaja) > 0 Then
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
Else
ErrorGuardar = True
@@ -2155,8 +2220,9 @@ Partial Class AF_AF
If Not ObjAF.UpdateActivosFijos(CveActivoFijo.ToString.ToEntero, TxtCodigo.Text.Trim, TxtDescripcion.Text.Trim, TxtValorCompra.Text.Trim.ToDouble, TxtFechaCompra.Text.Trim.ToDate, DdlSubTipoActivoFijo.SelectedValue.ToEntero,
DdlResponsable.SelectedValue.ToEntero, TxtNoSerie.Text.Trim, TxtAño.Text.Trim.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.Trim.ToEntero, DdlEstadoActivoFijo.SelectedValue.ToEntero, DdlCtaContableDepreciacion.SelectedValue.ToEntero,
TxtPorDepreciacion.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, DdlClientes.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveEmpresaActual,
CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero) Then
TxtPorDepreciacion.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveEmpresaActual,
CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero,
FechaBaja:=FechaBaja) Then
'Comentado porque te redirecciona no se ocupa - 22 Enero 2016 - Israel Piña
'CargaDatos()
@@ -3097,7 +3163,8 @@ Partial Class AF_AF
TxtDescripcion.Text = DdlAFInvPS.SelectedText
TxtValorCompra.Text = Costo.FormatoNumero
TxtFechaCompra.Text = Now.ToShortDateString
TxtFechaCompra.Text = Now.ToShortDateString
TxtFechaBaja.Text = ""
TxtNoSerie.Text = TxtAFInvSerie.Text.Trim
TxtValorCompra.Enabled = False
@@ -3727,5 +3794,373 @@ Partial Class AF_AF
ImprimirPDF("Empresas/Grales/Formatos/RepComprasInsumos.rdlc", DTCompras, params, "RepComprasInsumos", Formato)
End Sub
End Sub
#Region "Produccion"
Private Sub CargaProduccion()
Dim ObjAF As New ClsAF
If ObjAF.GetProduccion(CveActivoFijo, UsuarioActual.CveEmpresa) Then
GvProduccion.DataSource = ObjAF.DtResultados
Else
GvProduccion.DataSource = Nothing
End If
ObjAF.Dispose()
GvProduccion.DataBind()
UpProduccion.Update()
End Sub
Protected Sub LnkAgregarProduccion_Click(sender As Object, e As EventArgs)
LblModaProduccionTitulo.Text = "Agregar Producción"
LnkModalAgregarProduccion.Text = "Agregar"
CveProduccion = -1
DdlModalCultivosCuadro.SelectedValueExist(-1)
TxtModalProduccionCantidad.Text = ""
TxtModalProduccionFecha.Text = ""
RegistraScript("$('#DVModalProduccion').modal('show');")
UpModalProduccion.Update()
End Sub
Protected Sub LnkGvProduccionEdit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveProduccion = GvRow.DataKey("CveProduccion").ToEntero
Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToEntero
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
DdlModalCultivosCuadro.SelectedValueExist(CveCultivoCuadroDetalle)
TxtModalProduccionCantidad.Text = Cantidad.ToString("###,###,###.00")
TxtModalProduccionFecha.Text = Fecha.ToString("dd/MM/yyyy")
LblModaProduccionTitulo.Text = "Actualizar Producción"
LnkModalAgregarProduccion.Text = "Actualizar"
UpModalProduccion.Update()
RegistraScript("$('#DVModalProduccion').modal('show');")
End Sub
Protected Sub LnkGvProduccionRemove_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveProduccionEliminar As Integer = GvRow.DataKey("CveProduccion").ToEntero
Dim ObjAF As New ClsAF
If ObjAF.RemoveProduccion(CveProduccionEliminar, UsuarioActual.CveEmpresa) Then
ErrorProceso = False
Else
ErrorProceso = True
End If
ObjAF.Dispose()
If Not ErrorProceso Then
Alert("Producción Eliminada Correctamente.")
CargaProduccion()
End If
End Sub
Protected Sub LnkModalAgregarProduccion_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim ObjAF As New ClsAF
If CveProduccion > 0 Then
If ObjAF.UpdateProduccion(CveProduccion, CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
ErrorProceso = False
Else
ErrorProceso = True
End If
Else
If ObjAF.AddProduccion(CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
ErrorProceso = False
Else
ErrorProceso = True
End If
End If
ObjAF.Dispose()
If Not ErrorProceso Then
RegistraScript("$('#DVModalMantenimiento').modal('hide');")
Alert("Producción Agregada Correctamente.")
CargaProduccion()
End If
End Sub
#End Region
#Region "MANTENIMIENTO"
Private Sub CargaMantenimento()
Dim ObjAF As New ClsAF
If ObjAF.GetMantenimientos(CveActivoFijo, UsuarioActual.CveEmpresa) Then
GvMantenimientos.DataSource = ObjAF.DtResultados
Else
GvMantenimientos.DataSource = Nothing
End If
ObjAF.Dispose()
GvMantenimientos.DataBind()
UpMantenimientos.Update()
End Sub
Protected Sub LnkAgregarMantenimiento_Click(sender As Object, e As EventArgs)
LblModaMantenimientoTitulo.Text = "Agregar Mantenimiento"
LnkModalAgregarMantenimiento.Text = "Agregar"
CveMantenimiento = -1
TxtModalMantenimiento.Text = ""
TxtModalMantenimientoObservaciones.Text = ""
TxtModalMantenimientoFecha.Text = ""
TxtArchivoMantenimiento.Text = "[]"
RegistraScript("$('#DVModalMantenimiento').modal('show');")
UpModalMantenimiento.Update()
End Sub
Protected Sub LnkGvMantenimientoEdit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion, Usuario
CveMantenimiento = GvRow.DataKey("CveMantenimiento").ToEntero
Dim Mantenimiento As String = GvRow.DataKey("Mantenimiento")
Dim Observaciones As String = GvRow.DataKey("Observaciones")
Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
TxtModalMantenimiento.Text = Mantenimiento
TxtModalMantenimientoObservaciones.Text = Observaciones
TxtModalMantenimientoFecha.Text = Fecha.ToString("dd/MM/yyyy")
TxtArchivoMantenimiento.Text = "[]"
LblModaMantenimientoTitulo.Text = "Actualizar Mantenimiento"
LnkModalAgregarMantenimiento.Text = "Actualizar"
UpModalMantenimiento.Update()
RegistraScript("$('#DVModalMantenimiento').modal('show');")
End Sub
Protected Sub LnkGvMantenimientoRemove_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveMantenimientoEliminar As Integer = GvRow.DataKey("CveMantenimiento").ToEntero
Dim ObjAF As New ClsAF
If ObjAF.RemoveMantenimientos(CveMantenimientoEliminar, UsuarioActual.CveEmpresa) Then
ErrorProceso = False
Else
ErrorProceso = True
End If
ObjAF.Dispose()
If Not ErrorProceso Then
Alert("Mantenimiento Eliminado Correctamente.")
CargaMantenimento()
End If
End Sub
Protected Sub LnkModalAgregarMantenimiento_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim ObjAF As New ClsAF
ObjAF.IniciaTransacSQL()
If CveMantenimiento > 0 Then
Dim FileExtension As String = ""
Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos
Dim Filename As String = "-1"
If Filesgral.Count > 0 Then
For Each fileItem As Archivo In Filesgral
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Filename = fileItem.filename
Exit For
Next
Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimiento}.{FileExtension}"))
If Archivo.Exists() Then
Archivo.Delete()
End If
If Not Filename.FilesMove(String.Format("{0}", CveMantenimiento.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then
ErrorProceso = True
Alert("Error al mover Archivo", TipoMensaje.MsgError)
End If
End If
If Not ErrorProceso Then
If Not ObjAF.UpdateMantenimientos(CveMantenimiento, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimiento}.{FileExtension}") Then
ErrorProceso = True
End If
End If
Else
Dim CveMantenimientoTemp As Integer = -1
CveMantenimientoTemp = ObjAF.AddMantenimientos(CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, "-1")
If CveMantenimientoTemp > 0 Then
ErrorProceso = False
Else
ErrorProceso = True
End If
If Not ErrorProceso Then
Dim FileExtension As String = ""
Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos
Dim Filename As String = ""
If Filesgral.Count > 0 Then
For Each fileItem As Archivo In Filesgral
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Filename = fileItem.filename
Exit For
Next
Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimientoTemp}.{FileExtension}"))
If Archivo.Exists() Then
Archivo.Delete()
End If
If Not Filename.FilesMove(String.Format("{0}", CveMantenimientoTemp.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then
ErrorProceso = True
Alert("Error al mover Archivo", TipoMensaje.MsgError)
End If
If Not ErrorProceso Then
If Not ObjAF.UpdateMantenimientos(CveMantenimientoTemp, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimientoTemp}.{FileExtension}") Then
ErrorProceso = True
End If
End If
End If
End If
End If
If Not ErrorProceso Then
ObjAF.Commit()
ObjAF.Dispose()
RegistraScript("$('#DVModalMantenimiento').modal('hide');")
Alert("Mantenimiento Guardado Correctamente.")
CargaMantenimento()
Else
ObjAF.RollBack()
ObjAF.Dispose()
End If
End Sub
Protected Sub LnkDescargaArcgivo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Archivo As String = GvRow.DataKey("Archivo")
Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
If InfArchivo.Exists Then
Response.Clear()
Response.AppendHeader("Content-Disposition", "attachment; filename=" + InfArchivo.Name)
Response.AppendHeader("Content-Length", InfArchivo.Length.ToString())
Response.ContentType = "application/octet-stream"
Response.WriteFile(InfArchivo.FullName)
Response.End()
End If
End Sub
Protected Sub GvMantenimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Archivo As String = e.Row.DataKey("Archivo")
Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
If InfArchivo.Exists Then
e.Row.FCLinkButton("LnkDescargaArcgivo").Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkDescargaArcgivo"))
End If
End If
End Sub
#End Region
End Class

View File

@@ -47,6 +47,7 @@ Public Class ClsAF
Public Property CveCompra As Integer
Public Property ValorCompra As Double
Public Property FechaCompra As Date
Public Property FechaBaja As Date
Public Property CuentaInicial As Integer
Public Property CveTipoActivoFijo As Integer
Public Property TipoActivoFijo As String
@@ -230,6 +231,7 @@ Public Class ClsAF
Me.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
Me.Usuario = Data.Rows(0)("Usuario").ToString
Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
Me.FechaBaja = Data.Rows(0)("FechaBaja").ToString.ToDate
End If
Retorno = True
Catch ex As Exception
@@ -344,6 +346,9 @@ Public Class ClsAF
Me.CveGrupoAF = Data.Rows(0)("CveGrupo").ToString.ToEntero
Me.CveAFPadre = Data.Rows(0)("CveAFPadre").ToString.ToEntero
Me.CveDispositivo = Data.Rows(0)("CveDispositivo").ToString.ToEntero
Me.FechaBaja = Data.Rows(0)("FechaBaja").ToString.ToDate
End If
Retorno = True
Catch ex As Exception
@@ -397,7 +402,7 @@ Public Class ClsAF
Public Function AddActivosFijos(Codigo As String, Descripcion As String, ValorCompra As Double, FechaCompra As Date, CveSubTipoActivoFijo As Integer, CvePersonalResponsable As Integer, NoSerie As String, Año As Integer,
CveSubProyecto As Integer, Cuenta As Integer, CveEstadoActivoFijo As Integer, IdCtaContDepreciacion As Integer, PorDepreciacion As Double, Observaciones As String, CveCliente As Integer,
CveMovimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveModelo As Integer = -1, Optional CveGrupo As Integer = -1,
Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1) As Integer
Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1, Optional FechaBaja As Date = MinFecha) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_AF_ActivosFijosAdd")
@@ -427,6 +432,7 @@ Public Class ClsAF
.Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo
.Add("@CveAFPadre", SqlDbType.Int).Value = CveAFPadre
.Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo
.Add("@FechaBaja", SqlDbType.Date).Value = FechaBaja
.Add("@CveActivoFijo", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
@@ -458,7 +464,7 @@ Public Class ClsAF
CvePersonalResponsable As Integer, NoSerie As String, Año As Integer, CveSubProyecto As Integer, IdCtaContActivoFijo As Integer,
CveEstadoActivoFijo As Integer, IdCtaContDepreciacion As Integer, PorDepreciacion As Double, Observaciones As String, CveCliente As Integer,
CveUsuarioModifico As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveModelo As Integer = -1, Optional CveGrupo As Integer = -1,
Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1) As Boolean
Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1, Optional FechaBaja As Date = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ActivosFijosUpdate")
@@ -490,6 +496,7 @@ Public Class ClsAF
.Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo
.Add("@CveAFPadre", SqlDbType.Int).Value = CveAFPadre
.Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo
.Add("@FechaBaja", SqlDbType.Date).Value = FechaBaja
End With
Try
@@ -4512,6 +4519,230 @@ Public Class ClsAF
#End Region
#End Region
#Region " P R O D U C C C I Ó N "
Public Function AddProduccion(CveActivoFijo As Integer, CveCultivoCuadroDetalle As Integer, Cantidad As Decimal, Fecha As Date, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ProduccionAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateProduccion(CveProduccion As Integer, CveActivoFijo As Integer, CveCultivoCuadroDetalle As Integer, Cantidad As Decimal, Fecha As Date, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ProduccionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveProduccion", SqlDbType.Int).Value = CveProduccion
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetProduccion(CveActivoFijo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ProduccionGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al consultar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveProduccion(CveProduccion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ProduccionRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveProduccion", SqlDbType.Int).Value = CveProduccion
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region " M A N T E N I M I E N T O S "
Public Function AddMantenimientos(CveActivoFijo As Integer, Mantenimiento As String, Observaciones As String, Fecha As Date, CveUsuario As Integer, Archivo As String) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_AF_MantenimientosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@Mantenimiento", SqlDbType.VarChar).Value = Mantenimiento
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Archivo", SqlDbType.VarChar).Value = Archivo
.Add("@CveMantenimiento", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = SqlAdapter.SelectCommand.Parameters("@CveMantenimiento").Value.ToString.ToEntero
Catch ex As Exception
OnError("Ocurrió un error al agregar el mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateMantenimientos(CveMantenimiento As Integer, CveActivoFijo As Integer, Mantenimiento As String, Observaciones As String, Fecha As Date, CveUsuario As Integer, Archivo As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_MantenimientosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMantenimiento", SqlDbType.Int).Value = CveMantenimiento
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@Mantenimiento", SqlDbType.VarChar).Value = Mantenimiento
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Archivo", SqlDbType.VarChar).Value = Archivo
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetMantenimientos(CveActivoFijo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_MantenimientosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al consultar los mantenimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveMantenimientos(CveMantenimiento As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_MantenimientosRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMantenimiento", SqlDbType.Int).Value = CveMantenimiento
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region

View File

@@ -1287,7 +1287,8 @@ Public Class ClsInventarios
Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha,
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1,
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetalleRemision As Integer = -1) As Boolean
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetalleRemision As Integer = -1,
Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleAdd")
@@ -1314,6 +1315,7 @@ Public Class ClsInventarios
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@EsInterno", SqlDbType.Int).Value = EsInterno
.Add("@CveVentaDetalleRemision", SqlDbType.Int).Value = CveVentaDetalleRemision
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -1349,7 +1351,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateMovimientoDetalle(Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Double, CveAF As Integer, CveMovimientoDetalle As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "",
Optional Observaciones As String = "-1", Optional PUTC As Double = -1, Optional CveUsuarioModifico As Integer = -1) As Boolean
Optional Observaciones As String = "-1", Optional PUTC As Double = -1, Optional CveUsuarioModifico As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleUpdate")
@@ -1366,6 +1368,7 @@ Public Class ClsInventarios
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
End With
Try

View File

@@ -1701,6 +1701,25 @@
<label for="<%= TdTotal.ClientID.ToString()%>">Total</label>
<asp:Literal ID="TdTotal" runat="server" Visible="false"></asp:Literal>
</div>
<div runat="server" id="DVCultivosCuadro" class="form-group form-md-line-input input-iconright" visible="false">
<asp:DropDownList ID="DdlModalCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpProduccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalCultivosCuadro" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModalCultivosCuadro"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El Cuadro <b>''Cuadro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpProduccion">
</asp:RequiredFieldValidator>
<label runat="server" for="<%= DdlModalCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
<i></i>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LkAgregarDetalle" runat="server" CssClass="btn btn-primary" Text="Agregar"></asp:LinkButton>

View File

@@ -511,6 +511,7 @@ Partial Class Inventarios_EntradasSalidas
dt.Columns.Add("Observaciones")
dt.Columns.Add("CountMovimientoEntradaDetalle")
dt.Columns.Add("TotalExtranjero", Type.GetType("System.Double"))
dt.Columns.Add("CveCultivoCuadroDetalle", Type.GetType("System.Int32"))
CargaGVM(dt)
@@ -569,6 +570,10 @@ Partial Class Inventarios_EntradasSalidas
End If
If IfNull(Request("CI"), -1).ToString.ToEntero > 0 And UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)")
End If
DdlAlmacenInventarioFisico.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
DdlAlmacenCambioVigencias.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)")
@@ -1328,7 +1333,7 @@ Partial Class Inventarios_EntradasSalidas
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDecimal,
txtPrecio.Text.ToDecimal, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.Toentero)
LimpiarAgregar()
txtCantidad.Text = ""
@@ -1339,6 +1344,8 @@ Partial Class Inventarios_EntradasSalidas
TxtnFechaCaducidad.Text = ""
HdnCodigoAF.Value = "-1"
HdnCveActivoFijo.Value = "-1"
DdlModalCultivosCuadro.SelectedValueExist(-1)
RegistraScript("CodigoAF = "";")
If Not UsuarioActual.Empresa.Funcionalidad(105).ToString = "1" Then
@@ -1352,7 +1359,8 @@ Partial Class Inventarios_EntradasSalidas
End Sub
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Decimal, PU As Decimal, Serie 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, Optional CargarGV As Boolean = True)
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Decimal, PU As Decimal, Serie 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, Optional CargarGV As Boolean = True, Optional CveCultivoCuadroDetalle As Integer = -1)
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
@@ -1445,6 +1453,8 @@ Partial Class Inventarios_EntradasSalidas
registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("Observaciones") = Observaciones
registro.Item("AplicaCaducidad") = RowPS("AplicaCaducidad").ToString
registro.Item("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle
DtMovimientos.Rows.Add(registro)
If CargarGV Then
@@ -1536,13 +1546,13 @@ Partial Class Inventarios_EntradasSalidas
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), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("Serie").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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) 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, 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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1552,7 +1562,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, 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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1669,7 +1679,7 @@ Partial Class Inventarios_EntradasSalidas
Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
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("Serie").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=FechaCaducidadVal) >= 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, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=FechaCaducidadVal, 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:=FechaCaducidadVal, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1687,7 +1697,7 @@ Partial Class Inventarios_EntradasSalidas
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, 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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1721,7 +1731,7 @@ 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, 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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1956,7 +1966,7 @@ Partial Class Inventarios_EntradasSalidas
If Not ErrorAC And Not ErrorMovInv Then
Dim Msg As New StringBuilder
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, ObjInventario.CveMovimiento)
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, CveMovimiento)
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
If RetornoVirtual IsNot Nothing Then
@@ -3326,6 +3336,24 @@ Partial Class Inventarios_EntradasSalidas
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
TrSubProyectoActivoFijo.Visible = True
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, "Seleccione Uno")
DVCultivosCuadro.Visible = True
CargaCultivos()
End If
End Sub
Private Sub CargaCultivos()
DdlModalCultivosCuadro.Items.Clear()
DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlModalCultivosCuadro.DataBind()
DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
#End Region
@@ -5029,6 +5057,18 @@ Partial Class Inventarios_EntradasSalidas
'#End Region
Protected Sub LkAgregar_Click() Handles LnkAgregarProducto.Click
If EsConsumoInterno And UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
If DdlSubProyecto.SelectedValue.ToEntero <= 0 Then
Alert("Debe seleccionar un Centro de Constos.", TipoMensaje.MsgAdvertencia)
Exit Sub
Else
CargaCultivos()
End If
End If
limpiarModalDetalle()
UpAgregar.Update()
RegistraScript("$('#ModalAgregar').modal()")
@@ -5039,7 +5079,7 @@ Partial Class Inventarios_EntradasSalidas
Dim ObjInventario As New ClsInventarios
If Not ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDouble, DdlUnidad.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, txtPrecio.Text.ToDouble, CveAFEdit,
CveMovimientoDetalleEdit, DdlSeccionAlmacen.SelectedValue.ToEntero, TxtnSerie.Text, TxtObservacionesdetalle.Text,
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.ToEntero) Then
Alert("Error al Actualizar los movimientos")
Else
Alert("Movimiento actualizado correctamente")
@@ -5067,6 +5107,7 @@ Partial Class Inventarios_EntradasSalidas
TxtObservacionesdetalle.Text = ""
DdlSeccionAlmacen.ClearSelection()
LkAgregarDetalle.Text = "Agregar"
DdlModalCultivosCuadro.SelectedValueExist(-1)
If DdlMonedaTC.SelectedValue.ToEntero = 2 Then
VisualizaPUExtranjero(UsuarioActual.TienePermisoProceso(201))
Else

View File

@@ -661,7 +661,9 @@ Partial Class Inventarios_ResguardoMaterial
End If
CargaResguardos()
If UsuarioActual.CveEmpresa = 140 Then
@@ -686,6 +688,9 @@ Partial Class Inventarios_ResguardoMaterial
End If
CargaResguardos()
UpGridLiberacion.Update()
UpGenerales.Update()