Files
SIG/Ventas/RepRemisiones.aspx

400 lines
24 KiB
Plaintext

<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepRemisiones.aspx.vb" Inherits="RepRemisiones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblTitulo" runat="server" Text="Reporte de Remisiones por Facturar"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server" defaultbutton="BtnConsultar">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1">Sucursal: </label>
<div class="col-md-2">
<asp:ListBox ID="DdlSubProyectos" SelectionMode="Multiple" data-text="Todas" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
<%--<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlSubProyectos" DataTextField="SubProyecto" DataValueField="CveSubProyecto" runat="server"></asp:DropDownList>--%>
</div>
<label class="col-md-1">Cliente: </label>
<div class="col-md-2">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;" selectedindexchange="DdlClientes_SelectedIndexChanged" >
</ADS:Dropdownlost>
</div>
<label class="col-md-1 ">Vendedor:</label>
<div class="col-md-2">
<asp:ListBox ID="DdlVendedor" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
<%-- <asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>--%>
</div>
</div>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<label class="col-md-1 truncate">F.I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></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>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate">F.F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 ">F. Venc. al:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaVencimiento" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioV" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaVencimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaVencimiento" PopupButtonID="imgCalendarioV" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaVencimiento" runat="server" ControlToValidate="TxtFechaVencimiento" Display="None" ErrorMessage="El campo <b>''Fecha Vencimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVOFechaVencimiento" runat="server" ControlToValidate="TxtFechaVencimiento" Display="None" ErrorMessage="El campo <b>''Fecha Vencimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaVencimiento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CVOFechaVencimiento" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-2" runat="server" id="divVerInv">
<asp:CheckBox ID="chkInv" Checked="false" runat="server" Text="Ver Inventario"></asp:CheckBox>
<%--<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlSubProyectos" DataTextField="SubProyecto" DataValueField="CveSubProyecto" runat="server"></asp:DropDownList>--%>
</div>
<label class="col-md-1">Contrato: </label>
<div class="col-md-2">
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlContrato" DataTextField="ContratoCompleto" DataValueField="CveContrato" runat="server">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row">
<div align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ninguna remisión pendiente por facturar" DataKeyNames="CveVenta"
ToolTip="Remisiones sin Facturar"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true" GridLines="None">
<Columns>
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField ="Folio" DataNavigateUrlFormatString="/Ventas/RepRemisionesDetalle.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" Target="_blank" />
<asp:HyperLinkField HeaderText="Fecha" ItemStyle-Width="100px" DataTextField ="Fecha" DataTextFormatString="{0:d}" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
<asp:BoundField HeaderText="Vencimiento" DataField="FechaVencimiento" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Cliente" DataField="Cliente" />
<asp:BoundField HeaderText="Contrato" DataField="TieneContrato" Visible="false" />
<asp:BoundField HeaderText="Médico" DataField="Medico" Visible="false" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
<asp:BoundField HeaderText="Folio Rem" DataField="Alfa1" Visible="false" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
<asp:BoundField DataField="PorcentajeAvance" HeaderText="Facturado" DataFormatString="{0:F}%" HtmlEncode="false" />
<asp:BoundField DataField="SubTotal" HeaderText="SubTotal" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Descuento" HeaderText="Descuento" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="IVA" HeaderText="IVA" DataFormatString="{0:N2}" Visible="false" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="10%" >
<HeaderTemplate>
<asp:Label Text="Total" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") & " " & Eval("Abreviatura").ToString %>'></asp:Literal>
<%--<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>--%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ImporteInventario" HeaderText="Inventario" DataFormatString="{0:N2} MXN" Visible="false" ItemStyle-HorizontalAlign="Right" />
</Columns>
<HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover Widthall">
<tbody>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkUsuarioCancelacion" runat="server" Text="Usuario Cancelación" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTipo" runat="server" Text="Cargo/Abono" /></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<%--<script type="text/javascript">
function Scroll() {
$(document).ready(function () {
var Tam = TamañoVentana();
var Alto = Tam.height - 300;
$('#<%=GvDatos.ClientID%>').gridviewScroll({
width: 995,
height: Alto
});
});
}
</script>--%>
<script type="text/javascript">
function GetSelectedRow(lnk, txtf, txtoi) {
//var row = lnk.parentNode.parentNode;
//var txtoi = row.cells[10].getElementsByTagName("input")[1];
if (lnk.checked) {
debugger;
if (txtf) { txtf.style.display = ""; }
if (txtoi) { txtoi.style.display = ""; }
// try {
// row.cells[10].getElementsByTagName("input")[0].style.display = "";
// if (txtoi) { txtoi.style.display = ""; }
// }
// catch (err) {
// row = row.parentNode;
// row.cells[10].getElementsByTagName("input")[0].style.display = "";
// }
} else {
if (txtf) { txtf.style.display = "none"; }
if (txtoi) { txtoi.style.display = "none"; }
// try {
// row.cells[10].getElementsByTagName("input")[0].style.display = "none";
// }
// catch (err) {
// row = row.parentNode;
// row.cells[10].getElementsByTagName("input")[0].style.display = "none";
// }
}
return false;
}
function FechaGeneral(lnk, FechaDocumento) {
debugger;
var row = lnk.parentNode.parentNode;
var parts = FechaDocumento.split("/");
var F1 = new Date(parts[2], parts[1], parts[0]);
if (lnk.checked) {
try {
parts = $get("TxtFechaAplicadoHeader").value.split("/");
var F2 = new Date(parts[2], parts[1], parts[0]);
if (F1 < F2) {
row.cells[10].getElementsByTagName("input")[0].value = $get("TxtFechaAplicadoHeader").value;
} else {
row.cells[10].getElementsByTagName("input")[0].value = FechaDocumento;
}
}
catch (err) {
row = row.parentNode;
row.cells[10].getElementsByTagName("input")[0].value = $get("TxtFechaAplicadoHeader").value;
}
}
return false;
}
</script>
<script type="text/javascript">
function OnClientShown(sender, args) {
sender._popupBehavior._element.style.zIndex = 10005;
sender._popupBehavior._element.style.position = "absolute";
sender._popupBehavior._element.style.top = "0px";
document.getElementById("C_GvDatosPanelItem").style.overflow = "initial";
}
</script>
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
//function OrdenarGV() {
// var Tam = TamañoVentana();
// var Alto = Tam.height - 270;
// if (Alto < 100) {
// Alto = 100;
// }
// $('#C_GvDatos').DataTable({
// scrollY: Alto + 'px',
// scrollCollapse: true,
// paging: false,
// searching: false,
// info: false
// });
// $('#C_GvDatos').parent().parent().children().first().css("position", "static");
//}
</script>
</asp:Content>