Rep Agro Precios Ventas

This commit is contained in:
rakcsle
2025-04-03 13:35:46 -07:00
parent 3b8bf96871
commit db978c769e
4 changed files with 712 additions and 250 deletions

View File

@@ -1,30 +1,40 @@
<%@ Page Title="Reporte de Ordenes de Servicio Médicas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPreciosVentaManifiesto.aspx.vb" Inherits="Agrupecuaria_RepPreciosVentaManifiesto" %> <%@ Page Title="Precios Ventas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPreciosVentaManifiesto.aspx.vb" Inherits="Agrupecuaria_RepPreciosVentaManifiesto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.form-group.form-md-line-input .form-control {
/*background: unset;*/
background-color:white;
padding: 3px 6px;
color: #666;
font-size: 12px;
}
</style>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAddPreciosVentaFecha" runat="server" OnClick="LnkAddPreciosVentaFecha_Click" >
<i class="fa fa-plus" aria-hidden="true"></i> Agregar Precio
</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Ordenes de Servicio Médicas Precios Ventas
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExportar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
@@ -37,17 +47,13 @@
<a href="javascript:;" class="expand"></a> <a href="javascript:;" class="expand"></a>
</div> </div>
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row" style="height: 32px;"> <div class="row" style="height: 32px;">
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
Fecha Inicio: Fecha Inicio:
</div> </div>
<div class="col-md-1" style="min-width: 115px"> <div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox> <asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" BackColor="White" ></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span> </span>
@@ -60,12 +66,11 @@
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
Fecha Fin: Fecha Fin:
</div> </div>
<div class="col-md-1" style="min-width: 115px"> <div class="col-md-1" >
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox> <asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" BackColor="White"></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span> </span>
@@ -78,26 +83,28 @@
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label> <div class="col-md-1" >
<div runat="server" id="DivSubProyecto" class="col-md-1"> <asp:Label ID="LblSubProyecto" runat="server"></asp:Label>:
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList> </div>
<div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server" OnSelectedIndexChanged="DdlSubProyecto_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
</div> </div>
<label id="lblCultivo" runat="server" class="col-md-1 truncate">Cultivo:</label>
<div class="col-md-2" id="DivCultivo" runat="server">
<asp:DropDownList ID="DdlCultivo" data-text="Todos" AppendDataBoundItems="true" DataTextField="Cultivo" DataValueField="CveCultivo" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="portlet-body" style="display: none"> <div class="portlet-body" style="display: none">
<div class="row"> <div class="row">
<label id="lblCultivo" runat="server" class="col-md-1 truncate">Cultivo </label> <label id="Label1" runat="server" class="col-md-1 truncate">Manifiesto:</label>
<div class="col-md-2" id="DivCultivo" runat="server"> <div class="col-md-2" id="Div1" runat="server">
<asp:ListBox ID="DdlCultivo" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Cuadro" DataValueField="CveCultivoCuadroDetalle" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox> <asp:DropDownList ID="DdlManifiesto" data-text="Todos" AppendDataBoundItems="true" DataTextField="NoEmbarque" DataValueField="CveEmbarqueManifiesto" CssClass=" input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -110,48 +117,272 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron ordenes de servicio con los filtros especificados"
ToolTip="Listado de ordenes de servicio" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<%--0--%>
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOS" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataTextField="Folio" Target="_blank" />
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" />--%>
<%--1--%>
<asp:BoundField DataField="FechaCita" HeaderText="Fecha Cirugía" ItemStyle-Width="110px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
<%--2--%>
<asp:BoundField HeaderText="Hospital" DataField="Nombre" />
<%--3--%>
<asp:BoundField HeaderText="Tipo" DataField="TipoVenta" />
<%--4--%>
<asp:BoundField HeaderText="Médico" DataField="Medico" />
<%--5--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" />
<%--6--%>
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
<%--7--%>
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" />
<%--8--%>
<asp:BoundField HeaderText="Técnico" DataField="NombreUsuario" />
<%--9--%>
<asp:BoundField HeaderText="Paciente" DataField="Paciente" />
<%--10--%>
<asp:BoundField HeaderText="Episodio" DataField="IdentificadorCliente" />
<%--11--%>
<asp:HyperLinkField HeaderText="Pedido" DataTextField="SerieFolioPedido" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVentaPedido" Target="_blank" />
<%--12--%>
<asp:HyperLinkField HeaderText="Remisión" DataTextField="SerieFolioRemision" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVentaRemision" Target="_blank" />
<%--13--%>
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" />
<%--14--%>
<asp:BoundField HeaderText="Folio Adicional" DataField="FolioAdicional" visible="false" />
<asp:BoundField HeaderText="Total" DataField="TotalRemision" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,###.00}" />
</Columns> <div class="row">
<div class="col-md-12">
</asp:GridView>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron datos con los filtros especificados"
DataKeyNames="CvePrecioVentaManifiesto,CveEmbarqueManifiesto,CveCultivo,CveCultivoVariedad,Referencia,LdDate,InvDate,PDDate,CantidadVendida,PUVenta,Observaciones"
ToolTip="" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Manifiesto" DataField="NoEmbarque" />
<asp:BoundField HeaderText="Cultivo" DataField="Cultivo" />
<asp:BoundField HeaderText="Variedad" DataField="CultivoVariedad" />
<asp:BoundField HeaderText="Tamaño" DataField="Tamaño" />
<asp:BoundField HeaderText="Referencia" DataField="Referencia" />
<asp:BoundField HeaderText="Fecha Vta" DataField="InvDate" ItemStyle-Width="110px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
<asp:BoundField HeaderText="Cantidad" DataField="CantidadVendida" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Precio venta (Grow)" DataField="PUVenta" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Precio del día" DataField="PrecioVenta" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="% de diferencia" DataField="Porcentaje" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha Ing." DataField="FechaIng" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<%-- POPUP Modal GV Precios Venta Fecha --%>
<div id="DVModalGVPreciosVentaFecha" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalGVPreciosVentaFecha" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding" style="width:1000px!important">
<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="H1" runat="server">
<asp:Literal runat="server" ID="Literal1" Text="Precios"></asp:Literal>
</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpModalFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idModalFiltro">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<%--<asp:Button ID="Button1" runat="server" Text="Consultar" class="btn btn-primary" />--%>
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<div class="col-md-1">
Fecha Inicio:
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<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="TxtModalFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="100px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="METxtModalFechaInicio" runat="server" TargetControlID="TxtModalFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtModalFechaInicio" TargetControlID="TxtModalFechaInicio" PopupButtonID="LnkTxtModalFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<div class="col-md-1">
Fecha Fin:
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<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="TxtModalFechaFin" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="100px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="METxtModalFechaFin" runat="server" TargetControlID="TxtModalFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtModalFechaFin" TargetControlID="TxtModalFechaFin" PopupButtonID="LnkTxtModalFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<div class="col-md-2" ></div>
<div class="col-md-2" style="text-align: right">
<asp:LinkButton ID="LnkModalBuscar" runat="server" CssClass="btn btn-primary" OnClick="LnkModalBuscar_Click"> Consultar</asp:LinkButton>
</div>
<div class="col-md-2" style="text-align: left">
<asp:LinkButton ID="LnkModalMuestra" runat="server" CssClass="btn btn-primary" OnClick="LnkModalMuestraAdd_Click"><i class="fa fa-plus" aria-hidden="true"></i> Agregar</asp:LinkButton>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GVPrecioVentaFecha" runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="No se encontraron datos con los filtros especificados"
DataKeyNames="CvePrecioVentaFecha,CveCultivo,CveTamaño,Descripcion,Fecha,CveCultivoVariedad,PrecioVenta"
ToolTip="" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cultivo" DataField="Cultivo" />
<asp:BoundField HeaderText="Variedad" DataField="CultivoVariedad" />
<asp:BoundField HeaderText="Tamaño" DataField="Tamaño" />
<asp:BoundField HeaderText="Precio" DataField="PrecioVenta" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" ItemStyle-Width="110px" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="False" />
<asp:BoundField HeaderText="Fecha Ing." DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" HtmlEncode="False" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="LnkEditarPrecioVentaFecha" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="LnkEditarPrecioVentaFecha_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarPrecioVentaFecha" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="LnkEliminarPrecioVentaFecha_Click" 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 class="modal-footer">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%-- POPUP AGREGAR Precios Venta Fecha --%>
<div id="DVModalPreciosVentaFecha" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalPreciosVentaFecha" 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="myModalLabel" runat="server">
<asp:Literal runat="server" ID="LtlModalTituloPreciosVentaFecha" Text="Agregar Precios"></asp:Literal>
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList runat="server" ID="DdlModalCultivo" CssClass="form-control select2me" DataValueField="CveCultivo" DataTextField="Cultivo" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlModalCultivo_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalCultivo" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModalCultivo"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cultivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPrecioVentaFecha"></asp:RequiredFieldValidator>
<label for="<%= DdlModalCultivo.ClientID.ToString()%>">Cultivo:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList runat="server" ID="DdlModalCultivoVariedad" CssClass="form-control select2me" DataValueField="CveCultivoVariedad" DataTextField="CultivoVariedad" Width="100%" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalCultivoVariedad" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModalCultivoVariedad"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cultivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPrecioVentaFecha"></asp:RequiredFieldValidator>
<label for="<%= DdlModalCultivoVariedad.ClientID.ToString()%>">Variedad:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList runat="server" ID="DdlModalTamaño" CssClass="form-control select2me" DataValueField="CveTamaño" DataTextField="Tamaño" Width="100%" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalTamaño" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModalTamaño"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tamaño''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPrecioVentaFecha"></asp:RequiredFieldValidator>
<label for="<%= DdlModalTamaño.ClientID.ToString()%>">Tamaño:</label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtModalDescripcion" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<label for="<%= TxtModalDescripcion.ClientID.ToString()%>">Descripción:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
<label for="<%= TxtModalFecha.ClientID.ToString()%>" style="color: #888888;">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="TxtModalFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="100px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtModalFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="METxtModalFecha" runat="server" TargetControlID="TxtModalFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtModalFecha" TargetControlID="TxtModalFecha" PopupButtonID="LnkTxtModalFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RfvTxtModalFecha" runat="server" ControlToValidate="TxtModalFecha" Display="None"
ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpPrecioVentaFecha"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VeRfvTxtModalFecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPrecioVentaFecha" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtPrecioVentaFecha" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioVentaFecha"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPrecioVentaFecha"></asp:RequiredFieldValidator>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioVentaFecha" FilterType="Custom" ValidChars="0123456789." />
<label for="<%= TxtPrecioVentaFecha.ClientID.ToString()%>">Precio:</label>
</div>
</div>
</div>
<%--<hr style="border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));" />--%>
</div>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkModalGuardarPreciosVentaFecha" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpPrecioVentaFecha" OnClick="LnkModalGuardarPreciosVentaFecha_Click">Agregar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -2,260 +2,315 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.DirectoryServices.ActiveDirectory
Imports Extensiones Imports Extensiones
Partial Class Agrupecuaria_RepPreciosVentaManifiesto Partial Class Agrupecuaria_RepPreciosVentaManifiesto
Inherits ClsPaginas Inherits ClsPaginas
Private Property CvePrecioVentaFecha As Integer
Get
If ViewState("CvePrecioVentaFecha") Is Nothing Then
ViewState("CvePrecioVentaFecha") = -1
End If
Return ViewState("CvePrecioVentaFecha").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePrecioVentaFecha") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx") If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
txtFechaI.Text = $"01/{Now.Month.ToString("0#")}/{Now.Year}"
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
TxtModalFechaInicio.Text = $"01/{Now.Month.ToString("0#")}/{Now.Year}"
TxtModalFechaFin.Text = Now.ToString("dd/MM/yyyy")
CargaCombos() CargaCombos()
CargaDatos() CargaDatos()
End If End If
End Sub End Sub
#Region " CARGA COMBOS " #Region " CARGA COMBOS "
Private Sub CargaCombos() Private Sub CargaCombos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
CargaManifiesto(-1)
CargaCultivo(-1)
End Sub
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) Private Sub CargaManifiesto(CveSubProyecto As Integer)
CargaCultivo() DdlManifiesto.ClearSelection()
DdlManifiesto.SelectedValue = Nothing
DdlManifiesto.Items.Clear()
'CargaEstatus Dim objNow As New ClsNominas
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
DdlEstatusOS.DataBind()
DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
Dim DTTecnicos As DataTable = Nothing
Dim ObjOS As New ClsOS If objNow.EmbarqueManifiestoGet(CveSubProyecto, -1, UsuarioActual.CveEmpresa, -1) Then
If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then DdlManifiesto.DataSource = objNow.DtResultados.FiltraParametros("", "", {"CveEmbarqueManifiesto", "NoEmbarque"})
DTTecnicos = ObjOS.DtResultados
End If
ObjOS.Dispose()
DdlTecnico.DataSource = DTTecnicos
DdlTecnico.DataBind()
DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTecnico.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
'376
If UsuarioActual.TienePermisoProceso(376) Then
DdlTecnico.Enabled = False
DdlTecnico.SelectedValueExist(UsuarioActual.CveUsuario)
End If End If
objNow.Dispose()
If IfNull(Request("CveUsuarioTecnico"), 0).ToString.ToEntero > 0 Then DdlManifiesto.DataBind()
DdlTecnico.SelectedValueExist(Request("CveUsuarioTecnico").ToString) DdlManifiesto.Items.Insert(0, New ListItem("Todos", "-1"))
Else
ViewState("CveUsuarioTecnico") = -1
End If
'CargaClientes End Sub
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) Private Sub CargaCultivo(CveSubProyecto As Integer)
'If EsWS Then
' DdlClientes.setEsWebService(True)
'Else
' DdlClientes.setEsWebService(False)
' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlClientes.DataBind()
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
'End If
'Vendedor DdlCultivo.ClearSelection()
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso DdlCultivo.SelectedValue = Nothing
DdlVendedor.DataBind() DdlCultivo.Items.Clear()
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
DdlVendedor.Items.Insert(1, New ListItem("Sin Vendedor", "-2"))
If UsuarioActual.CveVendedor > 0 Then
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor)
DdlVendedor.Enabled = False
End If
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaF.Text = NowADS().AddDays(2).ToShortDateString
DdlMedico.DataSource = If(UsuarioActual.CveVendedor > 0, GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros($" Estatus = 'True' AND CveVendedor = {UsuarioActual.CveVendedor} "), GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' "))
DdlMedico.DataBind()
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlProcedimiento.DataBind()
DdlTipoVenta.DataSource = GlobalDTTipoVenta(UsuarioActual.CveEmpresa)
DdlTipoVenta.DataBind
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then
DdlEspecialidad.DataSource = ObjVentas.DtResultados DdlCultivo.DataSource = ObjVentas.DtResultados
Else Else
DdlEspecialidad.DataSource = Nothing DdlCultivo.DataSource = Nothing
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
DdlEspecialidad.DataBind() DdlCultivo.DataBind()
DdlEspecialidad.Items.Insert(0, New ListItem("Todas", "-1")) DdlCultivo.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClienteSucursal.DataSource = GlobalDTClientesTodosSucursales(UsuarioActual.CveEmpresa)
DdlClienteSucursal.DataBind()
DdlClienteSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
'Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
'Else
' DdlCliente.setEsWebService(False)
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlCliente.DataBind()
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
'End If
End Sub
Private Sub CargaCultivo()
DdlCultivo.Items.Clear()
If DdlSubProyecto.GetSelectedValuesM(True) <> "" Then
DdlCultivo.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto IN ({0})", DdlSubProyecto.GetSelectedValuesM(True)))
DdlCultivo.DataBind()
Else
DdlCultivo.DataSource = Nothing
DdlCultivo.DataBind()
End If
End Sub End Sub
#End Region #End Region
Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaCultivo(DdlSubProyecto.SelectedValue.ToEntero)
CargaManifiesto(DdlSubProyecto.SelectedValue.ToEntero)
UPFiltros.Update()
End Sub
#Region " CARGA DATOS " #Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos() CargaDatos()
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjOS As New ClsOS Dim objVenas As New ClsVentas
Dim FechaI As Date = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.ToDate)
Dim FechaF As Date = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.ToDate)
Dim Cvecliente As Integer = DdlClienteSucursalCliente()
Dim CveClienteSucursal As Integer = DdlClienteSucursalSucursal()
LnkPersonalizar.Visible = False
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, If objVenas.GetPreciosVentaManifiesto(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlManifiesto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlCultivo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero, GvDatos.DataSource = objVenas.DtResultados
CveClienteSucursal:=CveClienteSucursal, CveUsuario:=UsuarioActual.CveUsuario, CveTipoVenta:=DdlTipoVenta.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjOS.DtResultados
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
LnkPersonalizar.Visible = True
End If
Else Else
GvDatos.DataSource = Nothing GvDatos.DataSource = Nothing
End If End If
objVenas.Dispose()
ObjOS.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
LnkExportar.Visible = If(GvDatos.Rows.Count > 0, True, False)
UpAcciones.Update() UpAcciones.Update()
UPDatos.Update() UPDatos.Update()
End Sub End Sub
#End Region #End Region
'Private Sub CargaClientes()
' DdlClientes.ddl.Items.Clear()
' DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
' DdlClientes.DataBind()
' DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
'End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargarSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
End Sub
#Region " GV DATOS - ROW DATABOUND " #Region " GV DATOS - ROW DATABOUND "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaCita").ToDateTime.ToString("yyyyMMddHHmm"))
If e.Row.DBCampo("CveOS") = "" Then
e.Row.CssClass = "Totales"
End If
End If
End Sub End Sub
#End Region #End Region
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click Protected Sub LnkAddPreciosVentaFecha_Click(sender As Object, e As EventArgs)
Dim SubProyecto As String = "" CargaCultivoModal(-1)
CargaPreciosVentaFecha()
CargaTamaños()
If DdlSubProyecto.SelectedValue.ToEntero > 0 Then RegistraScript("$('#DVModalGVPreciosVentaFecha').modal('show');")
SubProyecto = DdlSubProyecto.SelectedItem.Text
End If
Dim SbFiltros As New StringBuilder()
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
SbFiltros.AppendFormat("SubProyecto: {0}|", SubProyecto)
GvDatos.ExportToExcelGembox("OrdenesServicio", UsuarioActual, "Ordenes de Servicio Medicas", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
End Sub End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Private Sub CargaCultivoModal(CveSubProyecto As Integer)
End Sub
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs) DdlModalCultivo.ClearSelection()
DdlModalCultivo.SelectedValue = Nothing
DdlModalCultivo.Items.Clear()
' ChkGuardarPersonalizacion.Checked = False Dim ObjVentas As New ClsVentas
RegistraScript("$('#DivPersonalizar').modal('show')")
End Sub If ObjVentas.GetCultivos(-1, UsuarioActual.CveEmpresa) Then
DdlModalCultivo.DataSource = ObjVentas.DtResultados
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
Personaliza()
End Sub
Private Sub Personaliza()
GvDatos.Columns(13).Visible = ChkObservaciones.Checked
GvDatos.Columns(14).Visible = ChkFolioAdicional.Checked
CargaDatos()
End Sub
Private Function DdlClienteSucursalCliente() As Integer
If DdlClienteSucursal.SelectedValue = "-1" Then
Return -1
Else Else
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c) DdlModalCultivo.DataSource = Nothing
Return If(array(0).ToEntero > 0, array(0).ToEntero, -1)
End If End If
End Function
Private Function DdlClienteSucursalSucursal() As Integer ObjVentas.Dispose()
If DdlClienteSucursal.SelectedValue = "-1" Then
Return -1 DdlModalCultivo.DataBind()
DdlModalCultivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaCultivoVariedadModal(CveCultivo As Integer)
DdlModalCultivoVariedad.ClearSelection()
DdlModalCultivoVariedad.SelectedValue = Nothing
DdlModalCultivoVariedad.Items.Clear()
Dim objVentas As New ClsVentas
If objVentas.GetCultivosVariedad(CveCultivo, -1, UsuarioActual.CveEmpresa) Then
DdlModalCultivoVariedad.DataSource = objVentas.DtResultados
End If
objVentas.Dispose()
DdlModalCultivoVariedad.DataBind()
DdlModalCultivoVariedad.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaTamaños()
DdlModalTamaño.ClearSelection()
DdlModalTamaño.SelectedValue = Nothing
DdlModalTamaño.Items.Clear()
Dim objVentas As New ClsVentas
If objVentas.GetEmbarqueTamaño(-1, -1, UsuarioActual.CveEmpresa) Then
DdlModalTamaño.DataSource = objVentas.DtResultados
End If
objVentas.Dispose()
DdlModalTamaño.DataBind()
DdlModalTamaño.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Protected Sub DdlModalCultivo_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaCultivoVariedadModal(DdlModalCultivo.SelectedValue.ToEntero)
UpModalPreciosVentaFecha.Update()
End Sub
Protected Sub LnkModalBuscar_Click(sender As Object, e As EventArgs)
CargaPreciosVentaFecha()
End Sub
Private Sub CargaPreciosVentaFecha()
Dim objVentas As New ClsVentas
Dim FechaInicio As Date = If(TxtModalFechaInicio.Text.ToDate > MinFecha, TxtModalFechaInicio.Text.ToDate, MinFecha)
Dim FechaFin As Date = If(TxtModalFechaFin.Text.ToDate > MinFecha, TxtModalFechaFin.Text.ToDate, MaxFecha)
If objVentas.GetPreciosVentaFecha(FechaInicio, FechaFin, -1, -1, -1, UsuarioActual.CveEmpresa) Then
GVPrecioVentaFecha.DataSource = objVentas.DtResultados
Else Else
Dim array As String() = DdlClienteSucursal.SelectedValue.Split("|"c) GVPrecioVentaFecha.DataSource = Nothing
Return If(array(1).ToEntero > 0, array(1).ToEntero, -1)
End If End If
End Function
objVentas.Dispose()
GVPrecioVentaFecha.DataBind()
UpModalGVPreciosVentaFecha.Update()
End Sub
Protected Sub LnkModalGuardarPreciosVentaFecha_Click(sender As Object, e As EventArgs)
Dim objVentas As New ClsVentas
Dim ProcesoOC As Boolean = True
If CvePrecioVentaFecha > 0 Then
If Not objVentas.UpdatePreciosVentaFecha(CvePrecioVentaFecha, DdlModalCultivo.SelectedValue.ToEntero, DdlModalTamaño.SelectedValue.ToEntero, TxtModalDescripcion.Text.Trim, TxtModalFecha.Text.ToDate, DdlModalCultivoVariedad.SelectedValue.ToEntero,
TxtPrecioVentaFecha.Text.ToDecimal, UsuarioActual.CveEmpresa, UsuarioActual.CveEmpresa) Then
ProcesoOC = False
End If
Else
If Not objVentas.AddPreciosVentaFecha(DdlModalCultivo.SelectedValue.ToEntero, TxtModalDescripcion.Text.Trim, TxtModalFecha.Text.ToDate, DdlModalCultivoVariedad.SelectedValue.ToEntero,
DdlModalTamaño.SelectedValue.ToEntero, TxtPrecioVentaFecha.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ProcesoOC = False
End If
End If
objVentas.Dispose()
If ProcesoOC Then
CargaPreciosVentaFecha()
Alert("Precio Guardado correctamente.")
End If
End Sub
Protected Sub LnkEditarPrecioVentaFecha_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim ProcesoOK As Boolean = True
CvePrecioVentaFecha = GvRow.DataKey("CvePrecioVentaFecha").ToEntero
DdlModalCultivo.SelectedValueExist(GvRow.DataKey("CveCultivo"))
CargaCultivoVariedadModal(DdlModalCultivo.SelectedValue.ToEntero)
DdlModalTamaño.SelectedValueExist(GvRow.DataKey("CveTamaño"))
TxtModalDescripcion.Text = GvRow.DataKey("Descripcion")
TxtModalFecha.Text = GvRow.DataKey("Fecha").ToDate.ToString("dd/MM/yyyy")
DdlModalCultivoVariedad.SelectedValueExist(GvRow.DataKey("CveCultivoVariedad"))
'If ProcesoOK Then
' CargaPreciosVentaFecha()
'End If
UpModalPreciosVentaFecha.Update()
RegistraScript("$('#DVModalPreciosVentaFecha').modal('show');")
End Sub
Protected Sub LnkEliminarPrecioVentaFecha_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim ProcesoOK As Boolean = True
Dim CvePrecioVentaFechaElimianr As Integer = GvRow.DataKey("CvePrecioVentaFecha").ToEntero
Dim objVentas As New ClsVentas
If Not objVentas.DeletePreciosVentaFecha(CvePrecioVentaFechaElimianr, UsuarioActual.CveEmpresa) Then
ProcesoOK = False
End If
objVentas.Dispose()
If ProcesoOK Then
CargaPreciosVentaFecha()
UpModalPreciosVentaFecha.Update()
RegistraScript("$('#DVModalPreciosVentaFecha').modal('hide');")
Alert("Precio eliminado correctamente.")
End If
End Sub
Protected Sub LnkModalMuestraAdd_Click(sender As Object, e As EventArgs)
CvePrecioVentaFecha = -1
DdlModalCultivo.SelectedValueExist(-1)
DdlModalTamaño.SelectedValueExist(-1)
TxtModalDescripcion.Text = ""
TxtModalFecha.Text = ""
DdlModalCultivoVariedad.SelectedValueExist(-1)
UpModalPreciosVentaFecha.Update()
RegistraScript("$('#DVModalPreciosVentaFecha').modal('show');")
End Sub
End Class End Class

View File

@@ -3,6 +3,7 @@ Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports System.Runtime.CompilerServices
Imports Extensiones Imports Extensiones
Imports Profact.TimbraCFDI40 Imports Profact.TimbraCFDI40
@@ -7715,6 +7716,181 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetPreciosVentaManifiesto(FechaInicio As Date, FechaFin As Date, CveEmbarqueManifiesto As Integer, CveSubProyecto As Integer, CveCultivo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaManifiestoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveEmbarqueManifiesto", SqlDbType.Int).Value = CveEmbarqueManifiesto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los indicadores de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddPreciosVentaFecha(CveCultivo As Integer, Descripcion As String, Fecha As Date, CveCultivoVariedad As Integer, CveTamaño As Integer, PrecioVenta As Decimal, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaFechaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
.Add("@PrecioVenta", SqlDbType.Money).Value = PrecioVenta
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdatePreciosVentaFecha(CvePrecioVentaFecha As Integer, CveCultivo As Integer, CveTamaño As Integer, Descripcion As String, Fecha As Date, CveCultivoVariedad As Integer, PrecioVenta As Decimal, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaFechaUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrecioVentaFecha", SqlDbType.Int).Value = CvePrecioVentaFecha
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
.Add("@PrecioVenta", SqlDbType.Money).Value = PrecioVenta
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetPreciosVentaFecha(FechaInicio As Date, FechaFin As Date, CvePrecioVentaFecha As Integer, CveCultivo As Integer, CveCultivoVariedad As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaFechaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CvePrecioVentaFecha", SqlDbType.Int).Value = CvePrecioVentaFecha
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function DeletePreciosVentaFecha(CvePrecioVentaFecha As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_PreciosVentaFechaDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrecioVentaFecha", SqlDbType.Int).Value = CvePrecioVentaFecha
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetCultivos(CveCultivo As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AgroCultivoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@cveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los cultivos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetCultivosVariedad(CveCultivo As Integer, cveCultivosVariedad As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_CultivosVariedadGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo
.Add("@cveCultivosVariedad", SqlDbType.Int).Value = cveCultivosVariedad
.Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los precios del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetEmbarqueTamaño(CveTamaño As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Agro_Embarque_TamañoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los tamaños del día.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region "IDisposable Support" #Region "IDisposable Support"

View File

@@ -15627,7 +15627,7 @@ Partial Class Compras_Compras
Amortizacion = TmpDT.SUMD("ImporteSinImpuestos") Amortizacion = TmpDT.SUMD("ImporteSinImpuestos")
End If End If
Dim SubTotalCompra As Decimal = Amortizacion Dim SubTotalCompra As Decimal = Amortizacion
Dim DiferenciaPermitida As Decimal = 1 Dim DiferenciaPermitida As Decimal = 5
Dim Cont As Integer = 0 Dim Cont As Integer = 0
'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") 'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
For Each gvr As GridViewRow In GvOC1.Rows For Each gvr As GridViewRow In GvOC1.Rows