Commit inicial Ventas Productivo
This commit is contained in:
423
Ventas/ActualizarPrecios.aspx
Normal file
423
Ventas/ActualizarPrecios.aspx
Normal file
@@ -0,0 +1,423 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ActualizarPrecios.aspx.vb" Inherits="Ventas_ActualizarPrecios" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Actualizar Precios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="True" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Importar Listado</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpEncabezado" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" ValidationGroup="GrpConsultar" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row v-center">
|
||||
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DdlPrecioLista" runat="server" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">Clasificación:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DDlClasificacion" runat="server" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DDlClasificacion_SelectedIndexChanged" AutoPostBack="True" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">PS:</label>
|
||||
<div class="col-md-2 v-center">
|
||||
<ADS:Dropdownlost ID="DDlPs" AutoPostBack="false" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width:200px;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate">Marca:</label>
|
||||
<asp:DropDownList ID="DdlMarca" CssClass="form-control input-sm select2me" runat="server" Visible="false" DataTextField="Marca" DataValueField="CveMarca" Width="206px" Height="22px">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row v-center">
|
||||
<label class="col-md-1 v-center" id="LblProveedorCompra" runat="server" visible="false">Proveedor:</label>
|
||||
<div class="col-md-1 v-center" id="DivProveedorCompra" runat="server" visible="false">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlProveedor" Width="100%" data-metodo="getproveedores" runat="server" DataTextField="RazonSocial" DataValueField="CveProveedor" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">Estado:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DdlEstado" runat="server" Width="100%" CssClass="select2me">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
<asp:ListItem Value="1" Selected="True">Activos</asp:ListItem>
|
||||
<asp:ListItem Value="0">Incativos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UPPrecioLista">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light smmallpadding traspasorow bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Actualizar Precio de Lista</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:RadioButtonList AutoPostBack="true" OnSelectedIndexChanged="RblTipo_SelectedIndexChanged" RepeatDirection="Horizontal" ID="RblTipo" runat="server">
|
||||
<asp:ListItem Selected="true" Value="Imp" Text="Importe Fijo" />
|
||||
<asp:ListItem Value="Por" Text="Porcentaje" />
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div runat="Server" id="ImporteFijo" class="form-group form-md-line-input input-iconright" style="width: 50%">
|
||||
<asp:TextBox ID="TxtImporte" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtImporte" FilterType="Numbers, Custom" ValidChars="." />
|
||||
<label for="<%= TxtImporte.ClientID.ToString()%>">Importe Nuevo:</label>
|
||||
<i>$</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<a class="btn btn-default" onclick="CambiaImporte();">Aplicar Importe</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div runat="Server" id="Div1" class="form-group form-md-line-input input-iconright" style="width: 50%">
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtPrecio" FilterType="Numbers, Custom" ValidChars="." />
|
||||
<label for="<%= TxtPrecio.ClientID.ToString()%>">Precio Min.:</label>
|
||||
<i>$</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<a class="btn btn-default" onclick="CambiaPrecio();">Aplicar Precio Min.</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 50%">
|
||||
<asp:TextBox ID="TxtPorcentaje" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBSerie" runat="server" TargetControlID="TxtPorcentaje" FilterType="Numbers, Custom" ValidChars=".,-" />
|
||||
<label for="<%= TxtPorcentaje.ClientID.ToString()%>">Porcentaje Nuevo:</label>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<asp:LinkButton ID="BtnGuardar" runat="server" AlternateText="Actualizar" CausesValidation="True" CssClass="btn btn-primary" Text="Actualizar Seleccionadas" ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div runat="server" visible="false" id="dvDatos">
|
||||
<div align="right">
|
||||
<input type="text" id="TxtBuscar" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,Porcentaje,CodigoPS"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros" ToolTip="Listado de Nombres">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkPS" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Codigo" ItemStyle-Width="10%" HeaderText="Código" />
|
||||
<asp:BoundField DataField="PS" ItemStyle-Width="30%" HeaderText="Producto/Servicio" />
|
||||
<asp:BoundField DataField="Clasificacion" ItemStyle-Width="15%" HeaderText="Clasificación" />
|
||||
<asp:BoundField DataField="PrecioLista" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecio" FilterType="Numbers,Custom" ValidChars="." />
|
||||
<asp:RegularExpressionValidator ID="REVTxtPrecio" runat="server" ControlToValidate="TxtPrecio" Display="None" EnableClientScript="True" ErrorMessage="El campo <b>''PrecioLista''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationGroup="GrpGuardar" ValidationExpression="^[0-9]{1,15}(?:\.[0-9]{1,4})?$" />
|
||||
<ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Precio Mínimo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkPrecioMinActual" OnClick="LnkPrecioMinActual_Click" runat="server" Text='<%# If(Eval("PrecioMinimo").ToString.Length = 0, "N/A", Eval("PrecioMinimo", "{0:N2}")) %>'></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecioMinimo" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." />
|
||||
<asp:RegularExpressionValidator ID="REVTxtPrecioMinimo" runat="server" ControlToValidate="TxtPrecioMinimo" Display="None" EnableClientScript="True" ErrorMessage="El campo <b>''PrecioLista''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationGroup="GrpGuardar" ValidationExpression="^[0-9]{1,15}(?:\.[0-9]{1,4})?$" />
|
||||
<ajax:ValidatorCalloutExtender ID="VCTxtPrecioMinimo" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecioMinimo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Moneda" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="VentaMinima" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="E. Mínimo" ItemStyle-HorizontalAlign="right" />
|
||||
|
||||
|
||||
<asp:BoundField DataField="ImporteAnterior" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe Anterior" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Fecha Modificación" />
|
||||
<asp:BoundField DataField="UsuarioModifico" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Usuario Modificó" />
|
||||
<asp:BoundField DataField="Porcentaje" NullDisplayText="N/A" ItemStyle-Width="10%" DataFormatString="%{0}" HeaderText="Porcentaje" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Fecha Ingreso" />
|
||||
<asp:BoundField DataField="Usuario" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="10%" HeaderText="Usuario Ingresó" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="ModalActualizaPrecios" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:UpdatePanel ID="UpModalTitulo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Literal ID="LtlModalTitleUpModalTitulo" runat="server">Codigo </asp:Literal>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalActualizaPrecios" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-4" style="text-align: left">
|
||||
<input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" />Seleccionar Todos
|
||||
</div>
|
||||
<div class="col-md-8" style="text-align: right">
|
||||
<label>Aplicar precio mínimo</label>
|
||||
<asp:TextBox ID="TxtAplicarPrecio" runat="server" Width="60px" MaxLength="39"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtAplicarPrecio" TargetControlID="TxtAplicarPrecio" runat="server" FilterType="Numbers,Custom" ValidChars="." InvalidChars="-+" />
|
||||
<a id="lnkAplicarPrecioSucursales" runat="server" class="btn btn-default" onclick="CambiaPrecioModal();">Aplicar</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="gvSucursal" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSubProyecto" EmptyDataText="No se encontraron Sucursales" ToolTip="Listado de Sucursales habilitadas para Productos o Servicios"
|
||||
CssClass="table table-striped table-smallpadding table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chkSucursal" runat="server" Checked='<%# Eval("Activo") %>' CssClass="CsMCheckGvSucursal" />
|
||||
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sucursal">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Precio Mínimo">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecioMinimo" Style="text-align: right" runat="server" CausesValidation="true" MaxLength="39" Text='<%# Eval("PrecioMinimo", "{0:N2}")%>' ValidationGroup="GrpEditGuardarO" Width="90px" CssClass="CssMCamviaPrecio"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtPrecioMinimo" runat="server" ControlToValidate="TxtPrecioMinimo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOTxtPrecioMinimo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtPrecioMinimo" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtPrecioMinimo" runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." InvalidChars=",-+" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Mínimo" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtMinimo" Style="text-align: right" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Minimo") %>' ValidationGroup="GrpEditGuardarO" Width="100px"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Máximo" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtMaximo" Style="text-align: right" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Maximo")%>' ValidationGroup="GrpEditGuardarO" Width="100px"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalBotonesCodigos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:LinkButton ID="LnkModalGuardarPreciosMinimos" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="LnkModalGuardarPreciosMinimos_Click"></asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--CARGA EXCEL--%>
|
||||
<div id="DivCargaExcel" class="modal ADS 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">×</button>
|
||||
<h4 class="modal-title">Agregar Excel</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row v-center">
|
||||
<div class="col-md-6 v-center">
|
||||
<label class="col-md-6 v-center truncate">Precio de Lista:</label>
|
||||
<div class="col-md-6 v-center">
|
||||
<asp:DropDownList ID="DdlPrecioListaCarga" runat="server" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPrecioListaCarga" runat="server" ControlToValidate="DdlPrecioListaCarga" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio Lista''</b> es necesario, por favor selecionarlo." ValidationGroup="GrpCargarExcel"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEPrecioListaCarga" runat="server" HighlightCssClass="vco" TargetControlID="RFVPrecioListaCarga" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3>Arraste o haga click para subir el archivo Excel</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px;">
|
||||
<asp:TextBox ID="TxtExcel" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-2" style="text-align: left">
|
||||
<asp:UpdatePanel ID="UpDescargar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnDescargarFormato" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnDescargarFormato" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="col-md-10" style="text-align: right">
|
||||
<asp:Button ID="BtnCargaExcel" runat="server" CssClass="btn btn-success" Text="Aceptar" ValidationGroup="GrpCargarExcel"></asp:Button>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
function CambiaImporte() {
|
||||
var topLevelElem = document.getElementById("form1");
|
||||
var checks = topLevelElem.getElementsByTagName("input");
|
||||
var idd = '';
|
||||
|
||||
var valor = $('#<%= TxtImporte.ClientID %>').val();
|
||||
|
||||
for (var i = 0; i < checks.length; i++) {
|
||||
if (checks[i].type == "checkbox") {
|
||||
debugger;
|
||||
|
||||
if (checks[i].checked) {
|
||||
idd = checks[i].id.replace('C_GVPrecios_chkPS_', '')
|
||||
if ($get('C_GVPrecios_TxtPrecio_' + idd) != null) {
|
||||
$get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CambiaPrecio() {
|
||||
var topLevelElem = document.getElementById("form1");
|
||||
var checks = topLevelElem.getElementsByTagName("input");
|
||||
var idd = '';
|
||||
|
||||
var valor = $('#<%= TxtPrecio.ClientID %>').val();
|
||||
|
||||
//if (!isNaN(valor) && valor.length > 0) {
|
||||
// $('.CssCamviaPrecio').val(valor);
|
||||
//}
|
||||
|
||||
for (var i = 0; i < checks.length; i++) {
|
||||
if (checks[i].type == "checkbox") {
|
||||
debugger;
|
||||
|
||||
if (checks[i].checked) {
|
||||
idd = checks[i].id.replace('C_GVPrecios_chkPS_', '')
|
||||
if ($get('C_GVPrecios_TxtPrecioMinimo_' + idd) != null) {
|
||||
$get('C_GVPrecios_TxtPrecioMinimo_' + idd).value = FormatoNumero(ToDouble(valor), 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CambiaPrecioModal() {
|
||||
|
||||
var ChecksGv = $('.CsMCheckGvSucursal').find('input[type=checkbox]');
|
||||
|
||||
var valor = $('#<%= TxtAplicarPrecio.ClientID %>').val();
|
||||
if (!isNaN(valor) && valor.length > 0) {
|
||||
$(".CssMCamviaPrecio").each(function (index) {
|
||||
if ($($(ChecksGv).get(index)).attr('checked')) {
|
||||
|
||||
$(this).val(valor);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function SeleccionarTodosChkGvSucursa() {
|
||||
if ($('#ChkSeleccionarTodos').attr('checked')) {
|
||||
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', true);
|
||||
} else {
|
||||
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
474
Ventas/ActualizarPrecios.aspx.vb
Normal file
474
Ventas/ActualizarPrecios.aspx.vb
Normal file
@@ -0,0 +1,474 @@
|
||||
|
||||
Option Explicit On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class Ventas_ActualizarPrecios
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtSubProyectos As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtSubProyectos")), Nothing, CType(ViewState("DtSubProyectos"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSubProyectos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveSucursal As Integer
|
||||
Get
|
||||
If ViewState("CveSucursal") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveSucursal").ToString.ToEntero
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSucursal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CvePS As Integer
|
||||
Get
|
||||
If ViewState("CvePS") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CvePS").ToString.ToEntero
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property PS As String
|
||||
Get
|
||||
If ViewState("PS") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("PS").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("PS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaCombos()
|
||||
End If
|
||||
End Sub
|
||||
Public Sub CargaCombos()
|
||||
CargaDDlClasif()
|
||||
CargaPS()
|
||||
CargaPreciosLista()
|
||||
CargaProveedores()
|
||||
CargarMarcas()
|
||||
End Sub
|
||||
Public Sub CargaDDlClasif()
|
||||
DDlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DDlClasificacion.DataBind()
|
||||
DDlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub CargaPreciosLista()
|
||||
Dim ObjVta As New ClsVentas
|
||||
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
|
||||
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
|
||||
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
|
||||
DdlPrecioLista.DataBind()
|
||||
DdlPrecioListaCarga.DataBind()
|
||||
|
||||
DdlPrecioListaCarga.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub CargaPS()
|
||||
'FUNCIONALIDAD 105
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DDlPs.setEsWebService(True)
|
||||
Else
|
||||
DDlPs.setEsWebService(False)
|
||||
|
||||
'FUNCIONALIDAD DE COMPUESTO
|
||||
If UsuarioActual.Empresa.Funcionalidad(143) = "1" Then
|
||||
DDlPs.ddl.DataTextField = "PSCodigoCompuesto"
|
||||
End If
|
||||
|
||||
DDlPs.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DDlPs.DataBind()
|
||||
|
||||
DDlPs.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaProveedores()
|
||||
If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then
|
||||
DdlProveedor.setEsWebService(True)
|
||||
DivProveedorCompra.Visible = True
|
||||
LblProveedorCompra.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub CargarMarcas()
|
||||
If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarca.DataSource = ObjMarcas.DtResultados
|
||||
End If
|
||||
ObjMarcas.Dispose()
|
||||
DdlMarca.DataBind()
|
||||
|
||||
LblMarca.Visible = True
|
||||
DdlMarca.Visible = True
|
||||
End If
|
||||
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
Dim objPS As New ClsProductosServicios
|
||||
Dim CveProveedor As Integer = -1
|
||||
Dim CvePS As Integer = -1
|
||||
|
||||
If DDlPs.SelectedValue.ToEntero > 0 Then
|
||||
CvePS = DDlPs.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
If DdlProveedor.txtValue.Value.ToEntero > 0 Then
|
||||
CveProveedor = DdlProveedor.txtValue.Value.ToEntero
|
||||
End If
|
||||
|
||||
If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS,
|
||||
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, CveMarca:=DdlMarca.SelectedValue.ToEntero()) Then
|
||||
GVPrecios.DataSource = objPS.DtResultados
|
||||
End If
|
||||
objPS.Dispose()
|
||||
dvDatos.Visible = True
|
||||
GVPrecios.DataBind()
|
||||
|
||||
UpDescargar.Update()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub DDlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaPS()
|
||||
UpEncabezado.Update()
|
||||
End Sub
|
||||
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If RblTipo.SelectedValue = "Imp" Then
|
||||
ImporteFijo.Visible = True
|
||||
Else
|
||||
ImporteFijo.Visible = False
|
||||
End If
|
||||
UPPrecioLista.Update()
|
||||
End Sub
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
If RblTipo.SelectedIndex = 1 And TxtPorcentaje.Text.ToDecimal = 0 Then
|
||||
Alert("Se debe de especificar un porcentaje.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim Correcto As Boolean = False
|
||||
|
||||
'Dim Importe As Decimal = If(TxtImporte.Text = "", -1, TxtImporte.Text.ToDecimal)
|
||||
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
|
||||
For Each row As GridViewRow In GVPrecios.Rows
|
||||
|
||||
If row.FCCheckBox("chkPS").Checked Then
|
||||
Correcto = ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
|
||||
If Not Correcto Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Correcto Then
|
||||
Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente")
|
||||
End If
|
||||
|
||||
|
||||
ObjPS.Dispose()
|
||||
BtnConsultar_Click(Nothing, Nothing)
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
TxtImporte.Text = ""
|
||||
TxtPrecio.Text = ""
|
||||
TxtPorcentaje.Text = ""
|
||||
End Sub
|
||||
|
||||
#Region "MODAL PRECIOS MINIMOS"
|
||||
Public Sub LnkPrecioMinActual_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
CvePS = GvRow.DataKey("CvePS").ToEntero
|
||||
PS = GvRow.DataKey("PS").ToString
|
||||
|
||||
TxtAplicarPrecio.Text = ""
|
||||
|
||||
CargaDatosModalPreciosMinimos()
|
||||
|
||||
RegistraScript("$('#ModalActualizaPrecios').modal({ backdrop: 'static', keyboard: false}); $('#ChkSeleccionarTodos').find('input[type=checkbox]').prop('checked', false);")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkModalGuardarPreciosMinimos_Click(sender As Object, e As EventArgs)
|
||||
ProcesaPreciosSucursales()
|
||||
CargaDatosModalPreciosMinimos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatosModalPreciosMinimos()
|
||||
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSSucursales(CvePS, UsuarioActual.CveEmpresa) Then
|
||||
gvSucursal.DataSource = ObjPS.DtResultados
|
||||
End If
|
||||
|
||||
ObjPS.Dispose()
|
||||
gvSucursal.DataBind()
|
||||
LtlModalTitleUpModalTitulo.Text = PS
|
||||
UpModalActualizaPrecios.Update()
|
||||
UpModalTitulo.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ProcesaPreciosSucursales()
|
||||
|
||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||
|
||||
For i As Integer = 0 To gvSucursal.Rows.Count - 1
|
||||
|
||||
If gvSucursal.Rows(i).FCCheckBox("chkSucursal").Checked Then
|
||||
|
||||
If gvSucursal.Rows(i).FCHiddenField("hdnEnBD").Value.ToEntero = 1 Then
|
||||
ObjProductosServicios.UpdatePSSucursales(CvePS, -1, gvSucursal.Rows(i).FCTextBox("TxtMinimo").Text.ToDouble, -1, UsuarioActual.CveUsuario, gvSucursal.Rows(i).DataKey("CveSubProyecto").ToEntero, PrecioMinimo:=gvSucursal.Rows(i).FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
|
||||
Else
|
||||
ObjProductosServicios.AddPSSucursales(CvePS, Nothing, gvSucursal.Rows(i).FCTextBox("TxtMinimo").Text.ToDouble, -1, UsuarioActual.CveUsuario, gvSucursal.Rows(i).DataKey("CveSubProyecto").ToEntero, PrecioMinimo:=gvSucursal.Rows(i).FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
ObjProductosServicios.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "C A R G A R E X C E L "
|
||||
Private Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs) Handles BtnDescargarFormato.Click
|
||||
|
||||
Dim DtExcel As DataTable = (From row As GridViewRow In GVPrecios.Rows
|
||||
Where row.RowType = DataControlRowType.DataRow
|
||||
Select New With
|
||||
{
|
||||
.Codigo = row.DataKey("Codigo"),
|
||||
.PS = row.DataKey("PS"),
|
||||
.Precio = row.FCTextBox("TxtPrecio").Text.ToDecimal()
|
||||
}).QueryToDataTable(True)
|
||||
If DtExcel.Rows.Count < 2 Then
|
||||
Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
DtExcel.TableName = DdlPrecioLista.SelectedItem.Text
|
||||
DtExcel.Columns("Codigo").ColumnName = "Código"
|
||||
DtExcel.Columns("PS").ColumnName = "Producto / Servicio"
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
|
||||
Dim FileExcel As New ExcelFile()
|
||||
|
||||
Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName)
|
||||
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
||||
{
|
||||
.ColumnHeaders = True,
|
||||
.StartRow = 0,
|
||||
.StartColumn = 0
|
||||
})
|
||||
worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
||||
|
||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||
For i = 0 To columnCount
|
||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||
Next
|
||||
|
||||
'worksheet.Cells.Style.Locked = False
|
||||
'worksheet.Cells.Style.FormulaHidden = False
|
||||
|
||||
'worksheet.Columns(0).Cells.Style.Locked = True
|
||||
|
||||
'worksheet.Protected = True
|
||||
|
||||
'Dim protectionSettings = worksheet.ProtectionSettings
|
||||
'protectionSettings.AllowDeletingColumns = False
|
||||
'protectionSettings.AllowDeletingRows = True
|
||||
'protectionSettings.AllowEditingObjects = True
|
||||
'protectionSettings.AllowEditingScenarios = True
|
||||
'protectionSettings.AllowFormattingCells = True
|
||||
'protectionSettings.AllowFormattingColumns = True
|
||||
'protectionSettings.AllowFormattingRows = True
|
||||
'protectionSettings.AllowInsertingColumns = False
|
||||
'protectionSettings.AllowInsertingRows = True
|
||||
'protectionSettings.AllowSelectingLockedCells = True
|
||||
'protectionSettings.AllowSelectingUnlockedCells = True
|
||||
'protectionSettings.AllowSelectingUnlockedCells = True
|
||||
'protectionSettings.AllowSorting = True
|
||||
'protectionSettings.AllowUsingAutoFilter = True
|
||||
'protectionSettings.AllowUsingPivotTableReports = True
|
||||
'protectionSettings.SetPassword(ModExtensiones.IMEI)
|
||||
|
||||
FileExcel.Save(Response, "Precios.xlsx", SaveOptions.XlsxDefault)
|
||||
|
||||
End Sub
|
||||
Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
||||
|
||||
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
||||
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
|
||||
CargarArchivo(Directorio, file.filename)
|
||||
Else
|
||||
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargarArchivo(Ruta As String, FileName As String)
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim Tipo As String = "EXCEL"
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
|
||||
Try
|
||||
dt = ReadExcelFile(Ruta + FileName, True)
|
||||
Catch ex As Exception
|
||||
ErrorArchivo = True
|
||||
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
End Try
|
||||
If Not ErrorArchivo AndAlso dt IsNot Nothing Then
|
||||
|
||||
If DdlPrecioListaCarga.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(0).ColumnName = "Código" Then
|
||||
Alert("El nombre de la tercera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(1).ColumnName = "Producto / Servicio" Then
|
||||
Alert("El nombre de la cuarta columna debe ser 'Producto / Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not dt.Columns(2).ColumnName = "Precio" Then
|
||||
Alert("El nombre de la sexta columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
dt.TableName = "Datos"
|
||||
Dim ProductosNoCargados As New StringBuilder()
|
||||
Dim RowsCargados As Integer = 0
|
||||
Dim RowsNoCargados As Integer = 0
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
'ObjPS.IniciaTransacSQL()
|
||||
Try
|
||||
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim Correcto As Boolean = False
|
||||
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa))
|
||||
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
|
||||
|
||||
If CvePS > 0 AndAlso CvePrecioLista > 0 Then
|
||||
Dim Porcentaje As Decimal = -1
|
||||
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
|
||||
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
End If
|
||||
Else
|
||||
Correcto = False
|
||||
End If
|
||||
If Not Correcto Then
|
||||
ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString())
|
||||
RowsNoCargados += 1
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar los precios.", ex)
|
||||
Finally
|
||||
|
||||
Dim MensajeFinal As New StringBuilder()
|
||||
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Los precios de los Productos/Servicios se cargaron correctamente. <br/><br/>")
|
||||
End If
|
||||
If RowsCargados > 0 Then
|
||||
MensajeFinal.Append("Se actualizaron <b>" & RowsCargados & "</b> Productos o Servicios correctamente.")
|
||||
End If
|
||||
If RowsNoCargados > 0 Then
|
||||
MensajeFinal.Append("No se pudieron actualizar <b>" & RowsNoCargados & "</b> Productos/Servicios. <br/>Los siguientes Productos o Servicios no se pudieron actualizar: " & ProductosNoCargados.ToString())
|
||||
End If
|
||||
|
||||
Alert(MensajeFinal.ToString())
|
||||
ObjPS.Dispose()
|
||||
End Try
|
||||
|
||||
'If RowNoEncontrados.Length > 0 Then
|
||||
' Alert("Los siguientes Productos o Servicios no se encontraron en la Base de Datos.<\BR>" & RowNoEncontrados, TipoMensaje.MsgAdvertencia)
|
||||
'Else
|
||||
' Alert("Se Cargaron " & NumRow & " Productos o Servicios correctamente.")
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
Dim columns As String()
|
||||
Dim curRow As Integer = 0
|
||||
Dim curCol As Integer = 0
|
||||
Dim dataTable As DataTable = New DataTable()
|
||||
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||
|
||||
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||
|
||||
If firstRowHasHeaders Then
|
||||
|
||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||
Else
|
||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||
End If
|
||||
|
||||
curRow = 1
|
||||
Else
|
||||
dataTable.Columns.Add("Column " & (cols + 1))
|
||||
End If
|
||||
Next
|
||||
|
||||
While curRow < worksheet.Rows.Count
|
||||
columns = New String(cols - 1) {}
|
||||
|
||||
For curCol = 0 To cols - 1
|
||||
|
||||
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||
columns(curCol) = ""
|
||||
Else
|
||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||
End If
|
||||
Next
|
||||
|
||||
dataTable.Rows.Add(columns)
|
||||
curRow += 1
|
||||
End While
|
||||
|
||||
Return dataTable
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
214
Ventas/AuxiliarCliente.aspx
Normal file
214
Ventas/AuxiliarCliente.aspx
Normal file
@@ -0,0 +1,214 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="AuxiliarCliente.aspx.vb" Inherits="Ventas_AuxiliarCliente" %>
|
||||
|
||||
<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;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<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">
|
||||
Auxiliar Clientes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltro" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT portletfiltrostitlee">
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel runat="server" style="display: inline-block;">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Buscar" class="btn btn-primary" OnClick="BtnConsultar_Click" ValidationGroup="Valida" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Cliente</label>
|
||||
<div class="col-md-5">
|
||||
<ADS:Dropdownlost ID="DdlClientes" CssClassDdl="select2me" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="NombreComercial" DataValueField="CveCliente"></ADS:Dropdownlost>
|
||||
</div>
|
||||
|
||||
|
||||
<%-- <div class="col-md-1">Conceptos:</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlConceptosContables" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" >
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div> --%>
|
||||
<label class="col-md-1 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
<label class="col-md-1 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Opción:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlOpcion" runat="server" Width="100%" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Text="Detallado" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Text="Agrupado por Venta" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-md-12" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvAuxCliente.ClientID) %>" style="display: inline-block;margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", "tablita") %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info" ><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<div class=" col-md-12">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvAuxCliente" runat="server" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" BorderColor="#D3D3D3" BorderWidth="1" GridLines="none"
|
||||
AutoGenerateColumns="False" EmptyDataText="No se encontraron resultados" OnRowDataBound="GvAuxCliente_RowDataBound">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Cliente" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblCliente" Text='<%# Eval("Nombre") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblFecha" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Concepto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblConceptoContable" Text='<%# Eval("ConceptoContable") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--<asp:TemplateField HeaderText="Tipo" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblTipo" Text='<%# Eval("TipoDocto") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField> --%>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Venta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplVenta" Target="_blank" CssClass="Texto" runat="server" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Referencia</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplReferencia" Target="_blank" CssClass="Texto" runat="server" Text='<%# Eval("Referencia")%>' ></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblCargo" Text='<%# Eval("Cargo", "{0:N2}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Abono" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblAbono" Text='<%# Eval("Abono", "{0:N2}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Moneda">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblMoneda" Text='<%# Eval("Abreviatura") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<%--<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>--%>
|
||||
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
205
Ventas/AuxiliarCliente.aspx.vb
Normal file
205
Ventas/AuxiliarCliente.aspx.vb
Normal file
@@ -0,0 +1,205 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_AuxiliarCliente
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES"
|
||||
Private Property DtActivosFijos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtActivosFijos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtActivosFijos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private ReadOnly Property CveActivoFijo As Integer
|
||||
Get
|
||||
Return ViewState("CveActivoFijo").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property DTAFCaracteristicas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTAFCaracteristicas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTAFCaracteristicas") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaFiltros()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub CargaFiltros()
|
||||
|
||||
If (UsuarioActual.Empresa.Funcionalidad(105) = "1") Then
|
||||
DdlClientes.setEsWebService(True)
|
||||
DdlClientes.Attributes.Add("data-metodo", "getcliente")
|
||||
DdlClientes.SelectedText = "Todos"
|
||||
DdlClientes.SelectedValue = "-1"
|
||||
Else
|
||||
DdlClientes.setEsWebService(False)
|
||||
DdlClientes.ddl.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClientes.ddl.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
'DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1)
|
||||
'DdlConceptosContables.DataBind()
|
||||
'DdlConceptosContables.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
txtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy")
|
||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
|
||||
'Falta PA
|
||||
If ObjConta.GetClienteAuxiliar(DdlClientes.SelectedValue.ToEntero, -1, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, DdlOpcion.SelectedValue.ToEntero) Then
|
||||
If DdlOpcion.SelectedValue.ToEntero = 2 Then
|
||||
GvAuxCliente.DataSource = ObjConta.DtResultados.FiltraParametros($" IIF(ISNULL(CveConceptoContable,0) = 1 AND Importe >= 0,0,1) = 1")
|
||||
Else
|
||||
GvAuxCliente.DataSource = ObjConta.DtResultados
|
||||
End If
|
||||
Else
|
||||
GvAuxCliente.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
|
||||
GvAuxCliente.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
ExportToExcelGTest(GvAuxCliente, "Auxiliar" & DdlClientes.SelectedText & ".xlsx", "Auxiliar Clientes", UsuarioActual)
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
Public Sub ExportToExcelGTest(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing)
|
||||
Dim sw As New StringWriter()
|
||||
Dim htw As New HtmlTextWriter(sw)
|
||||
Gv.RenderControl(htw)
|
||||
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8")
|
||||
|
||||
Dim excel As GemBox.Spreadsheet.ExcelFile
|
||||
Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
|
||||
Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
|
||||
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options)
|
||||
If Usuario IsNot Nothing Then
|
||||
Dim worksheet = excel.Worksheets(0)
|
||||
Dim num As Integer = worksheet.Rows.Count
|
||||
If num > 128 Then num = 128
|
||||
|
||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||
'If columnCount > 1 Then
|
||||
' For i As Integer = 1 To columnCount - 1
|
||||
' worksheet.Columns(i).AutoFit(1, worksheet.Rows(1), worksheet.Rows(num - 1))
|
||||
' Next
|
||||
'End If
|
||||
|
||||
worksheet.Rows.InsertEmpty(0, 6)
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Usuario.CveEmpresa)
|
||||
|
||||
If Imagen.Exists Then
|
||||
worksheet.Pictures.Add(logouri.ToString(), "A1", "B4")
|
||||
End If
|
||||
|
||||
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
|
||||
celdasConTexto.Style.Font.Name = "Calibri Light"
|
||||
|
||||
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
|
||||
RangoNombreEmpresa.Merged = True
|
||||
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
|
||||
RangoNombreEmpresa.Style.Font.Size = 18 * 20
|
||||
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
|
||||
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
|
||||
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
|
||||
RangoTitulo.Merged = True
|
||||
RangoTitulo.Value = Titulo
|
||||
RangoTitulo.Style.Font.Size = 20 * 20
|
||||
RangoTitulo.Style.Font.Name = "Calibri Light"
|
||||
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
|
||||
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
|
||||
worksheet.Rows(6).Cells(i).Style.Font.Size = 12 * 20
|
||||
worksheet.Rows(6).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||
worksheet.Rows(6).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||
worksheet.Rows(6).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
|
||||
worksheet.Rows(6).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
|
||||
'If i > 0 Then
|
||||
' Try
|
||||
' worksheet.Columns(i).AutoFit(1)
|
||||
' Catch ex As Exception
|
||||
' End Try
|
||||
'End If
|
||||
Next
|
||||
|
||||
|
||||
Dim IndexEndTable As Integer = Gv.Rows.Count + 8
|
||||
|
||||
worksheet.Rows(IndexEndTable).Cells(2).Value = "Usuario Imprimió"
|
||||
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre
|
||||
|
||||
worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión"
|
||||
worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy")
|
||||
End If
|
||||
|
||||
End Using
|
||||
htw.Dispose()
|
||||
|
||||
excel.Save(HttpContext.Current.Response, NombreArchivoXLSx)
|
||||
|
||||
End Sub
|
||||
Protected Sub GvAuxCliente_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If DdlOpcion.SelectedValue.ToEntero = 2 Then
|
||||
If Not e.Row.DBCampo("CveConceptoContable").ToEntero > 0 Then
|
||||
e.Row.CssClass = "Totales"
|
||||
Else
|
||||
e.Row.Cells(0).Text = ""
|
||||
e.Row.Cells(7).Text = ""
|
||||
End If
|
||||
End If
|
||||
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
|
||||
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DBCampo("CveReferencia")}"
|
||||
ElseIf e.Row.DBCampo("TipoReferencia").ToEntero = 2 Then
|
||||
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DBCampo("CveReferencia")}"
|
||||
ElseIf e.Row.DBCampo("TipoReferencia").ToEntero = 3 Then
|
||||
e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveReferencia")}"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CveConceptoContable").ToEntero = 1 AndAlso e.Row.DBCampo("Importe").ToString.ToDouble < 0 Then
|
||||
e.Row.ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
218
Ventas/AuxiliarClienteVentas.aspx
Normal file
218
Ventas/AuxiliarClienteVentas.aspx
Normal file
@@ -0,0 +1,218 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="AuxiliarClienteVentas.aspx.vb" Inherits="Ventas_AuxiliarClienteVentas" %>
|
||||
|
||||
<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;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<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">
|
||||
Auxiliar de Ventas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltro" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT portletfiltrostitlee" >
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel runat="server" style="display:inline-block;">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Buscar" class="btn btn-primary" OnClick="BtnConsultar_Click" ValidationGroup="Valida" /></ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Cliente</label>
|
||||
<div class="col-md-5">
|
||||
<ADS:Dropdownlost ID="DdlClientes" CssClassDdl="select2me" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="NombreComercial" DataValueField="CveCliente"></ADS:Dropdownlost>
|
||||
</div>
|
||||
|
||||
|
||||
<%-- <div class="col-md-1">Conceptos:</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlConceptosContables" CssClass="form-control input-sm select2me" Width="100%" runat="server" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" >
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div> --%>
|
||||
<label class="col-md-1 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
<label class="col-md-1 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display:none;" >
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-1 truncate">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:ListBox ID="DdlVendedor" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
|
||||
|
||||
</div>
|
||||
<label runat="server" id="LblSubProyecto" class="col-md-1 truncate">Sucursal:</label>
|
||||
<div runat="server" id="DivSubProyecto" class="col-md-2">
|
||||
<asp:ListBox ID="DdlSubProyecto" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:ListBox>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-md-12" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvAuxCliente.ClientID) %>" style="display: inline-block;margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", "tablita") %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info" ><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<div class=" col-md-12">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvAuxCliente" runat="server" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" BorderColor="#D3D3D3" BorderWidth="1" GridLines="none"
|
||||
AutoGenerateColumns="False" EmptyDataText="No se encontraron resultados">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblFecha" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Concepto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblConceptoContable" Text='<%# Eval("ConceptoContable") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Tipo" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblTipo" Text='<%# Eval("TipoDocto") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Venta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplVenta" CssClass="Texto" runat="server" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Referencia</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplIE" CssClass="Texto" runat="server" Text='<%# Eval("Folio")%>' NavigateUrl='<%# Eval("CveIE", "/Bancos/IE.aspx?CveIE={0}")%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblCargo" Text='<%# Eval("Cargo", "{0:N2}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Abono" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblAbono" Text='<%# Eval("Abono", "{0:N2}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblSaldo" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Moneda">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LblMoneda" Text='<%# Eval("Abreviatura") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<%--<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>--%>
|
||||
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
112
Ventas/AuxiliarClienteVentas.aspx.vb
Normal file
112
Ventas/AuxiliarClienteVentas.aspx.vb
Normal file
@@ -0,0 +1,112 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_AuxiliarClienteVentas
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES"
|
||||
Private Property DtActivosFijos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtActivosFijos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtActivosFijos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private ReadOnly Property CveActivoFijo As Integer
|
||||
Get
|
||||
Return ViewState("CveActivoFijo").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property DTAFCaracteristicas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTAFCaracteristicas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTAFCaracteristicas") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaFiltros()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub CargaFiltros()
|
||||
|
||||
If (UsuarioActual.Empresa.Funcionalidad(105) = "1") Then
|
||||
DdlClientes.setEsWebService(True)
|
||||
DdlClientes.Attributes.Add("data-metodo", "getcliente")
|
||||
DdlClientes.SelectedText = "Todos"
|
||||
DdlClientes.SelectedValue = "-1"
|
||||
Else
|
||||
DdlClientes.setEsWebService(False)
|
||||
DdlClientes.ddl.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClientes.ddl.DataBind()
|
||||
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
'Vendedor
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlSubProyecto.Items.Clear()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) 'GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
txtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy")
|
||||
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
|
||||
'Falta PA
|
||||
If ObjConta.GetClienteAuxiliarxVenta(DdlClientes.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlVendedor.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvAuxCliente.DataSource = ObjConta.DtResultados
|
||||
Else
|
||||
GvAuxCliente.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
|
||||
GvAuxCliente.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvAuxCliente.ExportToExcelG("Auxiliar" & DdlClientes.SelectedText & ".xlsx")
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
|
||||
Private Sub GvAuxCliente_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAuxCliente.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("ConceptoContable") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
395
Ventas/CatClasificaciones.aspx
Normal file
395
Ventas/CatClasificaciones.aspx
Normal file
@@ -0,0 +1,395 @@
|
||||
<%@ Page Title="Clasificaciones de Producto o Servicios" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatClasificaciones.aspx.vb" Inherits="CatClasificaciones" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Clasificaciones de Productos o Servicios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="HlAgregarClasificacion" runat="server"><i class="fa fa-plus"></i> Agregar Clasificación</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPersonalizar" runat="server" OnClick="LnkPersonalizar_Click"><i class="fa fa-pencil"></i> Personalizar Columnas</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Categoria:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlCategoriaFiltro" runat="server" AppendDataBoundItems="true" DataTextField="Categoria" DataValueField="CveCategoria" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Tipo Clasificacion:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipoClasificacion" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Gasto" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos/Gasto" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Estatus:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<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; margin-right: -20px; 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>
|
||||
|
||||
<asp:Button ID="BtnCargarCuentas" runat="server" ClientIDMode="Static" Text="CargaCuentas" Style="display: none;" />
|
||||
<asp:HiddenField ID="HdnCuenta" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:Button ID="BtnCargarCuentasEdit" runat="server" ClientIDMode="Static" Text="CargaCuentas2" Style="display: none;" />
|
||||
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<div>
|
||||
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Clasificación">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlClasificacion" runat="server" Text='<%# Eval("Clasificacion", "{0}") %>' Style="word-break: break-all;"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacion" runat="server" CausesValidation="true" MaxLength="200" Text='<%# Eval("Clasificacion") %>' ValidationGroup="GrpGV" Width="184px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cuenta Gasto">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlCuentaGasto" runat="server" Text='<%# Eval("CuentaGasto")%>' Style="word-break: break-all;"></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cuenta Costos">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlCuentaCosto" runat="server" Text='<%# Eval("CuentaCostos")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cuenta Ingresos">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlCuentaIngresos" runat="server" Text='<%# Eval("CuentaIngresos")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Categoría">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCategoria" runat="server" Text='<%# Eval("Categoria")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCategoria" CssClass="form-control input-sm select2me" DataTextField="Categoria" DataValueField="CveCategoria" runat="server" Width="110px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Req. Serie" ItemStyle-Width="60px" Visible="false">
|
||||
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRequiereSerieLote" runat="server" Text='<%# If(Eval("RequiereSerieLote").ToString = "True", "Si", "No") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstado" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Uso Clasif." ItemStyle-Width="20px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsoClasif" runat="server" Text='<%# Eval("UsoClasif")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Producto SAT" ItemStyle-Width="50px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSATClaveProductoServicio" runat="server" Text='<%# Eval("SATClaveProductoServicio")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Req. AF<br />Compra" ItemStyle-Width="60px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRequiereAFCompra" runat="server" Text='<%# If(Eval("RequiereAFCompra").ToString = "True", "Si", "No") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Req. AF<br />Insumo" ItemStyle-Width="60px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRequiereAFInsumo" runat="server" Text='<%# If(Eval("RequiereAFInsumo").ToString = "True", "Si", "No") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Req.<br />Personal" ItemStyle-Width="60px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRequirePersonal" runat="server" Text='<%# If(Eval("RequierePersonal").ToString = "True", "Si", "No") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaClasificacion" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<ItemStyle Width="80" />
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal">
|
||||
<ContentTemplate>
|
||||
<div id="ModalClasificaciones" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalClasif" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModal" runat="server">Agregar Clasificación</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtClasificacion" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtClasificacion.ClientID.ToString()%>">Clasificación:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlCategoria" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="Categoria" DataValueField="CveCategoria" Width="340px" ValidationGroup="GrpGuardar"></asp:DropDownList>
|
||||
<label for="<%= DdlCategoria.ClientID.ToString()%>">Categoría:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUsoClasificacion" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" Width="340px" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Text="Ingresos" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Gasto" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos/Gasto" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlUsoClasificacion.ClientID.ToString()%>">Uso Clasificación:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group input-iconright" id="DivCuentaGasto" runat="server">
|
||||
<label for="<%= DdlCuentaGasto.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Gasto:</label>
|
||||
<asp:DropDownList ID="DdlCuentaGasto" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group input-iconright" id="DivCuentaCostos" runat="server">
|
||||
<label for="<%= DdlCuentaCostos.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Costos:</label>
|
||||
<asp:DropDownList ID="DdlCuentaCostos" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group input-iconright" id="DivCuentaIngresos" runat="server">
|
||||
<label for="<%= DdlCuentaIngresos.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Ingresos:</label>
|
||||
<asp:DropDownList ID="DdlCuentaIngresos" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivPSSAT">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlSATPS" CssStyle="width: 340px;" CssClass="form-control input-sm select2me" DataTextField="Descripcion" DataValueField="CveSATPS" />
|
||||
<label for="<%= DdlSATPS.ClientID.ToString()%>">Producto Servicio SAT:</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>" style="width: 130px;">Estatus:</label>
|
||||
<asp:CheckBox runat="server" ID="ChkEstatus" Checked="true" CssClass="make-switchsd" />
|
||||
</div>
|
||||
<div id="DivRequiereSerieLote" runat="server" class="form-group form-md-line-input input-iconright" visible="false">
|
||||
<label for="<%= ChkRequiereSerieLote.ClientID.ToString()%>" style="width: 130px;">Requiere Serie:</label>
|
||||
<asp:CheckBox ID="ChkRequiereSerieLote" runat="server" CssClass="make-switchsd" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input" runat="server">
|
||||
<label for="<%= ChkRequiereAFCompra.ClientID.ToString()%>" style="width: 130px;">Requiere AF Compra:</label>
|
||||
<asp:CheckBox ID="ChkRequiereAFCompra" Checked="false" CssClass="make-switchsd" runat="server" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input" runat="server">
|
||||
<label for="<%= ChkRequiereAFInsumo.ClientID.ToString()%>" style="width: 130px;">Requiere AF Insumo:</label>
|
||||
<asp:CheckBox ID="ChkRequiereAFInsumo" Checked="false" CssClass="make-switchsd" runat="server" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input" runat="server">
|
||||
<label for="<%= ChkRequierePersonal.ClientID.ToString()%>" style="width: 130px;">Requiere Personal:</label>
|
||||
<asp:CheckBox ID="ChkRequierePersonal" Checked="false" runat="server" CssClass="make-switchsd" />
|
||||
</div>
|
||||
<div runat="server" id="DivEsAcumulador" visible="false" class="form-group form-md-line-input input-iconright">
|
||||
<label style="width: 130px;">Es Acumulador: </label>
|
||||
<asp:CheckBox ID="ChkEsAcumulador" runat="server" CssClass="make-switchsd" Text="" ClientIDMode="Static" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input" runat="server">
|
||||
<label for="<%= ChkTopVentas.ClientID.ToString()%>" style="width: 130px;">TOP 10 Ventas:</label>
|
||||
<asp:CheckBox ID="ChkTopVentas" Checked="false" runat="server" CssClass="make-switchsd" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input" runat="server">
|
||||
<label for="<%= ChkTopCompras.ClientID.ToString()%>" style="width: 130px;">TOP 10 Compras:</label>
|
||||
<asp:CheckBox ID="ChkTopCompras" Checked="false" runat="server" CssClass="make-switchsd" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardar" />
|
||||
<button id="BtnCancelarProyecto" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
<asp:HiddenField ID="HdnModalidadClasificacion" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnIDClasificacion" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</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">×</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 style="width: 598px; margin-bottom: 0px !important;" class="table table-advance ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td runat="server" id="TDReqSerie" style="text-align: left;" visible="false">
|
||||
<asp:CheckBox ID="ChkReqSerie" runat="server" Text="Requiere Serie" />
|
||||
</td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkReqAFCompra" runat="server" Text="Requiere AF Compra" />
|
||||
</td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkReqAFInsumo" runat="server" Text="Requiere AF Insumo" />
|
||||
</td>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkReqPersonal" runat="server" Text="Requiere Personal" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;" colspan="1">
|
||||
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario" />
|
||||
</td>
|
||||
<td style="text-align: left;" colspan="3">
|
||||
<asp:CheckBox ID="ChkProductoSAT" runat="server" Text="Producto SAT" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnPersonalizar" OnClick="BtnPersonalizar_Click" runat="server" Text="Personalizar" class="btn btn-success" />
|
||||
<%--OnClientClick="javascript:$('#DivPersonalizar').modal('hide')"--%>
|
||||
<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>
|
||||
function SetText(ObjFrom, ObjTo) {
|
||||
ObjTo.value = ObjFrom.value;
|
||||
}
|
||||
|
||||
function CargaCuentas(op) {
|
||||
$get("HdnCuenta").value = op;
|
||||
$("#BtnCargarCuentas").click();
|
||||
}
|
||||
|
||||
function CargaCuentas2(op) {
|
||||
$get("HiddenField2").value = op;
|
||||
$("#BtnCargarCuentasEdit").click();
|
||||
}
|
||||
|
||||
function fnCxP() {
|
||||
|
||||
$("#BtnRecargaCxP").click();
|
||||
}
|
||||
|
||||
function pageLoad() {
|
||||
var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
|
||||
if (isAsyncPostback) {
|
||||
tb_init('a.thickbox');
|
||||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
|
||||
var Alto = 300
|
||||
|
||||
$('#gv-container').css({ 'max-height': Alto + 'px' });
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
462
Ventas/CatClasificaciones.aspx.vb
Normal file
462
Ventas/CatClasificaciones.aspx.vb
Normal file
@@ -0,0 +1,462 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class CatClasificaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property DtCuentasContables As Data.DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCuentasContables"), DataTable)
|
||||
End Get
|
||||
Set(value As Data.DataTable)
|
||||
ViewState("DtCuentasContables") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property DtCuentas As DataTable
|
||||
Get
|
||||
Return CType((ViewState("DtCuentas")), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCuentas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveCuentaGastoActual As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveCuentaGastoActual"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCuentaGastoActual") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CargaGastos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("CargaGastos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("CargaGastos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveCuentaIngresoActual As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveCuentaIngresoActual"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCuentaIngresoActual") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CargaIngresos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("CargaIngresos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("CargaIngresos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveCuentaCostoActual As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveCuentaCostoActual"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCuentaCostoActual") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CargaCostos As Boolean
|
||||
Get
|
||||
Return CType(ViewState("CargaCostos"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("CargaCostos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
CargaGastos = True
|
||||
CargaCostos = True
|
||||
CargaIngresos = True
|
||||
DtCuentasContables = Nothing
|
||||
|
||||
CargaDdlSATPS()
|
||||
CargaDDLs()
|
||||
CargaGlobal()
|
||||
|
||||
DdlCategoriaFiltro.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoriaFiltro.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlCategoriaFiltro.DataBind()
|
||||
|
||||
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoria.DataBind()
|
||||
|
||||
'' 16/03/2018 - se mueve validacion de la culumna a Personaliza Columna
|
||||
If UsuarioActual.CveEmpresa.Contiene(80, 72) Then
|
||||
DivRequiereSerieLote.Visible = True
|
||||
'GvDatos.Columns(5).Visible = True
|
||||
TDReqSerie.Visible = True
|
||||
Else
|
||||
DivRequiereSerieLote.Visible = False
|
||||
'GvDatos.Columns(5).Visible = False
|
||||
TDReqSerie.Visible = False
|
||||
End If
|
||||
UpModalClasif.Update()
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
|
||||
''COMENTADO DF 30 JUNIO 2017
|
||||
'Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'If Cuenta.GetCuentas(-1, "-1", 1, 20000) Then
|
||||
' DtCuentas = Cuenta.DtResultados
|
||||
'End If
|
||||
'Cuenta.Dispose()
|
||||
Else
|
||||
DivCuentaIngresos.Visible = False
|
||||
DivCuentaCostos.Visible = False
|
||||
DivCuentaGasto.Visible = False
|
||||
|
||||
GvDatos.Columns(1).Visible = False
|
||||
GvDatos.Columns(2).Visible = False
|
||||
GvDatos.Columns(3).Visible = False
|
||||
End If
|
||||
|
||||
DdlCuentaGasto.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlCuentaCostos.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlCuentaIngresos.Items.Insert(0, New ListItem("-", "-1"))
|
||||
|
||||
CargaDatos()
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ' Funcionalidad Es Distribuidor
|
||||
DivEsAcumulador.Visible = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.GetClasificaciones() Then
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
CargaGrid()
|
||||
End Sub
|
||||
|
||||
Public Sub CargaGlobal()
|
||||
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
|
||||
If ObjClasificaciones.GetClasificaciones() Then
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
|
||||
GlobalDTClasificaciones = ObjClasificaciones.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0)
|
||||
|
||||
If HdnModalidadClasificacion.Value = "A" Then
|
||||
If ObjClasificaciones.AddClasificaciones(TxtClasificacion.Text.Trim, "",
|
||||
DdlCuentaGasto.SelectedValue.ToEntero, DdlCuentaGasto.SelectedItem.Text,
|
||||
DdlCuentaCostos.SelectedValue.ToEntero, DdlCuentaCostos.SelectedItem.Text,
|
||||
DdlCuentaIngresos.SelectedValue.ToEntero, DdlCuentaIngresos.SelectedItem.Text,
|
||||
DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero,
|
||||
RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then
|
||||
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
|
||||
|
||||
TxtClasificacion.Text = ""
|
||||
DdlCuentaGasto.SelectedValueExist("0")
|
||||
DdlCuentaCostos.SelectedValueExist("0")
|
||||
DdlCuentaIngresos.SelectedValueExist("0")
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
|
||||
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ElseIf HdnModalidadClasificacion.Value = "U" Then
|
||||
Dim Clasificacion As String = TxtClasificacion.Text
|
||||
Dim Estatus As Boolean = ChkEstatus.Checked
|
||||
Dim CveClasificacion As Integer = HdnIDClasificacion.Value.ToEntero
|
||||
Dim DdlGasto As DropDownList = DdlCuentaGasto
|
||||
Dim DdlCosto As DropDownList = DdlCuentaCostos
|
||||
Dim DdlIngresos As DropDownList = DdlCuentaIngresos
|
||||
|
||||
If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text,
|
||||
DdlCosto.SelectedValue.ToEntero, DdlCosto.SelectedItem.Text, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text,
|
||||
Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero,
|
||||
RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
CargaGlobal()
|
||||
ObjClasificaciones.Dispose()
|
||||
CargaDatos()
|
||||
|
||||
UpDatos.Update()
|
||||
UpModalClasif.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
|
||||
Dim ObjEmpresa As New ClsSisEmpresas
|
||||
Dim Empresa As Empresa = Nothing
|
||||
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
Empresa = ObjEmpresa.Empresa
|
||||
Dim ObjContabilidad As New ClsContPAQi(Empresa)
|
||||
If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then
|
||||
DtCuentasContables = ObjContabilidad.DtResultados
|
||||
End If
|
||||
ObjContabilidad.Dispose()
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
|
||||
Select Case HdnCuenta.Value
|
||||
Case "1"
|
||||
If DdlCuentaGasto.Attributes("onclick") <> "" And DtCuentasContables Is Nothing Then CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(216).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(216).ToEntero, -1))
|
||||
DdlCuentaGasto.Items.Clear() : DdlCuentaGasto.Items.Add(New ListItem("-", "-1"))
|
||||
DdlCuentaGasto.DataSource = DtCuentasContables : DdlCuentaGasto.DataBind()
|
||||
DdlCuentaGasto.AutoPostBack = False : DdlCuentaGasto.Attributes.Remove("onclick") : DdlCuentaGasto.CssClass &= " select2me" : UpModalClasif.Update()
|
||||
DdlCuentaGasto.SelectedValueExist(CveCuentaGastoActual)
|
||||
Case "2"
|
||||
If DdlCuentaCostos.Attributes("onclick") <> "" And DtCuentasContables Is Nothing Then CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(216).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(216).ToEntero, -1))
|
||||
DdlCuentaCostos.Items.Clear() : DdlCuentaCostos.Items.Add(New ListItem("-", "-1"))
|
||||
DdlCuentaCostos.DataSource = DtCuentasContables : DdlCuentaCostos.DataBind()
|
||||
DdlCuentaCostos.AutoPostBack = False : DdlCuentaCostos.Attributes.Remove("onclick") : DdlCuentaCostos.CssClass &= " select2me" : UpModalClasif.Update()
|
||||
DdlCuentaCostos.SelectedValueExist(CveCuentaCostoActual)
|
||||
Case "3"
|
||||
If DdlCuentaIngresos.Attributes("onclick") <> "" And DtCuentasContables Is Nothing Then CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(216).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(216).ToEntero, -1))
|
||||
DdlCuentaIngresos.Items.Clear() : DdlCuentaIngresos.Items.Add(New ListItem("-", "-1"))
|
||||
DdlCuentaIngresos.DataSource = DtCuentasContables : DdlCuentaIngresos.DataBind()
|
||||
DdlCuentaIngresos.AutoPostBack = False : DdlCuentaIngresos.Attributes.Remove("onclick") : DdlCuentaIngresos.CssClass &= " select2me" : UpModalClasif.Update()
|
||||
DdlCuentaIngresos.SelectedValueExist(CveCuentaIngresoActual)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub CargaDDLs()
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
DdlCuentaGasto.AutoPostBack = True
|
||||
DdlCuentaCostos.AutoPostBack = True
|
||||
DdlCuentaIngresos.AutoPostBack = True
|
||||
|
||||
DdlCuentaGasto.Attributes.Add("onclick", "CargaCuentas(1);")
|
||||
DdlCuentaCostos.Attributes.Add("onclick", "CargaCuentas(2);")
|
||||
DdlCuentaIngresos.Attributes.Add("onclick", "CargaCuentas(3);")
|
||||
UpModal.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDdlSATPS()
|
||||
DdlSATPS.setEsWebService(True)
|
||||
DdlSATPS.Attributes.Add("data-metodo", "getpssat")
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.Header Then
|
||||
e.Row.Cells(5).Text = "<Label data-html='true' data-toggle='tooltip' data-placement='top' title='<b>Requiere Serie</b>'><b>Req. Serie</b><Label>"
|
||||
End If
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(200)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(120)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(120)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(135)
|
||||
|
||||
e.Row.Cells(4).Width = Unit.Pixel(70)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(75)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(7).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(8).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(9).Width = Unit.Pixel(60)
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DBCampo("CuentaGasto") = "Seleccione" Or e.Row.DBCampo("CuentaGasto") = "" Then e.Row.FCLabel("LtlCuentaGasto").Text = "-"
|
||||
If e.Row.DBCampo("CuentaCostos") = "Seleccione" Or e.Row.DBCampo("CuentaCostos") = "" Then e.Row.FCLabel("LtlCuentaCosto").Text = "-"
|
||||
If e.Row.DBCampo("CuentaIngresos") = "Seleccione" Or e.Row.DBCampo("CuentaIngresos") = "" Then e.Row.FCLabel("LtlCuentaIngresos").Text = "-"
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
e.Row.FCLabel("LtlClasificacion").Text = String.Format("<a Class='Texto' href='/Ventas/CatClasificacionesDetalle.aspx?CveClasificacion={0}'>{1}</a>", e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("Clasificacion"))
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
|
||||
If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
CargaGrid()
|
||||
CargaGlobal()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub CargaGrid()
|
||||
GvDatos.DataSource = CType(ViewState("DTClasificaciones"), DataTable)
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub Limpiador()
|
||||
CveCuentaGastoActual = -1
|
||||
CveCuentaCostoActual = -1
|
||||
CveCuentaIngresoActual = -1
|
||||
DdlCuentaGasto.SelectedValue = "-1"
|
||||
DdlCuentaCostos.SelectedValue = "-1"
|
||||
DdlCuentaIngresos.SelectedValue = "-1"
|
||||
End Sub
|
||||
Private Sub HlAgregarClasifiacion(sender As Object, e As EventArgs) Handles HlAgregarClasificacion.Click
|
||||
Limpiador()
|
||||
|
||||
TxtClasificacion.Text = ""
|
||||
DdlCategoria.SelectedIndex = 0
|
||||
DdlSATPS.SelectedValue = ""
|
||||
DdlSATPS.SelectedText = ""
|
||||
LtlTituloModal.Text = "Agregar Clasificación"
|
||||
LbAgregar.Text = "Agregar"
|
||||
HdnModalidadClasificacion.Value = "A"
|
||||
|
||||
ChkEstatus.Checked = True
|
||||
|
||||
ChkEsAcumulador.Checked = False
|
||||
ChkRequiereSerieLote.Checked = False
|
||||
ChkRequiereAFCompra.Checked = False
|
||||
ChkRequiereAFInsumo.Checked = False
|
||||
ChkRequierePersonal.Checked = False
|
||||
|
||||
UpModal.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
|
||||
End Sub
|
||||
|
||||
Public Sub ActualizaClasificacion(sender As Object, e As EventArgs)
|
||||
Limpiador()
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim CveClasificacion As String = GvRow.DataKey("CveClasificacion").ToString
|
||||
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
|
||||
Dim CveCategoria As String = GvRow.DataKey("CveCategoria").ToString
|
||||
Dim CuentaGasto As String = GvRow.DataKey("CuentaGasto").ToString
|
||||
Dim CuentaCostos As String = GvRow.DataKey("CuentaCostos").ToString
|
||||
Dim CuentaIngresos As String = GvRow.DataKey("CuentaIngresos").ToString
|
||||
Dim UsoClasificacion As String = GvRow.DataKey("UsoClasificacion").ToString
|
||||
Dim TopVentas As Boolean = If(GvRow.DataKey("TopVentas") = "True", True, False)
|
||||
Dim TopCompras As Boolean = If(GvRow.DataKey("TopCompras") = "True", True, False)
|
||||
|
||||
ChkTopCompras.Checked = TopCompras
|
||||
ChkTopVentas.Checked = TopVentas
|
||||
|
||||
CveCuentaGastoActual = GvRow.DataKey("IdCuentaGasto").ToString.ToEntero
|
||||
CveCuentaCostoActual = GvRow.DataKey("IdCuentaCostos").ToString.ToEntero
|
||||
CveCuentaIngresoActual = GvRow.DataKey("IdCuentaIngresos").ToString.ToEntero
|
||||
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
|
||||
ChkRequiereSerieLote.Checked = If(GvRow.DataKey("RequiereSerieLote") = "True", True, False)
|
||||
|
||||
ChkEsAcumulador.Checked = Boolean.Parse(GvRow.DataKey("EsAcumulador").ToString)
|
||||
|
||||
ChkRequiereAFCompra.Checked = If(GvRow.DataKey("RequiereAFCompra") = "True", True, False)
|
||||
ChkRequiereAFInsumo.Checked = If(GvRow.DataKey("RequiereAFInsumo") = "True", True, False)
|
||||
ChkRequierePersonal.Checked = If(GvRow.DataKey("RequierePersonal") = "True", True, False)
|
||||
|
||||
If CuentaGasto.Length > 1 And CargaGastos Then
|
||||
DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString))
|
||||
DdlCuentaGasto.SelectedIndex = 0
|
||||
CargaGastos = False
|
||||
Else
|
||||
DdlCuentaGasto.SelectedValueExist(CveCuentaGastoActual)
|
||||
End If
|
||||
|
||||
If CuentaCostos.Length > 1 And CargaCostos Then
|
||||
DdlCuentaCostos.Items.Insert(0, New ListItem(CuentaCostos, CveCuentaCostoActual.ToString))
|
||||
DdlCuentaCostos.SelectedIndex = 0
|
||||
CargaCostos = False
|
||||
Else
|
||||
DdlCuentaCostos.SelectedValueExist(CveCuentaCostoActual)
|
||||
End If
|
||||
|
||||
If CuentaIngresos.Length > 1 And CargaIngresos Then
|
||||
DdlCuentaIngresos.Items.Insert(0, New ListItem(CuentaIngresos, CveCuentaIngresoActual.ToString))
|
||||
DdlCuentaIngresos.SelectedIndex = 0
|
||||
CargaIngresos = False
|
||||
Else
|
||||
DdlCuentaIngresos.SelectedValueExist(CveCuentaIngresoActual)
|
||||
End If
|
||||
|
||||
|
||||
TxtClasificacion.Text = Clasificacion
|
||||
DdlCategoria.SelectedValueExist(CveCategoria)
|
||||
DdlUsoClasificacion.SelectedValue = UsoClasificacion
|
||||
HdnIDClasificacion.Value = CveClasificacion
|
||||
If GvRow.DataKey("CveSATPS").ToString <> Nothing Then
|
||||
DdlSATPS.SelectedValue = GvRow.DataKey("CveSATPS").ToString
|
||||
DdlSATPS.SelectedText = GvRow.DataKey("SATClaveProductoServicio").ToString
|
||||
End If
|
||||
HdnModalidadClasificacion.Value = "U"
|
||||
LtlTituloModal.Text = "Actualizar Clasificación"
|
||||
LbAgregar.Text = "Actualizar"
|
||||
UpModal.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#DivPersonalizar').modal()")
|
||||
UPPersonalizar.Update()
|
||||
End Sub
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(80, 72) Then
|
||||
GvDatos.Columns(5).Visible = ChkReqSerie.Checked
|
||||
End If
|
||||
GvDatos.Columns(8).Visible = ChkUsuario.Checked
|
||||
GvDatos.Columns(10).Visible = ChkProductoSAT.Checked
|
||||
GvDatos.Columns(11).Visible = ChkReqAFCompra.Checked
|
||||
GvDatos.Columns(12).Visible = ChkReqAFInsumo.Checked
|
||||
GvDatos.Columns(13).Visible = ChkReqPersonal.Checked
|
||||
|
||||
CargaDatos()
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
RegistraScript("$('#DivPersonalizar').modal('hide')")
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
End Class
|
||||
268
Ventas/CatClasificaciones2.aspx
Normal file
268
Ventas/CatClasificaciones2.aspx
Normal file
@@ -0,0 +1,268 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatClasificaciones2.aspx.vb" Inherits="Ventas_CatClasificaciones2" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Catálogo de Clasificaciones 2
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" Runat="Server">
|
||||
|
||||
<ajax:TabContainer ID="tabs" runat="server" ActiveTabIndex="0" Width="100%">
|
||||
<ajax:TabPanel ID="TabFam" runat="server" HeaderText="Categoria">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosF" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<table class="table table-striped table-advance table-hover Widthall">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th style="width: 350px">
|
||||
<asp:LinkButton ID="LbCategoria" runat="server" CausesValidation="false" Text="" CommandArgument="Categoria" OnClick="LbOrden_Click">
|
||||
Categoria (2)
|
||||
<asp:Literal ID="ImgCategoria" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCategoria" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCategoria" runat="server" ControlToValidate="TxtCategoria" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Familia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCategoria" runat="server" HighlightCssClass="vco" TargetControlID="RFVCategoria" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosF" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row col-md-12" style="margin-top: 20px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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 class="row col-md-12">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCategoria" EmptyDataText="No se encontraron Familias Registradas" ToolTip="Listado de Familias" CssClass="table table-striped table-advance table-hover ScrollAD Widthall" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCategoria" runat="server" Text='<%# Eval("Categoria", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCategoria" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Categoria") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCategoria" runat="server" ControlToValidate="TxtCategoria" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Familia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCategoria" runat="server" HighlightCssClass="vco" TargetControlID="RFVCategoria" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabSub" runat="server" HeaderText="Clasificación">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosS" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover Widthall" id="TbHeaderS" runat="server">
|
||||
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th style="width: 250px">
|
||||
<asp:LinkButton ID="LbClasificacionS" runat="server" CausesValidation="false" Text="" CommandArgument="Clasificacion" OnClick="LbOrdenS_Click">
|
||||
Clasificacion (2)
|
||||
<asp:Literal ID="ImgClasificacionS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
|
||||
<th style="width: 150px">
|
||||
<asp:LinkButton ID="LbCategoriaS" runat="server" CausesValidation="false" Text="" CommandArgument="Categoria" OnClick="LbOrdenS_Click">
|
||||
categoria (2)
|
||||
<asp:Literal ID="ImgCategoriaS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<asp:LinkButton ID="LbEstatusS" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrdenS_Click">
|
||||
Estado
|
||||
<asp:Literal ID="ImgEstatusS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<asp:LinkButton ID="LbFechaS" runat="server" CausesValidation="false" Text="" CommandArgument="Fecha" OnClick="LbOrdenS_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 100px">
|
||||
<asp:LinkButton ID="LbUsuarioS" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrdenS_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuarioS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width: 200px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtClasificacionS" runat="server" CausesValidation="true" MaxLength="200" ValidationGroup="GrpGuardarS" Width="184px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacionS" runat="server" ControlToValidate="TxtClasificacionS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubFamilia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacionS" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacionS" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlCategoriaS" DataTextField="Categoria" DataValueField="CveCategoria" runat="server" Width="114px"></asp:DropDownList></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarS" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarS"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosS" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row col-md-12" style="margin-top: 20px;" align="right">
|
||||
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatosS.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatosS.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="row col-md-12">
|
||||
<asp:GridView ID="GvDatosS" runat="server" AutoGenerateColumns="False" DataKeyNames="CveClasificacion" EmptyDataText="No se encontraron SubFamilias Registradas" ToolTip="Listado de SubFamilias" CssClass="table table-striped table-advance table-hover ScrollAD Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlClasificacion" runat="server" Text='<%# Eval("Clasificacion", "{0}") %>' Style="word-break: break-all;"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacion" runat="server" CausesValidation="true" MaxLength="200" Text='<%# Eval("Clasificacion") %>' ValidationGroup="GrpGVS" Width="184px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGVS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCategoria" runat="server" Text='<%# Eval("Categoria")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCategoria" DataTextField="Categoria" DataValueField="CveCategoria" runat="server" Width="110px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstado" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGVS" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
403
Ventas/CatClasificaciones2.aspx.vb
Normal file
403
Ventas/CatClasificaciones2.aspx.vb
Normal file
@@ -0,0 +1,403 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
Partial Class Ventas_CatClasificaciones2
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property DtCuentas As DataTable
|
||||
Get
|
||||
Return CType((ViewState("DtCuentas")), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCuentas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden1") = ""
|
||||
ViewState("Orden2") = ""
|
||||
DdlCategoriaS.DataSource = GlobalDTGralCategorias2(UsuarioActual.CveEmpresa) 'GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoriaS.DataBind()
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
|
||||
'Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'If Cuenta.GetCuentas(-1, "-1", 1, 20000) Then
|
||||
' DtCuentas = Cuenta.DtResultados
|
||||
'End If
|
||||
'Cuenta.Dispose()
|
||||
|
||||
'DdlCuentaGastoS.DataSource = DtCuentas : DdlCuentaGastoS.DataBind()
|
||||
'DdlCuentaAnticipoS.DataSource = DtCuentas : DdlCuentaAnticipoS.DataBind()
|
||||
'DdlCuentaInventarioS.DataSource = DtCuentas : DdlCuentaInventarioS.DataBind()
|
||||
Else
|
||||
'SubFamilia
|
||||
GvDatosS.Columns(1).Visible = False
|
||||
GvDatosS.Columns(2).Visible = False
|
||||
GvDatosS.Columns(3).Visible = False
|
||||
TbHeaderS.Rows(0).Cells(1).Visible = False
|
||||
TbHeaderS.Rows(0).Cells(2).Visible = False
|
||||
TbHeaderS.Rows(0).Cells(3).Visible = False
|
||||
TbHeaderS.Rows(1).Cells(1).Visible = False
|
||||
TbHeaderS.Rows(1).Cells(2).Visible = False
|
||||
TbHeaderS.Rows(1).Cells(3).Visible = False
|
||||
End If
|
||||
|
||||
CargaDatos()
|
||||
CargaDatosS()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
If ObjCategorias.GetCategorias(UsuarioActual.CveEmpresa, 4) Then
|
||||
ViewState("DTCategorias2") = ObjCategorias.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjCategorias.Dispose()
|
||||
|
||||
'ViewState("DTFamilias") = GlobalDTGralCategorias2
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatosS()
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
|
||||
GlobalDTClasificaciones2 = ObjClasificaciones.DtResultados
|
||||
ViewState("DTClasificacion2") = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
GvDatosS.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden1") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Protected Sub LbOrdenS_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_") & "S"), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden1") = Orden
|
||||
CargaGridS(Orden)
|
||||
End Sub
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTCategorias2"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTCategorias2"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatosF.Update()
|
||||
End Sub
|
||||
Private Sub CargaGridS(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTClasificacion2"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosS.DataSource = DV.ToTable().FiltraParametros("1=1") 'SubFamilia---------------------------------------------------------------
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosS.DataSource = CType(ViewState("DTClasificacion2"), DataTable).FiltraParametros("1=1") 'SubFamilia----------------------------
|
||||
End If
|
||||
GvDatosS.DataBind()
|
||||
UpDatosS.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
If ObjCategorias.AddCategorias(TxtCategoria.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4) Then
|
||||
TxtCategoria.Text = ""
|
||||
Alert("La nueva Categoria 2 se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosF.Update()
|
||||
|
||||
'ViewState("DTFamilias") = ObjCategorias.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
'GlobalDTGralCategorias2(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
If ObjCategorias.GetCategorias(-1, 4) Then
|
||||
ViewState("DTCategorias2") = ObjCategorias.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTGralCategorias2(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
CargaDdlCat()
|
||||
End If
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjCategorias.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LbAgregarS_Click(sender As Object, e As EventArgs) Handles LbAgregarS.Click
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "",
|
||||
-1, "", -1, "", -1, "",
|
||||
DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False) Then
|
||||
'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text,
|
||||
'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text,
|
||||
'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text,
|
||||
TxtClasificacionS.Text = ""
|
||||
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosS.Update()
|
||||
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
|
||||
ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTClasificaciones2 = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
|
||||
'DdlCuentaGastoS.SelectedValue = "-1"
|
||||
'DdlCuentaAnticipoS.SelectedValue = "-1"
|
||||
'DdlCuentaInventarioS.SelectedValue = "-1"
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(350)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(65)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosS.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
|
||||
e.Row.Cells(0).Width = Unit.Pixel(350)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
End If
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
|
||||
'e.Row.FCDropDownList("DdlCategoria").DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlCategoria").DataSource = GlobalDTGralCategorias2(UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlCategoria").DataBind()
|
||||
e.Row.FCDropDownList("DdlCategoria").SelectedValue = e.Row.DBCampo("CveCategoria")
|
||||
|
||||
Else
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
e.Row.FCLabel("LtlClasificacion").Text = String.Format("<a class='Texto' href='/Ventas/CatClasificacionesDetalle.aspx?CveClasificacion={0}'>{1}</a>", e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("Clasificacion"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
If ObjCategorias.RemoveCategorias(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
If ObjCategorias.GetCategorias(-1, 4) Then
|
||||
ViewState("DTCategorias2") = ObjCategorias.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTGralCategorias2(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
CargaDdlCat()
|
||||
End If
|
||||
Alert("La categoria se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCategorias.Dispose()
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDatosS.RowDeleting
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.RemoveClasificacion(GvDatosS.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosS.EditIndex = -1
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
|
||||
ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTClasificaciones2 = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
Alert("La Clasificacion se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvDatosS.RowCancelingEdit
|
||||
GvDatosS.EditIndex = -1
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
|
||||
Dim Categoria As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCategoria"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveCategoria As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjCategorias.UpdateCategoria(Categoria, Estatus, CveCategoria) Then
|
||||
GvDatos.EditIndex = -1
|
||||
If ObjCategorias.GetCategorias(-1, 4) Then
|
||||
ViewState("DTCategorias2") = ObjCategorias.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTGralCategorias2(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
CargaDdlCat()
|
||||
End If
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCategorias.Dispose()
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvDatosS.RowUpdating
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
Dim Clasificacion As String = DirectCast(GvDatosS.Rows(e.RowIndex).FindControl("TxtClasificacion"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatosS.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
Dim CveClasificacion As Integer = GvDatosS.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
'Dim DdlGasto As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaGasto")
|
||||
'Dim DdlAnticipo As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaAnticipo")
|
||||
'Dim DdlInventario As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaInventario")
|
||||
Dim DdlCategoria As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCategoria")
|
||||
'Dim IDCuentaGasto As Integer = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaGasto").SelectedValue.ToEntero
|
||||
|
||||
If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", -1, "", -1, "", -1, "", Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion) Then
|
||||
'DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text,
|
||||
'DdlAnticipo.SelectedValue.ToEntero, DdlAnticipo.SelectedItem.Text,
|
||||
'DdlInventario.SelectedValue.ToEntero, DdlInventario.SelectedItem.Text,
|
||||
|
||||
GvDatosS.EditIndex = -1
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 4) Then
|
||||
ViewState("DTClasificacion2") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
End If
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvDatosS.RowEditing
|
||||
GvDatosS.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlCat()
|
||||
DdlCategoriaS.DataSource = ViewState("DTCategorias2")
|
||||
DdlCategoriaS.DataBind()
|
||||
UpTitulosS.Update()
|
||||
End Sub
|
||||
End Class
|
||||
184
Ventas/CatClasificacionesDetalle.aspx
Normal file
184
Ventas/CatClasificacionesDetalle.aspx
Normal file
@@ -0,0 +1,184 @@
|
||||
<%@ Page Title="Clasificaciones de Producto o Servicios" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatClasificacionesDetalle.aspx.vb" Inherits="CatClasificacionesDetalle" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th, td {
|
||||
padding: 4px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Clasificaciones:
|
||||
<asp:Label ID="LblClasificacion" runat="server" Text=""></asp:Label>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<table class="table table-striped table-advance table-hover" style="width: 50%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 150px; text-align: left;">Clasificación:</th>
|
||||
<th>
|
||||
<asp:TextBox ID="TxtClasificacion" CssClass="form-control input-sm col-md-5" runat="server" CausesValidation="true" MaxLength="200" ValidationGroup="GrpGuardar"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</th>
|
||||
<tr>
|
||||
<th style="text-align: left">Cuenta Gasto:</th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlCuentaGasto" CssClass="form-control input-sm select2me col-md-5" DataTextField="CtaCodigo" DataValueField="Id" runat="server"></asp:DropDownList></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left">Cuenta Costos:</th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlCuentaCostos" CssClass="form-control input-sm select2me col-md-5" DataTextField="CtaCodigo" DataValueField="Id" runat="server"></asp:DropDownList></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th style="text-align: left">Cuenta Ingresos:</th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlCuentaIngresos" CssClass="form-control input-sm select2me col-md-5" DataTextField="CtaCodigo" DataValueField="Id" runat="server"></asp:DropDownList></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th style="text-align: left">Categoría:</th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlCategoria" CssClass="form-control input-sm select2me col-md-5" Style="text-align: left" DataTextField="Categoria" DataValueField="CveCategoria" runat="server"></asp:DropDownList></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left">Estado:</th>
|
||||
<th style="text-align: left">
|
||||
<asp:CheckBox ID="ChkEstado" CssClass="md-checksd" runat="server" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-md-12" align="center">
|
||||
<asp:Button ID="BtnGuardar" runat="server" CssClass="btn btn-primary" Text="Guardar" Visible="False" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<table class="table table-striped Widthall " id="TbHeader" runat="server" visible="False">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbProyecto" runat="server" CausesValidation="false" Text="" CommandArgument="Proyecto" OnClick="LbOrden_Click">
|
||||
Proyecto
|
||||
<asp:Literal ID="ImgProyecto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="200px">
|
||||
<asp:LinkButton ID="LbSubProyecto" runat="server" CausesValidation="false" Text="" CommandArgument="SubProyecto" OnClick="LbOrden_Click">
|
||||
SubProyecto
|
||||
<asp:Literal ID="ImgSubProyecto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="150px">
|
||||
<asp:LinkButton ID="LbCuentaGasto" runat="server" CausesValidation="false" Text="" CommandArgument="CuentaGasto" OnClick="LbOrden_Click">
|
||||
Cuenta Gasto
|
||||
<asp:Literal ID="ImgCuentaGasto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="150px">
|
||||
<asp:LinkButton ID="LbCuentaCostos" runat="server" CausesValidation="false" Text="" CommandArgument="CuentaAnticipo" OnClick="LbOrden_Click">
|
||||
Cuenta Anticipo
|
||||
<asp:Literal ID="ImgCuentaCostos" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
|
||||
<th width="161px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" ShowHeader="True" DataKeyNames="CveClasificacion,CveSubProyecto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-hover Widthall" Style="text-align: left;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Proyecto">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlProyecto" runat="server" Text='<%# Eval("Proyecto", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:Literal ID="LtlProyecto" runat="server" Text='<%# Eval("Proyecto", "{0}")%>'></asp:Literal>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="SubProyecto">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto", "{0}")%>'></asp:Literal>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cuenta Gasto">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCuentaGasto" runat="server" Text='<%# Eval("CuentaGasto")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCuentaGasto" DataTextField="CtaCodigo" CssClass="form-control input-sm select2me" DataValueField="Id" runat="server" Width="144px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cuenta Costos">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCuentaCostos" runat="server" Text='<%# Eval("CuentaCostos")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCuentaCostos" DataTextField="CtaCodigo" CssClass="form-control input-sm select2me" DataValueField="Id" runat="server" Width="144px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cuenta Ingresos" HeaderStyle-Width="400px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCuentaIngresos" runat="server" Text='<%# Eval("CuentaIngresos")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCuentaIngresos" DataTextField="CtaCodigo" CssClass="form-control input-sm select2me" DataValueField="Id" runat="server" Width="144px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton Visible="False" ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
328
Ventas/CatClasificacionesDetalle.aspx.vb
Normal file
328
Ventas/CatClasificacionesDetalle.aspx.vb
Normal file
@@ -0,0 +1,328 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class CatClasificacionesDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property CveClasificacion As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveClasificacion"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClasificacion") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property DtCuentas As DataTable
|
||||
Get
|
||||
Return CType((ViewState("DtCuentas")), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCuentas") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
|
||||
|
||||
CveClasificacion = IfNull(Request("Cveclasificacion"), "-1").ToString.ToEntero
|
||||
If CveClasificacion > 0 Then
|
||||
|
||||
|
||||
If CargaDatos() Then
|
||||
|
||||
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoria.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
|
||||
If Cuenta.GetCuentas(-1, "-1", -1) Then
|
||||
DtCuentas = Cuenta.DtResultados
|
||||
End If
|
||||
Cuenta.Dispose()
|
||||
Try
|
||||
DdlCuentaGasto.DataSource = DtCuentas : DdlCuentaGasto.DataBind()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
Try
|
||||
DdlCuentaCostos.DataSource = DtCuentas : DdlCuentaCostos.DataBind()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
Try
|
||||
DdlCuentaIngresos.DataSource = DtCuentas : DdlCuentaIngresos.DataBind()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
DdlCuentaGasto.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlCuentaCostos.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlCuentaIngresos.Items.Insert(0, New ListItem("-", "-1"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGlobal()
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
|
||||
If ObjClasificaciones.GetClasificaciones() Then
|
||||
GlobalDTClasificaciones = ObjClasificaciones.DtResultados
|
||||
Else
|
||||
Alert("Ocurrió un error al cargar las clasificaciones generales. Por favor avisar a Sistemas.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
If ObjClasificaciones.GetClasificacionesSubProyecto(CveClasificacion, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function CargaDatos() As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
|
||||
If ObjClasificaciones.GetClasificaciones() Then
|
||||
Dim dr As DataRow = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveClasificacion = {0} AND CveEmpresa = {1}", CveClasificacion, UsuarioActual.CveEmpresa)).FiltroPrimero("")
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
TxtClasificacion.Text = dr("Clasificacion").ToString
|
||||
LblClasificacion.Text = dr("Clasificacion").ToString
|
||||
DdlCuentaGasto.SelectedValue = dr("IdCuentaGasto").ToString
|
||||
DdlCuentaCostos.SelectedValue = dr("IdCuentaCostos").ToString
|
||||
DdlCuentaIngresos.SelectedValue = dr("IdCuentaIngresos").ToString
|
||||
|
||||
|
||||
DdlCategoria.SelectedValue = dr("CveCategoria").ToString
|
||||
ChkEstado.Checked = dr("Estatus").ToString = "Activo"
|
||||
Retorno = True
|
||||
BtnGuardar.Visible = True
|
||||
|
||||
If ObjClasificaciones.GetClasificacionesSubProyecto(CveClasificacion, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados
|
||||
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.UpdateClasificacion(TxtClasificacion.Text, "", DdlCuentaGasto.SelectedValue.ToEntero, DdlCuentaGasto.SelectedItem.Text,
|
||||
DdlCuentaCostos.SelectedValue.ToEntero, DdlCuentaCostos.SelectedItem.Text, DdlCuentaIngresos.SelectedValue.ToEntero, DdlCuentaIngresos.SelectedItem.Text,
|
||||
ChkEstado.Checked, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al guardar los cambios. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
CargaGlobal()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(220)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(220)
|
||||
|
||||
e.Row.Cells(4).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(61)
|
||||
'e.Row.Cells(7).Width = Unit.Pixel(50)
|
||||
'e.Row.Cells(8).Width = Unit.Pixel(50)
|
||||
End If
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
|
||||
e.Row.FCDropDownList("DdlCuentaGasto").DataSource = DtCuentas
|
||||
e.Row.FCDropDownList("DdlCuentaGasto").DataBind()
|
||||
e.Row.FCDropDownList("DdlCuentaGasto").Items.Insert(0, New ListItem("-", "-1"))
|
||||
e.Row.FCDropDownList("DdlCuentaGasto").SelectedValue = e.Row.DBCampo("IdCuentaGasto")
|
||||
|
||||
e.Row.FCDropDownList("DdlCuentaCostos").DataSource = DtCuentas
|
||||
e.Row.FCDropDownList("DdlCuentaCostos").DataBind()
|
||||
e.Row.FCDropDownList("DdlCuentaCostos").Items.Insert(0, New ListItem("-", "-1"))
|
||||
e.Row.FCDropDownList("DdlCuentaCostos").SelectedValue = e.Row.DBCampo("IdCuentaCostos")
|
||||
|
||||
e.Row.FCDropDownList("DdlCuentaIngresos").DataSource = DtCuentas
|
||||
e.Row.FCDropDownList("DdlCuentaIngresos").DataBind()
|
||||
e.Row.FCDropDownList("DdlCuentaIngresos").Items.Insert(0, New ListItem("-", "-1"))
|
||||
e.Row.FCDropDownList("DdlCuentaIngresos").SelectedValue = e.Row.DBCampo("IdCuentaIngresos")
|
||||
|
||||
'e.Row.FCDropDownList("DdlCuentaInventario").DataSource = DtCuentas
|
||||
'e.Row.FCDropDownList("DdlCuentaInventario").DataBind()
|
||||
' e.Row.FCDropDownList("DdlCuentaInventario").Items.Insert(0, New ListItem("-", "-1"))
|
||||
' e.Row.FCDropDownList("DdlCuentaInventario").SelectedValue = e.Row.DBCampo("IdCuentaInventario")
|
||||
End If
|
||||
|
||||
'If e.Row.DBCampo("IdCuentaContable").ToEntero > 0 Then
|
||||
' Dim Dr As DataRow = DtCuentas.FiltroPrimero(String.Format("Id= {0}", e.Row.DBCampo("IdCuentaContable")))
|
||||
|
||||
' If GvDatos.EditIndex <> e.Row.RowIndex Then
|
||||
' If Dr IsNot Nothing Then
|
||||
' e.Row.Cells(1).Text = Dr("Nombre").ToString
|
||||
' End If
|
||||
' End If
|
||||
|
||||
'End If
|
||||
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
CargaGlobal()
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
Dim CveSubProyecto As Integer = e.Keys("CveSubProyecto").ToString.ToEntero
|
||||
Dim tCveClasificacion As Integer = e.Keys("CveClasificacion").ToString.ToEntero
|
||||
|
||||
|
||||
Dim DdlGasto As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaGasto")
|
||||
Dim DdlCostos As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaCostos")
|
||||
Dim DdlIngresos As DropDownList = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCuentaIngresos")
|
||||
|
||||
If ObjClasificaciones.UpdateClasificacionSubProyecto(tCveClasificacion, CveSubProyecto, DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text,
|
||||
DdlCostos.SelectedValue.ToEntero, DdlCostos.SelectedItem.Text, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
CargaGlobal()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTClasificaciones"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTClasificaciones"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
586
Ventas/CatClientes.aspx
Normal file
586
Ventas/CatClientes.aspx
Normal file
@@ -0,0 +1,586 @@
|
||||
<%@ Page Title="Ventas - Catálogo de Clientes" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatClientes.aspx.vb" Inherits="CatClientes" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink runat="server" NavigateUrl="/Ventas/Clientes.aspx"> <i class="fa fa-user-plus"></i> Agregar</asp:HyperLink> <%--fa fa-users--%>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPdf" 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>
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
|
||||
</li>
|
||||
<%--<li>
|
||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivCorporativo" ID="HyperLink1" runat="server"> <i class="fa fa-building"></i> Agregar Corporativo</asp:HyperLink>
|
||||
</li>--%>
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivUnificarCliente" ID="ImgUnificar" runat="server" Visible="false"> <i class="fa fa-pencil"></i> Unificar Clientes</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Clientes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT portletfiltrostitlee">
|
||||
<div class="tools">
|
||||
<asp:Button ID="LbFiltrar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button>
|
||||
|
||||
<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">
|
||||
<div class="col-md-1" style="font-size: medium; max-width: 100px!important">Nombre:</div>
|
||||
<div class="col-md-2 " style="max-width: 283px!important">
|
||||
<asp:TextBox ID="TxtNombre" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="30" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">RFC:</div>
|
||||
<div class=" col-md-2 " style="max-width: 283px!important">
|
||||
<asp:TextBox ID="TxtRFC" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="40" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Estatus:</div>
|
||||
<div class=" col-md-2 " style="max-width: 283px!important">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="1">Activo</asp:ListItem>
|
||||
<asp:ListItem Value="2">Inactivo</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:CheckBox runat="server" ID ="ChkPermiteCredito" CssClass="md-checksd" Text="Permite Crédito" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
<div class="row">
|
||||
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Sucursal:</div>
|
||||
<div class=" col-md-2 " style="max-width: 283px!important">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Clasif:</div>
|
||||
<div class=" col-md-2 " style="max-width: 283px!important">
|
||||
<asp:DropDownList ID="DdlClasificaciones" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Tipo:</div>
|
||||
<div class=" col-md-2 " style="max-width: 283px!important">
|
||||
<asp:DropDownList ID="DdlTipoCliente" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
<asp:ListItem Selected="True" Value="1">Frecuente</asp:ListItem>
|
||||
<asp:ListItem Value="2">No Frecuente</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate" style="font-size: medium; max-width: 100px!important">
|
||||
Vendedor:
|
||||
</div>
|
||||
<div class="col-md-2 " style="max-width: 283px!important">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" ValidationGroup="GrpFiltrar" CssClass=" form-control input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="portlet-body">
|
||||
<table class="table table-striped" style="border: 1px solid #D3D3D3; min-width: 985px; width: 100%; display: none;">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" Text="" CommandArgument="Codigo" OnClick="LbOrden_Click">
|
||||
Codigo
|
||||
<asp:Literal ID="Literal1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="320px">
|
||||
<asp:LinkButton ID="LbNombre" runat="server" CausesValidation="false" Text="" CommandArgument="Nombre" OnClick="LbOrden_Click">
|
||||
Nombre
|
||||
<asp:Literal ID="ImgNombre" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LbRFC" runat="server" CausesValidation="false" Text="" CommandArgument="RFC" OnClick="LbOrden_Click">
|
||||
RFC
|
||||
<asp:Literal ID="ImgRFC" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="120px">
|
||||
<asp:LinkButton ID="LbSucursal" runat="server" CausesValidation="false" Text="" CommandArgument="Sucursal" OnClick="LbOrden_Click">
|
||||
Sucursal
|
||||
<asp:Literal ID="ImgSucursal" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="110px">
|
||||
<asp:LinkButton ID="LbTelefono" runat="server" CausesValidation="false" Text="" CommandArgument="Telefono" OnClick="LbOrden_Click">
|
||||
Teléfono
|
||||
<asp:Literal ID="ImgTelefono" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="80px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estado
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="80px">
|
||||
<asp:LinkButton ID="LbFecha" runat="server" CausesValidation="false" Text="" CommandArgument="Fecha" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFecha" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div style="">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="320px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="RFC" ItemStyle-Width="100">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="80">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Teléfono" ItemStyle-Width="60">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Vendedor" Visible="false" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Nombre Corto</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNombreCorto" runat="server" Text='<%# Eval("NombreCorto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>No Ext</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNoExt" runat="server" Text='<%# Eval("NoExt") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>No Int</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNoInt" runat="server" Text='<%# Eval("NoInt") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Colonia</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Ciudad</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCiudad" runat="server" Text='<%# Eval("Ciudad") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Estado</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>País</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>CP</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCP" runat="server" Text='<%# Eval("CP") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Contacto</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Correo Env. Factura</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMail" runat="server" Text='<%# Eval("Mail") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Recepción Facturas</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRecepcionFacturas" runat="server" Text='<%# Eval("RecepcionPagos") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Ret IVA</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Ret ISR</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Plazo Cobranza</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPlazoCobranza" runat="server" Text='<%# Eval("PlazoCobranza") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Límite Crédito</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlLimiteCredito" runat="server" Text='<%# Eval("LimiteCredito", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>CIE</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCIE" runat="server" Text='<%# Eval("ConvenioCIE") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Calle</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Celular</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTelefonoOtro" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Correo Env. Cotización</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCorreoCotizacion" runat="server" Text='<%# Eval("MailCotizacion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Otro Telefono</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
|
||||
<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">×</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">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkNombre" runat="server" Text="Nombre" Checked="true" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" Checked="true" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkSucursal" runat="server" Text="Sucursal" Checked="true" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Teléfono" Checked="true" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkEstadoSis" runat="server" Text="Estado (Sis)" Checked="true" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Captura (Sis)" Checked="true" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario Capturó (Sis)" Checked="true" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCodigo" runat="server" Text="Código" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkNombreCorto" runat="server" Text="Nombre Corto" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkVendedor" runat="server" Text="Vendedor" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkNoExt" runat="server" Text="No Ext" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkNoInt" runat="server" Text="No Int" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCiudad" runat="server" Text="Ciudad" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkPais" runat="server" Text="País" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCP" runat="server" Text="C.P." /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkContacto" runat="server" Text="Contacto" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkMail" runat="server" Text="Correo Envió Facturación" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkRecepcionFacturas" runat="server" Text="Recepción Facturas" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkPlazoCobranza" runat="server" Text="Plazo Cobranza" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text="Límite Crédito" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCIE" runat="server" Text="CIE" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCelular" runat="server" Text="Celular" /></td>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkCorreoCotizacion" runat="server" Text="Correo Envió Cotización" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
</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>
|
||||
|
||||
<%--<div id="DivCorporativo" 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">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Agregar Corporativo"></asp:Label></h4>
|
||||
</div>
|
||||
<div class="modal-body" >
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:Label runat="server">Seleccione un Corporativo</asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left">
|
||||
<asp:DropDownList ID="DdlCorporativo" runat="server" CssClass=" form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnCorporativo" runat="server" Text="Agregar" class="btn btn-success" />
|
||||
<%--OnClick="BtnCorporativo_Click"
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="DivUnificarCliente" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpUnificar" 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">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel4">Unificar Clientes</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyUnificar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label>Cliente a Unificar: </label>
|
||||
<br />
|
||||
<asp:DropDownList ID="DdlClienteAUnificar" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>En: </label>
|
||||
<br />
|
||||
<asp:DropDownList ID="DdlClienteOriginal" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="text-center">
|
||||
<asp:Button ID="BtnUnificar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Unificar"></asp:Button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ajax:ModalPopupExtender ID="MPContrato" runat="server" PopupControlID="PanelContrato" TargetControlID="BtnMostrarClasificaciones"
|
||||
CancelControlID="BtnCerrarClasificaciones" BackgroundCssClass="modalBackground">
|
||||
</ajax:ModalPopupExtender>
|
||||
|
||||
|
||||
|
||||
<asp:Button ID="BtnMostrarClasificaciones" runat="server" Style="visibility: hidden; display: none;" />
|
||||
<asp:Button ID="BtnCerrarClasificaciones" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" />
|
||||
<asp:Panel ID="PanelContrato" runat="server" CssClass="modalPopup" align="center" Style="display: none; padding: 10px;">
|
||||
|
||||
<asp:UpdatePanel ID="UpClasifTipo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="AccionContrato" runat="server">
|
||||
<p>
|
||||
Tipo de Clasificación:
|
||||
</p>
|
||||
<asp:RadioButtonList ID="RblOpcionClasificacion" runat="server" CssClass="rbl" RepeatDirection="Vertical" RepeatLayout="Table">
|
||||
<asp:ListItem Text="Compra de Material para Venta" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Gastos o Compras Administrativas" Value="2"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
|
||||
<asp:LinkButton ID="BtnIniciarContrato" runat="server" CssClass="btn btn-success" Text="Aceptar" />
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<%-- FIN OC X SURTIR --%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
346
Ventas/CatClientes.aspx.vb
Normal file
346
Ventas/CatClientes.aspx.vb
Normal file
@@ -0,0 +1,346 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class CatClientes
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
|
||||
CargaNombreClientes()
|
||||
|
||||
|
||||
CargaSucursales()
|
||||
CargaClasificaciones()
|
||||
CargaVendedor()
|
||||
|
||||
'CargaCorporativo()
|
||||
|
||||
'CargaDatos()
|
||||
|
||||
PanelContrato.Visible = True
|
||||
MPContrato.Enabled = True
|
||||
|
||||
|
||||
Me.Form.DefaultButton = LbFiltrar.UniqueID
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos(Optional Nombre As String = "-1", Optional RFC As String = "-1")
|
||||
|
||||
Dim ObjClientes As New ClsClientes
|
||||
|
||||
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then
|
||||
|
||||
DTDatos = ObjClientes.DtResultados
|
||||
ObjClientes.Dispose()
|
||||
|
||||
'ViewState("DTCliente") = DTDatos
|
||||
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then
|
||||
DTDatos = DTDatos.FiltraParametros("CveCliente IN (10450, 10460, 10458)")
|
||||
ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then
|
||||
DTDatos = DTDatos.FiltraParametros("CveCliente IN (27448)")
|
||||
End If
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSucursales()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClasificaciones()
|
||||
DdlClasificaciones.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificaciones.DataBind()
|
||||
DdlClasificaciones.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaNombreClientes()
|
||||
DdlClienteAUnificar.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClienteAUnificar.DataBind()
|
||||
|
||||
DdlClienteOriginal.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClienteOriginal.DataBind()
|
||||
UpBodyUnificar.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaVendedor()
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LbFiltrar_Click(sender As Object, e As EventArgs) Handles LbFiltrar.Click
|
||||
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Dim Nombre, RFC As String
|
||||
Nombre = "-1"
|
||||
RFC = "-1"
|
||||
|
||||
If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
|
||||
|
||||
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
|
||||
|
||||
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
DTDatos = ObjClientes.DtResultados
|
||||
Else
|
||||
DTDatos = Nothing
|
||||
Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
ObjClientes.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||
|
||||
GvDatos.Columns(0).Visible = ChkCodigo.Checked
|
||||
GvDatos.Columns(1).Visible = ChkNombre.Checked
|
||||
GvDatos.Columns(2).Visible = ChkRFC.Checked
|
||||
GvDatos.Columns(3).Visible = ChkSucursal.Checked
|
||||
GvDatos.Columns(4).Visible = ChkTelefono.Checked
|
||||
GvDatos.Columns(5).Visible = ChkVendedor.Checked
|
||||
|
||||
GvDatos.Columns(6).Visible = ChkEstadoSis.Checked
|
||||
GvDatos.Columns(7).Visible = ChkFechaIng.Checked
|
||||
GvDatos.Columns(8).Visible = ChkUsuario.Checked
|
||||
GvDatos.Columns(9).Visible = ChkNombreCorto.Checked
|
||||
' GvDatos.Columns(10).Visible = ChkVendedor.Checked
|
||||
GvDatos.Columns(10).Visible = ChkNoExt.Checked
|
||||
GvDatos.Columns(11).Visible = ChkNoInt.Checked
|
||||
GvDatos.Columns(12).Visible = ChkColonia.Checked
|
||||
GvDatos.Columns(13).Visible = ChkCiudad.Checked
|
||||
GvDatos.Columns(14).Visible = ChkEstado.Checked
|
||||
GvDatos.Columns(15).Visible = ChkPais.Checked
|
||||
GvDatos.Columns(16).Visible = ChkCP.Checked
|
||||
GvDatos.Columns(17).Visible = ChkContacto.Checked
|
||||
GvDatos.Columns(18).Visible = ChkMail.Checked
|
||||
GvDatos.Columns(19).Visible = ChkRecepcionFacturas.Checked
|
||||
GvDatos.Columns(20).Visible = ChkRetIVA.Checked
|
||||
GvDatos.Columns(21).Visible = ChkRetISR.Checked
|
||||
GvDatos.Columns(22).Visible = ChkPlazoCobranza.Checked
|
||||
GvDatos.Columns(23).Visible = ChkLimiteCredito.Checked
|
||||
GvDatos.Columns(24).Visible = ChkCIE.Checked
|
||||
GvDatos.Columns(25).Visible = ChkCalle.Checked
|
||||
GvDatos.Columns(26).Visible = ChkCelular.Checked
|
||||
GvDatos.Columns(27).Visible = ChkCorreoCotizacion.Checked
|
||||
GvDatos.Columns(28).Visible = ChkOtroTelefono.Checked
|
||||
|
||||
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvDatos.ExportToExcel("RepClientes_" & Now.ToShortDateString)
|
||||
End Sub
|
||||
|
||||
#Region "P D F"
|
||||
Private Sub LinkPdf_Click(sender As Object, e As EventArgs) Handles LinkPdf.Click
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
'OBTENEMOS LOS DATOS
|
||||
Dim DtClientes As DataTable
|
||||
'Dim ObjClientes As New ClsClientes
|
||||
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
|
||||
DtClientes = DTDatos
|
||||
|
||||
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then
|
||||
DtClientes = DTDatos.FiltraParametros("CveCliente IN (10450, 10460, 10458)")
|
||||
ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then
|
||||
DtClientes = DTDatos.FiltraParametros("CveCliente IN (27448)")
|
||||
End If
|
||||
Else
|
||||
DtClientes = Nothing
|
||||
End If
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||
params.Add(New ReportParameter("DireccionEmpresa", UsuarioActual.Empresa.Direccion))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepClientes.rdlc", DtClientes, params, "RepClientes")
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(1).Width = Unit.Pixel(300)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(120)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(190)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(110)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(7).Width = Unit.Pixel(100)
|
||||
End If
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
'e.Row.FCLiteral("LtlNombre").Text = "<a class=""Texto"" href=""javascript:AbrirVentana('/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & "', 700, 500, 'N', 'PS')"">" & e.Row.FCLiteral("LtlNombre").Text & "</a>"
|
||||
'e.Row.FCLiteral("LtlRFC").Text = "<a class=""Texto"" href=""javascript:AbrirVentana('/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & "', 700, 500, 'N', 'PS')"">" & e.Row.FCLiteral("LtlRFC").Text & "</a>"
|
||||
'e.Row.FCLiteral("LtlSucursal").Text = "<a class=""Texto"" href=""javascript:AbrirVentana('/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & "', 700, 500, 'N', 'PS')"">" & e.Row.FCLiteral("LtlSucursal").Text & "</a>"
|
||||
'e.Row.FCLiteral("LtlTelefono").Text = "<a class=""Texto"" href=""javascript:AbrirVentana('/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & "', 700, 500, 'N', 'PS')"">" & e.Row.FCLiteral("LtlTelefono").Text & "</a>"
|
||||
|
||||
e.Row.FCLiteral("LtlCodigo").Text = "<a class=""Texto"" href=""/Ventas/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & """>" & e.Row.FCLiteral("LtlCodigo").Text & "</a>"
|
||||
e.Row.FCLiteral("LtlNombre").Text = "<a class=""Texto"" href=""/Ventas/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & """>" & e.Row.FCLiteral("LtlNombre").Text & "</a>"
|
||||
e.Row.FCLiteral("LtlRFC").Text = "<a class=""Texto"" href=""/Ventas/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & """>" & e.Row.FCLiteral("LtlRFC").Text & "</a>"
|
||||
e.Row.FCLiteral("LtlSucursal").Text = "<a class=""Texto"" href=""/Ventas/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & """>" & e.Row.FCLiteral("LtlSucursal").Text & "</a>"
|
||||
e.Row.FCLiteral("LtlTelefono").Text = "<a class=""Texto"" href=""/Ventas/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & """>" & e.Row.FCLiteral("LtlTelefono").Text & "</a>"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(DTDatos, "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = DTDatos
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "UNIFICAR CLIENTE"
|
||||
Private Sub BtnUnificar_Click(sender As Object, e As EventArgs) Handles BtnUnificar.Click
|
||||
Dim ObjCliente As New ClsClientes()
|
||||
|
||||
ObjCliente.IniciaTransacSQL()
|
||||
If ObjCliente.UnificarClientes(DdlClienteAUnificar.SelectedValue.ToEntero, DdlClienteOriginal.SelectedValue.ToEntero) Then
|
||||
ObjCliente.Commit()
|
||||
Alert("Se han unificado los clientes satisfactoriamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjCliente.RollBack()
|
||||
Alert("Ha ocurrido un error al unificar clientes", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCliente.Dispose()
|
||||
CargaNombreClientes()
|
||||
CargaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
'Protected Sub BtnCorporativo_Click(sender As Object, e As EventArgs)
|
||||
|
||||
' Dim ObjClientes As New ClsClientes
|
||||
|
||||
' If ObjClientes.AddCorporativo(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero) Then
|
||||
' If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
' DTDatos = ObjClientes.DtResultados
|
||||
' Else
|
||||
' DTDatos = Nothing
|
||||
' Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
' ObjClientes.Dispose()
|
||||
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
|
||||
' UPDatos.Update()
|
||||
|
||||
'End Sub
|
||||
|
||||
'Private Sub CargaCorporativo()
|
||||
|
||||
' DdlCorporativo.DataSource = GlobalDTCorporativo(UsuarioActual.CveEmpresa)
|
||||
' DdlCorporativo.DataBind()
|
||||
' DdlCorporativo.Items.Insert(0, New ListItem("Selecione", "-1"))
|
||||
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
144
Ventas/CatClientesClasificaciones.aspx
Normal file
144
Ventas/CatClientesClasificaciones.aspx
Normal file
@@ -0,0 +1,144 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatClientesClasificaciones.aspx.vb" Inherits="Ventas_ClientesClasificaciones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Clasificaciones de Clientes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarSucursalModal" runat="server" data-toggle="tooltip" OnClientClick="javascript:showDivEC();SetValue('HdnModalidad', 'I');CleanObjects();return false;" data-placement="left" title="Agregar una Clasificación." Text="<i class='fa fa-plus'></i> Agregar"></asp:LinkButton></td>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvClasificacion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvClasificacion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpGvClasificacion" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvClasificacion" runat="server" AutoGenerateColumns="False" DataKeyNames="CveClienteClasificacion" EmptyDataText="No se encontraron Clasificaciones." ToolTip="Listado de Clasificacaiones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ClienteClasificacion" ItemStyle-Width="30%" HeaderText="Clasificación" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="30%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="Usuario" ItemStyle-Width="30%" HeaderText="Usuario" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green mysmallbtn" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red mysmallbtn" 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>
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div id="divAgregarSucursal" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" 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">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Guardar Clasificación</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpAgregarSucursal" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtClasificacion" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtClasificacion.ClientID.ToString()%>">Clasificación:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="LbAgregar" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardarRegistro" />
|
||||
<button id="BtnCancelarPrecioLista" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
var TxtClasificacion = '<%= TxtClasificacion.ClientID%>';
|
||||
|
||||
function showDivEC() {
|
||||
$('#divAgregarSucursal').modal('show');
|
||||
}
|
||||
function hideDivEC() {
|
||||
$('#divAgregarSucursal').modal('hide');
|
||||
}
|
||||
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#divAgregarSucursal').modal();
|
||||
}
|
||||
function HideDivRegistro() {
|
||||
$('#divAgregarSucursal').modal('hide');
|
||||
}
|
||||
|
||||
|
||||
function SetObjects(Clasificacion) {
|
||||
debugger;
|
||||
document.getElementById(TxtClasificacion).value = Clasificacion;
|
||||
}
|
||||
|
||||
|
||||
function CleanObjects() {
|
||||
document.getElementById(TxtClasificacion).value = "";
|
||||
}
|
||||
|
||||
function SetValue(Hidden, Value) {
|
||||
document.getElementById(Hidden).value = Value;
|
||||
}
|
||||
|
||||
</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">
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
135
Ventas/CatClientesClasificaciones.aspx.vb
Normal file
135
Ventas/CatClientesClasificaciones.aspx.vb
Normal file
@@ -0,0 +1,135 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_ClientesClasificaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " CARGAS "
|
||||
Private Sub CargaDatos()
|
||||
Dim Objeto As New ClsClientes
|
||||
If Objeto.GetClienteClasificacion(UsuarioActual.CveEmpresa) Then
|
||||
GvClasificacion.DataSource = Objeto.DtResultados
|
||||
End If
|
||||
GvClasificacion.DataBind()
|
||||
CargaGlobal()
|
||||
Objeto.Dispose()
|
||||
OrdenaDatos()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " GV Clasificaciones Y AGREGAR "
|
||||
Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
|
||||
Dim Objeto As New ClsClientes
|
||||
If HdnModalidad.Value = "I" Then
|
||||
If Objeto.AddClienteClasificacion(TxtClasificacion.Text, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, True) Then
|
||||
TxtClasificacion.Text = ""
|
||||
Alert("La Clasificación se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaDatos()
|
||||
UpGvClasificacion.Update()
|
||||
Objeto.Dispose()
|
||||
OcultaDiv()
|
||||
End If
|
||||
|
||||
Else
|
||||
If HdnID.Value.ToEntero <> -1 Then
|
||||
If Objeto.UpdateClienteClasificacion(TxtClasificacion.Text, HdnID.Value.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, True) Then
|
||||
Alert("Se actualizó correctamente la Clasificación.", TipoMensaje.MsgInformacion)
|
||||
CargaDatos()
|
||||
UpGvClasificacion.Update()
|
||||
Objeto.Dispose()
|
||||
OcultaDiv()
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvClasificacion_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvClasificacion.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim URL As String = String.Format("javascript:CleanObjects();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}');ShowDivRegistro();return false;", e.Row.DBCampo("CveClienteClasificacion").ToEntero, e.Row.DBCampo("ClienteClasificacion"))
|
||||
'GeneroLigas
|
||||
Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvClasificacion_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvClasificacion.RowEditing
|
||||
GvClasificacion.EditIndex = e.NewEditIndex
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvClasificacion_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvClasificacion.RowUpdating
|
||||
|
||||
Dim Update As New ClsClientes
|
||||
Dim Clasificacion = GvClasificacion.Rows(e.RowIndex).FCTextBox("TxtClasificacion").Text.Trim
|
||||
Dim Clave = GvClasificacion.Rows(e.RowIndex).DataKey("CveClienteClasificacion").ToEntero
|
||||
|
||||
If Update.UpdateClienteClasificacion(Clasificacion, Clave, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, True) Then
|
||||
Alert("Se actualizó correctamente la Clasificación.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GvClasificacion.EditIndex = -1
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvClasificacion_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvClasificacion.RowCancelingEdit
|
||||
GvClasificacion.EditIndex = -1
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub GvClasificacion_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvClasificacion.RowDeleting
|
||||
Dim Objeto As New ClsClientes
|
||||
Dim Clave = GvClasificacion.Rows(e.RowIndex).DataKey("CveClienteClasificacion").ToEntero
|
||||
If Objeto.RemoveClienteClasificacion(Clave) Then
|
||||
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
Objeto.Dispose()
|
||||
GvClasificacion.EditIndex = -1
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " O R D E N A M I E N T O JAVASCRIPT"
|
||||
Private Sub OrdenaDatos()
|
||||
If (GvClasificacion.Rows.Count > 0) Then
|
||||
GvClasificacion.UseAccessibleHeader = True
|
||||
GvClasificacion.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Private Sub CargaGlobal()
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClienteClasificacion(-1) Then Application("GlobalDTClienteClasificaciones") = ObjClientes.DtResultados Else Application("GlobalDTClienteClasificaciones") = Nothing
|
||||
ObjClientes.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub OcultaDiv()
|
||||
ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
339
Ventas/CatDocumentosClientes.aspx
Normal file
339
Ventas/CatDocumentosClientes.aspx
Normal file
@@ -0,0 +1,339 @@
|
||||
<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentosClientes.aspx.vb" Inherits="Vta_CatDocumentosClientes" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
#C_GvDocumentos > tbody > tr:nth-child(2) > td:nth-child(1){
|
||||
min-width:275px!important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Documentos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarDocumento" CssClass="" data-toggle="tooltip"
|
||||
data-placement="left" title="Agregar Documento." Text="<i class='fa fa-plus'></i> Agregar Documento"></asp:LinkButton>
|
||||
</li>
|
||||
<%-- <li>
|
||||
<a data-toggle="modal" data-target="#DvTags" ><i class="fa fa-tags" ></i> Etiquetas</a>
|
||||
</li>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosGral" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPBtnDocumentacionNext4" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="portlet smmallpadding light bordered" id="DIVDocumentacion" runat="server">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Documentación</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
|
||||
<asp:UpdatePanel ID="UPGvDocumentos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDocumentos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveDocumentacion,Documentacion,DocumentacionFormato,Orden,Estatus,CveDocumentacionTipo,DocumentacionTipo,Requerido,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento" EmptyDataText="No se encontraron registros de documentos" CssClass="table table-hover table-advance Widthall" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="60px" HeaderText="Documento">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDocumentacion" runat="server" Text='<%# Eval("Documentacion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ControlStyle-CssClass="template" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="275" HeaderText="Formato">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDocumentacionFormato" runat="server" Text='<%# Eval("DocumentacionFormato") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Documentacion Tipo">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDocumentacionTipo" runat="server" Text='<%# Eval("DocumentacionTipo") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Dias Limite">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDocumentacionDiasLimite" runat="server" Text='<%# If(Eval("DiasLimite").ToString() = "" Or Eval("DiasLimite").ToString() = "0", "-", Eval("DiasLimite").ToString()) %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Aplica Limite">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAplicaDiasLimite" runat="server" Text='<%# If(Eval("AplicaDiasLimite").ToString() = "1", "Si", "No") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Aplica Vencimiento">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDocumentacionAplicaFechaVencimiento" runat="server" Text='<%# If(Eval("AplicaFechaVencimiento").ToString() = "1", "Si", "No") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDocumentacionEstatus" runat="server" Text='<%# If(Eval("Estatus").ToString() = "True", "Activo", "Inactivo") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Requerido">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRequerido" runat="server" Text='<%# If(Eval("Requerido").ToString() = "True", "Requerido", "No requerido") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Orden" ItemStyle-Width="100">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlOrden" runat="server" Text='<%# Eval("Orden") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="ImgDownLoad" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" ToolTip="Editar documento" CausesValidation="False" OnClick="Edit_ClickDocumentacion"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil' Tittle='Editar Documento' ></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkEliminar" OnClick="Remove_ClickDocumentacion" runat="server" AlternateText="Editar" ToolTip="Eliminar" CausesValidation="False"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash' title='Eliminar'></i>" Title="Eliminar Documento" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar el documento?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row col-md-12 ">
|
||||
<asp:LinkButton runat="server" Visible="false" CommandArgument="4" ID="BtnDocumentacionNext4" CssClass="btn btn-primary" data-toggle="tooltip" data-placement="left" ValidationGroup="GpoDocumentacion" Text="Guardar"></asp:LinkButton>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="BtnDocumentacionNext4" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
<div id="divAgregarDocumentacion" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalDocumentacion" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<h4> <asp:Literal ID="LtlTituloModalDocumentacion" runat="server">Agregar Documento</asp:Literal></h4>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="Txtdocumentacion" CssClass="form-control" MaxLength="100" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="rfvTxtdocumentacion" runat="server" ControlToValidate="Txtdocumentacion" ValidationGroup="GrpEscolaridad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Institución''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<label for="<%= Txtdocumentacion.ClientID.ToString()%>">Documento:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlDocumentacionTipo" runat="server" Width="150" CssClass=" select2me form-control " DataValueField="CveDocumentacionTipo" DataTextField="DocumentacionTipo">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator InitialValue="-1" ID="rfvDdlDocumentacionTipo" ControlToValidate="DdlDocumentacionTipo" CssClass="help-block errorimput" ValidationGroup="GrpEscolaridad" runat="server" ErrorMessage="Seleccione una de las opciones"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlDocumentacionTipo.ClientID.ToString()%>">Tipo de documento:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtOrden" CssClass="form-control" onkeypress="validate(event)" MaxLength="3" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="rfvTxtOrden" runat="server" ControlToValidate="TxtOrden" ValidationGroup="GrpEscolaridad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Institución''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender ID="filTxtOrden" runat="server" TargetControlID="TxtOrden" FilterType="Numbers" ValidChars="" />
|
||||
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<%-- <div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDocumentacionFormato" CssClass="form-control" MaxLength="50" runat="server"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="filTxtDocumentacionFormato" runat="server" TargetControlID="TxtDocumentacionFormato" FilterType="Numbers, uppercaseLetters,LowercaseLetters,Custom" ValidChars="_" />
|
||||
<label for="<%= TxtDocumentacionFormato.ClientID.ToString()%>">Nombre de Formato:</label>
|
||||
</div>--%>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDiasLimite" CssClass="form-control" onkeypress="validate(event)" MaxLength="2" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="rfvTxtDiasLimite" runat="server" ControlToValidate="TxtDiasLimite" ValidationGroup="GrpEscolaridad" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender ID="FilTxtDiasLimite" runat="server" TargetControlID="TxtDiasLimite" FilterType="Numbers" ValidChars="" />
|
||||
<label for="<%= TxtOrden.ClientID.ToString()%>">Dias Limite:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkAplicaDiasLimite" runat="server" Text ="Aplica Dias Limite" />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkAplicaFechaVencimiento" runat="server" Text ="Aplica Fecha de Vencimiento" />
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="chkRequerido" runat="server" Text ="Requerido" />
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="chkEstatus" runat="server" Text ="Activo" />
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright ">
|
||||
<div class="row ">
|
||||
<div class="col-md-12">
|
||||
<asp:TextBox ID="TxtFileDocumentacion" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarDocumentoModal" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpEscolaridad" />
|
||||
<button id="BtnCancelarEscolaridadModal4" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvTags" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpEtiquetas" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<h4> <asp:Literal ID="Literal2" runat="server">Etiquetas</asp:Literal></h4>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etiqueta</th>
|
||||
<th>Descripción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>{Nombres}</td><td>Nombre</td></tr>
|
||||
<tr><td>{APaterno}</td><td>Apellido Paterno</td></tr>
|
||||
<tr><td>{AMaterno}</td><td>Apellido Materno</td></tr>
|
||||
<tr><td>{NombreCompleto}</td><td>Nombre Completo</td></tr>
|
||||
<tr><td>{RFC}</td><td></td></tr>
|
||||
<tr><td>{Estatura}</td> <td></td></tr>
|
||||
<tr><td>{Peso}</td><td></td></tr>
|
||||
<tr><td>{LugarNacimiento}</td><td>Lugar de nacimie</td></tr>
|
||||
<tr><td>{Edad}</td><td></td></tr>
|
||||
<tr><td>{NombreTelEmergencia}</td><td>Nombre y telefono al presentarse una emergencia</td></tr>
|
||||
<tr><td>{TipoSangre}</td><td></td></tr>
|
||||
<tr><td>{SubProyecto}</td><td>Se refiere a la sucursal o centro de costos</td></tr>
|
||||
<tr><td>{EstadoCivil}</td><td></td></tr>
|
||||
<tr><td>{Direccion}</td><td></td></tr>
|
||||
<tr><td>{Vivienda}</td><td></td></tr>
|
||||
<tr><td>{ViviendaDueno}</td><td></td></tr>
|
||||
<tr><td>{CreditoInfonavit}</td><td></td></tr>
|
||||
<tr><td>{RentaMensual}</td><td></td></tr>
|
||||
<tr><td>{TransportePublico}</td><td></td></tr>
|
||||
<tr><td>{TrabajadoAnteriormente}</td><td>La persona a trabajado enteriormente en la empresa</td></tr>
|
||||
<tr><td>{TrabajadoAnteriormenteObservaciones}</td><td>Detalle de trabajo enterior en empresa</td></tr>
|
||||
<tr><td>{ParientesEmpresa}</td><td>Se tienen parientes en la empresa</td></tr>
|
||||
<tr><td>{AcusadoDelito}</td><td></td></tr>
|
||||
<tr><td>{AcusadoDelitoObservaciones}</td><td></td></tr>
|
||||
<tr><td>{Calle}</td><td></td></tr>
|
||||
<tr><td>{Colonia}</td><td></td></tr>
|
||||
<tr><td>{CP}</td><td></td></tr>
|
||||
<tr><td>{Telefono}</td><td></td></tr>
|
||||
<tr><td>{Celular}</td><td></td></tr>
|
||||
<tr><td>{Correo}</td><td></td></tr>
|
||||
<tr><td>{NumeroSS}</td><td></td></tr>
|
||||
<tr><td>{Licencia}</td><td></td></tr>
|
||||
<tr><td>{CartillaMilitar}</td><td></td></tr>
|
||||
<tr><td>{CURP}</td><td></td></tr>
|
||||
<tr><td>{CredencialElector}</td><td></td></tr>
|
||||
<tr><td>{FechaIngreso}</td><td></td></tr>
|
||||
<tr><td>{Puesto}</td><td></td></tr>
|
||||
<tr><td>{FechaActual}</td><td></td></tr>
|
||||
<tr><td>{FechaActualDF}</td><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button id="btnCerrarEtiquetas" runat="server" type="button" class="btn btn-Default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
function validate(evt) {
|
||||
var theEvent = evt || window.event;
|
||||
var key = theEvent.keyCode || theEvent.which;
|
||||
key = String.fromCharCode(key);
|
||||
var regex = /[0-9]|\./;
|
||||
if (!regex.test(key)) {
|
||||
theEvent.returnValue = false;
|
||||
if (theEvent.preventDefault) theEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
455
Ventas/CatDocumentosClientes.aspx.vb
Normal file
455
Ventas/CatDocumentosClientes.aspx.vb
Normal file
@@ -0,0 +1,455 @@
|
||||
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
|
||||
Partial Class Vta_CatDocumentosClientes
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DTDocumentacion As DataTable
|
||||
Get
|
||||
If ViewState("DTDocumentacion") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDocumentacion"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property Documentacion As String
|
||||
Get
|
||||
If ViewState("Documentacion") Is Nothing Then
|
||||
Return "-1"
|
||||
Else
|
||||
Return ViewState("Documentacion").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Documentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
Property CveDocumentacion As Integer
|
||||
Get
|
||||
If ViewState("CveDocumentacion") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveDocumentacion"), Integer)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DocumentacionTipo As String
|
||||
Get
|
||||
If ViewState("DocumentacionTipo") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("DocumentacionTipo").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CveDocumentacionTipo As Integer
|
||||
Get
|
||||
If ViewState("CveDocumentacionTipo") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("CveDocumentacionTipo"), Integer)
|
||||
End If
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("CveDocumentacionTipo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property ActualizarDocumentacion As Boolean
|
||||
Get
|
||||
If ViewState("ActualizarDocumentacion") Is Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ActualizarDocumentacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property Estatus As Boolean
|
||||
Get
|
||||
If ViewState("Estatus") Is Nothing Then
|
||||
Return 0
|
||||
Else
|
||||
Return DirectCast(ViewState("Estatus"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("Estatus") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Property DocumentacionFormato As String
|
||||
Get
|
||||
If ViewState("DocumentacionFormato") Is Nothing Then
|
||||
Return ""
|
||||
Else
|
||||
Return ViewState("DocumentacionFormato").ToString
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("DocumentacionFormato") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property Requerido As Boolean
|
||||
Get
|
||||
If ViewState("Requerido") Is Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return DirectCast(ViewState("Requerido"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("Requerido") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property DiasLimite As Integer
|
||||
Get
|
||||
If ViewState("DiasLimite") Is Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return DirectCast(ViewState("DiasLimite"), Integer)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("DiasLimite") = value
|
||||
End Set
|
||||
End Property
|
||||
Property AplicaDiasLimite As Boolean
|
||||
Get
|
||||
If ViewState("AplicaDiasLimite") Is Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return DirectCast(ViewState("AplicaDiasLimite"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaDiasLimite") = value
|
||||
End Set
|
||||
End Property
|
||||
Property AplicaFechaVencimiento As Boolean
|
||||
Get
|
||||
If ViewState("AplicaFechaVencimiento") Is Nothing Then
|
||||
Return True
|
||||
Else
|
||||
Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaFechaVencimiento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property Orden As Integer
|
||||
Get
|
||||
If ViewState("Orden") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return DirectCast(ViewState("Orden"), Integer)
|
||||
End If
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Orden") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDocumentacion()
|
||||
CargaComboDocumentacion()
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "D O C U M E N T A C I O N"
|
||||
|
||||
Protected Sub BtnAgregarDocumento_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumento.Click
|
||||
ResetFormDocumentacion()
|
||||
RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});")
|
||||
End Sub
|
||||
|
||||
Private Sub ResetFormDocumentacion()
|
||||
|
||||
|
||||
Txtdocumentacion.Text = ""
|
||||
TxtOrden.Text = ""
|
||||
BtnAgregarDocumentoModal.Text = "Agregar"
|
||||
LtlTituloModalDocumentacion.Text = "Agregar documentación"
|
||||
'TxtDocumentacionFormato.Text = ""
|
||||
DdlDocumentacionTipo.SelectedIndex = 0
|
||||
chkEstatus.Checked = True
|
||||
chkRequerido.Checked = True
|
||||
|
||||
TxtDiasLimite.Text = ""
|
||||
ChkAplicaDiasLimite.Checked = False
|
||||
ChkAplicaFechaVencimiento.Checked = False
|
||||
|
||||
|
||||
ActualizarDocumentacion = False
|
||||
UpModalDocumentacion.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDocumentacion()
|
||||
|
||||
Dim objRH As New ClsEdocumentacion
|
||||
|
||||
If objRH.DocumentacionGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa, Modulo:=2) Then
|
||||
|
||||
DTDocumentacion = objRH.DtResultados
|
||||
GvDocumentos.DataSource = objRH.DtResultados
|
||||
Else
|
||||
DTDocumentacion = Nothing
|
||||
GvDocumentos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
GvDocumentos.DataBind()
|
||||
UPGvDocumentos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaComboDocumentacion()
|
||||
Dim objDocumentacion As New ClsEdocumentacion
|
||||
|
||||
If objDocumentacion.DocumentacionTipoGet(UsuarioActual.CveEmpresa, Modulo:=2) Then
|
||||
|
||||
DdlDocumentacionTipo.DataSource = objDocumentacion.DtResultados
|
||||
|
||||
End If
|
||||
|
||||
objDocumentacion.Dispose()
|
||||
DdlDocumentacionTipo.DataBind()
|
||||
DdlDocumentacionTipo.Items.Insert(0, New ListItem("Seleccione un tipo", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_ClickDocumentacion(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
CveDocumentacion = GvRow.DataKey("CveDocumentacion")
|
||||
Documentacion = GvRow.DataKey("Documentacion")
|
||||
DocumentacionFormato = GvRow.DataKey("DocumentacionFormato")
|
||||
CveDocumentacionTipo = GvRow.DataKey("CveDocumentacionTipo")
|
||||
DocumentacionTipo = GvRow.DataKey("DocumentacionTipo")
|
||||
Orden = GvRow.DataKey("Orden")
|
||||
Estatus = GvRow.DataKey("Estatus")
|
||||
Requerido = GvRow.DataKey("Requerido")
|
||||
|
||||
DiasLimite = GvRow.DataKey("DiasLimite").ToEntero
|
||||
AplicaDiasLimite = If(GvRow.DataKey("AplicaDiasLimite").ToEntero = 1, True, False)
|
||||
AplicaFechaVencimiento = If(GvRow.DataKey("AplicaFechaVencimiento").ToEntero = 1, True, False)
|
||||
|
||||
Txtdocumentacion.Text = Documentacion
|
||||
TxtOrden.Text = Orden
|
||||
DdlDocumentacionTipo.SelectedValueExist(CveDocumentacionTipo)
|
||||
chkEstatus.Checked = Estatus
|
||||
chkRequerido.Checked = Requerido
|
||||
|
||||
TxtDiasLimite.Text = DiasLimite
|
||||
ChkAplicaDiasLimite.Checked = AplicaDiasLimite
|
||||
ChkAplicaFechaVencimiento.Checked = AplicaFechaVencimiento
|
||||
|
||||
LtlTituloModalDocumentacion.Text = "Actualizar Documento: " & Documentacion
|
||||
BtnAgregarDocumentoModal.Text = "Actualizar"
|
||||
|
||||
UpModalDocumentacion.Update()
|
||||
ActualizarDocumentacion = True
|
||||
|
||||
RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function GuardarArchivo(_CveDocumentacion As Integer) As String
|
||||
|
||||
Dim respuesta As String = ""
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
Try
|
||||
respuesta = fileItem.filenameO
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
Dim tempArray() As String
|
||||
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
|
||||
|
||||
Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & fileItem.filenameO
|
||||
Dim docAnterior As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & DocumentacionFormato
|
||||
|
||||
If DocumentacionFormato.Trim.Length > 0 Then
|
||||
If File.Exists(docAnterior) Then
|
||||
File.Delete(docAnterior)
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "\Formatos") Then
|
||||
Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "\Formatos")
|
||||
|
||||
End If
|
||||
|
||||
If System.IO.File.Exists(rutaDestino) Then
|
||||
System.IO.File.Delete(rutaDestino)
|
||||
End If
|
||||
|
||||
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Error al cargar archivo", ex)
|
||||
End Try
|
||||
TxtFileDocumentacion.Text = ""
|
||||
UpModalDocumentacion.Update()
|
||||
Next
|
||||
|
||||
|
||||
Return respuesta
|
||||
End Function
|
||||
|
||||
Public Sub Remove_ClickDocumentacion(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion")
|
||||
Dim _documetacionFormato As String = GvRow.DataKey("DocumentacionFormato")
|
||||
|
||||
|
||||
|
||||
Dim objEdoc As New ClsEdocumentacion
|
||||
|
||||
If objEdoc.DocumentacionRemove(_CveDocumentacion, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
EliminarDocumentoDisco(_documetacionFormato)
|
||||
Alert("Documento eliminado correctamente", TipoMensaje.MsgInformacion)
|
||||
CargaDocumentacion()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EliminarDocumentoDisco(documento As String)
|
||||
|
||||
Dim archivo As String = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
|
||||
|
||||
If File.Exists(archivo) Then
|
||||
File.Delete(archivo)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnAgregarDocumentoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentoModal.Click
|
||||
|
||||
Dim objRH As New ClsEdocumentacion
|
||||
Dim intCompleto As Integer = 0
|
||||
Dim _estatus As Integer = 0
|
||||
Dim _requerido As Integer = 0
|
||||
Dim _formato As String = ""
|
||||
|
||||
|
||||
If chkEstatus.Checked Then
|
||||
_estatus = 1
|
||||
End If
|
||||
|
||||
If chkRequerido.Checked Then
|
||||
_requerido = 1
|
||||
End If
|
||||
|
||||
If ActualizarDocumentacion Then
|
||||
|
||||
_formato = GuardarArchivo(CveDocumentacion)
|
||||
If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, UsuarioActual.Empresa.CveEmpresa, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0)) Then
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
|
||||
Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaDocumentacion()
|
||||
End If
|
||||
|
||||
Else
|
||||
If objRH.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.Empresa.CveEmpresa) Then
|
||||
|
||||
CveDocumentacion = objRH.DtResultados(0)(0).ToString.ToEntero
|
||||
_formato = GuardarArchivo(CveDocumentacion)
|
||||
If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, If(ChkAplicaDiasLimite.Checked, 1, 0), If(ChkAplicaFechaVencimiento.Checked, 1, 0), UsuarioActual.Empresa.CveEmpresa) Then
|
||||
|
||||
End If
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion"))
|
||||
Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaDocumentacion()
|
||||
End If
|
||||
End If
|
||||
|
||||
ActualizarDocumentacion = False
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero
|
||||
Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString
|
||||
Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
|
||||
Dim separado As Char() = {"."}
|
||||
Dim array() As String = DocumetacionFormato.Split(separado)
|
||||
Dim extencion As String = ""
|
||||
|
||||
If array.Length > 0 Then
|
||||
extencion = array(array.Length - 1)
|
||||
End If
|
||||
|
||||
If DocumetacionFormato.Trim.Length > 0 Then
|
||||
|
||||
Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato
|
||||
Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato
|
||||
If File.Exists(linkDescargaArchivo) Then
|
||||
ImgDownLoad.Visible = True
|
||||
If extencion.Length > 0 Then
|
||||
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar Formato'></i></a>", linkDescarga, DocumetacionFormato)
|
||||
Else
|
||||
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' download='{1}'><i class='fa fa-download' title='Descargar Formato'></i></a>", linkDescarga, DocumetacionFormato)
|
||||
End If
|
||||
Else
|
||||
ImgDownLoad.Visible = False
|
||||
End If
|
||||
|
||||
Else
|
||||
ImgDownLoad.Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
292
Ventas/CatEsquemaComisiones.aspx
Normal file
292
Ventas/CatEsquemaComisiones.aspx
Normal file
@@ -0,0 +1,292 @@
|
||||
<%@ Page Title="SIG: Catálogo Esquema Comisiones" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEsquemaComisiones.aspx.vb" Inherits="Ventas_CatEsquemaComisiones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo Esquema Comisiones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<ajax:TabContainer ID="TabEsquemaLimite" runat="server" ActiveTabIndex="0" Width="100%">
|
||||
|
||||
<ajax:TabPanel ID="TabEsquema" runat="server" HeaderText="Esquema">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpTitulosEsquema" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table-striped table-hover Widthall" style="max-width: 750px;">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="30%">
|
||||
<%--<asp:LinkButton ID="LbEsquemaC" runat="server" CausesValidation="false" Text="" CommandArgument="LbEsquema;0">
|
||||
Esquema Comisión
|
||||
<asp:Literal ID="LtEsquemaC" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>--%>
|
||||
Esquema Comisión
|
||||
</th>
|
||||
|
||||
<th width="30%">
|
||||
<%--<asp:LinkButton ID="LbEsquemaC" runat="server" CausesValidation="false" Text="" CommandArgument="LbEsquema;0">
|
||||
Esquema Comisión
|
||||
<asp:Literal ID="LtEsquemaC" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>--%>
|
||||
Tipo Comisión
|
||||
</th>
|
||||
<th width="40%">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtEsquemaComision" Width="90%" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEsquemaComision" runat="server" ControlToValidate="TxtEsquemaComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Esquema Comision''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOEsquemaComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVEsquemaComision" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlTipoComision" runat="server" Width="90%" CssClass="select2me">
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Importe de Venta" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Utilidad" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoComision" runat="server" ControlToValidate="DdlTipoComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Comision''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoComision" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarEsquema" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpdatosEsquema" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVEsquema" runat="server" CssClass="table-striped table-hover Widthall ADScroller" Style="max-width: 750px;" DataKeyNames="CveEsquemaComision" GridLines="None" EmptyDataText="No se encontraron Registros con el filtro actual" AutoGenerateColumns="false">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="30%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtEsquema" runat="server" Text='<%# Eval("EsquemaComision") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxTComisionEdit" runat="server" Text='<%# Eval("EsquemaComision") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEsquemaComisionEdit" runat="server" ControlToValidate="TxTComisionEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Esquema''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOEsquemaComisionEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVEsquemaComisionEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="30%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtTipoComision" runat="server" Text='<%# Eval("TipoComisionTexto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlTipoComisionEdit" runat="server" Width="90%" CssClass="select2me">
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Importe de Venta" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Utilidad" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoComision" runat="server" ControlToValidate="DdlTipoComisionEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Comision''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoComision" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<div style="width: 100px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpComisionEdit" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabLimite" runat="server" HeaderText="Limite">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpTitulosLimites" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table-striped Widthall" style="max-width: 750px;">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="20%">
|
||||
<%-- <asp:LinkButton ID="LbEsquema" runat="server" CausesValidation="false" Text="" CommandArgument="EsquemaComision;0" OnClick="LbOrden_Click">
|
||||
Esquema
|
||||
<asp:Literal ID="ImgEsquemaComision" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>--%>
|
||||
Esquema
|
||||
</th>
|
||||
<th width="20%">Nivel
|
||||
</th>
|
||||
<th width="20%">
|
||||
<%--<asp:LinkButton ID="LbLimite" runat="server" CausesValidation="false" Text="" CommandArgument="LimiteMaximo;0" OnClick="LbOrden_Click">
|
||||
Límite Máximo
|
||||
<asp:Literal ID="ImgLimiteMaximo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>--%>
|
||||
Límite Máximo
|
||||
</th>
|
||||
<th width="20%">
|
||||
<%--<asp:LinkButton ID="LbComision" runat="server" CausesValidation="false" Text="" CommandArgument="Comision;0" OnClick="LbOrden_Click">
|
||||
Comisión
|
||||
<asp:Literal ID="ImgComision" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>--%>
|
||||
Comisión
|
||||
</th>
|
||||
<%--<th width="200px">
|
||||
<asp:LinkButton ID="LbImporte" runat="server" CausesValidation="false" Text="" CommandArgument="ImporteFijo;0" OnClick="LbOrden_Click">
|
||||
Importe
|
||||
<asp:Literal ID="ImgImporte" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>--%>
|
||||
<th width="20%">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlEsquemaComision" runat="server" Width="90%" DataValueField="CveEsquemaComision" DataTextField="EsquemaComision" CssClass="select2me"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVEsquemaC" runat="server" ControlToValidate="DdlEsquemaComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Esquema''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarLimites"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOEsquemaC" runat="server" HighlightCssClass="vco" TargetControlID="RFVEsquemaC" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtNivel" Width="90%" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVNivel" runat="server" ControlToValidate="TxtNivel" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nivel''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCENivel" runat="server" HighlightCssClass="vco" TargetControlID="RFVNivel" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtLimite" runat="server" type='number' step='0.01' Width="90%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLimite" runat="server" ControlToValidate="TxtLimite" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Limite Maximo''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarLimites"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVLimite" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtComision" runat="server" type='number' step='0.01' Width="90%"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVComision" runat="server" ControlToValidate="TxtComision" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Comision''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarLimites"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOComision" runat="server" HighlightCssClass="vco" TargetControlID="RFVComision" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<%-- <td style="text-align: center">
|
||||
<asp:TextBox ID="TxtImporte" runat="server" type='number' step='0.01'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" ControlToValidate="TxtImporte" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarLimites"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEImporte" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporte" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>--%>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarLimites" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarLimites"></asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosLimites" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVLimites" runat="server" CssClass="table-striped table-hover Widthall ADScroller" Style="max-width: 750px;" DataKeyNames="CveEsquemaComisionLimite, CveEsquemaComision" GridLines="None" EmptyDataText="No se encontraron Registros con el filtro actual" AutoGenerateColumns="false">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEsquemaComision" runat="server" Text='<%# Eval("EsquemaComision") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlComisionEdit" runat="server" DataValueField="CveEsquemaComision" DataTextField="EsquemaComision" Class="select2me" Style="width: 184px !important;" ValidationGroup="GrpLimiteEdit"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVEsquemaComisionEdit" runat="server" ControlToValidate="DdlComisionEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Esquema''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpLimiteEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOEsquemaComisionEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVEsquemaComisionEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="20%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtNivel" runat="server" Text='<%# Eval("Nivel") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxTNivelEdit" runat="server" Text='<%# Eval("Nivel") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVNivelEdit" runat="server" ControlToValidate="TxTNivelEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nivel''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCONivelEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVNivelEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtLimite" runat="server" Text='<%# Eval("LimiteMaximo", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxTLimiteEdit" runat="server" Text='<%# Eval("LimiteMaximo", "{0:##########0.00}") %>' type='number' step='0.01'></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="CVPrecio" runat="server" ControlToValidate="TxTLimiteEdit" Display="None" ErrorMessage="El campo <b>''Límite Máximo''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationExpression="^([1-9]{1}[\d]{0,2}(\,[\d]{3})*(\.[\d]{0,4})?|[1-9]{1}[\d]{0,}(\.[\d]{0,4})?|0(\.[\d]{0,2})?|(\.[\d]{1,4})?)$" ValidationGroup="GprAgregaPS"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCPrecioA" runat="server" HighlightCssClass="vco" TargetControlID="CVPrecio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVLimiteEdit" runat="server" ControlToValidate="TxTLimiteEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Limite Maximo''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpLimiteEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOEsquemaC" runat="server" HighlightCssClass="vco" TargetControlID="RFVLimiteEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlComision" runat="server" Text='<%# Eval("Comision", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxTComisionLimiteEdit" runat="server" type='number' step='0.01' lang="fr" Text='<%# Eval("Comision", "{0:##########0.00}")%>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVComisionEdit" runat="server" ControlToValidate="TxTComisionLimiteEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Comision''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpLimiteEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOComisionEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVComisionEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--<asp:TemplateField ItemStyle-Width="200px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtImporte" runat="server" Text='<%# Eval("ImporteFijo", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtImporteEdit" runat="server" type='number' step='0.01' Text='<%# Eval("ImporteFijo") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImporteEdit" runat="server" ControlToValidate="TxtImporteEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpLimiteEdit"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOImporteEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteEdit" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<div style="width: 80px;">
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpLimiteEdit" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
247
Ventas/CatEsquemaComisiones.aspx.vb
Normal file
247
Ventas/CatEsquemaComisiones.aspx.vb
Normal file
@@ -0,0 +1,247 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class Ventas_CatEsquemaComisiones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
#End Region
|
||||
Private Sub Ventas_CatEsquemaComisiones_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub InicializaValores()
|
||||
CargaDdlEsquemaComisiones()
|
||||
CargaGridEsquema()
|
||||
CargaGridLimites()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region " ESQUEMA COMISIONES "
|
||||
Private Sub LbAgregarEsquema_Click(sender As Object, e As EventArgs) Handles LbAgregarEsquema.Click
|
||||
Dim ObjEsquemas As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
|
||||
If Not ObjEsquemas.AddEsquemaComisiones(TxtEsquemaComision.Text, DdlTipoComision.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjEsquemas.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
Alert(String.Format("Se guardo el esquema {0}", TxtEsquemaComision.Text), TipoMensaje.MsgInformacion)
|
||||
TxtEsquemaComision.Text = ""
|
||||
CargaGridEsquema()
|
||||
Else
|
||||
Alert("Error al guardar esquema", TipoMensaje.MsgError)
|
||||
End If
|
||||
CargaDdlEsquemaComisiones()
|
||||
End Sub
|
||||
|
||||
Private Sub GVEsquema_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVEsquema.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlTipoComisionEdit").SelectedValue = e.Row.DBCampo("TipoComision")
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GVEsquema_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GVEsquema.RowEditing
|
||||
GVEsquema.EditIndex = e.NewEditIndex
|
||||
CargaGridEsquema()
|
||||
End Sub
|
||||
Private Sub GVEsquema_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GVEsquema.RowCancelingEdit
|
||||
GVEsquema.EditIndex = -1
|
||||
CargaGridEsquema()
|
||||
End Sub
|
||||
Private Sub GVEsquema_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GVEsquema.RowUpdating
|
||||
Dim ObjEsquemas As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
Dim CveEsquemaComision = GVEsquema.Rows(e.RowIndex).DataKey("CveEsquemaComision").ToEntero
|
||||
Dim EsquemaComision = GVEsquema.Rows(e.RowIndex).FCTextBox("TxTComisionEdit").Text.Trim
|
||||
Dim TipoComision = GVEsquema.Rows(e.RowIndex).FCDropDownList("DdlTipoComisionEdit").SelectedValue.ToEntero
|
||||
|
||||
If Not ObjEsquemas.UpdateEsquemaComisiones(CveEsquemaComision, EsquemaComision, TipoComision, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjEsquemas.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
GVEsquema.EditIndex = -1
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaGridEsquema()
|
||||
CargaDdlEsquemaComisiones()
|
||||
CargaGridLimites()
|
||||
Else
|
||||
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
|
||||
End If
|
||||
UpdatosEsquema.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GVEsquema_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GVEsquema.RowDeleting
|
||||
Dim ObjEsquemas As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
Dim CveEsquemaComision = GVEsquema.Rows(e.RowIndex).DataKey("CveEsquemaComision").ToEntero
|
||||
|
||||
If Not ObjEsquemas.RemoveEsquemaComisiones(GVEsquema.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
GVEsquema.EditIndex = -1
|
||||
Alert("El Esquema se elimino correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaGridEsquema()
|
||||
CargaDdlEsquemaComisiones()
|
||||
Else
|
||||
Alert("Error al eliminar Esquema", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjEsquemas.Dispose()
|
||||
'GVEsquema.DataSource = DtMovimientos
|
||||
'GVEsquema.DataBind()
|
||||
UpdatosEsquema.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGridEsquema()
|
||||
Dim ObjEsquemas As New ClsEsquemasComisiones
|
||||
|
||||
If ObjEsquemas.GetEsquemaComisiones(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
GVEsquema.DataSource = ObjEsquemas.DtResultados.FiltraParametros("", Orderby:="EsquemaComision")
|
||||
End If
|
||||
ObjEsquemas.Dispose()
|
||||
GVEsquema.DataBind()
|
||||
UpdatosEsquema.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub CargaDdlEsquemaComisiones()
|
||||
Dim ObjEsquemas As New ClsEsquemasComisiones
|
||||
If ObjEsquemas.GetEsquemaComisiones(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
DdlEsquemaComision.DataSource = ObjEsquemas.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
DdlEsquemaComision.DataBind()
|
||||
DdlEsquemaComision.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
ObjEsquemas.Dispose()
|
||||
UpTitulosLimites.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " LIMITES "
|
||||
Private Sub LbAgregarLimites_Click(sender As Object, e As EventArgs) Handles LbAgregarLimites.Click
|
||||
Dim ObjEsquemas As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
|
||||
If Not ObjEsquemas.AddEsquemaComisionLimite(TxtLimite.Text.ToDouble, TxtComision.Text.ToDouble, DdlEsquemaComision.SelectedValue.ToEntero, TxtNivel.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjEsquemas.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
Alert("Se guardo correctamente", TipoMensaje.MsgInformacion)
|
||||
TxtLimite.Text = ""
|
||||
TxtComision.Text = ""
|
||||
DdlEsquemaComision.SelectedIndex = -1
|
||||
CargaGridLimites()
|
||||
Else
|
||||
Alert("Error al guardar esquema", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GVLimites_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVLimites.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
Dim ObjLimites As New ClsEsquemasComisiones
|
||||
|
||||
If ObjLimites.GetEsquemaComisiones(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
e.Row.FCDropDownList("DdlComisionEdit").DataSource = ObjLimites.DtResultados.FiltraParametros("", Orderby:="EsquemaComision")
|
||||
e.Row.FCDropDownList("DdlComisionEdit").DataBind()
|
||||
|
||||
End If
|
||||
e.Row.FCDropDownList("DdlComisionEdit").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
e.Row.FCDropDownList("DdlComisionEdit").SelectedValueExist(e.Row.DataKey("CveEsquemaComision"))
|
||||
ObjLimites.Dispose()
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GVLimites_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GVLimites.RowEditing
|
||||
GVLimites.EditIndex = e.NewEditIndex
|
||||
CargaGridLimites()
|
||||
End Sub
|
||||
Private Sub GVLimites_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GVLimites.RowCancelingEdit
|
||||
GVLimites.EditIndex = -1
|
||||
CargaGridLimites()
|
||||
End Sub
|
||||
Private Sub GVLimites_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GVLimites.RowUpdating
|
||||
Dim ObjLimites As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
Dim CveEsquemaComisionLimite = GVLimites.Rows(e.RowIndex).DataKey("CveEsquemaComisionLimite").ToEntero
|
||||
Dim CveEsquemaComision As Integer = GVLimites.Rows(e.RowIndex).FCDropDownList("DdlComisionEdit").SelectedValue.ToEntero
|
||||
Dim Nivel = GVLimites.Rows(e.RowIndex).FCTextBox("TxTNivelEdit").Text.Trim
|
||||
Dim LimiteMaximo = GVLimites.Rows(e.RowIndex).FCTextBox("TxTLimiteEdit").Text.Trim.ToDouble
|
||||
Dim Comision = GVLimites.Rows(e.RowIndex).FCTextBox("TxTComisionLimiteEdit").Text.Trim.ToDouble
|
||||
'Dim Importe = DirectCast(GVLimites.Rows(e.RowIndex).FindControl("TxtImporteEdit"), TextBox).Text.Trim.ToDouble
|
||||
|
||||
If Not ObjLimites.UpdateEsquemaComisionLimite(CveEsquemaComisionLimite, LimiteMaximo, Comision, CveEsquemaComision, Nivel, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjLimites.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
GVLimites.EditIndex = -1
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaGridLimites()
|
||||
Else
|
||||
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
UpDatosLimites().Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GVLimites_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GVLimites.RowDeleting
|
||||
Dim ObjLimites As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
Dim CveEsquemaComisionLimite = GVLimites.Rows(e.RowIndex).DataKey("CveEsquemaComisionLimite").ToEntero
|
||||
|
||||
If Not ObjLimites.RemoveEsquemaComisionLimite(CveEsquemaComisionLimite, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjLimites.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
GVLimites.EditIndex = -1
|
||||
Alert("Se eliminador datos correctamente", TipoMensaje.MsgInformacion)
|
||||
CargaGridLimites()
|
||||
Else
|
||||
Alert("Error al eliminar", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
UpDatosLimites.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaGridLimites()
|
||||
Dim ObjLimites As New ClsEsquemasComisiones
|
||||
If ObjLimites.GetEsquemaComisionLimite(-1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
GVLimites.DataSource = ObjLimites.DtResultados
|
||||
End If
|
||||
ObjLimites.Dispose()
|
||||
|
||||
GVLimites.DataBind()
|
||||
UpDatosLimites.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
172
Ventas/CatEstatusFactura.aspx
Normal file
172
Ventas/CatEstatusFactura.aspx
Normal file
@@ -0,0 +1,172 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEstatusFactura.aspx.vb" Inherits="CatEstatusFactura" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.placeholder {
|
||||
background-color:#ff6a00 !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Estatus de Factura
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregar" runat="server" Text="<i class='fa fa-plus'></i>Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEstatusFactura,EstatusFactura,Estado,TipoDocto" EmptyDataText="No se encontraron Estatus Registrados" ToolTip="Listado de Estatus" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="500" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField itemstyle-width="10%" HeaderText="Clave">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlClave" runat="server" Text='<%# Eval("CveEstatusFactura", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField itemstyle-width="20%" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("EstatusFactura", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField itemstyle-width="15%" HeaderText="Tipo Documento" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoDocto" runat="server" Text='<%# Eval("TipoDocto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField itemstyle-width="15%" HeaderText="Estado">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField itemstyle-width="15%" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField itemstyle-width="15%" HeaderText="Fecha Ingreso">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" itemstyle-width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-xs mysmallbtn green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" itemstyle-width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-xs mysmallbtn 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>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="divAddEstatusFactura" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddEstatusFactura" 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">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" runat="server">Agregar Proveedor De Comunicaciones</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright" id="divclave" runat="server">
|
||||
<asp:TextBox ID="TxtClave" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="3"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClave" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtClave" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVClave" runat="server" ControlToValidate="TxtClave" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEClave2" runat="server" HighlightCssClass="vco" TargetControlID="CVClave" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtClave.ClientID.ToString()%>">Clave:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatus" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEstatus" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="divtipodocto" runat="server">
|
||||
<asp:DropDownList ID="DdlTipoDocto" runat="server" Width="150px" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoDocto.ClientID.ToString()%>">Tipo Documento:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="divEstado" runat="server">
|
||||
<label>Activo: </label>
|
||||
<asp:CheckBox ID="ChkEstado" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnAgregarEstatusFactura" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <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>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||
<script>
|
||||
|
||||
function MakeSortable() {
|
||||
$('#C_GvDatos').sortable({
|
||||
containerSelector: 'table',
|
||||
itemPath: '> tbody',
|
||||
itemSelector: 'tr',
|
||||
placeholder: '<tr class="placeholder"/>'
|
||||
});
|
||||
var oldIndex;
|
||||
// Sortable column heads
|
||||
$('#C_GvDatos tr').sortable({
|
||||
containerSelector: 'tr',
|
||||
itemSelector: 'th',
|
||||
placeholder: '<th class="placeholder"/>',
|
||||
vertical: false,
|
||||
onDragStart: function ($item, container, _super) {
|
||||
oldIndex = $item.index();
|
||||
$item.appendTo($item.parent());
|
||||
_super($item, container);
|
||||
},
|
||||
onDrop: function ($item, container, _super) {
|
||||
var field,
|
||||
newIndex = $item.index();
|
||||
|
||||
if (newIndex != oldIndex) {
|
||||
$item.closest('table').find('tbody tr').each(function (i, row) {
|
||||
row = $(row);
|
||||
if (newIndex < oldIndex) {
|
||||
row.children().eq(newIndex).before(row.children()[oldIndex]);
|
||||
} else if (newIndex > oldIndex) {
|
||||
row.children().eq(newIndex).after(row.children()[oldIndex]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_super($item, container);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
276
Ventas/CatEstatusFactura.aspx.vb
Normal file
276
Ventas/CatEstatusFactura.aspx.vb
Normal file
@@ -0,0 +1,276 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class CatEstatusFactura
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
CargaCombo(DdlTipoDocto)
|
||||
''Permiso Registro
|
||||
'If PermisoRegistro Then
|
||||
' LbAgregar.Enabled = True
|
||||
'Else
|
||||
' ' LbAgregar.Enabled = False
|
||||
'End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjEstatusFactura As New ClsEstatusFactura
|
||||
If ObjEstatusFactura.GetEstatusFactura() Then
|
||||
GlobalDTEstatusFactura = ObjEstatusFactura.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjEstatusFactura.Dispose()
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaCombo(Ddl As DropDownList)
|
||||
Ddl.Items.Insert(1, New ListItem("Ingreso", "Ing"))
|
||||
Ddl.Items.Insert(2, New ListItem("Remisión", "Rem"))
|
||||
Ddl.Items.Insert(3, New ListItem("Cotización", "Cot"))
|
||||
Ddl.Items.Insert(4, New ListItem("Anticipo", "Ant"))
|
||||
Ddl.Items.Insert(5, New ListItem("Pedido", "Ped"))
|
||||
Ddl.Items.Insert(6, New ListItem("Pedido2", "Pd2"))
|
||||
Ddl.Items.Insert(7, New ListItem("PedidoA", "PA"))
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.FCLiteral("LtlTipoDocto").Text = "Ing" Then
|
||||
e.Row.FCLiteral("LtlTipoDocto").Text = "Ingreso"
|
||||
ElseIf e.Row.FCLiteral("LtlTipoDocto").Text = "Rem" Then
|
||||
e.Row.FCLiteral("LtlTipoDocto").Text = "Remisión"
|
||||
ElseIf e.Row.FCLiteral("LtlTipoDocto").Text = "Cot" Then
|
||||
e.Row.FCLiteral("LtlTipoDocto").Text = "Cotización"
|
||||
ElseIf e.Row.FCLiteral("LtlTipoDocto").Text = "Ant" Then
|
||||
e.Row.FCLiteral("LtlTipoDocto").Text = "Anticipo"
|
||||
ElseIf e.Row.FCLiteral("LtlTipoDocto").Text = "Ped" Then
|
||||
e.Row.FCLiteral("LtlTipoDocto").Text = "Pedido"
|
||||
End If
|
||||
If e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal Then
|
||||
If e.Row.RowIndex <= 1 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(250)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(120)
|
||||
'e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
'e.Row.Cells(7).Width = Unit.Pixel(61)
|
||||
|
||||
End If
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
'If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
' CargaCombo(e.Row.FCDropDownList("DdlTipoDocto"))
|
||||
' e.Row.FCDropDownList("DdlTipoDocto").SelectedValue = e.Row.DBCampo("TipoDocto")
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjEstatusFactura As New ClsEstatusFactura
|
||||
' If ObjEstatusFactura.RemoveEstatusFactura(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' GlobalDTEstatusFactura = ObjEstatusFactura.DtResultados
|
||||
' Alert("El Estatus de Factura se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
' ObjEstatusFactura.Dispose()
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
' GvDatos.EditIndex = -1
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
' Dim ObjEstatusFactura As New ClsEstatusFactura
|
||||
' Dim EstatusFactura As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEstatus"), TextBox).Text.Trim
|
||||
' Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
' Dim TipoDocto As String = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlTipoDocto").SelectedValue
|
||||
' Dim CveEstatusFactura As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjEstatusFactura.UpdateEstatusFactura(EstatusFactura, Estado, TipoDocto, UsuarioActual.CveUsuario, CveEstatusFactura) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' GlobalDTEstatusFactura = ObjEstatusFactura.DtResultados
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
' ObjEstatusFactura.Dispose()
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
' GvDatos.EditIndex = e.NewEditIndex
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub BtnAgregarEstatusFactura_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusFactura.Click
|
||||
|
||||
If DdlTipoDocto.SelectedValue = "-1" Then
|
||||
Alert("Tiene que seleccionar un tipo de documento.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjEstatusFactura As New ClsEstatusFactura
|
||||
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjEstatusFactura.AddEstatusFactura(TxtClave.Text.Trim.ToEntero, TxtEstatus.Text.Trim, UsuarioActual.CveUsuario, DdlTipoDocto.SelectedValue) Then
|
||||
TxtClave.Text = ""
|
||||
TxtEstatus.Text = ""
|
||||
Alert("El Estatus de Factura se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
GlobalDTEstatusFactura = ObjEstatusFactura.DtResultados
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
If ObjEstatusFactura.UpdateEstatusFactura(TxtEstatus.Text.Trim, ChkEstado.Checked, DdlTipoDocto.SelectedValue, UsuarioActual.CveUsuario, HdnID.Value.ToEntero) Then
|
||||
GlobalDTEstatusFactura = ObjEstatusFactura.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusFactura"))
|
||||
ObjEstatusFactura.Dispose()
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CveEstatusFactura")
|
||||
UpDatos.Update()
|
||||
Dim ObjEstatusFactura As New ClsEstatusFactura
|
||||
If ObjEstatusFactura.RemoveEstatusFactura(HdnID.Value.ToEntero) Then
|
||||
GlobalDTEstatusFactura = ObjEstatusFactura.DtResultados
|
||||
Alert("El Estatus de Factura se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjEstatusFactura.Dispose()
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
HdnID.Value = GvRow.DataKey("CveEstatusFactura")
|
||||
UpDatos.Update()
|
||||
divclave.Visible = False
|
||||
BtnAgregarEstatusFactura.Text = "Actualizar"
|
||||
myModalLabel.InnerText = "Actualizar de Estatus Factura"
|
||||
TxtEstatus.Text = GvRow.DataKey("EstatusFactura")
|
||||
divEstado.Visible = True
|
||||
If GvRow.DataKey("Estado") = "Activo" Then ChkEstado.Checked = True Else ChkEstado.Checked = False
|
||||
DdlTipoDocto.SelectedValueExist(GvRow.DataKey("TipoDocto"))
|
||||
UpAddEstatusFactura.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddEstatusFactura"))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregar_Click(sender As Object, e As EventArgs) Handles LnkAgregar.Click
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
BtnAgregarEstatusFactura.Text = "Agregar"
|
||||
myModalLabel.InnerText = "Agregar de Estatus Factura"
|
||||
divclave.Visible = True
|
||||
TxtClave.Text = ""
|
||||
TxtEstatus.Text = ""
|
||||
divEstado.Visible = False
|
||||
ChkEstado.Checked = True
|
||||
DdlTipoDocto.SelectedValue = "-1"
|
||||
UpAddEstatusFactura.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddEstatusFactura"))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(GlobalDTEstatusFactura, "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = GlobalDTEstatusFactura.FiltraParametros($"{If(UsuarioActual.Empresa.CvePlataforma = 2, "TipoDocto IN ('Ing', 'Egs', 'Rem')", "1 = 1")}")
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
||||
GvDatos.Columns(6).Visible = False
|
||||
GvDatos.Columns(7).Visible = False
|
||||
End If
|
||||
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
293
Ventas/CatFamiliaSubFamilia.aspx
Normal file
293
Ventas/CatFamiliaSubFamilia.aspx
Normal file
@@ -0,0 +1,293 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatFamiliaSubFamilia.aspx.vb" Inherits="Ventas_CatFamiliaSubFamilia" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Familias y SubFamilias
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<ajax:TabContainer ID="tabs" runat="server" ActiveTabIndex="0" Width="100%">
|
||||
<ajax:TabPanel ID="TabFam" runat="server" HeaderText="Familia">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosF" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th style="width:250px">
|
||||
<asp:LinkButton ID="LbCategoria" runat="server" CausesValidation="false" Text="" CommandArgument="Categoria" OnClick="LbOrden_Click">
|
||||
Familia
|
||||
<asp:Literal ID="ImgCategoria" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:100px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:100px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCategoria" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCategoria" runat="server" ControlToValidate="TxtCategoria" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Familia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCategoria" runat="server" HighlightCssClass="vco" TargetControlID="RFVCategoria" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center"><asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatosF" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCategoria" EmptyDataText="No se encontraron Familias Registradas" ToolTip="Listado de Familias" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCategoria" runat="server" Text='<%# Eval("Categoria", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCategoria" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Categoria") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCategoria" runat="server" ControlToValidate="TxtCategoria" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Familia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCCategoria" runat="server" HighlightCssClass="vco" TargetControlID="RFVCategoria" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabSub" runat="server" HeaderText="SubFamilia">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTitulosS" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover" id="TbHeaderS" runat="server"> <%--style="width: 100%" --%>
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th style="width:250px">
|
||||
<asp:LinkButton ID="LbClasificacionS" runat="server" CausesValidation="false" Text="" CommandArgument="Clasificacion" OnClick="LbOrdenS_Click">
|
||||
SubFamilia
|
||||
<asp:Literal ID="ImgClasificacionS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<%-- <th style="width:120px">
|
||||
<asp:LinkButton ID="LbCuentaGastoS" runat="server" CausesValidation="false" Text="" CommandArgument="CuentaGasto" OnClick="LbOrdenS_Click">
|
||||
Cuenta Gasto
|
||||
<asp:Literal ID="ImgCuentaGastoS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:120px">
|
||||
<asp:LinkButton ID="LbCuentaAnticipoS" runat="server" CausesValidation="false" Text="" CommandArgument="CuentaAnticipo" OnClick="LbOrdenS_Click">
|
||||
Cuenta Anticipo
|
||||
<asp:Literal ID="ImgCuentaAnticipoS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:135px">
|
||||
<asp:LinkButton ID="LbCuentaInventarioS" runat="server" CausesValidation="false" Text="" CommandArgument="CuentaInventario" OnClick="LbOrdenS_Click">
|
||||
Cuenta Inventario
|
||||
<asp:Literal ID="ImgCuentaInventarioS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>--%>
|
||||
<th style="width:150px">
|
||||
<asp:LinkButton ID="LbCategoriaS" runat="server" CausesValidation="false" Text="" CommandArgument="Categoria" OnClick="LbOrdenS_Click">
|
||||
Familia
|
||||
<asp:Literal ID="ImgCategoriaS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:100px">
|
||||
<asp:LinkButton ID="LbEstatusS" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrdenS_Click">
|
||||
Estado
|
||||
<asp:Literal ID="ImgEstatusS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:100px">
|
||||
<asp:LinkButton ID="LbFechaS" runat="server" CausesValidation="false" Text="" CommandArgument="Fecha" OnClick="LbOrdenS_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:100px">
|
||||
<asp:LinkButton ID="LbUsuarioS" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrdenS_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuarioS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th style="width:200px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtClasificacionS" runat="server" CausesValidation="true" MaxLength="200" ValidationGroup="GrpGuardarS" Width="184px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacionS" runat="server" ControlToValidate="TxtClasificacionS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubFamilia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacionS" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacionS" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<%-- <td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlCuentaGastoS" DataTextField="CtaCodigo" DataValueField="Id" runat="server" Width="104px"></asp:DropDownList></td>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlCuentaAnticipoS" DataTextField="CtaCodigo" DataValueField="Id" runat="server" Width="104px"></asp:DropDownList></td>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlCuentaInventarioS" DataTextField="CtaCodigo" DataValueField="Id" runat="server" Width="104px"></asp:DropDownList></td>--%>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="DdlCategoriaS" DataTextField="Categoria" DataValueField="CveCategoria" runat="server" Width="114px"></asp:DropDownList></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregarS" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarS"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatosS" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosS" runat="server" AutoGenerateColumns="False" DataKeyNames="CveClasificacion" EmptyDataText="No se encontraron SubFamilias Registradas" ToolTip="Listado de SubFamilias" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlClasificacion" runat="server" Text='<%# Eval("Clasificacion", "{0}") %>' Style="word-break: break-all;"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtClasificacion" runat="server" CausesValidation="true" MaxLength="200" Text='<%# Eval("Clasificacion") %>' ValidationGroup="GrpGVS" Width="184px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="TxtClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGVS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlCuentaGasto" runat="server" Text='<%# Eval("CuentaGasto")%>' Style="word-break: break-all;"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCuentaGasto" DataTextField="CtaCodigo" DataValueField="Id" runat="server" Width="110px"></asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="LSEDdlCuenta" runat="server" TargetControlID="DdlCuentaGasto" PromptCssClass="Titulos" PromptText="Escriba el Nombre " QueryPattern="Contains" PromptPosition="Top" IsSorted="false" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCuentaAnticipo" runat="server" Text='<%# Eval("CuentaAnticipo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCuentaAnticipo" DataTextField="CtaCodigo" DataValueField="Id" runat="server" Width="110px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCuentaInventario" runat="server" Text='<%# Eval("CuentaInventario")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCuentaInventario" DataTextField="CtaCodigo" DataValueField="Id" runat="server" Width="110px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCategoria" runat="server" Text='<%# Eval("Categoria")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCategoria" DataTextField="Categoria" DataValueField="CveCategoria" runat="server" Width="110px"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstado" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGVS" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
407
Ventas/CatFamiliaSubFamilia.aspx.vb
Normal file
407
Ventas/CatFamiliaSubFamilia.aspx.vb
Normal file
@@ -0,0 +1,407 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_CatFamiliaSubFamilia
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property DtCuentas As DataTable
|
||||
Get
|
||||
Return CType((ViewState("DtCuentas")), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCuentas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden1") = ""
|
||||
ViewState("Orden2") = ""
|
||||
DdlCategoriaS.DataSource = GlobalDTFamilias(UsuarioActual.CveEmpresa) 'GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
DdlCategoriaS.DataBind()
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
|
||||
'Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'If Cuenta.GetCuentas(-1, "-1", 1, 20000) Then
|
||||
' DtCuentas = Cuenta.DtResultados
|
||||
'End If
|
||||
'Cuenta.Dispose()
|
||||
|
||||
'DdlCuentaGastoS.DataSource = DtCuentas : DdlCuentaGastoS.DataBind()
|
||||
'DdlCuentaAnticipoS.DataSource = DtCuentas : DdlCuentaAnticipoS.DataBind()
|
||||
'DdlCuentaInventarioS.DataSource = DtCuentas : DdlCuentaInventarioS.DataBind()
|
||||
Else
|
||||
'SubFamilia
|
||||
GvDatosS.Columns(1).Visible = False
|
||||
GvDatosS.Columns(2).Visible = False
|
||||
GvDatosS.Columns(3).Visible = False
|
||||
TbHeaderS.Rows(0).Cells(1).Visible = False
|
||||
TbHeaderS.Rows(0).Cells(2).Visible = False
|
||||
TbHeaderS.Rows(0).Cells(3).Visible = False
|
||||
TbHeaderS.Rows(1).Cells(1).Visible = False
|
||||
TbHeaderS.Rows(1).Cells(2).Visible = False
|
||||
TbHeaderS.Rows(1).Cells(3).Visible = False
|
||||
End If
|
||||
|
||||
'DdlCuentaGastoS.Items.Insert(0, New ListItem("-", "-1"))
|
||||
'DdlCuentaAnticipoS.Items.Insert(0, New ListItem("-", "-1"))
|
||||
'DdlCuentaInventarioS.Items.Insert(0, New ListItem("-", "-1"))
|
||||
CargaDatos()
|
||||
CargaDatosS()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
If ObjCategorias.GetCategorias(UsuarioActual.CveEmpresa, 2) Then
|
||||
ViewState("DTFamilias") = ObjCategorias.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjCategorias.Dispose()
|
||||
|
||||
'ViewState("DTFamilias") = GlobalDTFamilias
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatosS()
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 2) Then
|
||||
GlobalDTSubFamilias = ObjClasificaciones.DtResultados
|
||||
ViewState("DTSubFamilias") = GlobalDTSubFamilias(UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
GvDatosS.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTFamilias"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTFamilias"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatosF.Update()
|
||||
End Sub
|
||||
Private Sub CargaGridS(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTSubFamilias"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatosS.DataSource = DV.ToTable().FiltraParametros("1=1") 'SubFamilia---------------------------------------------------------------
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatosS.DataSource = CType(ViewState("DTSubFamilias"), DataTable).FiltraParametros("1=1") 'SubFamilia----------------------------
|
||||
End If
|
||||
GvDatosS.DataBind()
|
||||
UpDatosS.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden1") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Protected Sub LbOrdenS_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_") & "S"), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden1") = Orden
|
||||
CargaGridS(Orden)
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
If ObjCategorias.AddCategorias(TxtCategoria.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 2) Then
|
||||
TxtCategoria.Text = ""
|
||||
Alert("La nueva Familia se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosF.Update()
|
||||
|
||||
'ViewState("DTFamilias") = ObjCategorias.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
'GlobalDTFamilias(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
If ObjCategorias.GetCategorias(-1, 2) Then
|
||||
ViewState("DTFamilias") = ObjCategorias.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTFamilias(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
CargaDdlCat()
|
||||
End If
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjCategorias.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregarS_Click(sender As Object, e As EventArgs) Handles LbAgregarS.Click
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.AddClasificaciones(TxtClasificacionS.Text.Trim, "",
|
||||
-1, "", -1, "", -1, "",
|
||||
DdlCategoriaS.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
'DdlCuentaGastoS.SelectedValue.ToEntero, DdlCuentaGastoS.SelectedItem.Text,
|
||||
'DdlCuentaAnticipoS.SelectedValue.ToEntero, DdlCuentaAnticipoS.SelectedItem.Text,
|
||||
'DdlCuentaInventarioS.SelectedValue.ToEntero, DdlCuentaInventarioS.SelectedItem.Text,
|
||||
TxtClasificacionS.Text = ""
|
||||
Alert("La nueva SubFamilia se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulosS.Update()
|
||||
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 2) Then
|
||||
ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTSubFamilias = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
|
||||
'DdlCuentaGastoS.SelectedValue = "-1"
|
||||
'DdlCuentaAnticipoS.SelectedValue = "-1"
|
||||
'DdlCuentaInventarioS.SelectedValue = "-1"
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(350)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(65)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosS.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
|
||||
e.Row.Cells(0).Width = Unit.Pixel(350)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
End If
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
|
||||
'e.Row.FCDropDownList("DdlCategoria").DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlCategoria").DataSource = GlobalDTFamilias(UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlCategoria").DataBind()
|
||||
e.Row.FCDropDownList("DdlCategoria").SelectedValue = e.Row.DBCampo("CveCategoria")
|
||||
|
||||
Else
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
e.Row.FCLabel("LtlClasificacion").Text = String.Format("<a class='Texto' href='/Ventas/CatClasificacionesDetalle.aspx?CveClasificacion={0}'>{1}</a>", e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("Clasificacion"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
If ObjCategorias.RemoveCategorias(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
If ObjCategorias.GetCategorias(-1, 2) Then
|
||||
ViewState("DTFamilias") = ObjCategorias.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTFamilias(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
CargaDdlCat()
|
||||
End If
|
||||
Alert("La Familia se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCategorias.Dispose()
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDatosS.RowDeleting
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.RemoveClasificacion(GvDatosS.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatosS.EditIndex = -1
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 2) Then
|
||||
ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTSubFamilias = ObjClasificaciones.DtResultados
|
||||
End If
|
||||
Alert("La SubFamilia se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvDatosS.RowCancelingEdit
|
||||
GvDatosS.EditIndex = -1
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjCategorias As New ClsGenerales
|
||||
|
||||
Dim Categoria As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCategoria"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveCategoria As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjCategorias.UpdateCategoria(Categoria, Estatus, CveCategoria) Then
|
||||
GvDatos.EditIndex = -1
|
||||
If ObjCategorias.GetCategorias(-1, 2) Then
|
||||
ViewState("DTFamilias") = ObjCategorias.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GlobalDTFamilias(UsuarioActual.CveEmpresa) = ObjCategorias.DtResultados
|
||||
CargaDdlCat()
|
||||
End If
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCategorias.Dispose()
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvDatosS.RowUpdating
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
Dim Clasificacion As String = DirectCast(GvDatosS.Rows(e.RowIndex).FindControl("TxtClasificacion"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatosS.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
Dim CveClasificacion As Integer = GvDatosS.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
'Dim DdlGasto As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaGasto")
|
||||
'Dim DdlAnticipo As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaAnticipo")
|
||||
'Dim DdlInventario As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaInventario")
|
||||
Dim DdlCategoria As DropDownList = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCategoria")
|
||||
'Dim IDCuentaGasto As Integer = GvDatosS.Rows(e.RowIndex).FCDropDownList("DdlCuentaGasto").SelectedValue.ToEntero
|
||||
|
||||
If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", -1, "", -1, "", -1, "", Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion) Then
|
||||
'DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text,
|
||||
'DdlAnticipo.SelectedValue.ToEntero, DdlAnticipo.SelectedItem.Text,
|
||||
'DdlInventario.SelectedValue.ToEntero, DdlInventario.SelectedItem.Text,
|
||||
|
||||
GvDatosS.EditIndex = -1
|
||||
If ObjClasificaciones.GetClasificaciones(-1, 2) Then
|
||||
ViewState("DTSubFamilias") = ObjClasificaciones.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
End If
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden1").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden1").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatosS_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvDatosS.RowEditing
|
||||
GvDatosS.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden2").ToString() <> String.Empty Then
|
||||
CargaGridS(ViewState("Orden2").ToString())
|
||||
Else
|
||||
CargaGridS("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlCat()
|
||||
DdlCategoriaS.DataSource = ViewState("DTFamilias")
|
||||
DdlCategoriaS.DataBind()
|
||||
UpTitulosS.Update()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
254
Ventas/CatImpuestosLocales.aspx
Normal file
254
Ventas/CatImpuestosLocales.aspx
Normal file
@@ -0,0 +1,254 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatImpuestosLocales.aspx.vb" Inherits="Ventas_CatImpuestosLocales" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</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;
|
||||
}
|
||||
|
||||
.btn-verde {
|
||||
color: #32c5d2;
|
||||
background-color: #fff;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde .fa-plus {
|
||||
color: #32c5d2 !important;
|
||||
}
|
||||
|
||||
.btn-verde:hover {
|
||||
color: #fff;
|
||||
background-color: #32c5d2;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde:hover .fa-plus {
|
||||
color: white !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Impuestos Locales
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UPAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarImpuestoModal" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Impuesto Local" Text="<i class='fa fa-plus'></i> Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveImpuesto" Value="-1" />
|
||||
|
||||
<asp:GridView ID="GvImpuestos" runat="server" GridLines="None" DataKeyNames="CveImpuestoLocal,ImpuestoLocal,Porcentaje,Orden,Estatus,TipoImpuesto,IdCuentaImpuestoLocal,EstatusBol" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Impuestos Locales">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ImpuestoLocal" HeaderText="Impuesto Local" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Porcentaje" HeaderText="Porcentaje" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Orden" HeaderText="Orden" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TipoImpuestoTexto" HeaderText="Tipo Impuesto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderText="Cuenta Contable">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCuentaContable" runat="server" Text=""></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_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="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddImpuestoLocal" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddImpuesto" 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">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Impuestos Locales</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyImpuesto" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtImpuesto" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImpuesto" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtImpuesto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Impuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtImpuesto.ClientID.ToString()%>">Impuesto:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPorcentaje" type="number" step="0.01" runat="server" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPorcentaje" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPorcentaje" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje'</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPorcentaje.ClientID.ToString()%>">Porcentaje:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtOrden" runat="server" Width="100%" CssClass="form-control" TextMode="Number" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtOrden" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden'</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoImpuesto" runat="server" CssClass="form-control select2me js-Impuesto-programmatic" Width="100%">
|
||||
<asp:ListItem Value="1" Text="Impuesto Local Retenido"></asp:ListItem>
|
||||
<asp:ListItem Value="5" Text="Impuesto Local Traslado"></asp:ListItem>
|
||||
<asp:ListItem Value="3" Text="Deducciones"></asp:ListItem>
|
||||
<asp:ListItem Value="4" Text="Fondo de Garantía"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlCuentasContables.ClientID.ToString()%>">Tipo Impuesto:</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlCuentasContables" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" CssClass="form-control select2me js-Cuentas-programmatic" CausesValidation="true" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<%-- <asp:RequiredFieldValidator ID="RFVCtaContable" runat="server" ControlToValidate="DdlCuentasContables" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta Contable''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>--%>
|
||||
<label for="<%= DdlCuentasContables.ClientID.ToString()%>">Cuenta Contable:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarImpuesto" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var TxtImpuesto = '<%= TxtImpuesto.ClientID%>';
|
||||
var TxtPorcentaje = '<%= TxtPorcentaje.ClientID%>';
|
||||
var TxtOrden = '<%= TxtOrden.ClientID%>';
|
||||
var DdlTipoImpuesto = '<%= DdlTipoImpuesto.ClientID%>';
|
||||
var DdlCuentasContables = '<%= DdlCuentasContables.ClientID%>';
|
||||
var ChkEstatus = '<%= ChkEstatus.ClientID%>';
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#divAddImpuestoLocal').modal();
|
||||
}
|
||||
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#C_GvImpuestos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#C_GvImpuestos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
|
||||
function CleanObjects() {
|
||||
document.getElementById(TxtImpuesto).value = "";
|
||||
document.getElementById(TxtPorcentaje).value = "";
|
||||
}
|
||||
|
||||
|
||||
function SetValue(Hidden, Value) {
|
||||
document.getElementById(Hidden).value = Value;
|
||||
}
|
||||
|
||||
function LimpiaModal() {
|
||||
$('#<%= TxtImpuesto.ClientID %>').val('');
|
||||
$('#<%= TxtPorcentaje.ClientID %>').val('');
|
||||
$('#<%= TxtOrden.ClientID %>').val('');
|
||||
$('#<%= ChkEstatus.ClientID %>').prop("checked", false);
|
||||
|
||||
var $example = $(".js-Impuesto-programmatic").select2();
|
||||
$example.val('1').trigger("change");
|
||||
|
||||
var $cuenta = $(".js-Cuentas-programmatic").select2();
|
||||
$cuenta.val('-1').trigger("change");
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
274
Ventas/CatImpuestosLocales.aspx.vb
Normal file
274
Ventas/CatImpuestosLocales.aspx.vb
Normal file
@@ -0,0 +1,274 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class Ventas_CatImpuestosLocales
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES"
|
||||
Private Property DtCuentasContables As Data.DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCuentasContables"), DataTable)
|
||||
End Get
|
||||
Set(value As Data.DataTable)
|
||||
ViewState("DtCuentasContables") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtImpuestosLocales As Data.DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtImpuestosLocales"), DataTable)
|
||||
End Get
|
||||
Set(value As Data.DataTable)
|
||||
ViewState("DtImpuestosLocales") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveImpuestoLocal As Integer
|
||||
Get
|
||||
Return ViewState("CveImpuestoLocal").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveImpuestoLocal") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CveImpuestoLocal = -1
|
||||
CargaCuentasContables()
|
||||
CargaDatos()
|
||||
OrdenaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetImpuestosLocales(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
GvImpuestos.DataSource = ObjVentas.DtResultados
|
||||
GvImpuestos.DataBind()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentasContables()
|
||||
If UsuarioActual.Empresa.UsaContabilidad OrElse UsuarioActual.Empresa.UsaAC Then
|
||||
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
|
||||
If ObjContabilidad.GetCuentasRecursiva(1, 1) Then
|
||||
DtCuentasContables = ObjContabilidad.DtResultados
|
||||
Else
|
||||
DtCuentasContables = Nothing
|
||||
End If
|
||||
ObjContabilidad.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
DdlCuentasContables.DataSource = DtCuentasContables
|
||||
DdlCuentasContables.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "GV IMPUESTOS "
|
||||
|
||||
|
||||
'Protected Sub GvImpuestos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvImpuestos.RowEditing
|
||||
' GvImpuestos.EditIndex = e.NewEditIndex
|
||||
' CargaDatos()
|
||||
'End Sub
|
||||
|
||||
Protected Sub GvImpuestos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvImpuestos.RowUpdating
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim TieneError = False
|
||||
Dim CveImpuestoLocal As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero
|
||||
Dim Impuesto As String = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtImpuestoLocal").Text.Trim
|
||||
Dim Porcentaje As Double = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDouble
|
||||
Dim Orden = GvImpuestos.Rows(e.RowIndex).FCTextBox("TxtOrdenImpuesto").Text.ToEntero
|
||||
Dim TipoImpuesto = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlTipoImpuestoEdit").SelectedValue.ToEntero
|
||||
Dim IdCtaContable = GvImpuestos.Rows(e.RowIndex).FCDropDownList("DdlCuentasContables").SelectedValue.ToEntero
|
||||
|
||||
Dim Estatus As Integer
|
||||
If GvImpuestos.Rows(e.RowIndex).FCCheckBox("ChkEstatusEdit").Checked = True Then
|
||||
Estatus = 1
|
||||
Else
|
||||
Estatus = 0
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjVentas.UpdateImpuestosLocales(CveImpuestoLocal, Impuesto, Porcentaje, Orden, TipoImpuesto, Estatus, IdCtaContable) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
GvImpuestos.EditIndex = -1
|
||||
CargaDatos()
|
||||
Else
|
||||
Alert("Ocurrio un erro al actualizar los datos", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvImpuestos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvImpuestos.RowCancelingEdit
|
||||
GvImpuestos.EditIndex = -1
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvImpuestos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvImpuestos.RowDeleting
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim TieneError = False
|
||||
|
||||
Dim CveImpuesto As Integer = GvImpuestos.Rows(e.RowIndex).DataKey("CveImpuestoLocal").ToEntero
|
||||
|
||||
If Not ObjVentas.RemoveImpuestosLocales(CveImpuesto) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
GvImpuestos.EditIndex = -1
|
||||
Alert("Se elimino correctamente el Impuesto Local.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al eliminar el Impuesto Local.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub GvImpuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvImpuestos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If (e.Row.RowState And DataControlRowState.Edit) > 0 Then
|
||||
e.Row.FCDropDownList("DdlTipoImpuestoEdit").SelectedValueExist(e.Row.DataKey("TipoImpuesto"))
|
||||
|
||||
e.Row.FCDropDownList("DdlCuentasContables").DataSource = DtCuentasContables
|
||||
e.Row.FCDropDownList("DdlCuentasContables").DataBind()
|
||||
e.Row.FCDropDownList("DdlCuentasContables").Items.Add(New ListItem("Seleccione", "-1"))
|
||||
e.Row.FCDropDownList("DdlCuentasContables").SelectedValue = e.Row.DBCampo("IdCuentaImpuestoLocal")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal Then
|
||||
If e.Row.DBCampo("IdCuentaImpuestoLocal").ToEntero > 0 Then
|
||||
e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCuentaImpuestoLocal")}")
|
||||
Else
|
||||
e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta"
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub OrdenaDatos()
|
||||
If (GvImpuestos.Rows.Count > 0) Then
|
||||
GvImpuestos.UseAccessibleHeader = True
|
||||
GvImpuestos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "BTN'S"
|
||||
Private Sub BtnAgregarImpuestoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarImpuestoModal.Click
|
||||
CveImpuestoLocal = -1
|
||||
|
||||
If CveImpuestoLocal > 0 Then
|
||||
BtnAgregarImpuesto.Text = "Actualizar"
|
||||
UpFooter.Update()
|
||||
Else
|
||||
BtnAgregarImpuesto.Text = "Agregar"
|
||||
End If
|
||||
|
||||
RegistraScript("$('#divAddImpuestoLocal').modal();LimpiaModal()")
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarImpuesto_Click(sender As Object, e As EventArgs) Handles BtnAgregarImpuesto.Click
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim Estatus = 0
|
||||
|
||||
If CveImpuestoLocal = -1 Then
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
|
||||
If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDouble, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
CargaDatos()
|
||||
End If
|
||||
TxtImpuesto.Text = ""
|
||||
TxtPorcentaje.Text = ""
|
||||
TxtOrden.Text = ""
|
||||
TxtImpuesto.Focus()
|
||||
Else
|
||||
If CveImpuestoLocal <> -1 Then
|
||||
Dim TieneError = False
|
||||
Dim Impuesto As String = TxtImpuesto.Text.Trim
|
||||
Dim Porcentaje As Double = TxtPorcentaje.Text.ToDouble
|
||||
Dim Orden = TxtOrden.Text.ToEntero
|
||||
Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero
|
||||
Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
|
||||
If Not ObjVentas.UpdateImpuestosLocales(CveImpuestoLocal, Impuesto, Porcentaje, Orden, TipoImpuesto, Estatus, IdCtaContable) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
GvImpuestos.EditIndex = -1
|
||||
CargaDatos()
|
||||
Else
|
||||
Alert("Ocurrio un error al actualizar los datos", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
CveImpuestoLocal = -1
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
UpDatos.Update()
|
||||
RegistraScript("$('#divAddImpuestoLocal').modal('hide');")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCargaModal_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjImpuestos As New ClsVentas
|
||||
|
||||
Dim Clave = CType(sender, LinkButton).CommandArgument.ToEntero
|
||||
|
||||
If ObjImpuestos.GetImpuestosLocales(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
DtImpuestosLocales = ObjImpuestos.DtResultados.FiltraParametros(String.Format("CveImpuestoLocal = {0}", Clave))
|
||||
End If
|
||||
|
||||
|
||||
TxtOrden.Text = DtImpuestosLocales(0)("Orden").ToString
|
||||
DdlTipoImpuesto.SelectedValueExist(DtImpuestosLocales(0)("TipoImpuesto").ToString)
|
||||
DdlCuentasContables.SelectedValueExist(DtImpuestosLocales(0)("IdCuentaImpuestoLocal").ToString)
|
||||
|
||||
|
||||
ObjImpuestos.Dispose()
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
DdlTipoImpuesto.SelectedValueExist(GvRow.DataKey("TipoImpuesto"))
|
||||
DdlCuentasContables.SelectedValueExist(GvRow.DataKey("IdCuentaImpuestoLocal"))
|
||||
TxtImpuesto.Text = GvRow.DataKey("ImpuestoLocal")
|
||||
TxtPorcentaje.Text = GvRow.DataKey("Porcentaje")
|
||||
TxtOrden.Text = GvRow.DataKey("Orden")
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("EstatusBol").ToEntero = 1, True, False)
|
||||
BtnAgregarImpuesto.Text = "Actualizar"
|
||||
CveImpuestoLocal = GvRow.DataKey("CveImpuestoLocal").ToEntero
|
||||
UpAddImpuesto.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddImpuestoLocal"))
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
120
Ventas/CatLeyendasFiscales.aspx
Normal file
120
Ventas/CatLeyendasFiscales.aspx
Normal file
@@ -0,0 +1,120 @@
|
||||
<%@ Page Title="Catálogo de Leyendas Fiscales" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatLeyendasFiscales.aspx.vb" Inherits="CatLeyendasFiscales" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Leyendas Fiscales
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content9" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped ">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="250px">
|
||||
<asp:LinkButton ID="LbLeyendaFiscal" runat="server" CausesValidation="false" Text="" CommandArgument="LeyendaFiscal" OnClick="LbOrden_Click">
|
||||
Leyenda Fiscal
|
||||
<asp:Literal ID="ImgLeyendaFiscal" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstado" runat="server" CausesValidation="false" Text="" CommandArgument="Estado" OnClick="LbOrden_Click">
|
||||
Estado
|
||||
<asp:Literal ID="ImgEstado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFecha" runat="server" CausesValidation="false" Text="" CommandArgument="Fecha" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFecha" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="161px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtLeyendaFiscal" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLeyendaFiscal" runat="server" ControlToValidate="TxtLeyendaFiscal" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Leyenda Fiscal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOLeyendaFiscal" runat="server" HighlightCssClass="vco" TargetControlID="RFVLeyendaFiscal" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveLeyendaFiscal" EmptyDataText="No se encontraron Leyendas Fiscales registradas" ToolTip="Listado de Leyendas Fiscales" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlLeyendaFiscal" runat="server" Text='<%# Eval("LeyendaFiscal", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtLeyendaFiscal" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("LeyendaFiscal") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLeyendaFiscal" runat="server" ControlToValidate="TxtLeyendaFiscal" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Leyenda Fiscal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOLeyendaFiscal" runat="server" HighlightCssClass="vco" TargetControlID="RFVLeyendaFiscal" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstado" runat="server" Checked='<%# If (Eval("Estado").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content10" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
168
Ventas/CatLeyendasFiscales.aspx.vb
Normal file
168
Ventas/CatLeyendasFiscales.aspx.vb
Normal file
@@ -0,0 +1,168 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class CatLeyendasFiscales
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
|
||||
''Permiso Registro
|
||||
'If PermisoRegistro Then
|
||||
' LbAgregar.Enabled = True
|
||||
'Else
|
||||
' LbAgregar.Enabled = False
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjLeyendasFiscal As New ClsLeyendasFiscales
|
||||
If ObjLeyendasFiscal.GetLeyendasFiscales() Then
|
||||
GlobalDTLeyendasFiscales = ObjLeyendasFiscal.DtResultados
|
||||
ViewState("DTLeyendaFiscal") = ObjLeyendasFiscal.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjLeyendasFiscal.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjLeyendasFiscal As New ClsLeyendasFiscales
|
||||
If ObjLeyendasFiscal.AddLeyendaFiscal(TxtLeyendaFiscal.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtLeyendaFiscal.Text = ""
|
||||
Alert("La nueva Leyenda Fiscal se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
GlobalDTLeyendasFiscales = ObjLeyendasFiscal.DtResultados
|
||||
ViewState("DTLeyendaFiscal") = ObjLeyendasFiscal.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjLeyendasFiscal.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(250)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(61)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjLeyendasFiscal As New ClsLeyendasFiscales
|
||||
If ObjLeyendasFiscal.RemoveLeyendaFiscal(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
GlobalDTLeyendasFiscales = ObjLeyendasFiscal.DtResultados
|
||||
ViewState("DTLeyendaFiscal") = ObjLeyendasFiscal.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("La Leyenda Fiscal se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjLeyendasFiscal.Dispose()
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjLeyendasFiscal As New ClsLeyendasFiscales
|
||||
Dim LeyendaFiscal As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtLeyendaFiscal"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
Dim CveLeyendaFiscal As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjLeyendasFiscal.UpdateLeyendaFiscal(LeyendaFiscal, Estatus, UsuarioActual.CveUsuario, CveLeyendaFiscal) Then
|
||||
GvDatos.EditIndex = -1
|
||||
GlobalDTLeyendasFiscales = ObjLeyendasFiscal.DtResultados
|
||||
ViewState("DTLeyendaFiscal") = ObjLeyendasFiscal.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjLeyendasFiscal.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTLeyendaFiscal"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTLeyendaFiscal"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
148
Ventas/CatMesas.aspx
Normal file
148
Ventas/CatMesas.aspx
Normal file
@@ -0,0 +1,148 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMesas.aspx.vb" Inherits="Ventas_CatMesas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Mesas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<div class="portlet box blue-hoki" style="min-width:895px;">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="icon-grid"></i>Catalogo
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover" style="min-width:880px; width:100%;">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="155px">
|
||||
<asp:LinkButton ID="LbSucursal" runat="server" CausesValidation="false" Text="" CommandArgument="Sucursal" OnClick="LbOrden_Click">
|
||||
Sucursal
|
||||
<asp:Literal ID="ImgSucursal" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="255px">
|
||||
<asp:LinkButton ID="LbMesa" runat="server" CausesValidation="false" Text="" CommandArgument="Mesa" OnClick="LbOrden_Click">
|
||||
Mesa
|
||||
<asp:Literal ID="ImgMesa" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="101px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="102px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="165px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:DropDownList ID="ddlSucursal" runat="server" DataValueField="CveSucursal" DataTextField="Sucursal" Width="134px" AutoPostBack="true"></asp:DropDownList>
|
||||
<asp:RangeValidator ID="RVSucursal" runat="server" ControlToValidate="ddlSucursal" Display="None" Type="Integer" MinimumValue="1" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESucursal" runat="server" HighlightCssClass="vco" TargetControlID="RVSucursal" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtMesa" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMesa" runat="server" ControlToValidate="TxtMesa" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mesa''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMesa" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesa" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMesa" EmptyDataText="No se encontraron Mesas Registrados" ToolTip="Listado de Mesas" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; min-width:880px; width:100%;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("Sucursal", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="ddlSucursal" runat="server" Width="134" DataValueField="CveSucursal" DataTextField="Sucursal"></asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMesa" runat="server" Text='<%# Eval("Mesa", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtMesa" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Mesa") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMesa" runat="server" ControlToValidate="TxtMesa" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mesa''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCMesa" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesa" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
213
Ventas/CatMesas.aspx.vb
Normal file
213
Ventas/CatMesas.aspx.vb
Normal file
@@ -0,0 +1,213 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_CatMesas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property PuedeEditar As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("PuedeEditar"))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PuedeEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property PuedeEliminar As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("PuedeEditar"))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PuedeEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaSucursales()
|
||||
CargaDatos()
|
||||
|
||||
''Permiso Registro
|
||||
'If PermisoRegistro Then
|
||||
' LbAgregar.Enabled = True
|
||||
'Else
|
||||
' LbAgregar.Enabled = False
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaSucursales()
|
||||
ddlSucursal.DataSource = GlobalDTSucursales().FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
ddlSucursal.DataBind()
|
||||
ddlSucursal.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjMesas As New ClsVentas
|
||||
If ObjMesas.GetMesas() Then
|
||||
ViewState("DTMesas") = ObjMesas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMesas = ObjMesas.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjMesas.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub ddlSucursal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlSucursal.SelectedIndexChanged
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjMesas As New ClsVentas
|
||||
If ObjMesas.AddMesa(TxtMesa.Text.Trim, UsuarioActual.CveUsuario, ddlSucursal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
TxtMesa.Text = ""
|
||||
Alert("La nueva Mesa se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTMesas") = ObjMesas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMesas = ObjMesas.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjMesas.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(250)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(61)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("ddlSucursal").DataSource = GlobalDTSucursales().FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
e.Row.FCDropDownList("ddlSucursal").DataBind()
|
||||
e.Row.FCDropDownList("ddlSucursal").SelectedValue = e.Row.DBCampo("CveSucursal")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjMesas As New ClsVentas
|
||||
If ObjMesas.RemoveMesa(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTMesas") = ObjMesas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMesas = ObjMesas.DtResultados
|
||||
Alert("La Mesa se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjMesas.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjMesas As New ClsVentas
|
||||
Dim CveSucursal As Integer = GvDatos.Rows(e.RowIndex).FCDropDownList("ddlSucursal").SelectedValue.ToEntero
|
||||
Dim Mesa As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtMesa"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveMesa As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjMesas.UpdateMesa(Mesa, Estatus, CveSucursal, CveMesa) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTMesas") = ObjMesas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTMesas = ObjMesas.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjMesas.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTMesas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable().FiltraParametros(String.Format("CveSucursal = {0} OR {0} = -1", ddlSucursal.SelectedValue))
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTMesas"), DataTable).FiltraParametros(String.Format("CveSucursal = {0} OR {0} = -1", ddlSucursal.SelectedValue))
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
375
Ventas/CatPS.aspx
Normal file
375
Ventas/CatPS.aspx
Normal file
@@ -0,0 +1,375 @@
|
||||
<%@ Page Title="Ventas - Catálogo de Productos o Servicios" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPS.aspx.vb" Inherits="CatPS" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</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;
|
||||
}
|
||||
|
||||
table td {
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
GvDatosHeader {
|
||||
color: White;
|
||||
font-family: Verdana;
|
||||
font-size: 12pt;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ADscroller2 {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
scrollbar-base-color: #303A48;
|
||||
scrollbar-face-color: #2B3643;
|
||||
scrollbar-3dlight-color: #303A48;
|
||||
scrollbar-highlight-color: #303A48;
|
||||
scrollbar-track-color: #343E4D;
|
||||
scrollbar-arrow-color: #303A48;
|
||||
scrollbar-shadow-color: #303A48;
|
||||
scrollbar-darkshadow-color: #303A48;
|
||||
}
|
||||
|
||||
.Izquierda {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAgregarPS" runat="server" PostBackUrl="~/Ventas/ProductosServicios.aspx">
|
||||
<i class="fa fa-plus"></i> Nuevo Producto/Servicio
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="HyperLink1" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivReportes" ID="ImgReportes" runat="server"> <i class="fa fa-print"></i> Productos sin SAT</asp:HyperLink>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LBImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LBExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
|
||||
<%--onclick="AbrirVentana('/Ventas/ProductosServicios.aspx', 700, 400, 'N', 'PS')"--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Productos o Servicios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button runat="server" ID="BtnFiltrar" Text="Filtrar" Width="80px" OnClick="BtnFiltrar_Click" class="btn btn-primary" />
|
||||
<a href="javascript;" class="expand" data-original-title="" title=""></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<label title="Tipo de Clasificación" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Tipo Clasif.:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipoClasificacion" OnSelectedIndexChanged="DdlTipoClasificacion_SelectedIndexChanged" AutoPostBack="true" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Gasto" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos/Gasto" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">Clasificación:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList runat="server" ID="Ddlclasificacion" CssClass="form-control input-sm select2me" DataValueField="CveClasificacion" DataTextField="Clasificacion" Width="90%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 " >Número de Parte / Código:</div>
|
||||
<div class="col-md-1">
|
||||
<asp:TextBox runat="server" ID="TxtCodigo" Width="90%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">Nombre:</div>
|
||||
<div class=" col-md-2">
|
||||
<asp:TextBox runat="server" ID="TxtNombre" Width="90%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
<div visible="false" runat="server" id="DivCBarras1" class="col-md-1 truncate">C. Barras:</div>
|
||||
<div visible="false" runat="server" id="DivCBarras2" class="col-md-2">
|
||||
<asp:TextBox runat="server" ID="TxtCodigoBarras" Width="90%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col-md-1 truncate" title="Tipo de Producto ó Servicio" data-toggle="tooltip" data-placement="top">Tipo Prod. y Serv.:</div>
|
||||
<div class=" col-md-2">
|
||||
<asp:DropDownList runat="server" ID="DdlCveTipoPS" CssClass="form-control input-sm select2me" Width="90%">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicio" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Producto" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
<div class="col-md-1 truncate" style="width: 60px;">Estado:</div>
|
||||
<div class=" col-md-1">
|
||||
<asp:DropDownList runat="server" ID="DdlEstado" CssClass="form-control input-sm select2me" Width="90%">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Aplica para Venta:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList runat="server" ID="DdlAplicaVenta" CssClass="form-control input-sm select2me" Width="90%">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-md-12" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron Productos o Servicios registrados" ToolTip="Listado de Productos o Servicios" CssClass="table table-striped table-hover Widthall" UseAccessibleHeader="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" SortExpression="OrdenarGV" />
|
||||
<asp:BoundField DataField="TipoPS" HeaderText="Tipo" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" />
|
||||
<asp:BoundField DataField="UnidadMedida" HeaderText="U.M." ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="Codigo" HeaderText="Número de Parte / Código:" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:HyperLinkField ItemStyle-CssClass="Izquierda Texto" HeaderText="Producto o Servicio" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" DataTextField="PS" DataNavigateUrlFields="CvePS" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
<asp:BoundField DataField="Precio" HeaderText="Precio" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
||||
<asp:BoundField DataField="AplicaParaVentap" HeaderText="Aplica Para Venta" Visible="false" ItemStyle-Width="10%" />
|
||||
<%-- <asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
<asp:TemplateField HeaderText="Estado" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Fecha" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<br />
|
||||
<asp:UpdatePanel runat="server" ID="UpBitacora" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light bordered xspadding">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Historial de Eliminacion</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12" align="right">
|
||||
<asp:Button ID="BtnMostrar" runat="server" Text="Mostrar" class="btn btn-primary" />
|
||||
<asp:Button ID="BtnOcultar" Visible="false" runat="server" Text="Ocultar" class="btn btn-primary" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<asp:GridView Visible="false" ID="GvBitacora" runat="server" GridLines="None" Width="100%" CssClass="table table-striped table-advance table-hover Widthall ADSCroll mysmallbtn ScrollAD" data-sort="true" CellSpacing="0" AutoGenerateColumns="False">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Id_Clave" HeaderText="Codigo / PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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">×</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 style="width: 335px;" class="table table-striped table-advance table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: left;">
|
||||
<asp:CheckBox ID="ChkAplicaVenta" runat="server" Text="Aplica para Venta" /></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:UpdatePanel runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvProductos" runat="server" Visible="false">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Codigo" HeaderText="Número de Parte / Código"/>
|
||||
<asp:BoundField DataField="PS" HeaderText="PS"/>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificacion"/>
|
||||
<asp:BoundField DataField="UnidadMedida" HeaderText="UnidadMedida"/>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<div id="DivReportes" 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">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Tipo de Reporte Productos SAT"></asp:Label></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table style="width: 335px;" class="table table-striped table-advance table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<asp:RadioButtonList runat="server" ID="RBLOpcion" >
|
||||
<asp:ListItem Text="Productos con Existencia" Value="1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Productos con Aplica para Venta" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Todos los productos" Value="3"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="LbImprimirProductos" runat="server" Text="Generar" class="btn btn-success" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var OrdenarGV = function () {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#GvDatos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
260
Ventas/CatPS.aspx.vb
Normal file
260
Ventas/CatPS.aspx.vb
Normal file
@@ -0,0 +1,260 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class CatPS
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property AplicaVenta As Boolean
|
||||
Get
|
||||
AplicaVenta = DirectCast(ViewState("AplicaVenta"), Boolean)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As Boolean)
|
||||
ViewState("AplicaVenta") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
AplicaVenta = False
|
||||
ViewState("Orden") = ""
|
||||
CargaClasificaciones()
|
||||
CargaGvBitacora()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
|
||||
DivCBarras1.Visible = True
|
||||
DivCBarras2.Visible = True
|
||||
TxtCodigoBarras.Focus()
|
||||
End If
|
||||
|
||||
'CargaDatos()
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(122) Then
|
||||
LBAgregarPS.Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaClasificaciones()
|
||||
Ddlclasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros(String.Format("CveEmpresa = {0} AND (UsoClasificacion = {1} OR {1} = -1)", UsuarioActual.CveEmpresa, DdlTipoClasificacion.SelectedValue.ToEntero))
|
||||
Ddlclasificacion.DataBind()
|
||||
Ddlclasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim Codigo As String = ""
|
||||
Dim Nombre As String = ""
|
||||
Dim CodigoBarras As String = ""
|
||||
|
||||
If TxtCodigo.Text.Trim = "" Then Codigo = "-1" Else Codigo = TxtCodigo.Text.ToUpper.Trim
|
||||
If TxtCodigoBarras.Text.Trim = "" Then CodigoBarras = "-1" Else CodigoBarras = TxtCodigoBarras.Text.Trim
|
||||
If TxtNombre.Text.Trim = "" Then Nombre = "-1" Else Nombre = TxtNombre.Text.ToUpper.Trim
|
||||
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSLite(Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, Codigo, CodigoBarras, Nombre, DdlAplicaVenta.SelectedValue.ToEntero, DdlEstado.SelectedValue.ToEntero, DdlCveTipoPS.SelectedValue.ToEntero, DdlTipoClasificacion.SelectedValue.ToEntero) Then
|
||||
DtDatos = ObjPS.DtResultados
|
||||
GvDatos.DataSource = DtDatos
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
'Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjPS.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
OrdenaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaClasificaciones()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Estado") = "Activo" Then
|
||||
e.Row.FCLabel("LblEstado").CssClass = "label label-success"
|
||||
Else
|
||||
e.Row.FCLabel("LblEstado").CssClass = "label label-danger"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "P E R S O N A L I Z A R G V"
|
||||
Private Sub BtnPersonalizar_Click(sender As Object, e As EventArgs) Handles BtnPersonalizar.Click
|
||||
If ChkAplicaVenta.Checked Then
|
||||
GvDatos.Columns(6).Visible = True
|
||||
AplicaVenta = True
|
||||
Else
|
||||
GvDatos.Columns(6).Visible = False
|
||||
AplicaVenta = False
|
||||
End If
|
||||
|
||||
CargaDatos()
|
||||
OrdenaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
|
||||
Private Sub OrdenaDatos()
|
||||
If (GvDatos.Rows.Count > 0) Then
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
'$('#GvD').DataTable({paging:false, 'scrollY':'300px', 'scrollCollapse': true, searching:false, info:false });
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
'Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
' Dim Orden As String = ""
|
||||
' Dim Campo As String = ""
|
||||
' Dim Literal As Literal = Nothing
|
||||
' Const OrdenInicial As String = ""
|
||||
' Dim Arg(2) As String
|
||||
|
||||
' Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
' Campo = Arg(0)
|
||||
' Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
' If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
' Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
' Else
|
||||
' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
' Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
' End If
|
||||
' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
' ViewState("Orden") = Orden
|
||||
' CargaGrid(Orden)
|
||||
'End Sub
|
||||
|
||||
'Private Sub CargaGrid(Orden As String)
|
||||
' If Orden <> String.Empty Then
|
||||
' Dim DV As New DataView(CType(ViewState("DTPS"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
' GvDatos.DataSource = DV.ToTable().FiltraParametros("RowNum <= 500")
|
||||
' DV.Dispose()
|
||||
' Else
|
||||
' GvDatos.DataSource = CType(ViewState("DTPS"), DataTable).FiltraParametros("RowNum <= 500")
|
||||
' End If
|
||||
' GvDatos.DataBind()
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Bitacora"
|
||||
Private Sub CargaGvBitacora()
|
||||
Dim ObjGral As New ClsGenerales
|
||||
If ObjGral.GetHistorialBitacoraRemoveGet("PS", UsuarioActual.CveEmpresa) Then
|
||||
GvBitacora.DataSource = ObjGral.DtResultados
|
||||
ObjGral.Dispose()
|
||||
End If
|
||||
GvBitacora.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnMostrar_Click(sender As Object, e As EventArgs) Handles BtnMostrar.Click
|
||||
GvBitacora.Visible = True
|
||||
BtnOcultar.Visible = True
|
||||
BtnMostrar.Visible = False
|
||||
UpBitacora.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnOcultar_Click(sender As Object, e As EventArgs) Handles BtnOcultar.Click
|
||||
GvBitacora.Visible = False
|
||||
BtnOcultar.Visible = False
|
||||
BtnMostrar.Visible = True
|
||||
UpBitacora.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LbImprimirProductos_Click(sender As Object, e As EventArgs) Handles LbImprimirProductos.Click
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetProductosServiciosSinSAT(RBLOpcion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
If ObjPS.DtResultados.Rows.Count > 0 Then
|
||||
GvProductos.DataSource = ObjPS.DtResultados
|
||||
GvProductos.DataBind()
|
||||
GvProductos.ExportToExcelx("Reporte de Producto")
|
||||
Else
|
||||
Alert("Todos los productos tienen Asignada Clave Producto Servicio SAT.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " IMPRESION "
|
||||
Protected Sub LBExcel_Click(sender As Object, e As EventArgs) Handles LBExcel.Click
|
||||
|
||||
If Not IsNothing(DtDatos) Then
|
||||
ImprimirReporte("EXCEL")
|
||||
Else
|
||||
CargaDatos()
|
||||
If IsNothing(DtDatos) Then
|
||||
Alert("No se encontró información para el reporte.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
ImprimirReporte("EXCEL")
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub LBImprimir_Click(sender As Object, e As EventArgs) Handles LBImprimir.Click
|
||||
|
||||
If Not IsNothing(DtDatos) Then
|
||||
ImprimirReporte()
|
||||
Else
|
||||
CargaDatos()
|
||||
If IsNothing(DtDatos) Then
|
||||
Alert("No se encontró información para el reporte.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
ImprimirReporte()
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Empresas/Grales/Formatos/CatPS.rpt", UsuarioActual.Empresa.Ruta))
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim lista = New List(Of CrystalParametro)
|
||||
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
lista.Add(New CrystalParametro("AplicaVenta", AplicaVenta.ToString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
lista.Add(New CrystalParametro("LogoPath", logouri))
|
||||
Else
|
||||
lista.Add(New CrystalParametro("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/CatPS.rpt"), DtDatos, lista, "Productos y Servicios", Formato), "Productos y Servicios", Formato)
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
95
Ventas/CatPreciosLista.aspx
Normal file
95
Ventas/CatPreciosLista.aspx
Normal file
@@ -0,0 +1,95 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPreciosLista.aspx.vb" Inherits="Ventas_CatPreciosLista" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Precios de Lista
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar Precio de Lista</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px;text-align: right;margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CvePrecioLista, PrecioLista, Estatus" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="PrecioLista" ItemStyle-Width="50%" HeaderText="Precio de lista" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="20%" HeaderText="Fecha Ing" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" 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">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Guardar Precio de Lista</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyCompuesto" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPrecioLista" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioLista" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio de Lista''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPrecioLista.ClientID.ToString()%>">Precio de Lista:</label>
|
||||
</div>
|
||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
286
Ventas/CatPreciosLista.aspx.vb
Normal file
286
Ventas/CatPreciosLista.aspx.vb
Normal file
@@ -0,0 +1,286 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_CatPreciosLista
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CvePrecioLista As Integer
|
||||
Get
|
||||
Return ViewState("CveCompuesto").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCompuesto") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CvePrecioLista = -1
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
CargaDatos(-1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveConductor As Integer)
|
||||
Dim ObjVta As New ClsVentas
|
||||
If ObjVta.GetPrecioListas(CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjVta.DtResultados
|
||||
GvDatos.DataBind()
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If ObjVta.GetPrecioListas(-1) Then
|
||||
GlobalDTPrecioListas(-1) = ObjVta.DtResultados
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CvePrecioLista = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtPrecioLista.Text = GvRow.DataKey("PrecioLista").ToString
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim ObjVta As New ClsVentas
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0) Then
|
||||
Alert("El Precio de Lista se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar el Precio de Lista", TipoMensaje.MsgError)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, CvePrecioLista) Then
|
||||
Alert("El Precio de Lista se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar al Precio de Lista", TipoMensaje.MsgError)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
ObjVta.Dispose()
|
||||
TxtPrecioLista.Text = ""
|
||||
|
||||
|
||||
CargaDatos(-1)
|
||||
UpDatos.Update()
|
||||
UpBodyCompuesto.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjPrecioLista As New ClsVentas
|
||||
Dim CvePrecioLista As Integer = GvDatos.Rows(e.RowIndex).DataKey("CvePrecioLista").ToEntero
|
||||
If ObjPrecioLista.RemovePrecioLista(CvePrecioLista) Then
|
||||
Alert("El Precio de lista se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjPrecioLista.Dispose()
|
||||
CargaDatos(-1)
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
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.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CvePrecioLista").ToString
|
||||
|
||||
If CBool(e.Row.DBCampo("Estatus")) = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtPrecioLista.Text = ""
|
||||
dvEstatus.Visible = False
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
#Region "VIEJO"
|
||||
' Public Property PuedeEliminar As Boolean
|
||||
' Get
|
||||
' Return CBool(ViewState("PuedeEditar"))
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' ViewState("PuedeEditar") = value
|
||||
' End Set
|
||||
' End Property
|
||||
|
||||
' Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
' If Not Page.IsPostBack Then
|
||||
|
||||
' CargaDatos()
|
||||
|
||||
' 'Permiso Registro
|
||||
' If UsuarioActual.TienePermisoProceso(132) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
|
||||
|
||||
' 'Permiso Eliminar
|
||||
' If UsuarioActual.TienePermisoProceso(134) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(6).Visible = False
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Private Sub CargaDatos()
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.GetPrecioListas(CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
' GvDatos.DataSource = ObjListas.DtResultados
|
||||
' GvDatos.DataBind()
|
||||
' Else
|
||||
' Me.GvDatos.DataSource = Nothing
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
' Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
' Dim ObjListas As New ClsVentas
|
||||
|
||||
' If HdnModalidad.Value = "I" Then
|
||||
' If ObjListas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text.Trim, TxtPorcentaje.Text.Trim.ToDouble) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La nueva Lista se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' ObjListas.Dispose()
|
||||
' Else
|
||||
' If HdnID.Value.ToEntero <> -1 Then
|
||||
' If ObjListas.UpdatePrecioLista(TxtPrecioLista.Text.Trim, True, UsuarioActual.CveUsuario, TxtPorcentaje.Text.Trim.ToDouble, HdnID.Value.ToEntero) Then
|
||||
' TxtPrecioLista.Text = ""
|
||||
' TxtPorcentaje.Text = ""
|
||||
' Alert("La lista se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' UpTitulos.Update()
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' OcultaDiv()
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End Sub
|
||||
|
||||
'#Region "G V D A T O S"
|
||||
' Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
' If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
|
||||
' Dim URL As String = String.Format("javascript:CleanObjects();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}','{2}');ShowDivRegistro();return false;", e.Row.DBCampo("CvePrecioLista").ToEntero, e.Row.DBCampo("PrecioLista"), e.Row.DBCampo("Porcentaje"))
|
||||
|
||||
' 'GeneroLigas
|
||||
' Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
' e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
' e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' End Sub
|
||||
|
||||
' Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' If ObjListas.RemovePrecioLista(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("La Lista se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' CargaDatos()
|
||||
' UpDatos.Update()
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
' Dim ObjListas As New ClsVentas
|
||||
' Dim PrecioLista As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPrecioLista"), TextBox).Text.Trim
|
||||
' Dim Porcentaje As Double = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtPorcentaje"), TextBox).Text.Trim.ToDouble
|
||||
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
' Dim CvePrecioLista As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjListas.UpdatePrecioLista(PrecioLista, Estatus, UsuarioActual.CveUsuario, Porcentaje, CvePrecioLista) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTPrecioListas") = ObjListas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' If ObjListas.GetPrecioListas(-1) Then
|
||||
' GlobalDTPrecioListas(-1) = ObjListas.DtResultados
|
||||
' End If
|
||||
|
||||
' ObjListas.Dispose()
|
||||
|
||||
' OrdenaDatos()
|
||||
' End Sub
|
||||
|
||||
'#End Region
|
||||
|
||||
|
||||
'#Region " O R D E N A M I E N T O JAVASCRIPT"
|
||||
' Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
' End Sub
|
||||
'#End Region
|
||||
|
||||
|
||||
|
||||
' Private Sub OcultaDiv()
|
||||
' ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
' End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
105
Ventas/CatPromociones.aspx
Normal file
105
Ventas/CatPromociones.aspx
Normal file
@@ -0,0 +1,105 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPromociones.aspx.vb" Inherits="Ventas_CatPromociones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgAddPromocion" PostBackUrl="/Ventas/Promociones.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Registrar Nueva Promoción</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="CSS" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Promociones
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Panel ID="Panel1" runat="server" DefaultButton="BtnConsultar">
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px;">
|
||||
<div class="tools">
|
||||
<asp:Button Text="Consultar" ID="BtnConsultar" CssClass="btn btn-primary" OnClick="BtnConsultar_Click" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row" style="padding-top: 10px;">
|
||||
<label class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2 ">
|
||||
<%-- <asp:DropDownList ID="DdlSucursal" runat="server" CssClass="select2me" DataTextField="Sucursal" DataValueField="CveSucursal" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>--%>
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 truncate">Estatus:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Promoción" ItemStyle-Width="300px" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink runat="server" ID="HLPromocion" Text='<%# Eval("Promocion").ToString %>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="FechaInicio" DataFormatString="{0:d}" HeaderText="Fecha I" ItemStyle-Width="70px" />
|
||||
<asp:BoundField DataField="FechaFin" DataFormatString="{0:d}" HeaderText="Fecha F" ItemStyle-Width="70px" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="70px">
|
||||
<ItemTemplate>
|
||||
<asp:Label runat="server" ID="LbEstatus" Text='<%#If(Eval("Estatus").ToString = "True", "Activo", "Inactivo") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script type="text/javascript">
|
||||
function pageLoad() {
|
||||
$(document).ready(function () {
|
||||
gridviewScroll();
|
||||
});
|
||||
|
||||
function gridviewScroll() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 210;
|
||||
|
||||
$('#<%=GvDatos.ClientID%>').gridviewScroll({
|
||||
width: 995,
|
||||
height: Alto,
|
||||
freezesize: 1,
|
||||
headerrowcount: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
70
Ventas/CatPromociones.aspx.vb
Normal file
70
Ventas/CatPromociones.aspx.vb
Normal file
@@ -0,0 +1,70 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class Ventas_CatPromociones
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
|
||||
'ImgAddPromocion.Attributes.Add("OnClick", "window.location = '/Ventas/Promociones.aspx'")
|
||||
'CARGA SUCURSALES
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetPromociones(-1, "-1", -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
Alert("Ocurrio un error al cargar las promociones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
If DtDatos IsNot Nothing Then
|
||||
CargaGrid()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid()
|
||||
GvDatos.DataSource = DtDatos
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.FCHyperLink("HLPromocion").NavigateUrl = String.Format("/Ventas/Promociones.aspx?CvePromocion={0}", e.Row.DBCampo("CvePromocion"))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
286
Ventas/CatUnidadesMedida.aspx
Normal file
286
Ventas/CatUnidadesMedida.aspx
Normal file
@@ -0,0 +1,286 @@
|
||||
<%@ Page Title="Catálogo de Unidades de Medida" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatUnidadesMedida.aspx.vb" Inherits="CatUnidadesMedida" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
#C_GvAlias > tbody > tr > th:nth-child(2) {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Unidades de Medida
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregar" runat="server" Text="Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveUnidadMedida,Estado,Abreviatura,UnidadMedida,CveUnidadMedidaSAT,ClaveNombre" data-sort="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Unidades de Medida">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Unidad de Medida">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUnidadMedida" runat="server" Text='<%# Eval("UnidadMedida") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="ClaveNombre" HeaderText="Unidad de Medida SAT" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="Abreviatura" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<center>
|
||||
<%-- <asp:Literal ID="LtlAlias1" runat="server" Text='<%# Eval("Alias1", "{0}") %>'></asp:Literal> --%>
|
||||
<asp:Button ID="BtnAlias" runat="server" AlternateText="Editar" OnClick="BtnAlias_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="Alias" />
|
||||
</center>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<%--<asp:TextBox ID="TxtAlias1" runat="server" CausesValidation="true" MaxLength="20" Text='<%# Eval("Alias1")%>' ValidationGroup="GrpGV" Width="64px"></asp:TextBox> --%>
|
||||
<asp:Button ID="BtnAlias" runat="server" AlternateText="Editar" OnClick="BtnAlias_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="Alias" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estado") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Fecha" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-xs green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-xs 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>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddUnidadMedida" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddUnidadMedida" 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">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" runat="server">Agregar Unidad de Medida</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyUnidadMedida" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtUnidadMedida" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVUnidadMedida" runat="server" ControlToValidate="TxtUnidadMedida" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtUnidadMedida.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlSATUnidadMedida" CssClass="form-control input-sm select2me" CssStyle="width: 46%;" DataTextField="ClaveNombre" DataValueField="CveSATUnidadMedida" />
|
||||
<%-- <asp:DropDownList ID="DdlSATUnidadMedida" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="false" CausesValidation="true" DataTextField="Nombre" DataValueField="CveSATUnidadMedida" Width="350px" Enabled="true">
|
||||
</asp:DropDownList>--%>
|
||||
<label for="<%= DdlSATUnidadMedida.ClientID.ToString()%>">Unidad de Medida SAT:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAbreviatura" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="9" ValidationGroup="GrpGuardar"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVAbreviatura" runat="server" ControlToValidate="TxtAbreviatura" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Abreviatura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtAbreviatura.ClientID.ToString()%>">Abreviatura:</label>
|
||||
</div>
|
||||
<%-- <div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Impuestos</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlImpEmpaque" runat="server" CssClass="form-control input-sm select2me" CausesValidation="true" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Sin selección" Value="000"></asp:ListItem>
|
||||
<asp:ListItem Text="Barrica" Value="001"></asp:ListItem>
|
||||
<asp:ListItem Text="Bolsa" Value="002"></asp:ListItem>
|
||||
<asp:ListItem Text="Bote" Value="003"></asp:ListItem>
|
||||
<asp:ListItem Text="Botella" Value="004"></asp:ListItem>
|
||||
<asp:ListItem Text="Caja" Value="005"></asp:ListItem>
|
||||
<asp:ListItem Text="Cajetilla" Value="006"></asp:ListItem>
|
||||
<asp:ListItem Text="Costal" Value="007"></asp:ListItem>
|
||||
<asp:ListItem Text="Estuche" Value="008"></asp:ListItem>
|
||||
<asp:ListItem Text="Garrafón" Value="009"></asp:ListItem>
|
||||
<asp:ListItem Text="Lata" Value="010"></asp:ListItem>
|
||||
<asp:ListItem Text="Mazo" Value="011"></asp:ListItem>
|
||||
<asp:ListItem Text="Otro Contenedor" Value="012"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVEmpaque" runat="server" ControlToValidate="DdlImpEmpaque" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empaque''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlImpEmpaque.ClientID.ToString()%>">Empaque:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlImpUM" runat="server" CssClass="form-control input-sm select2me" CausesValidation="true" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Sin selección" Value="000"></asp:ListItem>
|
||||
<asp:ListItem Text="Litros" Value="001"></asp:ListItem>
|
||||
<asp:ListItem Text="Kilogramos" Value="002"></asp:ListItem>
|
||||
<asp:ListItem Text="Toneladas" Value="003"></asp:ListItem>
|
||||
<asp:ListItem Text="Piezas" Value="004"></asp:ListItem>
|
||||
<asp:ListItem Text="Mililitros" Value="005"></asp:ListItem>
|
||||
<asp:ListItem Text="Gramos" Value="006"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVUM" runat="server" ControlToValidate="DdlImpEmpaque" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlImpUM.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
<div class="form-group form-md-line-input input-iconright" id="divEstatus" runat="server">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarUnidadMedida" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpGuardar"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivCancelarIE" class="modal fade">
|
||||
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
|
||||
<asp:UpdatePanel ID="UpDatosAlias" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
|
||||
<h3 class="modal-title" runat="server" id="headeralias">ALIAS: </h3>
|
||||
<asp:Label ID="lblClave" runat="server" Style="visibility: hidden"></asp:Label>
|
||||
<asp:Label ID="lblNombreUnidad" runat="server" Style="visibility: hidden"></asp:Label>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="align-items: center">
|
||||
<asp:UpdatePanel ID="UpAdd" runat="server" UpdateMode="Conditional">
|
||||
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped Widthall">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
|
||||
|
||||
<th width="400px" style="text-align: left">Alias
|
||||
<asp:TextBox ID="TxtAlias" runat="server" CausesValidation="true" MaxLength="20" ValidationGroup="GrpAddA" Width="260px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtAlias" runat="server" ControlToValidate="TxtAlias" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddA"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCTxtAlias" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtAlias" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</th>
|
||||
<th width="auto" style="text-align: left">Comandos</th>
|
||||
</thead>
|
||||
<tr>
|
||||
|
||||
<td style="text-align: left">
|
||||
|
||||
<td style="text-align: left">
|
||||
<asp:LinkButton ID="LbAgregarAlias" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpAddA"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<asp:UpdatePanel ID="UpGvAlias" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<asp:GridView ID="GvAlias" runat="server" AutoGenerateColumns="false" DataKeyNames="CveUnidadMedida" EmptyDataText="No se encontraron Alias registrados" ToolTip="Listado de Unidades de Medida" CssClass="table table-striped table-advance table-hover Widthall ScrollAD " data-height="320" Style="text-align: left;" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderStyle-Width="300px">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAlias" runat="server" Text='<%# Eval("UnidadMedidaAlias", "{0}") %>'></asp:Literal>
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="lbEliminar" runat="server" AlternateText="Eliminar" CausesValidation="False" Style="text-align: left" CommandName="Delete" OnClientClick="return confirm('¿Estas seguro de eliminar el alias?')" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" />
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
function ShowDivCancelarIE() {
|
||||
$('#DivCancelarIE').modal();
|
||||
}
|
||||
function HideDivCancelarIE() {
|
||||
$('#DivCancelarIE').modal('hide');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
371
Ventas/CatUnidadesMedida.aspx.vb
Normal file
371
Ventas/CatUnidadesMedida.aspx.vb
Normal file
@@ -0,0 +1,371 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class CatUnidadesMedida
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDdlSATUnidadMedida()
|
||||
CargaDatos()
|
||||
|
||||
''Permiso Registro
|
||||
'If PermisoRegistro Then
|
||||
' LbAgregar.Enabled = True
|
||||
'Else
|
||||
' LbAgregar.Enabled = False
|
||||
'End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Dim UM As String
|
||||
|
||||
Public Sub CargaDatos()
|
||||
|
||||
|
||||
Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
If ObjUnidadesMedida.GetUnidadesMedida() Then
|
||||
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
|
||||
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GvDatos.DataSource = ViewState("DTUnidadesMedida")
|
||||
GvDatos.DataBind()
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjUnidadesMedida.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregarAlias_Click(sender As Object, e As System.EventArgs) Handles LbAgregarAlias.Click
|
||||
Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
Dim cve As Integer
|
||||
cve = lblClave.Text.ToEntero
|
||||
|
||||
|
||||
If ObjUnidadesMedida.AddUnidadMedidaAlias(TxtAlias.Text.Trim, cve) Then
|
||||
TxtAlias.Text = ""
|
||||
Alert("El nueva Alias Unidad de Medida se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatosAlias.Update()
|
||||
GlobalDTUnidadesMedidaAlias = ObjUnidadesMedida.DtResultados
|
||||
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).FiltraParametros("CveUnidadMedida = " & cve)
|
||||
End If
|
||||
CargaGridAlias()
|
||||
ObjUnidadesMedida.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnCancelarIE_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#DivCancelarIE').modal('hide');")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAlias_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim cve = CType(sender, Button).CommandArgument.ToEntero
|
||||
Dim btn As Button = CType(sender, Button)
|
||||
|
||||
|
||||
Dim gvr As GridViewRow = CType(btn.NamingContainer, GridViewRow)
|
||||
Dim NombreUnidad As String = CType(gvr.FindControl("LtlUnidadMedida"), Literal).Text
|
||||
|
||||
headeralias.InnerText = String.Format("Alias de: {0}", NombreUnidad)
|
||||
|
||||
|
||||
lblClave.Text = cve.ToString
|
||||
|
||||
|
||||
Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
If ObjUnidadesMedida.GetUnidadesMedidaAlias(cve) Then
|
||||
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
ViewState("DTUnidadesMedidaAlias") = Nothing
|
||||
End If
|
||||
|
||||
CargaGridAlias()
|
||||
|
||||
ObjUnidadesMedida.Dispose()
|
||||
|
||||
RegistraScript("$('#DivCancelarIE').modal();")
|
||||
UpDatosAlias.Update()
|
||||
End Sub
|
||||
|
||||
#Region "G V A L I A S"
|
||||
Protected Sub GvAlias_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvAlias.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(400)
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvAlias_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvAlias.RowDeleting
|
||||
Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
Dim cve As Integer
|
||||
cve = lblClave.Text.ToEntero
|
||||
Dim Row As GridViewRow = GvAlias.Rows(e.RowIndex)
|
||||
Dim nombrealias As String = CType(Row.FindControl("LtlAlias"), Literal).Text
|
||||
|
||||
|
||||
If ObjUnidadesMedida.RemoveUnidadMedidaAlias(cve, nombrealias) Then
|
||||
GvAlias.EditIndex = -1
|
||||
GlobalDTUnidadesMedidaAlias = ObjUnidadesMedida.DtResultados
|
||||
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).FiltraParametros("CveUnidadMedida = " & cve)
|
||||
Alert("La Unidad de Medida se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjUnidadesMedida.Dispose()
|
||||
CargaGridAlias()
|
||||
|
||||
|
||||
'If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGridAlias(ViewState("Orden").ToString())
|
||||
'Else
|
||||
' CargaGridAlias("")
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(260)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(110)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(80)
|
||||
'e.Row.Cells(3).Width = Unit.Pixel(80)
|
||||
'e.Row.Cells(4).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(90)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(90)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(7).Width = Unit.Pixel(61)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
e.Row.FCButton("BtnAlias").CommandArgument = e.Row.DBCampo("CveUnidadMedida")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
' Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
' If ObjUnidadesMedida.RemoveUnidadMedida(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
|
||||
' ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("La Unidad de Medida se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' ObjUnidadesMedida.Dispose()
|
||||
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
' GvDatos.EditIndex = -1
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
'Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
' Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
' Dim UnidadMedida As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtUnidadMedida"), TextBox).Text.Trim
|
||||
' Dim SATUnidadMedida As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("SATUnidadMedida"), DropDownList).ToString.ToEntero
|
||||
' Dim Abreviatura As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAbreviatura"), TextBox).Text.Trim
|
||||
' 'Dim Alias1 As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAlias1"), TextBox).Text.Trim
|
||||
' 'Dim Alias2 As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAlias2"), TextBox).Text.Trim
|
||||
' 'Dim Alias3 As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAlias3"), TextBox).Text.Trim
|
||||
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
' Dim CveUnidadMedida As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
' If ObjUnidadesMedida.UpdateUnidadMedida(UnidadMedida, Abreviatura, "", "", "", Estatus, UsuarioActual.CveUsuario, CveUnidadMedida, SATUnidadMedida) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
|
||||
' ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' ObjUnidadesMedida.Dispose()
|
||||
|
||||
'End Sub
|
||||
|
||||
'Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
' CargaDdlSATUnidadMedida()
|
||||
' GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
|
||||
' If ViewState("Orden").ToString() <> String.Empty Then
|
||||
' CargaGrid(ViewState("Orden").ToString())
|
||||
' Else
|
||||
' CargaGrid("")
|
||||
' End If
|
||||
' CargaDdlSATUnidadMedida()
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
Public Sub CargaDdlSATUnidadMedida()
|
||||
DdlSATUnidadMedida.setEsWebService(True)
|
||||
DdlSATUnidadMedida.Attributes.Add("data-metodo", "getumsat")
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
|
||||
|
||||
Private Sub CargaGrid()
|
||||
Dim DV As New DataView(CType(ViewState("DTUnidadesMedida"), DataTable), "", "", DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGridAlias()
|
||||
|
||||
Dim DV As New DataView(CType(ViewState("DTUnidadesMedidaAlias"), DataTable), "", "", DataViewRowState.CurrentRows)
|
||||
GvAlias.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
GvAlias.DataBind()
|
||||
UpGvAlias.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub BtnAgregarUnidadMedida_Click(sender As Object, e As EventArgs) Handles BtnAgregarUnidadMedida.Click
|
||||
|
||||
Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
Dim Estatus = 0
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjUnidadesMedida.AddUnidadMedida(TxtUnidadMedida.Text.Trim, TxtAbreviatura.Text.Trim, "-1", "-1", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
DdlSATUnidadMedida.SelectedValue.ToEntero) > 0 Then
|
||||
TxtUnidadMedida.Text = ""
|
||||
TxtAbreviatura.Text = ""
|
||||
Alert("La nueva Unidad de Medida se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpAddUnidadMedida.Update()
|
||||
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
|
||||
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid()
|
||||
Else
|
||||
CargaGrid()
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If ObjUnidadesMedida.UpdateUnidadMedida(TxtUnidadMedida.Text.Trim, TxtAbreviatura.Text.Trim, "", "", "", CBool(Estatus),
|
||||
UsuarioActual.CveUsuario, HdnID.Value.ToEntero, DdlSATUnidadMedida.SelectedValue.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
|
||||
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid()
|
||||
Else
|
||||
CargaGrid()
|
||||
End If
|
||||
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddUnidadMedida"))
|
||||
ObjUnidadesMedida.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
HdnID.Value = GvRow.DataKey("CveUnidadMedida")
|
||||
UpDatos.Update()
|
||||
BtnAgregarUnidadMedida.Text = "Actualizar"
|
||||
myModalLabel.InnerText = "Actualizar Unidad de Medida"
|
||||
TxtUnidadMedida.Text = GvRow.DataKey("UnidadMedida")
|
||||
DdlSATUnidadMedida.SelectedValue = ""
|
||||
DdlSATUnidadMedida.SelectedText = ""
|
||||
'DdlImpEmpaque.SelectedValueExist(GvRow.DataKey("CveImpEmpaque"))
|
||||
'DdlImpUM.SelectedValueExist(GvRow.DataKey("CveImpUM"))
|
||||
If GvRow.DataKey("CveUnidadMedidaSAT") <> Nothing Then
|
||||
DdlSATUnidadMedida.SelectedValue = GvRow.DataKey("CveUnidadMedidaSAT")
|
||||
DdlSATUnidadMedida.SelectedText = GvRow.DataKey("ClaveNombre")
|
||||
End If
|
||||
TxtAbreviatura.Text = GvRow.DataKey("Abreviatura")
|
||||
divEstatus.Visible = True
|
||||
If GvRow.DataKey("Estado") = "Activo" Then
|
||||
ChkEstatus.Checked = True
|
||||
Else
|
||||
ChkEstatus.Checked = False
|
||||
End If
|
||||
UpAddUnidadMedida.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddUnidadMedida"))
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim ObjUnidadesMedida As New ClsUnidadesMedida
|
||||
HdnID.Value = GvRow.DataKey("CveUnidadMedida")
|
||||
UpDatos.Update()
|
||||
If ObjUnidadesMedida.RemoveUnidadMedida(HdnID.Value.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
|
||||
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Alert("La Unidad de Medida se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
CargaGrid()
|
||||
ObjUnidadesMedida.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkAgregar_Click(sender As Object, e As EventArgs) Handles LnkAgregar.Click
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
BtnAgregarUnidadMedida.Text = "Agregar"
|
||||
myModalLabel.InnerText = "Agregar Unidad de Medida"
|
||||
TxtUnidadMedida.Text = ""
|
||||
DdlSATUnidadMedida.SelectedValue = ""
|
||||
DdlSATUnidadMedida.SelectedText = ""
|
||||
'DdlImpEmpaque.SelectedValueExist("-1")
|
||||
'DdlImpUM.SelectedValueExist("-1")
|
||||
TxtAbreviatura.Text = ""
|
||||
divEstatus.Visible = False
|
||||
UpAddUnidadMedida.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddUnidadMedida"))
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
399
Ventas/CatVendedores.aspx
Normal file
399
Ventas/CatVendedores.aspx
Normal file
@@ -0,0 +1,399 @@
|
||||
<%@ Page Title="Vendedores de Producto o Servicios" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatVendedores.aspx.vb" Inherits="Ventas_CatVendedores" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
body {
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<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;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Vendedores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarModal" OnClick="BtnAgregarSucursalModal_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Vendedor." Text="<i class='fa fa-plus'></i> Agregar Vendedor"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="12" DataKeyNames="CveVendedor, CveEsquemaComision, Codigo, Telefono, Celular, Vendedor, Correo, Estatus, CveSuperior, VendedorTipo, TituloDocumentos,CveSubProyecto" EmptyDataText="No se encontraron Vendedores Registrados" ToolTip="Listado de Vendedores" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Sucursal">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<%--<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-small select2me" runat="server" DataValueField="CveSubProyecto" DataTextField="Sucursal" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 110px !important;"></asp:DropDownList>
|
||||
</EditItemTemplate>--%>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Código">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCodigo" CssClass="form-control tt-input" runat="server" CausesValidation="true" MaxLength="30" Text='<%# Eval("Codigo") %>' ValidationGroup="GrpGV" Width="50px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Vendedor">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtVendedor" CssClass="form-control tt-input" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Vendedor") %>' ValidationGroup="GrpGV" Width="110px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="TxtVendedor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Correo">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Teléfono">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
|
||||
<asp:TextBox ID="txtTelefono" CssClass="form-control tt-input" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Telefono") %>' ValidationGroup="GrpGV" Width="90px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTelefono" runat="server" ControlToValidate="TxtTelefono" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Telefono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VCTelefono" runat="server" HighlightCssClass="vco" TargetControlID="RFVTelefono" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="TituloDocumentos">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTituloDocumentos" runat="server" Text='<%# Eval("TituloDocumentos", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtTituloDocumentos" CssClass="form-control tt-input" runat="server" CausesValidation="true" MaxLength="150" Text='<%# Eval("TituloDocumentos") %>' ValidationGroup="GrpGV" Width="110px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTituloDocumentos" runat="server" ControlToValidate="TxtTituloDocumentos" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo de Documentos''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCVTitiloDocumentos" runat="server" HighlightCssClass="vco" TargetControlID="RFVTituloDocumentos" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Celular">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCelular" runat="server" Text='<%# Eval("Celular", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
|
||||
<asp:TextBox ID="txtCelular" CssClass="form-control tt-input" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Telefono") %>' ValidationGroup="GrpGV" Width="90px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCel" runat="server" ControlToValidate="txtCelular" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Celular''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VCCelular" runat="server" HighlightCssClass="vco" TargetControlID="RFVCel" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Esquema Comisión">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEsquemaComision" runat="server" Text='<%# Eval("EsquemaComision")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlEsquemaComision" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveEsquemaComision" DataTextField="EsquemaComision" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 80px !important;" AutoPostBack="true"></asp:DropDownList>
|
||||
<asp:RangeValidator ID="RVEsquemaComision" runat="server" ControlToValidate="DdlEsquemaComision" Display="None" Type="Integer" MinimumValue="1" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEEsquemaComision" runat="server" HighlightCssClass="vco" TargetControlID="RVEsquemaComision" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Usuario">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Usuario Vinculado" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuarioVinculado" runat="server" Text='<%# Eval("UsuarioVinculado") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Tipo Vendedor">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoVendedor" runat="server" Text='<%# Eval("TituloTipoVendedor", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Superior">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSupervisor" runat="server" Text='<%# Eval("NombreSuperior", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlSupervisor" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveVendedor" DataTextField="Vendedor" Class="table-group-action-input form-control input-inline input-small input-sm" Width="140px" AutoPostBack="true"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="DdlSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Supervisor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCVSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<%-- <asp:TemplateField HeaderText="Es Supervisor" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlEsSupervisor" runat="server" Text='<%# Eval("EsSupervisor") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEsSupervisor" runat="server" Checked='<%# If(Eval("Supervisor").ToString = "SI", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="Edit_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregarSucursal" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModal" runat="server">Agregar Vendedor</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Width="140px" AutoPostBack="true"></asp:DropDownList>
|
||||
<label for="<%= DdlSubProyecto.ClientID.ToString()%>">Sucursal:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCodigo" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtCodigo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtVendedor" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtVendedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtVendedor.ClientID.ToString()%>">Vendedor:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCorreo" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCorreo2" runat="server" ControlToValidate="TxtCorreo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCorreo.ClientID.ToString()%>">Correo:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="txtTelefono" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFTelefono" runat="server" ControlToValidate="txtTelefono" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= txtTelefono.ClientID.ToString()%>">Teléfono:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTituloDocumentos" CssClass="form-control " runat="server" MaxLength="150" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTituloDocumentos" runat="server" ControlToValidate="TxtTituloDocumentos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Titulo de Documentos''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= txtTelefono.ClientID.ToString()%>">Titulo de Documentos:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCelular" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCel" runat="server" ControlToValidate="TxtCelular" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Celular''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCelular.ClientID.ToString()%>">Celular:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" CausesValidation="true" Checked="true"></asp:CheckBox>
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DDlPuestoVendedor" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" Class="table-group-action-input form-control input-inline input-small input-sm" Width="140px">
|
||||
<asp:ListItem Text="Vendedor" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Coordinador" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Asistente" Value="3"></asp:ListItem>
|
||||
<asp:ListItem Text="Vendedor PV" Value="4"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DDlPuestoVendedor.ClientID.ToString()%>">Puesto:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivSupervisor">
|
||||
<asp:DropDownList ID="DdlSuperior" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveVendedor" DataTextField="Vendedor" Class="table-group-action-input form-control input-inline input-small input-sm" Width="140px" AutoPostBack="true"></asp:DropDownList>
|
||||
<label for="<%= DdlSuperior.ClientID.ToString()%>">Superior:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEsquemaComision" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveEsquemaComision" DataTextField="EsquemaComision" Class="table-group-action-input form-control input-inline input-small input-sm" Width="140px"></asp:DropDownList>
|
||||
<label for="<%= DdlEsquemaComision.ClientID.ToString()%>">Esquema Comisión:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-7">
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivTraspasar">
|
||||
<asp:DropDownList ID="DdlVendedores" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveVendedor" DataTextField="Vendedor" Class="table-group-action-input form-control input-inline input-small input-sm" Width="89%"></asp:DropDownList>
|
||||
<asp:LinkButton ID="BtnTraspasarClientes" runat="server" Width="10%" CssClass="btn btn-primary btn-sm" Style="margin-top:10px;" Text="<i class='fa fa-check'></i>">
|
||||
</asp:LinkButton>
|
||||
<label for="<%= DdlVendedores.ClientID.ToString()%>">Traspasar clientes de:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="LbAgregar" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardarRegistro" />
|
||||
<button id="BtnCancelarSucursal" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<script type="text/javascript">
|
||||
function showDivEC() {
|
||||
$('#divAgregarSucursal').modal('show');
|
||||
}
|
||||
function hideDivEC() {
|
||||
$('#divAgregarSucursal').modal('hide');
|
||||
}
|
||||
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#divAgregarSucursal').modal();
|
||||
}
|
||||
function HideDivRegistro() {
|
||||
$('#divAgregarSucursal').modal('hide');
|
||||
}
|
||||
|
||||
function SetValue(Hidden, Value) {
|
||||
document.getElementById(Hidden).value = Value;
|
||||
}
|
||||
|
||||
</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>
|
||||
252
Ventas/CatVendedores.aspx.vb
Normal file
252
Ventas/CatVendedores.aspx.vb
Normal file
@@ -0,0 +1,252 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_CatVendedores
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtVendedores As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtVendedores"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVendedores") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaValoresIniciales()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " CARGA VALORES INICIALES "
|
||||
Private Sub CargaValoresIniciales()
|
||||
ViewState("Orden") = ""
|
||||
CargaSubProyectos()
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Public Sub CargaSubProyectos()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
End Sub
|
||||
#End Region
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjVendedores As New ClsVtaVendedores
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones
|
||||
If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjVendedores.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtVendedores = ObjVendedores.DtResultados
|
||||
|
||||
DdlSuperior.Items.Clear()
|
||||
DdlSuperior.DataSource = DtVendedores.FiltraParametros("VendedorTipo = 2")
|
||||
DdlVendedores.DataSource = DtVendedores
|
||||
DdlSuperior.DataBind()
|
||||
ObjVendedores.Dispose()
|
||||
GvDatos.DataBind()
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
If ObjComisiones.GetEsquemaComisiones(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
DdlEsquemaComision.DataSource = ObjComisiones.DtResultados
|
||||
Else
|
||||
Alert("Ocurrio un Error al cargar los esquemas de comisiones", TipoMensaje.MsgError)
|
||||
DdlEsquemaComision.DataSource = Nothing
|
||||
End If
|
||||
ObjComisiones.Dispose()
|
||||
DdlEsquemaComision.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
|
||||
Dim ObjVendedores As New ClsVtaVendedores
|
||||
Dim TieneError = False
|
||||
|
||||
If HdnModalidad.Value = "I" Then
|
||||
If ObjVendedores.AddVendedores(TxtVendedor.Text.Trim, TxtCorreo.Text.Trim, txtTelefono.Text.Trim, TxtCelular.Text.Trim, ChkEstatus.Checked,
|
||||
DDlPuestoVendedor.SelectedValue.ToEntero, DdlSuperior.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtTituloDocumentos.Text, DdlSubProyecto.SelectedValue.ToEntero, TxtCodigo.Text.Trim, DdlEsquemaComision.SelectedValue.ToEntero) Then
|
||||
Alert("El nuevo Vendedor se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
TxtCodigo.Text = ""
|
||||
TxtVendedor.Text = ""
|
||||
TxtCorreo.Text = ""
|
||||
txtTelefono.Text = ""
|
||||
TxtCelular.Text = ""
|
||||
Else
|
||||
TieneError = True
|
||||
Alert("Error al agregar vendedor", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
If HdnID.Value.ToEntero <> -1 Then
|
||||
If ObjVendedores.UpdateVendedor(TxtCodigo.Text, TxtVendedor.Text, TxtCorreo.Text.Trim, txtTelefono.Text, TxtCelular.Text, ChkEstatus.Checked,
|
||||
DDlPuestoVendedor.SelectedValue.ToEntero, DdlSuperior.SelectedValue.ToEntero,
|
||||
HdnID.Value.ToEntero, TxtTituloDocumentos.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlEsquemaComision.SelectedValue.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
TieneError = True
|
||||
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjVendedores.Dispose()
|
||||
CargaDatos()
|
||||
CargaGlobal()
|
||||
OcultaDiv()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
|
||||
If e.Row.DBCampo("Estatus") = "Activo" Then
|
||||
e.Row.FCLabel("LtlEstatus").ForeColor = Drawing.Color.Green
|
||||
Else
|
||||
e.Row.FCLabel("LtlEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjVendedores As New ClsVtaVendedores
|
||||
Dim TieneError = False
|
||||
|
||||
If ObjVendedores.RemoveVendedor(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
Alert("EL Vendedor se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
TieneError = True
|
||||
Alert("Error al eliminar Vendedor", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVendedores.Dispose()
|
||||
CargaDatos()
|
||||
|
||||
If Not TieneError Then
|
||||
CargaGlobal()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "CARGA GLOBAL"
|
||||
Private Sub CargaGlobal()
|
||||
Dim ObjVendedores As New ClsVtaVendedores
|
||||
If ObjVendedores.GetVendedores(-1) Then
|
||||
GlobalDTVendedores(-1) = ObjVendedores.DtResultados
|
||||
End If
|
||||
ObjVendedores.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub OcultaDiv()
|
||||
ScriptManager.RegisterStartupScript(Me, Me.GetType, "Llave", "HideDivRegistro();", True)
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarSucursalModal_Click(sender As Object, e As EventArgs)
|
||||
LbAgregar.Text = "Agregar"
|
||||
LtlTituloModal.Text = "Agregar Vendedor"
|
||||
DdlSubProyecto.SelectedIndex = 0
|
||||
DdlSuperior.Items.Clear()
|
||||
DdlSuperior.DataSource = DtVendedores.FiltraParametros("VendedorTipo = 2")
|
||||
DdlSuperior.DataBind()
|
||||
DivSupervisor.Visible = True
|
||||
DDlPuestoVendedor.SelectedIndex = 0
|
||||
TxtCodigo.Text = ""
|
||||
txtTelefono.Text = ""
|
||||
TxtVendedor.Text = ""
|
||||
TxtCelular.Text = ""
|
||||
TxtTituloDocumentos.Text = ""
|
||||
TxtCorreo.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
UpModal.Update()
|
||||
HdnModalidad.Value = "I"
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAgregarSucursal"))
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjVendedores As New ClsVtaVendedores
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
|
||||
|
||||
HdnID.Value = GvRow.DataKey("CveVendedor")
|
||||
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
DdlEsquemaComision.SelectedValueExist(GvRow.DataKey("CveEsquemaComision"))
|
||||
TxtCodigo.Text = GvRow.DataKey("Codigo")
|
||||
txtTelefono.Text = GvRow.DataKey("Telefono")
|
||||
TxtTituloDocumentos.Text = GvRow.DataKey("TituloDocumentos")
|
||||
TxtVendedor.Text = GvRow.DataKey("Vendedor")
|
||||
TxtCorreo.Text = GvRow.DataKey("Correo")
|
||||
TxtCelular.Text = GvRow.DataKey("Celular")
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
|
||||
DDlPuestoVendedor.SelectedValueExist(GvRow.DataKey("VendedorTipo"))
|
||||
ValidaVendedores()
|
||||
DdlSuperior.SelectedValueExist(GvRow.DataKey("CveSuperior"))
|
||||
LbAgregar.Text = "Actualizar"
|
||||
LtlTituloModal.Text = String.Format("{0}{1}", "Actualizar Vendedor: ", TxtVendedor.Text)
|
||||
|
||||
If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
|
||||
DdlVendedores.Items.Clear()
|
||||
DdlVendedores.DataSource = DtVendedores.FiltraParametros($"CveVendedor <> {GvRow.DataKey("CveVendedor")}")
|
||||
DdlVendedores.DataBind()
|
||||
End If
|
||||
|
||||
UpModal.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAgregarSucursal"))
|
||||
ObjVendedores.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub DDlPuestoVendedor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DDlPuestoVendedor.SelectedIndexChanged
|
||||
ValidaVendedores()
|
||||
End Sub
|
||||
|
||||
Private Sub ValidaVendedores()
|
||||
If DDlPuestoVendedor.SelectedValue = "1" Then
|
||||
DdlSuperior.Items.Clear()
|
||||
DdlSuperior.DataSource = DtVendedores.FiltraParametros("VendedorTipo = 2")
|
||||
DdlSuperior.DataBind()
|
||||
DivSupervisor.Visible = True
|
||||
ElseIf DDlPuestoVendedor.SelectedValue = "3" Then
|
||||
DdlSuperior.Items.Clear()
|
||||
DdlSuperior.DataSource = DtVendedores.FiltraParametros("VendedorTipo = 1")
|
||||
DdlSuperior.DataBind()
|
||||
DivSupervisor.Visible = True
|
||||
ElseIf DDlPuestoVendedor.SelectedValue = "2" Then
|
||||
DdlSuperior.Items.Clear()
|
||||
DivSupervisor.Visible = False
|
||||
End If
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnTraspasarClientes_Click(sender As Object, e As EventArgs) Handles BtnTraspasarClientes.Click
|
||||
Dim ObjVendedores As New ClsVtaVendedores
|
||||
Dim TieneError = False
|
||||
|
||||
ObjVendedores.IniciaTransacSQL()
|
||||
|
||||
If Not ObjVendedores.TraspasarClientesVendedor(HdnID.Value.ToEntero, DdlVendedores.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjVendedores.Commit()
|
||||
Alert("Se han traspasado los clientes al nuevo vendedor", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjVendedores.RollBack()
|
||||
Alert("Ocurrió un error al traspasar los clientes al nuevo vendedor", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarSucursal"))
|
||||
ObjVendedores.Dispose()
|
||||
CargaDatos()
|
||||
CargaGlobal()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
End Class
|
||||
122
Ventas/CatVentasDeducciones.aspx
Normal file
122
Ventas/CatVentasDeducciones.aspx
Normal file
@@ -0,0 +1,122 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatVentasDeducciones.aspx.vb" Inherits="Ventas_CatVentasDeducciones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
.auto-style1 {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Ventas Deducciones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<%--CATPROYECTOS--%>
|
||||
|
||||
|
||||
<div class="row" style="margin-left: 0px; margin-right: 0px;">
|
||||
<div class="col-md-8">
|
||||
<asp:UpdatePanel ID="UpGVPorcentajes" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<table class="Widthall">
|
||||
<tr class="Titulos">
|
||||
<td style="width:100px" class="auto-style1">
|
||||
<b>Deducción</b>
|
||||
</td>
|
||||
<td style="width:90px" class="auto-style1">
|
||||
<b>Porcentaje</b>
|
||||
</td>
|
||||
<td style="width:100px" class="auto-style1">
|
||||
<b>Comandos</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtDeduccion" runat="server" Width="300px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDeduccion" runat="server" Display="None" ControlToValidate="TxtDeduccion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Deducción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDeduccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDeduccion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtPorcentaje" type="number" step="0.01" runat="server" Width="90px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPorcentaje" runat="server" Display="None" ControlToValidate="TxtPorcentaje" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje'</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
<asp:Button ID="AgregarGVPorcentajes" runat="server" Text="Agregar" CssClass=" btn btn-primary " ValidationGroup="GrpObligatorio" Width="100px" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="Widthall">
|
||||
<tr class="Titulos">
|
||||
<td></td>
|
||||
</tr>
|
||||
<asp:GridView ID="GvDeducciones" ShowHeader="false" runat="server" GridLines="None" DataKeyNames="CveVentaDeduccion" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Deducciones">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Deduccion" ItemStyle-Width="300px">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtVentaDeduccion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("VentaDeduccion") %>' Width="300px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVVentaDeduccion" runat="server" ControlToValidate="TxtVentaDeduccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Deduccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOVentaDeduccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaDeduccion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtDeduccion" runat="server" Text='<%# Eval("VentaDeduccion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Porcentaje" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtVentaPorcentaje" runat="server" type="number" step="0.01" CausesValidation="true" MaxLength="50" Text='<%# Eval("Porcentaje") %>' ValidationGroup="GrpGV" Width="90px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVVentaPorcentaje" runat="server" ControlToValidate="TxtVentaPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Porcentaje''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOVentaPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:Literal ID="LtPorcentaje" runat="server" Text='<%# Eval("Porcentaje", "{0:N2}%") %>'></asp:Literal>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="70px">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditarCuentaBanco" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Elim." ItemStyle-Width="5px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete"
|
||||
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>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
100
Ventas/CatVentasDeducciones.aspx.vb
Normal file
100
Ventas/CatVentasDeducciones.aspx.vb
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class Ventas_CatVentasDeducciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaTodo()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaTodo()
|
||||
CargaGrid()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Porcentajes"
|
||||
Public Sub CargaGrid()
|
||||
Dim Objeto As New ClsVentas
|
||||
If Objeto.GetDeduccion(UsuarioActual.CveEmpresa) Then
|
||||
GvDeducciones.DataSource = Objeto.DtResultados
|
||||
GvDeducciones.DataBind()
|
||||
|
||||
End If
|
||||
Objeto.Dispose()
|
||||
UpGVPorcentajes.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub AgregarGvDeducciones_Click(sender As Object, e As EventArgs) Handles AgregarGVPorcentajes.Click
|
||||
Dim AgregarDeduccion As New ClsVentas
|
||||
AgregarDeduccion.AddDeduccion(TxtDeduccion.Text, TxtPorcentaje.Text.ToDouble, UsuarioActual.CveUsuario.ToEntero, UsuarioActual.CveEmpresa.ToEntero)
|
||||
If AgregarDeduccion.GetDeduccion(UsuarioActual.CveEmpresa) Then
|
||||
CargaGrid()
|
||||
End If
|
||||
AgregarDeduccion.Dispose()
|
||||
|
||||
TxtDeduccion.Text = ("")
|
||||
TxtPorcentaje.Text = ("")
|
||||
TxtDeduccion.Focus()
|
||||
UpGVPorcentajes.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDeducciones_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDeducciones.RowEditing
|
||||
GvDeducciones.EditIndex = e.NewEditIndex
|
||||
CargaGrid()
|
||||
UpGVPorcentajes.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDeducciones_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDeducciones.RowUpdating
|
||||
Dim Objeto As New ClsVentas
|
||||
Dim Deduccion = GvDeducciones.Rows(e.RowIndex).FCTextBox("TxtVentaDeduccion").Text.Trim
|
||||
Dim Porcentaje = GvDeducciones.Rows(e.RowIndex).FCTextBox("TxtVentaPorcentaje").Text.ToDouble
|
||||
Dim Clave = GvDeducciones.Rows(e.RowIndex).DataKey("CveVentaDeduccion").ToEntero
|
||||
Objeto.UpdateDeduccion(Clave, Deduccion, Porcentaje, UsuarioActual.CveUsuario.ToEntero, UsuarioActual.CveEmpresa.ToEntero)
|
||||
GvDeducciones.EditIndex = -1
|
||||
CargaGrid()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDeducciones_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDeducciones.RowCancelingEdit
|
||||
GvDeducciones.EditIndex = -1
|
||||
CargaGrid()
|
||||
Alert("Se canceló la edición de los campos.")
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDeducciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDeducciones.RowDeleting
|
||||
Dim ObjNombres As New ClsVentas
|
||||
Dim CveVentaDeduccion = GvDeducciones.Rows(e.RowIndex).DataKey("CveVentaDeduccion").ToEntero
|
||||
|
||||
If ObjNombres.RemoveDeduccion(CveVentaDeduccion) Then
|
||||
GvDeducciones.EditIndex = -1
|
||||
|
||||
Alert("Se borró corrrectamente la deducción.", TipoMensaje.MsgInformacion)
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
ObjNombres.Dispose()
|
||||
CargaGrid()
|
||||
UpGVPorcentajes.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
85
Ventas/ClasificacionesDetalle.aspx
Normal file
85
Ventas/ClasificacionesDetalle.aspx
Normal file
@@ -0,0 +1,85 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ClasificacionesDetalle.aspx.cs" Inherits="Ventas_ClasificacionesDetalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Clasificaciones Detalle
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregarClasificacionDetalle" OnClick="LnkAgregarClasificacionDetalle_Click" runat="server"><i class="fa fa-plus"></i>Agregar Clasificacion Detalle</asp:LinkButton></li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" EmptyDataText="No se han encontrado clasificaciones detalle" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="100%" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveClasificacionDetalle,ClasificacionDetalle,Estatus,CveClasificacion" OnRowDataBound="GvDatos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ClasificacionDetalle" HeaderText="Clasificacion Detalle" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="LnkEliminar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la clasificacion detalle?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DModal" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="ltlMotititulo" Text="ClasificacionDetalle" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtClasificacionDetalle" CssClass="form-control" runat="server" MaxLength="200"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacionDetalle" runat="server" ControlToValidate="TxtClasificacionDetalle" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion Detalle''</b> es necesario, por favor ingréselo." ValidationGroup="VGMGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOClasificacionDetalle" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacionDetalle"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtClasificacionDetalle.ClientID.ToString()%>">Clasificacion Detalle:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlClasificacion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="50%">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="DdlClasificacion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor ingréselo." ValidationGroup="VGMGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificacion:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAddClasificacionDetalle" OnClick="BtnAddClasificacionDetalle_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMGuardar" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
121
Ventas/ClasificacionesDetalle.aspx.cs
Normal file
121
Ventas/ClasificacionesDetalle.aspx.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
|
||||
public partial class Ventas_ClasificacionesDetalle : ClsPaginas
|
||||
{
|
||||
|
||||
|
||||
#region Propiedades
|
||||
private int CveClasificacionDetalle
|
||||
{
|
||||
get { return (ViewState["CveClasificacionDetalle"] == null) ? 0 : Convert.ToInt32(ViewState["CveClasificacionDetalle"]); }
|
||||
set { ViewState["CveClasificacionDetalle"] = value; }
|
||||
}
|
||||
private string Modalidad
|
||||
{
|
||||
get { return (ViewState["Modalidad"] == null) ? "" : ViewState["Modalidad"].ToString(); }
|
||||
set { ViewState["Modalidad"] = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializaValores()
|
||||
{
|
||||
DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby: "Clasificacion");
|
||||
DdlClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
DdlClasificacion.DataBind();
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetClasificacionDetalle(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjVentas.DtResultados;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
protected void LimpiaModal()
|
||||
{
|
||||
TxtClasificacionDetalle.Text = "";
|
||||
DdlClasificacion.SelectedIndex = 0;
|
||||
Modalidad = "A";
|
||||
UpModal.Update();
|
||||
}
|
||||
|
||||
protected void LnkAgregarClasificacionDetalle_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RegistraScript("$('#DModal').modal();");
|
||||
LimpiaModal();
|
||||
BtnAddClasificacionDetalle.Text = "Agregar";
|
||||
DivEstatus.Visible = false;
|
||||
UpModal.Update();
|
||||
}
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
|
||||
if (Convert.ToBoolean(e.Row.DBCampo("Estatus")) == true)
|
||||
{
|
||||
e.Row.Cells[3].Text = "Activo";
|
||||
e.Row.Cells[3].ForeColor = System.Drawing.Color.Green;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Row.Cells[3].Text = "Inactivo";
|
||||
e.Row.Cells[3].ForeColor = System.Drawing.Color.Red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
ClsVentas ObjVenta = new ClsVentas();
|
||||
bool Continuar = ObjVenta.RemoveClasificacionDetalle(gvRow.DataKey("CveClasificacionDetalle").ToEntero());
|
||||
ObjVenta.Dispose();
|
||||
if (Continuar)
|
||||
{
|
||||
RecargaGlobal();
|
||||
CargaDatos();
|
||||
Alert("La Clasificacion Detalle se ha eliminado");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
LimpiaModal();
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveClasificacionDetalle = gvRow.DataKey("CveClasificacionDetalle").ToEntero();
|
||||
TxtClasificacionDetalle.Text = gvRow.DataKey("ClasificacionDetalle");
|
||||
DdlClasificacion.SelectedValueExist(gvRow.DataKey("CveClasificacion"));
|
||||
ChkEstatus.Checked = Convert.ToBoolean(gvRow.DataKey("Estatus"));
|
||||
Modalidad = "U";
|
||||
this.RegistraScript("$('#DModal').modal();");
|
||||
BtnAddClasificacionDetalle.Text = "Actualizar";
|
||||
DivEstatus.Visible = true;
|
||||
UpModal.Update();
|
||||
}
|
||||
|
||||
protected void BtnAddClasificacionDetalle_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
if (Modalidad == "A")
|
||||
6512
Ventas/Clientes.aspx
Normal file
6512
Ventas/Clientes.aspx
Normal file
File diff suppressed because it is too large
Load Diff
9533
Ventas/Clientes.aspx.vb
Normal file
9533
Ventas/Clientes.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
758
Ventas/ClientesAbonar.aspx
Normal file
758
Ventas/ClientesAbonar.aspx
Normal file
@@ -0,0 +1,758 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ClientesAbonar.aspx.vb" Inherits="Ventas_ClientesAbonar" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dashboard-stat2 {
|
||||
padding: 1px 2px 15px 10px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel ID="UpnTools" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:HyperLink ID="HlSaldarCuentasIncobrables" data-toggle="modal" data-target="#ModalSaldarCuentaIncobrable" title="Saldar Cuentas!" runat="server" Visible="false"><i class="fa fa-money"></i> Saldar Cuentas Incobrables</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink ID="HplVincularIntermediario" data-toggle="modal" data-target="#ModalVincularIntermediario" title="Vincular Intermediario" runat="server"><i class="fa fa-money"></i> Vincular Intermediario</asp:HyperLink>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Abonar Cliente:
|
||||
<asp:Label ID="LbEncabezado" runat="server" Text=""></asp:Label>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnTipoTransaccionAbreviatura" runat="server" Value="" />
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-8 col-md-10">
|
||||
<div class="chequesie">
|
||||
<div class="chequesie1">
|
||||
<div class="row" id="divTipoPago" runat="server" >
|
||||
<div class="col-md-7">
|
||||
<asp:RadioButtonList ID="RblTipoPago" AutoPostBack="true" runat="server" RepeatDirection="Horizontal">
|
||||
<asp:ListItem Value="1" Selected="true">Banco </asp:ListItem>
|
||||
<asp:ListItem Value="3">Ingresos x Comprobar</asp:ListItem>
|
||||
<asp:ListItem Value="2">Pago Intermediario</asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<asp:Label CssClass="col-md-2" Text="" ID="LbTipoMoneda" runat="server" />
|
||||
<div class="col-md-5">
|
||||
<asp:CheckBox Text="Pagar con pesos" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarPesos" OnCheckedChanged="ChkPagarPesos_CheckedChanged" runat="server" ClientIDMode="Static" />
|
||||
<asp:CheckBox Text="Pagar con dólares" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarDolares" runat="server" OnCheckedChanged="ChkPagarDolares_CheckedChanged" ClientIDMode="Static" />
|
||||
</div>
|
||||
<div class="col-md-5" runat="server" id="DivTCDolares" visible="false">
|
||||
T.C:
|
||||
<asp:TextBox ID="TxtTCDolares" runat="server" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||
<asp:RequiredFieldValidator ID="RFVTCDolares" Enabled="false" runat="server" ControlToValidate="TxtTCDolares" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="RFVTCDolares" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:Label ID="LbImporteMN" Text="" ClientIDMode="Static" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-5" id="DivTC" style="display: none;">
|
||||
T.C.:
|
||||
<asp:TextBox ID="TxtTC" runat="server" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||
<asp:RequiredFieldValidator ID="RFVTC" Enabled="false" runat="server" ControlToValidate="TxtTC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVTC" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:Label ID="LbImporteME" Text="" ClientIDMode="Static" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<asp:Panel ID="PanelIngresos" runat="server" Visible="false">
|
||||
<div class="row">
|
||||
<label class="col-xs-2 control-label">Ingreso:</label>
|
||||
<div class="col-xs-10">
|
||||
<asp:DropDownList ID="DdlIngreso" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="RazonSocial" DataValueField="CveIE" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDeudor" runat="server" ControlToValidate="DdlIngreso" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ingresos''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDeudor" runat="server" HighlightCssClass="vco" TargetControlID="RFVDeudor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<div class="row" id="divIntermediario" runat="server" visible="false">
|
||||
<label class="col-md-2">Intermediario:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlProveedorPagoInt" CssClass="form-control input-sm select2me" runat="server" AutoPostBack="true" DataTextField="Proveedor" DataValueField="CveProveedor" ValidationGroup="GrpGuardar" />
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DdlProveedorPagoInt" InitialValue="" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Es necesario seleccionar un <b>''Intermediario''</b>, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivDatosBancarios" runat="server" class="chequesie1">
|
||||
<div class="row">
|
||||
<label class="col-md-2">Movimiento:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardar">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Movimiento''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoTransaccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoTransaccion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 control-label">Cuenta:</label>
|
||||
<div class="col-md-5">
|
||||
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" ValidationGroup="GrpGuardar">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-5" runat="server" id="DivTCDolaresDolares" visible="false">
|
||||
T.C:
|
||||
<asp:TextBox ID="TxtTCDolaresDolares" runat="server" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||
<asp:RequiredFieldValidator ID="RFVTCDolaresDolares" Enabled="false" runat="server" ControlToValidate="TxtTCDolaresDolares" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server" HighlightCssClass="vco" TargetControlID="RFVTCDolaresDolares" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<asp:Button ID="BtnCambiaTipoMoneda" Text="" OnClick="BtnCambiaTipoMoneda_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="chequesie2">
|
||||
<div class="row">
|
||||
<div class="col-md-8"></div>
|
||||
<label class="col-md-1 control-label text-right">Fecha:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
|
||||
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" 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="CVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" 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>
|
||||
<asp:RangeValidator ID="RVTxtFechaDocumento" runat="server" Display="None" ErrorMessage="La fecha del documento no puede ser superior a la fecha actual" ControlToValidate="TxtFechaDocumento" MinimumValue="01/01/1900" MaximumValue="01/12/2999" Type="Date" ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento3" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 control-label">
|
||||
<asp:Label ID="LblFolio" runat="server" Text="Folio"> </asp:Label>:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox ID="TxtFolio" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="100px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolio" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-4"></div>
|
||||
<label class="col-md-1 control-label text-right">Importe:</label>
|
||||
<div class="col-md-2 input-icon">
|
||||
<i style="margin: 0px;">$</i>
|
||||
<asp:TextBox ID="TxtImporte" runat="server" CssClass="form-control input-sm" MaxLength="12" Width="140px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="TxtImporte" FilterType="Custom, Numbers" ValidChars="+-.," />
|
||||
<asp:RangeValidator ID="RVImporte" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtImporte" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="divAbonese" runat="server">
|
||||
<label class="col-md-2">
|
||||
<asp:Label ID="LblPagueseA" runat="server" Text="Abónese a"></asp:Label>:</label>
|
||||
<div class="col-md-7">
|
||||
<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
<asp:Button ID="BtnBuscarProveedor" runat="server" ClientIDMode="Static" Text="Buscar Proveedor" Style="display: none;" class="btn btn-primary" />
|
||||
<asp:TextBox ID="TxtAboneA" CssClass="form-control input-sm" runat="server" MaxLength="70" Width="394px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2">Observaciones</label>
|
||||
<div class="col-md-7">
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="400px" Rows="3" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
|
||||
<asp:HiddenField ID="HdnObs" runat="server" ClientIDMode="Static" />
|
||||
</div>
|
||||
<div class="col-md-2 input-icon">
|
||||
<i style="margin: 0px;">$</i>
|
||||
<asp:TextBox ID="TxtOtrosImportes" runat="server" ReadOnly="true" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Otros Importes" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTEOtrosImportes" runat="server" TargetControlID="TxtOtrosImportes" FilterType="Custom, Numbers" ValidChars="+-.," />
|
||||
<asp:RangeValidator ID="RangeValidator1" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtOtrosImportes" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>
|
||||
<asp:TextBox ID="TxtTotal" runat="server" CssClass="form-control input-sm" Visible="false" MaxLength="12" Width="140px" placeholder="Total" Enabled="false" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" runat="server" id="rowComisiones">
|
||||
<label class="col-md-2" runat="server" id="lblpagocomisiones">Otros Ingresos:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkAjusteOI" runat="server" AutoPostBack="true" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel ID="UpCuentaDeposito" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" id="trCuentaDeposito" runat="server" visible="False">
|
||||
<label class="col-md-2 control-label">Cuenta Depósito</label>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlCuentaDeposito_SelectedIndexChanged" runat="server" DataTextField="CuentaDeposito" DataValueField="CveCuentaDeposito" AppendDataBoundItems="True" Width="400px"></asp:DropDownList>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta de Depósito''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuentaDeposito" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="TrReferenciaCIE" runat="server" visible="False">
|
||||
<label class="col-md-2 control-label">Referencia:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtReferenciaCIE" Text="" runat="server" CssClass="form-control input-sm" Width="400px" />
|
||||
<%-- <asp:RequiredFieldValidator ID="RFVReferenciaCIE" runat="server" ControlToValidate="TxtReferenciaCIE" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Referencia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEReferenciaCIE" runat="server" HighlightCssClass="vco" TargetControlID="RFVReferenciaCIE" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-2">
|
||||
<div>
|
||||
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="Widthall">
|
||||
<tr>
|
||||
<td style="text-align: right; width: 25%">
|
||||
<asp:CheckBox Text=" Seguir Registrando Pagos" ID="ChkSeguirRegistrando" CssClass="md-checksd" runat="server" />
|
||||
</td>
|
||||
<td style="text-align: left; width: 9%">
|
||||
<asp:CheckBox Text=" Emitir complemento de pago" ID="ChkComplementoPago" Visible="false" CssClass="md-checksd" runat="server" />
|
||||
<br />
|
||||
<asp:Label ID="LblValidaCeuntaTipoTransaccion" runat="server" Visible="false" ForeColor="Red"></asp:Label>
|
||||
</td>
|
||||
<td style="text-align: left; width: 30%">
|
||||
<asp:Button ID="BtnIEGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
|
||||
<div class="row">
|
||||
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px; margin-right: 20px" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel ID="UPVentas" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Cobrar Pendientes"
|
||||
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<input type="checkbox" id="ChkAll" onclick="CheckAll();" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" CssClass="chkgv" runat="server"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Venta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplF" CssClass="Texto" NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}")%>' Text='<%# Eval("SerieFolio")%>' runat="server"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Tipo Docto" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
|
||||
<%--<asp:HyperLinkField DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" DataTextField="SerieFolio" HeaderText="Factura" ControlStyle-CssClass="Texto" />--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Fecha Venta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Fecha Vencimiento</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaVenci" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Días Vencidos</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDiasVencido" runat="server" Text='<%# Eval("DiasVencidos", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Método de Pago" DataField="ClaveMetodoPagoSAT" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Forma de Pago" DataField="FormaPago" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<HeaderTemplate>Monto Compra</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSaldoOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate></HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="LtlMoneda" runat="server" Text='<%# Eval("TMoneda", "{0}") %>' Style="text-decoration: none" Enabled="false" ForeColor="#333333"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Abonado</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAbonado" runat="server" Text='<%# Eval("Abonado", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Saldo</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Abonar</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtAbonar" Width="80px" runat="server" Style="text-align: right;" onkeyup="FormatoMoneda(this)"></asp:TextBox>
|
||||
<asp:RangeValidator ID="RVAbonar" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue='<%# Eval("Saldo", "{0:N2}") %>' ErrorMessage="*" ControlToValidate="TxtAbonar" Display="Dynamic"></asp:RangeValidator>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>Ot. Ing.</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtComision" Width="50px" runat="server" Style="text-align: right;"></asp:TextBox>
|
||||
<asp:RangeValidator ID="RVComision" runat="server" Enabled="false" ErrorMessage="*" ControlToValidate="TxtComision" Display="Dynamic" Type="Double"></asp:RangeValidator>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="300px">
|
||||
<HeaderTemplate>Auxiliar</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlAux" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="False">
|
||||
<HeaderTemplate>CveVenta</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HplF2" CssClass="Texto" Text='<%# Eval("CveVenta")%>' runat="server"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<%-- MODAL SALDAR INCOBRABLE--%>
|
||||
<div id="ModalSaldarCuentaIncobrable" class="modal ADS 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">×</button>
|
||||
<h4 class="modal-title">Saldar Cuentas</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpBodyIncobrable" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="alert alert-warning">Las facturas seleccionadas serán saldadas</div>
|
||||
|
||||
|
||||
<div class="dashboard-stat2 " style="border-style: solid; border-color: whitesmoke;">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="progress-info">
|
||||
<div class="status" style="font-size: 12px">
|
||||
$:
|
||||
<asp:Label Text="text" ID="LtlTotalMXN" runat="server" ClientIDMode="Static" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-2 control-label text-right">Fecha:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
|
||||
<asp:TextBox ID="TxtFechaIncobrable" runat="server" CssClass="form-control"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaIncobrable" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaIncobrable" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TxtFechaIncobrable" PopupButtonID="ImgFechaIncobrable" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVIncobrable" runat="server" ControlToValidate="TxtFechaIncobrable" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpIncobrable"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVIncobrable" runat="server" ControlToValidate="TxtFechaIncobrable" 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="GrpIncobrable"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RFVIncobrable" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="CVIncobrable" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-2 control-label text-right">Observación:</label>
|
||||
|
||||
<asp:TextBox ID="TxtObsSaldarIncobrable" Text="Saldar Cuenta" runat="server" TextMode="MultiLine" Rows="2" Width="300px"></asp:TextBox>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<label class="col-md-2 control-label text-right">Cta Deducción:</label>
|
||||
|
||||
<asp:DropDownList ID="DdlTipoDeduccion" runat="server" Width="300px">
|
||||
<asp:ListItem Text="Gasto No Deducible" Value="255" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Incobrable No Deducible" Value="211"></asp:ListItem>
|
||||
<asp:ListItem Text="Incobrable Deducible" Value="263"></asp:ListItem>
|
||||
<asp:ListItem Text="Reservas" Value="252"></asp:ListItem>
|
||||
<asp:ListItem Text="Otros Ingresos" Value="78"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnSaldarCuentasIncobrables" runat="server" CssClass="btn btn-primary" Text="Saldar cuentas" ValidationGroup="GrpIncobrable" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- FIN MODAL SALDAR INCOBRABLE--%>
|
||||
|
||||
<div id="ModalVincularIntermediario" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modalChkProveedorIntermediario">×</button>
|
||||
<h4 class="modal-title">Vincular Intermediario</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:CheckBox ID="ChkProveedorIntermediario" runat="server" />
|
||||
Intermediario:
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ADS:Dropdownlost ID="DdlProveedorIntermediario" CssClassDdl="select2me" CssStyle="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" runat="server"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnVincularIntermediario" runat="server" CssClass="btn btn-primary" Text="Vincular Intermediario" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
var Ventas = '';
|
||||
|
||||
function FnSuma(t, txt, importe) {
|
||||
debugger;
|
||||
var chkPesosBancos = $get("ChkPagarPesos");
|
||||
var chkDolaresBancos = $get("ChkPagarDolares");
|
||||
|
||||
|
||||
if (t.checked) {
|
||||
txt.value = FormatoNumero(importe, 2);
|
||||
} else {
|
||||
txt.value = "";
|
||||
}
|
||||
|
||||
|
||||
if (chkPesosBancos) {
|
||||
CambiaPesosDolares()
|
||||
} else if (chkDolaresBancos) {
|
||||
CambiaDolaresPesos()
|
||||
}
|
||||
}
|
||||
|
||||
function SumaValores(pagoMultiple, monedaPago) {
|
||||
debugger;
|
||||
var Importe = 0;
|
||||
var Comision = 0.00;
|
||||
var topLevelElem = document.getElementById("form1");
|
||||
var textBoxes = topLevelElem.getElementsByTagName("input");
|
||||
var idd = '';
|
||||
Ventas = '';
|
||||
var abono = 0;
|
||||
var abonoComision = 0;
|
||||
var moneda = '';
|
||||
var tc = 0;
|
||||
var facDolares = false;
|
||||
var div = document.getElementById("DivTC")
|
||||
|
||||
if ($get('TxtTC') != null) {
|
||||
tc = ToDouble($get('TxtTC').value);
|
||||
}
|
||||
if ($get('TxtTCDolares') != null) {
|
||||
tc = ToDouble($get('TxtTCDolares').value);
|
||||
}
|
||||
|
||||
for (var i = 0; i < textBoxes.length; i++) {
|
||||
if (textBoxes[i].type == "text") {
|
||||
if (textBoxes[i].id.indexOf('C_GvCxC_TxtAbonar') >= 0) {
|
||||
if (textBoxes[i].value != '') {
|
||||
idd = textBoxes[i].id.replace('C_GvCxC_TxtAbonar_', '');
|
||||
Ventas = Ventas + (Importe == 0 ? '' : ', ') + $get("C_GvCxC_HplF_" + idd).innerText;
|
||||
abono = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
moneda = $get("C_GvCxC_LtlMoneda_" + idd).innerText;
|
||||
|
||||
if (monedaPago == 1 && moneda == 'USD') {
|
||||
facDolares = true;
|
||||
abono = abono * tc;
|
||||
}
|
||||
if (monedaPago == 2 && moneda == 'MXN' && tc != 0) {
|
||||
abono = abono / tc;
|
||||
}
|
||||
Importe = Importe + abono
|
||||
}
|
||||
}
|
||||
if (textBoxes[i].id.indexOf('C_GvCxC_TxtComision') >= 0) {
|
||||
if (textBoxes[i].value != '') {
|
||||
abonoComision = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
moneda = $get("C_GvCxC_LtlMoneda_" + idd).innerText;
|
||||
if (monedaPago == 1 && moneda == 'USD') {
|
||||
facDolares = true
|
||||
abonoComision = abonoComision * tc;
|
||||
}
|
||||
if (monedaPago == 2 && moneda == 'MXN' && tc != 0) {
|
||||
abonoComision = abonoComision / tc;
|
||||
}
|
||||
Comision = parseFloat(Comision) + abonoComision;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pagoMultiple == -1 && tc == 0 && facDolares) {
|
||||
Importe = 0
|
||||
Comision = 0
|
||||
}
|
||||
if (facDolares && pagoMultiple == -1) {
|
||||
div.style.display = 'block';
|
||||
}
|
||||
if (!facDolares && div != null && pagoMultiple == -1) {
|
||||
div.style.display = 'none';
|
||||
}
|
||||
$get('TxtObservaciones').value = $get('HdnObs').value + ' Ventas: ' + Ventas;
|
||||
|
||||
if ($get('TxtOtrosImportes') != null) {
|
||||
if (pagoMultiple != 0) {
|
||||
$get('TxtOtrosImportes').value = FormatoNumero(Comision, 2);
|
||||
}
|
||||
|
||||
if ($get('TxtOtrosImportes').value == '') {
|
||||
$get('TxtOtrosImportes').value = 0.00
|
||||
|
||||
}
|
||||
else {
|
||||
return Importe + parseFloat(Comision);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
return Importe
|
||||
}
|
||||
}
|
||||
|
||||
function FnCambia(chk, txt, saldo, op, pagoMultiple, monedaPago) {
|
||||
debugger;
|
||||
|
||||
if (op == 1) {
|
||||
if (txt.value != '') {
|
||||
chk.checked = true;
|
||||
} else {
|
||||
chk.checked = false;
|
||||
}
|
||||
}
|
||||
if (op == 1 || op == 2) {
|
||||
if (ToDouble(txt.value) > saldo) {
|
||||
txt.value = saldo;
|
||||
alert("El Importe no debe de exceder a el saldo");
|
||||
}
|
||||
}
|
||||
var Suma = SumaValores(pagoMultiple, monedaPago);
|
||||
$get('TxtImporte').value = FormatoNumero(Suma, 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(Suma, 2))
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtOtrosImportes').value * -1)), 2);
|
||||
}
|
||||
|
||||
pagoMultiple = 0;
|
||||
if (monedaPago == 1) monedaPago = 2; else monedaPago = 1;
|
||||
|
||||
var SumaConversion = SumaValores(pagoMultiple, monedaPago)
|
||||
if (Suma == 0) SumaConversion = 0;
|
||||
|
||||
if ($("#LbImporteME").length) {
|
||||
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaConversion, 2) + ' USD';
|
||||
}
|
||||
if ($("#LbImporteMN").length) {
|
||||
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaConversion, 2) + ' MXN';
|
||||
}
|
||||
}
|
||||
|
||||
function FnLimites(chk, txt, limiteInferior, limiteSuperior) {
|
||||
debugger;
|
||||
if (ToDouble(txt.value) < limiteInferior) {
|
||||
txt.value = limiteInferior;
|
||||
alert("El Importe no debe de exceder a el saldo");
|
||||
} else if (ToDouble(txt.value) > limiteSuperior) {
|
||||
txt.value = limiteSuperior;
|
||||
alert("El Importe no debe de exceder a el saldo");
|
||||
}
|
||||
|
||||
var Suma = SumaValores();
|
||||
$get('TxtImporte').value = FormatoNumero(Suma, 2);
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtOtrosImportes').value * -1)), 2);
|
||||
}
|
||||
|
||||
CambiaPesosDolares()
|
||||
CambiaDolaresPesos()
|
||||
|
||||
}
|
||||
|
||||
function CambiaPesosDolares() {
|
||||
debugger;
|
||||
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
|
||||
|
||||
debugger;
|
||||
if ($("#LbImporteME").length) {
|
||||
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' USD';
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value) * ToDouble($get('TxtTC').value), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) * ToDouble($get('TxtTC').value), 2);
|
||||
}
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value) + (ToDouble($get('TxtOtrosImportes').value * -1)), 2);
|
||||
}
|
||||
}
|
||||
|
||||
function CambiaDolaresPesos() {
|
||||
debugger;
|
||||
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
|
||||
|
||||
|
||||
debugger;
|
||||
if ($("#LbImporteMN").length) {
|
||||
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN';
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTCDolares').value), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTCDolares').value), 2);
|
||||
|
||||
}
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value) + (ToDouble($get('TxtOtrosImportes').value * -1)), 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function waitforpastedata(elem, savedcontent) {
|
||||
if (elem.childNodes && elem.childNodes.length > 0) {
|
||||
processpaste(elem, savedcontent);
|
||||
}
|
||||
else {
|
||||
that = {
|
||||
e: elem,
|
||||
s: savedcontent
|
||||
}
|
||||
that.callself = function () {
|
||||
waitforpastedata(that.e, that.s)
|
||||
}
|
||||
setTimeout(that.callself, 20);
|
||||
}
|
||||
}
|
||||
|
||||
function processpaste(elem, savedcontent) {
|
||||
pasteddata = elem.innerHTML;
|
||||
//^^Alternatively loop through dom (elem.childNodes or elem.getElementsByTagName) here
|
||||
|
||||
elem.innerHTML = savedcontent;
|
||||
|
||||
// Do whatever with gathered data;
|
||||
alert(pasteddata);
|
||||
}
|
||||
|
||||
function CheckAll() {
|
||||
var topLevelElem = document.getElementById("C_UPVentas");
|
||||
var textBoxes = topLevelElem.getElementsByTagName("input");
|
||||
var check = false;
|
||||
|
||||
for (var i = 0; i < textBoxes.length; i++) {
|
||||
if (textBoxes[i].type == "checkbox") {
|
||||
debugger;
|
||||
|
||||
if (textBoxes[i].id == "ChkAll") {
|
||||
check = !textBoxes[i].checked;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (textBoxes[i].checked && check) {
|
||||
textBoxes[i].click();
|
||||
} else if (!textBoxes[i].checked && !check) {
|
||||
textBoxes[i].click();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var TipoCambioActual = 0.0;
|
||||
function CambiaTC(txt) {
|
||||
let TipoCambioTxt = ToDouble(txt.value)
|
||||
if (TipoCambioActual != TipoCambioTxt) {
|
||||
$get("BtnCambiaTipoMoneda").click();
|
||||
TipoCambioActual = TipoCambioTxt;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
2512
Ventas/ClientesAbonar.aspx.vb
Normal file
2512
Ventas/ClientesAbonar.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
1219
Ventas/ConsultaCliente.aspx.exclude
Normal file
1219
Ventas/ConsultaCliente.aspx.exclude
Normal file
File diff suppressed because it is too large
Load Diff
545
Ventas/ConsultaCliente.aspx.vb.exclude
Normal file
545
Ventas/ConsultaCliente.aspx.vb.exclude
Normal file
@@ -0,0 +1,545 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
|
||||
Partial Class Ventas_ConsultaCliente
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
'Configuración
|
||||
Private Property CveCliente As Integer
|
||||
Get
|
||||
Return ViewState("CveCliente").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCliente") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
Session("FileUpload") = ""
|
||||
ViewState("Orden") = ""
|
||||
ViewState("ONombre") = "Nombre DESC"
|
||||
|
||||
CveCliente = UsuarioActual.CveCliente
|
||||
|
||||
CargaDatos()
|
||||
CargaHistorial()
|
||||
CargaCxP()
|
||||
CargaAnticipos()
|
||||
CargarTipoBuzon()
|
||||
CargarClienteSucursal()
|
||||
CargaUsuariosPortal()
|
||||
|
||||
'Configuración de Modalidad Update
|
||||
BtnGuardar.Text = "Guardar"
|
||||
LtlTitulo.Text = "Expediente de:"
|
||||
If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
If ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
'Campos para Modificación
|
||||
LtlCliente.Text = ObjClientes.Nombre
|
||||
TxtContacto.Text = ObjClientes.Contacto
|
||||
TxtEmail.Text = ObjClientes.Mail
|
||||
TxtParaMail.Text = ObjClientes.Mail
|
||||
ChkMail.Checked = ObjClientes.EnviarFactura
|
||||
Else
|
||||
Alert("El Cliente Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
BtnGuardar.Enabled = False
|
||||
End If
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaHistorial()
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
If ObjClientes.GetHistorialVentas(UsuarioActual.CveCliente) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
'Carga Generales
|
||||
LtlCantidad.Text = ObjClientes.DtResultados.Rows(0)("CountTotal").ToString.FormatoNumero(2)
|
||||
LtlTotalVendido.Text = ObjClientes.DtResultados.Rows(0)("Total").ToString.FormatoNumero(2)
|
||||
LtlMinima.Text = ObjClientes.DtResultados.Rows(0)("MIN_Total").ToString.FormatoNumero(2)
|
||||
LtlPromedio.Text = ObjClientes.DtResultados.Rows(0)("AVG_Total").ToString.FormatoNumero(2)
|
||||
LtlMaxima.Text = ObjClientes.DtResultados.Rows(0)("MAX_Total").ToString.FormatoNumero(2)
|
||||
'Carga Grid
|
||||
GVHistorial.DataSource = ObjClientes.DtResultados
|
||||
Else
|
||||
GVHistorial.DataSource = Nothing
|
||||
End If
|
||||
Else
|
||||
GVHistorial.DataSource = Nothing
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
GVHistorial.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCxP()
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
'CxC Activas
|
||||
If ObjMovtos.GetCxCCliente(UsuarioActual.CveCliente) Then
|
||||
GvCxC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'")
|
||||
GvCxCHistorial.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'")
|
||||
Else
|
||||
GvCxC.DataSource = Nothing
|
||||
GvCxCHistorial.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GvCxC.DataBind()
|
||||
GvCxCHistorial.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaAnticipos()
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetAnticiposCliente(UsuarioActual.CveCliente) Then
|
||||
GVAnticipos.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'")
|
||||
GVAnticiposHistorial.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'")
|
||||
Else
|
||||
GVAnticipos.DataSource = Nothing
|
||||
GVAnticiposHistorial.DataSource = Nothing
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
GVAnticipos.DataBind()
|
||||
GVAnticiposHistorial.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarTipoBuzon()
|
||||
DdlTipoBuzon.DataSource = GlobalDTTipoBuzon
|
||||
DdlTipoBuzon.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarClienteSucursal()
|
||||
Dim ObjClienteSucursal As New ClsClientes
|
||||
If ObjClienteSucursal.GetSucursales(UsuarioActual.CveCliente) Then
|
||||
DdlClienteSucursal.DataSource = ObjClienteSucursal.DtResultados
|
||||
Else
|
||||
DdlClienteSucursal.DataSource = Nothing
|
||||
End If
|
||||
ObjClienteSucursal.Dispose()
|
||||
DdlClienteSucursal.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaUsuariosPortal()
|
||||
Dim ObjUsrs As New ClsSisUsuarios()
|
||||
|
||||
|
||||
If ObjUsrs.GetUsuariosPortal(-1, CveCliente, -1) Then
|
||||
Dim dtUsr As DataTable = ObjUsrs.DtResultados
|
||||
|
||||
dtUsr = dtUsr.FiltraParametros("Usuario <> 'Admin'")
|
||||
|
||||
ViewState("OrdenUsuarios") = ""
|
||||
|
||||
''busco la clave del admin, si es que existe
|
||||
'Dim dr As DataRow = dtUsr.FiltroPrimero("Usuario = 'Admin'")
|
||||
|
||||
'If dr IsNot Nothing Then
|
||||
' HdnCveUsuarioPortalAdmin.Value = dr("CveUsuarioPortal").ToString
|
||||
|
||||
' If dr("Estatus").ToString = "1" Then
|
||||
' HdnCveUsuarioPortalActivado.Value = "1"
|
||||
' End If
|
||||
|
||||
'End If
|
||||
|
||||
'If HdnCveUsuarioPortalActivado.Value.ToEntero > 0 Then
|
||||
' trEnviarActivacion.Visible = False
|
||||
' trRecuperacionContraseña.Visible = True
|
||||
'End If
|
||||
|
||||
GvUsuariosPortal.DataSource = dtUsr
|
||||
ViewState("DTUsuariosCliente") = dtUsr
|
||||
Else
|
||||
GvUsuariosPortal.DataSource = Nothing
|
||||
ViewState("DTUsuariosCliente") = Nothing
|
||||
End If
|
||||
ObjUsrs.Dispose()
|
||||
GvUsuariosPortal.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
DirectCast(e.Row.FindControl("HLSendMail"), HtmlAnchor).Visible = False
|
||||
End If
|
||||
|
||||
e.Row.FCLiteral("LtlFactura").Text = e.Row.DBCampo("Folio")
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
DirectCast(e.Row.FindControl("HLSendMail"), HtmlAnchor).HRef = "javascript:$get('HdnCveVenta').value='" & e.Row.DBCampo("CveVenta") & "';$get('HdnFolioVenta').value='" & e.Row.DBCampo("folio") & "';$('#DivMail').show(1000);PosicionaObjeto('" & DirectCast(e.Row.FindControl("HLSendMail"), HtmlAnchor).ClientID & "', 'DivMail');"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCxC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxC.RowDataBound, GvCxCHistorial.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).ColumnSpan = 4
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.FCLiteral("LtlFactura").Text = "Total" & " "
|
||||
e.Row.Cells(1).Visible = False
|
||||
e.Row.Cells(2).Visible = False
|
||||
e.Row.Cells(3).Visible = False
|
||||
'e.Row.Cells(9).ColumnSpan = 2
|
||||
'e.Row.Cells(10).Visible = False
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
If e.Row.RowIndex = 1 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(70)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(90)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(90)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(105)
|
||||
e.Row.Cells(7).Width = Unit.Pixel(90)
|
||||
e.Row.Cells(8).Width = Unit.Pixel(105)
|
||||
End If
|
||||
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(5).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(3).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Abonado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAbonado"), Literal).Text = ""
|
||||
If e.Row.DBCampo("PorRecuperado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlPorRecuperado"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldo"), Literal).Text = ""
|
||||
If e.Row.DBCampo("PorXRecuperar").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlPorXRecuperar"), Literal).Text = ""
|
||||
|
||||
e.Row.FCLiteral("LtlFactura").Text = e.Row.DBCampo("Folio")
|
||||
If CType(sender, GridView).ID = "GvCxCHistorial" Then
|
||||
DirectCast(e.Row.FindControl("LtlDiasVencido"), Literal).Text = ""
|
||||
Else
|
||||
e.Row.Cells(7).Font.Bold = True
|
||||
e.Row.Cells(8).Font.Bold = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GVAnticipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAnticipos.RowDataBound, GVAnticiposHistorial.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).ColumnSpan = 2
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.FCLiteral("LtlFactura").Text = "Total" & " "
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
e.Row.Cells(1).Visible = False
|
||||
End If
|
||||
If e.Row.RowIndex = 1 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(80)
|
||||
End If
|
||||
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(2).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAnticipos"), Literal).Text = ""
|
||||
|
||||
If e.Row.RowIndex > 0 Then
|
||||
e.Row.FCLiteral("LtlFactura").Text = e.Row.DBCampo("Folio")
|
||||
End If
|
||||
|
||||
If CType(sender, GridView).ID = "GVAnticipos" Then
|
||||
e.Row.Cells(2).Font.Bold = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnSendMail_Click(sender As Object, e As System.EventArgs) Handles BtnSendMail.Click
|
||||
Try
|
||||
|
||||
If HdnCveVenta.Value <> "-1" AndAlso HdnFolioVenta.Value <> "-1" Then
|
||||
Dim ObjEmprea As New ClsEmpresas()
|
||||
If ObjEmprea.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
Dim Ruta As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
|
||||
|
||||
If File.Exists(Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf") AndAlso File.Exists(Ruta & "XML\" & HdnFolioVenta.Value & ".xml") Then
|
||||
Dim PDF As String = Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf"
|
||||
Dim XML As String = Ruta & "XML\" & HdnFolioVenta.Value & ".xml"
|
||||
Dim ArrayCC() As String = TxtCC.Text.Trim.Split(Convert.ToChar(";"))
|
||||
|
||||
Dim ResultadoMail As Integer = 0
|
||||
If ObjMail.Mandacorreo(ObjEmprea.SendMail, ObjEmprea.SendMailPassword, TxtParaMail.Text.Trim, "Entrega de Factura", PDF, XML, ArrayCC, TxtBody.Text.Trim) Then
|
||||
ResultadoMail = 1
|
||||
TxtCC.Text = ""
|
||||
TxtBody.Text = ""
|
||||
Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
|
||||
CargaHistorial()
|
||||
UpnHistorial.Update()
|
||||
Else
|
||||
ResultadoMail = 3
|
||||
End If
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.UpdateVentaMail(ResultadoMail, HdnCveVenta.Value.ToEntero)
|
||||
ObjVentas.Dispose()
|
||||
Else
|
||||
Alert("No se pudo adjuntar el correo electrónica.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
ObjEmprea.Dispose()
|
||||
Else
|
||||
Alert("No se seleccionó ninguna factura para envíar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar MAIL", ex)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.UpdateVentaMail(3, HdnCveVenta.Value.ToEntero)
|
||||
ObjVentas.Dispose()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub CargaRHPersonal()
|
||||
Dim ObjRHPersonal As New ClsRHPersonal
|
||||
If ObjRHPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveCliente, TxtHora.PostedTime & ":00", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTRHPersonal") = ObjRHPersonal.DtResultados
|
||||
Else
|
||||
Me.GvRHPersonal.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjRHPersonal.Dispose()
|
||||
CargaGridRHPersonal("")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvRHPersonal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvRHPersonal.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex >= 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(100)
|
||||
'CARGAR IMAGENES DE PERSONAL
|
||||
If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL") & ".png") Then
|
||||
e.Row.FCImage("ImgPersonal").ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & e.Row.DBCampo("URL") & ".png"
|
||||
End If
|
||||
|
||||
'If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL")) Then
|
||||
'e.Row.FCLiteral("LtlImgPersonal").Text = "<img src='/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & e.Row.DBCampo("URL") & " ' width='75px' heigth='75px'/>"
|
||||
'Else
|
||||
'e.Row.FCLiteral("LtlImgPersonal").Text = "<img src='/Imagenes/SinImagen.jpg' width='50px' heigth='50px'/>"
|
||||
'End If
|
||||
'FIN CARGAR IMAGENES DE PERSONAL
|
||||
|
||||
e.Row.Cells(1).Width = Unit.Pixel(250)
|
||||
|
||||
End If
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGridRHPersonal(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTRHPersonal"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvRHPersonal.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvRHPersonal.DataSource = CType(ViewState("DTRHPersonal"), DataTable)
|
||||
End If
|
||||
GvRHPersonal.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
|
||||
Alert("Gracias por ponerse en contacto con nosotros.<br />Su queja a sido recibida y pronto nos pondremos en contacto con usted.", TipoMensaje.MsgConfirmacion)
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LbNombre_Click(sender As Object, e As System.EventArgs) Handles LbNombre.Click
|
||||
If ViewState("ONombre").ToString() = "Nombre DESC" Then
|
||||
ViewState("ONombre") = "Nombre ASC"
|
||||
ImgNombre.ImageUrl = "/Imagenes/FlechasArriba.gif"
|
||||
Else
|
||||
ViewState("ONombre") = "Nombre DESC"
|
||||
ImgNombre.ImageUrl = "/Imagenes/FlechasAbajo.gif"
|
||||
End If
|
||||
ViewState("Orden") = ViewState("ONombre")
|
||||
CargaGridRHPersonal(ViewState("Orden").ToString())
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultarPersonal_Click(sender As Object, e As System.EventArgs) Handles BtnConsultarPersonal.Click
|
||||
CargaRHPersonal()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnEnviar_Click(sender As Object, e As System.EventArgs) Handles BtnEnviar.Click
|
||||
'GvRHPersonal
|
||||
Dim ObjQueja As New ClsRHPersonal
|
||||
For Each Row As GridViewRow In GvRHPersonal.Rows
|
||||
If Row.FCCheckBox("ChbSeleccionado").Checked Then
|
||||
If ObjQueja.AddPersonalBuzon(GvRHPersonal.DataKeys(Row.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveCliente, DdlClienteSucursal.SelectedValue.ToEntero, DdlTipoBuzon.SelectedValue.ToEntero, Convert.ToDateTime(TxtFechaQueja.Text & " " & TxtHora.PostedTime), TxtDescripcion.Text, TxtNombreReporto.Text, TxtTelefonoReporto.Text, TxtMailReporto.Text, TxtObservaciones.Text, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Se Envió Correctamente")
|
||||
End If
|
||||
'Si está seleccionado el check del GridView quiere decir que lo seleccionaron. Hay que hacer el insert
|
||||
'La clave personal se saca de:
|
||||
'(string)this.grid.DataKeys[rowIndex]["myKey"];
|
||||
'GvRHPersonal.DataKeys(Row.RowIndex)("CvePersonal").ToString
|
||||
|
||||
End If
|
||||
Next
|
||||
ObjQueja.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Usuarios"
|
||||
|
||||
|
||||
Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click
|
||||
Dim Usuario As New ClsSisUsuarios
|
||||
If Usuario.AddUsuarioPortal(TxtUsuarioPortal.Text, ContraseñaPredeterminada, TxtNombrePortal.Text, CveCliente, 0,
|
||||
ChkPermiso1.Checked, ChkPermiso2.Checked, ChkPermiso3.Checked, ChkPermiso4.Checked, ChkPermiso5.Checked,
|
||||
ChkPermiso6.Checked, ChkPermiso7.Checked, ChkPermiso8.Checked, ChkPermiso9.Checked, ChkPermiso10.Checked, UsuarioActual.CveUsuario, 0) > 0 Then
|
||||
ViewState("DTUsuariosCliente") = Usuario.DtResultados
|
||||
TxtUsuarioPortal.Text = ""
|
||||
TxtNombrePortal.Text = ""
|
||||
End If
|
||||
Usuario.Dispose()
|
||||
If ViewState("OrdenUsuarios").ToString() <> String.Empty Then
|
||||
CargaGridUsuarios(ViewState("OrdenUsuarios").ToString())
|
||||
Else
|
||||
CargaGridUsuarios("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(70)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(7).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(8).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(9).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(10).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(11).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(12).Width = Unit.Pixel(45)
|
||||
e.Row.Cells(13).Width = Unit.Pixel(68)
|
||||
e.Row.Cells(14).Width = Unit.Pixel(70)
|
||||
e.Row.Cells(15).Width = Unit.Pixel(55)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing
|
||||
|
||||
GvUsuariosPortal.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("OrdenUsuarios").ToString() <> String.Empty Then
|
||||
CargaGridUsuarios(ViewState("OrdenUsuarios").ToString())
|
||||
Else
|
||||
CargaGridUsuarios("")
|
||||
End If
|
||||
'CargaUsuariosPortal()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating
|
||||
|
||||
Dim Usuarios As New ClsSisUsuarios
|
||||
|
||||
Dim Usuario, Nombre As String
|
||||
Dim Estatus As Boolean
|
||||
|
||||
Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex)
|
||||
Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim
|
||||
Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim
|
||||
'Rol = GvDatos.Rows(e.RowIndex).FCDropDownList("CbxA").SelectedValue.ToEntero
|
||||
Estatus = gvr.FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuarioPortal").ToEntero
|
||||
Dim pCveCliente As Integer = gvr.DataKey("CveCliente").ToEntero
|
||||
|
||||
'Correo = GvDatos.Rows(e.RowIndex).FCTextBox("TxtCorreo").Text.Trim
|
||||
'CveSupervisa = GvDatos.Rows(e.RowIndex).FCDropDownList("CboSupervisa").SelectedValue.ToEntero
|
||||
'CveAutoriza = GvDatos.Rows(e.RowIndex).FCDropDownList("CboAutoriza").SelectedValue.ToEntero
|
||||
'CveEmpresa = GvDatos.Rows(e.RowIndex).FCDropDownList("CboEmpresa").SelectedValue.ToEntero
|
||||
|
||||
If Usuarios.UpdateUsuarioPortal(Usuario, Nombre, gvr.FCCheckBox("ChkPermiso1").Checked, gvr.FCCheckBox("ChkPermiso2").Checked, gvr.FCCheckBox("ChkPermiso3").Checked, gvr.FCCheckBox("ChkPermiso4").Checked, gvr.FCCheckBox("ChkPermiso5").Checked,
|
||||
gvr.FCCheckBox("ChkPermiso6").Checked, gvr.FCCheckBox("ChkPermiso7").Checked, gvr.FCCheckBox("ChkPermiso8").Checked, gvr.FCCheckBox("ChkPermiso9").Checked, gvr.FCCheckBox("ChkPermiso10").Checked, Estatus, "-1", pCveCliente, -1, CveUsuarioPortal) Then
|
||||
|
||||
GvUsuariosPortal.EditIndex = -1
|
||||
ViewState("DTUsuariosCliente") = Usuarios.DtResultados
|
||||
End If
|
||||
|
||||
Usuarios.Dispose()
|
||||
|
||||
If ViewState("OrdenUsuarios").ToString() <> String.Empty Then
|
||||
CargaGridUsuarios(ViewState("OrdenUsuarios").ToString())
|
||||
Else
|
||||
CargaGridUsuarios("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting
|
||||
|
||||
Dim Usuario As New ClsSisUsuarios
|
||||
If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
|
||||
GvUsuariosPortal.EditIndex = -1
|
||||
ViewState("DTUsuariosCliente") = Usuario.DtResultados
|
||||
End If
|
||||
|
||||
Usuario.Dispose()
|
||||
|
||||
If ViewState("OrdenUsuarios").ToString() <> String.Empty Then
|
||||
CargaGridUsuarios(ViewState("OrdenUsuarios").ToString())
|
||||
Else
|
||||
CargaGridUsuarios("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit
|
||||
|
||||
GvUsuariosPortal.EditIndex = -1
|
||||
|
||||
If ViewState("OrdenUsuarios").ToString() <> String.Empty Then
|
||||
CargaGridUsuarios(ViewState("OrdenUsuarios").ToString())
|
||||
Else
|
||||
CargaGridUsuarios("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGridUsuarios(Orden As String)
|
||||
If CType(ViewState("DTUsuariosCliente"), DataTable).Rows.Count > 0 Then
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTUsuariosCliente"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvUsuariosPortal.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosCliente"), DataTable)
|
||||
End If
|
||||
|
||||
End If
|
||||
GvUsuariosPortal.DataBind()
|
||||
UPPUsuarios.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
119
Ventas/Default.aspx
Normal file
119
Ventas/Default.aspx
Normal file
@@ -0,0 +1,119 @@
|
||||
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>FullCalendar 2 Debugging Template - jsFiddle demo</title>
|
||||
|
||||
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
|
||||
|
||||
|
||||
<script type="text/javascript" src="/JQUERY/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="/SCRIPT/moment.js"></script>
|
||||
<script type="text/javascript" src="/SCRIPT/fullcalendar.js"></script>
|
||||
<script type="text/javascript" src="/SCRIPT/app.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/CSS/fullcalendar.css"/>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin-top: 40px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-family:"Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
|
||||
}
|
||||
#calendar {
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
$(function () {
|
||||
$('#calendar').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'agendaDay,month,agendaWeek,'
|
||||
// right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
timeFormat: {
|
||||
agenda: 'h(:mm)t{ - h(:mm)t}',
|
||||
'': 'h(:mm)t{-h(:mm)t }'
|
||||
},
|
||||
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
|
||||
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
||||
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
||||
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
|
||||
buttonText: {
|
||||
today: 'Hoy',
|
||||
month: 'Mes',
|
||||
week: 'Semana',
|
||||
day: 'Día'
|
||||
},
|
||||
defaultDate: '2014-01-01',
|
||||
editable: true,
|
||||
lang: 'es',
|
||||
defaultDate: '2014-06-12',
|
||||
editable: true,
|
||||
events: [{
|
||||
|
||||
|
||||
title: 'All Day Event',
|
||||
start: '2014-06-01',
|
||||
allDay: true,
|
||||
url: 'http://arshaw.com/fullcalendar/docs/mouse/dayClick/',
|
||||
backgroundColor: App.getCodigosColor('Rojo')
|
||||
|
||||
|
||||
}, {
|
||||
title: 'Long Event',
|
||||
start: '2014-06-07',
|
||||
end: '2014-06-10',
|
||||
backgroundColor: App.getCodigosColor('Verde')
|
||||
}, {
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2014-06-09T16:00:00'
|
||||
}, {
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2014-06-16T16:00:00'
|
||||
}, {
|
||||
title: 'Meeting',
|
||||
start: '2014-06-12T10:30:00',
|
||||
end: '2014-06-12T12:30:00'
|
||||
}, {
|
||||
title: 'Lunch',
|
||||
start: '2014-06-12T12:00:00'
|
||||
}, {
|
||||
title: 'Birthday Party',
|
||||
start: '2014-06-13T07:00:00'
|
||||
}, {
|
||||
title: 'Click for Google',
|
||||
url: 'http://google.com/',
|
||||
start: '2014-06-28'
|
||||
}]
|
||||
});
|
||||
});//]]>
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div id="calendar">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
5
Ventas/Default.aspx.vb
Normal file
5
Ventas/Default.aspx.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
Partial Class _Default
|
||||
Inherits System.Web.UI.Page
|
||||
|
||||
End Class
|
||||
3468
Ventas/PV.aspx
Normal file
3468
Ventas/PV.aspx
Normal file
File diff suppressed because it is too large
Load Diff
5393
Ventas/PV.aspx.vb
Normal file
5393
Ventas/PV.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
179
Ventas/PopUpBuscarClientes.aspx
Normal file
179
Ventas/PopUpBuscarClientes.aspx
Normal file
@@ -0,0 +1,179 @@
|
||||
<%@ Page Title="Ventas - Búsqueda de Clientes" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarClientes.aspx.vb" Inherits="PopUpBuscarClientes" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.truncate {
|
||||
width: 300px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
max-width: 750px !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Búsqueda de Clientes
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:HiddenField ID="hdnEsThickbox" runat="server" ClientIDMode="Static" />
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="Widthall">
|
||||
<%--border="1" rules="all" style="border-collapse: collapse;"--%>
|
||||
<tr>
|
||||
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Nombre del Cliente:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtNombre" runat="server" MaxLength="90" Width="200px" autofocus></asp:TextBox></td>
|
||||
<td class="text-right"><b>RFC:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtRFC" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Código:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCodigo" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
|
||||
<td class="text-right"><b>Nombre Corto:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtNombreCorto" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Teléfono:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtTelefono" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
|
||||
<td class="text-right"><b>Email:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtMail" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Sucursal:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-sm" Width="200px">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td class="text-right"><b>Estatus:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlEstatus" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm" Width="200px">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="4">
|
||||
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<%-- <table id="TblBusqueda" runat="server" border="0" visible="false">
|
||||
<tr>
|
||||
<td align="left">--%>
|
||||
<div id="TblBusqueda" runat="server" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-12">Número de registros encontrados: <b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></div>
|
||||
</div>
|
||||
|
||||
<div id="DivBeneficiarios" style="overflow-y: auto; width: 770px; height: 289px;">
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros"
|
||||
CssClass="ScrollAD table table-smallpadding Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Código</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCodigo" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-CssClass="truncate">
|
||||
<HeaderTemplate>Nombre</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNombre" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>RFC</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlRFC" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Dirección</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDireccion" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Ciudad</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCiudad" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Mail</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMail" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<%--<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
$(document).on('mouseenter', ".truncate", function () {
|
||||
var $this = $(this);
|
||||
if (this.offsetWidth < this.scrollWidth && !$this.attr('title')) {
|
||||
$this.tooltip({
|
||||
title: $this.text(),
|
||||
placement: "top"
|
||||
});
|
||||
$this.tooltip('show');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function Ir(c) {
|
||||
gotourl('/Ventas/Clientes.aspx?CveCliente=' + c);
|
||||
}
|
||||
function Ir2(c) {
|
||||
if (document.getElementById("hdnEsThickbox").value == "S") {
|
||||
parent.CargaCliente(c);
|
||||
parent.$('#ajax').modal('hide');
|
||||
parent.tb_remove();
|
||||
}
|
||||
else {
|
||||
|
||||
window.opener.CargaCliente(c);
|
||||
parent.$('#ajax').modal('hide');
|
||||
}
|
||||
}
|
||||
function Ir3(c) {
|
||||
gotourl('/AIMMGM/ConsultaCliente.aspx?CveCliente=' + c);
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
130
Ventas/PopUpBuscarClientes.aspx.vb
Normal file
130
Ventas/PopUpBuscarClientes.aspx.vb
Normal file
@@ -0,0 +1,130 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class PopUpBuscarClientes
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private ReadOnly Property OpcionBusqueda As String
|
||||
Get
|
||||
Return ViewState("Opt").ToString
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property TipoCliente As Integer
|
||||
Get
|
||||
Return ViewState("TipoCliente").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("TipoCliente") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
'CType(Me.Master, BaseMasterPage).PopupWidth = 800
|
||||
RegistraScript("if($get('tdContenido')){$get('tdContenido').style.height='520px';}")
|
||||
|
||||
CargaSubProyectos()
|
||||
|
||||
If Request("Opt") = "Fact" Then
|
||||
ViewState("Opt") = "Factura"
|
||||
Else
|
||||
ViewState("Opt") = "Expediente"
|
||||
End If
|
||||
|
||||
If Request("TipoCliente") IsNot Nothing AndAlso Request("TipoCliente").ToEntero > 0 Then
|
||||
ViewState("TipoCliente") = Request("TipoCliente")
|
||||
Else
|
||||
ViewState("TipoCliente") = -1
|
||||
End If
|
||||
|
||||
If Not Request("EsThickbox") Is Nothing Then
|
||||
hdnEsThickbox.Value = Request("EsThickbox")
|
||||
Else
|
||||
hdnEsThickbox.Value = "N"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSubProyectos()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
|
||||
Dim Nombre As String = "-1"
|
||||
Dim Codigo As String = "-1"
|
||||
Dim NombreCorto As String = "-1"
|
||||
Dim RFC As String = "-1"
|
||||
Dim Telefono As String = "-1"
|
||||
Dim Mail As String = "-1"
|
||||
|
||||
If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
|
||||
If TxtCodigo.Text.Trim <> String.Empty Then Codigo = TxtCodigo.Text.Trim
|
||||
If TxtNombreCorto.Text.Trim <> String.Empty Then NombreCorto = TxtNombreCorto.Text.Trim
|
||||
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
|
||||
If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim
|
||||
If TxtMail.Text.Trim <> String.Empty Then Mail = TxtMail.Text.Trim
|
||||
|
||||
If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente) Then
|
||||
If ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0)
|
||||
GV.DataSource = ObjClientes.DtResultados
|
||||
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then
|
||||
GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (10450, 10460, 10458)")
|
||||
LtlTotalRegistros.Text = "0"
|
||||
ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then
|
||||
GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (27448)")
|
||||
LtlTotalRegistros.Text = "0"
|
||||
End If
|
||||
Else
|
||||
LtlTotalRegistros.Text = "0"
|
||||
GV.DataSource = Nothing
|
||||
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjClientes.Dispose()
|
||||
GV.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
TblBusqueda.Visible = True
|
||||
End Sub
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
'e.Row.Cells(0).Width = Unit.Pixel(350)
|
||||
'e.Row.Cells(1).Width = Unit.Pixel(80)
|
||||
'e.Row.Cells(2).Width = Unit.Pixel(200)
|
||||
'e.Row.Cells(3).Width = Unit.Pixel(80)
|
||||
'e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
Dim Liga As String = String.Empty
|
||||
|
||||
If OpcionBusqueda = "Factura" Then
|
||||
Liga = "<a href='javascript:Ir2(""" & e.Row.DBCampo("CveCliente") & """);'>"
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 43 Then
|
||||
Liga = String.Format("<a href='javascript:Ir3(""{0}"");'>", e.Row.DBCampo("CveCliente"))
|
||||
Else
|
||||
Liga = String.Format("<a href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveCliente"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
e.Row.FCLiteral("LtlCodigo").Text = String.Format("<div class='truncate' style='width:60px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Codigo"))
|
||||
e.Row.FCLiteral("LtlNombre").Text = String.Format("<div class='truncate' style='width:190px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Nombre"))
|
||||
e.Row.FCLiteral("LtlRFC").Text = String.Format("<div class='truncate' style='width:100px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("RFC"))
|
||||
e.Row.FCLiteral("LtlDireccion").Text = String.Format("<div class='truncate' style='width:165px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Direccion"))
|
||||
e.Row.FCLiteral("LtlCiudad").Text = String.Format("<div class='truncate' style='width:90px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Ciudad"))
|
||||
e.Row.FCLiteral("LtlMail").Text = String.Format("<div class='truncate' style='width:100px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Mail"))
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
286
Ventas/PopUpBuscarFolio.aspx
Normal file
286
Ventas/PopUpBuscarFolio.aspx
Normal file
@@ -0,0 +1,286 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarFolio.aspx.vb" Inherits="PopUpBuscarFolio" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.truncate {
|
||||
width: 300px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
max-width: 750px !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Búsqueda de Folios-Facturas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Panel ID="PnlPrincipal" runat="server" HorizontalAlign="Center" DefaultButton="BtnBuscar" Width="750px">
|
||||
<table class="Widthall">
|
||||
<tr>
|
||||
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Tipo de Documento:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlTipoDocto" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="230px" OnSelectedIndexChanged="DdlTipoDocto_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos" Value="Ing"></asp:ListItem>
|
||||
<asp:ListItem Text="Anticipo" Value="Ant"></asp:ListItem>
|
||||
<asp:ListItem Text="Egresos" Value="Egs"></asp:ListItem>
|
||||
<asp:ListItem Text="Remisión" Value="Rem"></asp:ListItem>
|
||||
<asp:ListItem Text="Cotización" Value="Cot"></asp:ListItem>
|
||||
<asp:ListItem Text="Devolución" Value="Dev"></asp:ListItem>
|
||||
<asp:ListItem Text="Pedido" Value="Ped"></asp:ListItem>
|
||||
<asp:ListItem Text="Autorización" Value="PA"></asp:ListItem>
|
||||
<asp:ListItem Text="Pedido2" Value="Pd2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td class="text-right"><b>Estatus Factura:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlEstatusFactura" runat="server" AppendDataBoundItems="true" DataTextField="EstatusFactura" DataValueField="CveEstatusFactura" Class="table-group-action-input form-control input-inline input-sm select2me" Width="230px">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Folio:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="12" Width="230px" Height="30px" autofocus></asp:TextBox>
|
||||
</td>
|
||||
<td class="text-right"><b>Folio Fiscal (UUID):</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtFolioFiscal" runat="server" ClientIDMode="Static" MaxLength="36" Width="230px" Height="30px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Nombre del Cliente:</b></td>
|
||||
<td style="width: 250px;">
|
||||
<ADS:Dropdownlost ID="DdlNombre" runat="server" CssStyle="width: 95%;" DataTextField="NombreComercial" Onselectedindexchange="DdlNombre_selectedindexchange" DataValueField="CveCliente"></ADS:Dropdownlost>
|
||||
<%--<asp:DropDownList ID="DdlNombre" runat="server" CssClass="select2me" DataTextField="CodigoNombre" AutoPostBack="true" DataValueField="CveCliente" Width="230px"></asp:DropDownList>--%>
|
||||
</td>
|
||||
|
||||
|
||||
<td align="left" class="text-right"><b>
|
||||
<asp:Literal ID="LitSucursalCliente" runat="server" Visible="false">Sucursal del Cliente:</asp:Literal></b>
|
||||
<td style="width: 250px;">
|
||||
<asp:DropDownList ID="DdlSucursalCliente" runat="server" Visible="false" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal" Class="table-group-action-input form-control input-inline input-sm select2me" Width="230px">
|
||||
<asp:ListItem Selected="True" Text=" - " Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</td>
|
||||
|
||||
|
||||
<%-- <td class="text-right"><b>Código del Cliente:</b></td>
|
||||
<td style="width:200px;">
|
||||
<asp:DropDownList ID="DdlCodigoCliente" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Codigo" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px">
|
||||
<asp:ListItem Selected="True" Text=" - " Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td> --%>
|
||||
</tr>
|
||||
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Sucursal:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Width="230px">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td class="text-right"><b>Usuario Creó:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlUsuario" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-sm select2me" Width="230px">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Fecha Inicial:</b></td>
|
||||
<td valign="middle">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding: 0px">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Width="202px"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="imgCalendario" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<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>
|
||||
</td>
|
||||
<td class="text-right"><b>Fecha Final:</b></td>
|
||||
<td valign="middle">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding: 0px">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Width="202px"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="imgCalendarioF" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<asp:UpdatePanel runat="server" ID="UPPS" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<tr>
|
||||
<td align="left" class="text-right"><b>Clasificación:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlClasificacion" Class="table-group-action-input form-control input-inline input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="220px">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td align="left" class="text-right"><b>Producto Servicio:</b></td>
|
||||
<td>
|
||||
<ADS:Dropdownlost ID="DdlPS" runat="server" CssStyle="width: 95%;" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPS_selectedindexchange"></ADS:Dropdownlost>
|
||||
<%--<asp:DropDownList ID="DdlPS" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" AppendDataBoundItems="true" DataTextField="PSCodigo" DataValueField="CvePS" ValidationGroup="GprAgregaPS" Width="220px" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="*** Actualizar listado de Productos o Servicios ***" Value="-2"></asp:ListItem>
|
||||
</asp:DropDownList>--%>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Pedido:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtPedidoContrato" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
|
||||
</td>
|
||||
<td class="text-right"><b>Orden de Compra:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtOrdenCompra" runat="server" CssClass="form-control" Width="230px" Height="30px" style="padding: 0px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="4">
|
||||
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table id="TblBusqueda" runat="server" border="0" visible="false">
|
||||
<tr>
|
||||
<td align="left">Registros encontrados:<b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="DivFacturas" style="overflow-y: auto; width: 760px; max-height: 215px;">
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Tipo</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipo" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-CssClass="truncate" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Folio</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFolio" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-CssClass="truncate">
|
||||
<HeaderTemplate>Cliente</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNombre" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Pedido/OC</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPedidoContrato" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Total</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTotal" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Sucursal</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSucursal" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Estatus</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>XML</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlXML" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>PDF</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlPDF" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
function Ir(v) {
|
||||
gotourl('/Ventas/Ventas.aspx?CveVenta=' + v);
|
||||
}
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
|
||||
});
|
||||
|
||||
$(document).on('mouseenter', ".truncate", function () {
|
||||
var $this = $(this);
|
||||
if (this.offsetWidth < this.scrollWidth && !$this.attr('title')) {
|
||||
$this.tooltip({
|
||||
title: $this.text(),
|
||||
placement: "top"
|
||||
});
|
||||
$this.tooltip('show');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</asp:Content>
|
||||
268
Ventas/PopUpBuscarFolio.aspx.vb
Normal file
268
Ventas/PopUpBuscarFolio.aspx.vb
Normal file
@@ -0,0 +1,268 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class PopUpBuscarFolio
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private ReadOnly Property Ruta As String
|
||||
Get
|
||||
Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
|
||||
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 800
|
||||
txtFechaI.Text = Now.AddMonths(-12).ToShortDateString
|
||||
'RegistraScript("$get('tdContenido').style.height='500px'")
|
||||
CargaSubProyectos()
|
||||
CargaEstatus()
|
||||
CargaUsuarios()
|
||||
CargaNombreClientes()
|
||||
CargaClasificaciones()
|
||||
CargaPS(-1)
|
||||
'CargaCodigoCliente()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaNombreClientes()
|
||||
DdlNombre.setEsWebService(True)
|
||||
DdlNombre.Attributes.Add("data-metodo", "getcliente")
|
||||
|
||||
'DdlNombre.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
'DdlNombre.DataBind()
|
||||
'DdlNombre.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSubProyectos()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||
DdlSubProyecto.DataBind()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaUsuarios()
|
||||
DdlUsuario.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlUsuario.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClasificaciones()
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
Else
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
End If
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero)
|
||||
UPPS.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS(CveClasificacion As Integer)
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
DdlPS.SelectedText = ""
|
||||
DdlPS.SelectedValue = "-1"
|
||||
Else
|
||||
DdlPS.ddl.Items.Clear()
|
||||
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion)
|
||||
DdlPS.ddl.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub CargaCodigoCliente()
|
||||
' DdlCodigoCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> ''")
|
||||
' DdlCodigoCliente.DataBind()
|
||||
'End Sub
|
||||
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
|
||||
Dim Serie As String = "-1"
|
||||
Dim Folio As Integer = -1
|
||||
Dim Codigo As String = "-1"
|
||||
Dim Cliente As String = "-1"
|
||||
Dim FechaI As String = "-1"
|
||||
Dim FechaF As String = "-1"
|
||||
Dim FolioFiscal As String = "-1"
|
||||
Dim PeidoContrato As String = "-1"
|
||||
Dim OrdenCompra As String = "-1"
|
||||
|
||||
If TxtFolio.Text.Trim.Length = 0 Then
|
||||
Serie = "-1"
|
||||
Folio = -1
|
||||
Else
|
||||
Dim Array() As String = TxtFolio.Text.Trim.Split(CChar("-"))
|
||||
|
||||
If Array.Length = 2 Then
|
||||
Serie = Array(0)
|
||||
Folio = Array(1).ToEntero
|
||||
Else
|
||||
Serie = "-1"
|
||||
Folio = TxtFolio.Text.Trim.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
Codigo = "-1" 'If(DdlCodigoCliente.SelectedValue.ToEntero > 0, DdlCodigoCliente.SelectedItem.ToString, "-1")
|
||||
Cliente = If(DdlNombre.SelectedValue.ToEntero > 0, DdlNombre.SelectedValue, "-1")
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
FolioFiscal = If(TxtFolioFiscal.Text.Trim.Length = 0, "-1", TxtFolioFiscal.Text.Trim)
|
||||
PeidoContrato = If(TxtPedidoContrato.Text.Length = 0, "-1", TxtPedidoContrato.Text.Trim)
|
||||
OrdenCompra = If(TxtOrdenCompra.Text.Length = 0, "-1", TxtOrdenCompra.Text.Trim)
|
||||
|
||||
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1), DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0)
|
||||
GV.DataSource = ObjVentas.DtResultados
|
||||
Else
|
||||
LtlTotalRegistros.Text = "0"
|
||||
GV.DataSource = Nothing
|
||||
Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
GV.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
TblBusqueda.Visible = True
|
||||
End Sub
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'If e.Row.RowIndex = 0 Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(38)
|
||||
' e.Row.Cells(1).Width = Unit.Pixel(65)
|
||||
' e.Row.Cells(2).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(3).Width = Unit.Pixel(250)
|
||||
' 'e.Row.Cells(4).Width = Unit.Pixel(75)
|
||||
' e.Row.Cells(4).Width = Unit.Pixel(75)
|
||||
' e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
' e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
'End If
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
|
||||
'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
Dim Liga As String = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveVenta"))
|
||||
e.Row.FCLiteral("LtlTipo").Text = String.Format("<div class='truncate' style='width:27px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("TipoDocto"))
|
||||
e.Row.FCLiteral("LtlFolio").Text = String.Format("<div class='truncate' style='width:56px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Folio"))
|
||||
e.Row.FCLiteral("LtlFecha").Text = String.Format("<div class='truncate' style='width:64px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Fecha").ToDate.ToShortDateString)
|
||||
e.Row.FCLiteral("LtlNombre").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Nombre"))
|
||||
'e.Row.FCLiteral("LtlSubTotal").Text = Liga & e.Row.DBCampo("SubTotal").FormatoNumero & " </a>"
|
||||
e.Row.FCLiteral("LtlTotal").Text = String.Format("<div class='truncate' style='width:56px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Total").FormatoNumero)
|
||||
e.Row.FCLiteral("LtlSucursal").Text = String.Format("<div class='truncate' style='width:80px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("SubProyecto"))
|
||||
e.Row.FCLiteral("LtlEstatus").Text = String.Format("<div class='truncate' style='width:80px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("EstatusFactura"))
|
||||
e.Row.FCLiteral("LtlPedidoContrato").Text = String.Format("<div class='truncate' style='width:80px;'>{0}{1}</a></div>", Liga, e.Row.DBCampo("PedidoContrato"))
|
||||
If IO.File.Exists($"{Ruta}XML\{e.Row.DBCampo("TipoDocto")}\{e.Row.DBCampo("Folio")}.xml") Then
|
||||
e.Row.FCLiteral("LtlXML").Text = String.Format("<div class='truncate' style='width:23px;'><a class=""Texto"" target=""_blank"" href=""/Empresas/{0}/XML/{1}/{2}.xml"">XML</a></div>", UsuarioActual.CveEmpresa, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("Folio"))
|
||||
Else
|
||||
e.Row.FCLiteral("LtlXML").Text = "<div class='truncate' style='width:23px;'></div>"
|
||||
End If
|
||||
If IO.File.Exists($"{Ruta}PDF\{e.Row.DBCampo("TipoDocto")}\{e.Row.DBCampo("Folio")}.pdf") Then
|
||||
e.Row.FCLiteral("LtlPDF").Text = String.Format("<div class='truncate' style='width:23px;'><a class=""Texto"" target=""_blank"" href=""/Empresas/{0}/PDF/{1}/{2}.pdf"">PDF</a></div>", UsuarioActual.CveEmpresa, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("Folio"))
|
||||
Else
|
||||
e.Row.FCLiteral("LtlPDF").Text = "<div class='truncate' style='width:23px;'></div>"
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Private Sub DdlNombre_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlNombre.SelectedIndexChanged
|
||||
' DdlSucursalCliente.Items.Clear()
|
||||
' If DdlNombre.SelectedValue.ToEntero > 0 Then
|
||||
' Dim ObjCliente As New ClsClientes()
|
||||
|
||||
' If ObjCliente.GetSucursales(DdlNombre.SelectedValue.ToEntero) Then
|
||||
' DdlSucursalCliente.DataSource = ObjCliente.DtResultados
|
||||
' If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
' LitSucursalCliente.Visible = True
|
||||
' DdlSucursalCliente.Visible = True
|
||||
' Else
|
||||
' LitSucursalCliente.Visible = False
|
||||
' DdlSucursalCliente.Visible = False
|
||||
' End If
|
||||
' Else
|
||||
' DdlSucursalCliente.DataSource = Nothing
|
||||
' LitSucursalCliente.Visible = False
|
||||
' DdlSucursalCliente.Visible = False
|
||||
' End If
|
||||
' ObjCliente.Dispose()
|
||||
' DdlSucursalCliente.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
' DdlSucursalCliente.DataBind()
|
||||
' UPFiltros.Update()
|
||||
' End If
|
||||
|
||||
'End Sub
|
||||
|
||||
Protected Sub DdlNombre_selectedindexchange(sender As Object, e As EventArgs)
|
||||
DdlSucursalCliente.Items.Clear()
|
||||
If DdlNombre.SelectedValue.ToEntero > 0 Then
|
||||
Dim ObjCliente As New ClsClientes()
|
||||
|
||||
If ObjCliente.GetSucursales(DdlNombre.SelectedValue.ToEntero) Then
|
||||
DdlSucursalCliente.DataSource = ObjCliente.DtResultados
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
LitSucursalCliente.Visible = True
|
||||
DdlSucursalCliente.Visible = True
|
||||
Else
|
||||
LitSucursalCliente.Visible = False
|
||||
DdlSucursalCliente.Visible = False
|
||||
End If
|
||||
Else
|
||||
DdlSucursalCliente.DataSource = Nothing
|
||||
LitSucursalCliente.Visible = False
|
||||
DdlSucursalCliente.Visible = False
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
DdlSucursalCliente.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSucursalCliente.DataBind()
|
||||
UPFiltros.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPS_selectedindexchange(sender As Object, e As EventArgs)
|
||||
If DdlPS.SelectedValue.ToEntero > 0 Then
|
||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If PS IsNot Nothing Then
|
||||
If DdlClasificacion.SelectedIndex = 0 Then
|
||||
If PS("CveClasificacion").ToString IsNot Nothing Then
|
||||
DdlClasificacion.SelectedValueExist(PS("CveClasificacion").ToString)
|
||||
Else
|
||||
Alert("El Productos/Servicio no tiene asignada una Clasificación.")
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
UPPS.Update()
|
||||
End Sub
|
||||
Protected Sub DdlTipoDocto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaEstatus()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaEstatus()
|
||||
DdlEstatusFactura.Items.Clear()
|
||||
If DdlTipoDocto.SelectedValue <> "-1" Then
|
||||
DdlEstatusFactura.DataSource = GlobalDTEstatusFactura.FiltraParametros($"TipoDocto = '{DdlTipoDocto.SelectedValue}' OR ('Cot' = '{DdlTipoDocto.SelectedValue}' AND CveEstatusFactura = 2)")
|
||||
Else
|
||||
DdlEstatusFactura.DataSource = GlobalDTEstatusFactura
|
||||
End If
|
||||
DdlEstatusFactura.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlEstatusFactura.DataBind()
|
||||
End Sub
|
||||
End Class
|
||||
122
Ventas/PopUpBuscarPs.aspx
Normal file
122
Ventas/PopUpBuscarPs.aspx
Normal file
@@ -0,0 +1,122 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarPs.aspx.vb" Inherits="PopUpBuscarPs" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.Texto {
|
||||
text-align: left !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Busqueda Productos y Servicios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Panel ID="PnlPrincipal" runat="server" HorizontalAlign="Center" DefaultButton="lnkBuscar" Width="750px"></asp:Panel>
|
||||
<table class="Widthall">
|
||||
<tr>
|
||||
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right">Codigo:</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="TxtCodigo" Width="90%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</td>
|
||||
|
||||
<td class="text-right">Nombre:</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="TxtNombre" Width="90%" CssClass="form-control input-sm" autofocus></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right">Tipo:</td>
|
||||
<td>
|
||||
<asp:DropDownList runat="server" ID="DdlCveTipoPS" CssClass="form-control input-sm select2me" Width="90%">
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Servicio" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Producto" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList></td>
|
||||
<td class="text-right">Estado:</td>
|
||||
<td>
|
||||
<asp:DropDownList runat="server" ID="DdlEstado" CssClass="form-control input-sm select2me" Width="90%">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Activo" Value="1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="tdBarras1" visible="false" runat="server" class="text-right">C. Barras</td>
|
||||
<td id="tdBarras2" visible="false" runat="server">
|
||||
<asp:TextBox runat="server" ID="TxtCodigoBarras" Width="90%" CssClass="form-control input-sm"></asp:TextBox>
|
||||
</td>
|
||||
<td class="text-right">Aplica para Venta:</td>
|
||||
<td>
|
||||
<asp:DropDownList runat="server" ID="DdlAplicaVenta" CssClass="form-control input-sm select2me" Width="90%">
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right">Clasificación:</td>
|
||||
<td>
|
||||
<asp:DropDownList runat="server" ID="Ddlclasificacion" CssClass="form-control input-sm select2me" DataValueField="CveClasificacion" DataTextField="Clasificacion" Width="90%"></asp:DropDownList>
|
||||
</td>
|
||||
<td id="TdCompuesto1" runat="server" visible="false" class="text-right">Compuesto:</td>
|
||||
<td id="TdCompuesto2" runat="server" visible="false">
|
||||
<asp:DropDownList ID="DdlCompuesto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" runat="server" DataTextField="Compuesto" DataValueField="CveCompuesto" Width="90%"></asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" style="text-align: center!important">
|
||||
<asp:Button ID="lnkBuscar" runat="server" CssClass="btn btn-primary" Text="Buscar"></asp:Button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dvbusqueda" runat="server" visible="false" class="row col-md-12" style="text-align: right!important">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivFacturas" style="overflow-y: auto; width: 760px; max-height: 240px; margin-top: 5px">
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="CvePs" runat="server" ClientIDMode="Static" AutoGenerateColumns="False" EmptyDataText="No se encontraron Productos o Servicios registrados" ToolTip="Listado de Productos o Servicios" CssClass="table table-striped table-hover Widthall" UseAccessibleHeader="true" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Producto o Servicio" ItemStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="lnkPs" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="TipoPS" HeaderText="Tipo" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
function Ir(v) {
|
||||
gotourl('/Ventas/ProductosServicios.aspx?CvePS=' + v);
|
||||
}
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
96
Ventas/PopUpBuscarPs.aspx.vb
Normal file
96
Ventas/PopUpBuscarPs.aspx.vb
Normal file
@@ -0,0 +1,96 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class PopUpBuscarPs
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 800
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
|
||||
CargaClasificaciones()
|
||||
CargarCompuestos()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then
|
||||
tdBarras1.Visible = True
|
||||
tdBarras2.Visible = True
|
||||
TxtCodigoBarras.Focus()
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
Private Sub CargaClasificaciones()
|
||||
Ddlclasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
Ddlclasificacion.DataBind()
|
||||
Ddlclasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargarCompuestos()
|
||||
If UsuarioActual.Empresa.Funcionalidad(143) = "1" Then
|
||||
TdCompuesto1.Visible = True
|
||||
TdCompuesto2.Visible = True
|
||||
Dim PS As New ClsProductosServicios
|
||||
PS.GetCompuestosActivos(UsuarioActual.CveEmpresa)
|
||||
DdlCompuesto.DataSource = PS.DtResultados
|
||||
PS.Dispose()
|
||||
DdlCompuesto.DataBind()
|
||||
DdlCompuesto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
DdlCompuesto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
Protected Sub lnkBuscar_Click(sender As Object, e As EventArgs) Handles lnkBuscar.Click
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
Public Sub CargaDatos()
|
||||
Dim Codigo As String = ""
|
||||
Dim Nombre As String = ""
|
||||
Dim CodigoBarras As String = ""
|
||||
If TxtCodigo.Text = "" Then Codigo = "-1" Else Codigo = TxtCodigo.Text.ToUpper.Trim
|
||||
If TxtCodigoBarras.Text.Trim = "" Then CodigoBarras = "-1" Else CodigoBarras = TxtCodigoBarras.Text.Trim
|
||||
If TxtNombre.Text = "" Then Nombre = "-1" Else Nombre = TxtNombre.Text.ToUpper
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre, pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero, CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjPS.DtResultados
|
||||
dvbusqueda.Visible = True
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
dvbusqueda.Visible = False
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " GV DATOS "
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Try
|
||||
e.Row.FCLiteral("LnkPs").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(""" & e.Row.DBCampo("CvePs") & """);'>", e.Row.DBCampo("Ps"))
|
||||
Catch ex As Exception
|
||||
Dim exexex As String = ex.Message
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
18
Ventas/PopUpImprimir.aspx
Normal file
18
Ventas/PopUpImprimir.aspx
Normal file
@@ -0,0 +1,18 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpImprimir.aspx.vb" Inherits="PopUpImprimir" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
87
Ventas/PopUpImprimir.aspx.vb
Normal file
87
Ventas/PopUpImprimir.aspx.vb
Normal file
@@ -0,0 +1,87 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class PopUpImprimir
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If Request("RH") IsNot Nothing Then
|
||||
Dim Ext As String = Request("Ext")
|
||||
Dim ArchivoPath As String = String.Format("{0}Empresas\{1}\Temp\{2}{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Ext)
|
||||
|
||||
If ArchivoPath <> "" Then
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(ArchivoPath)
|
||||
|
||||
If Archivo.Exists Then
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
'HttpContext.Current.Response.ContentType = "application/msword"
|
||||
HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(ArchivoPath)
|
||||
HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
End If
|
||||
Archivo = Nothing
|
||||
|
||||
End If
|
||||
ElseIf Request("Tipo") IsNot Nothing AndAlso Request("Tipo") = "AcuseCancelacion" Then
|
||||
Dim Ext As String = Request("Ext")
|
||||
Dim Path As String = AppDomain.CurrentDomain.BaseDirectory & "Temp\" & Request("FolioFiscal") & "." & Ext
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
If Archivo.Exists Then
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = "application/pdf"
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(Path)
|
||||
'HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
End If
|
||||
Archivo = Nothing
|
||||
|
||||
|
||||
Else
|
||||
Dim CveVenta As String = Request("CveVenta")
|
||||
Dim Ext As String = Request("Ext")
|
||||
|
||||
If Ext = "CadenaOriginal" Then
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetCadenaOriginal(CveVenta.ToEntero) Then
|
||||
If ObjVentas.DtResultados.Rows.Count >= 0 Then Response.Write(ObjVentas.DtResultados.Rows(0)(0).ToString)
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 800
|
||||
RegistraScript("$get('tdContenido').style.height='520px'")
|
||||
|
||||
Else
|
||||
Dim Path As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\" & Ext & "\" & CveVenta & "." & Ext
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
If Archivo.Exists Then
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = "application/pdf"
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(Path)
|
||||
'HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
End If
|
||||
Archivo = Nothing
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
591
Ventas/ProductosFinancieros.aspx.vb
Normal file
591
Ventas/ProductosFinancieros.aspx.vb
Normal file
@@ -0,0 +1,591 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports Extensiones
|
||||
Partial Class Bancos_ProductosFinancieros
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property DtPresupuestosEgresos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPresupuestosEgresos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPresupuestosEgresos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtPresupuestosIngresos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPresupuestosIngresos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPresupuestosIngresos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePresupuestoEgresos As Integer
|
||||
Get
|
||||
Return ViewState("CvePresupuestoEgresos").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePresupuestoEgresos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePresupuestoIngresos As Integer
|
||||
Get
|
||||
Return ViewState("CvePresupuestoIngresos").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePresupuestoIngresos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Opcion As String
|
||||
Get
|
||||
Return ViewState("Opcion").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Opcion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "PROPIEDADES - AC NEW"
|
||||
Private Property DtPresupuestos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPresupuestos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPresupuestos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property EjercicioAC As Integer
|
||||
Get
|
||||
Return ViewState("EjercicioAC").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EjercicioAC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IDCtaBeneficiario As Integer
|
||||
Get
|
||||
Return ViewState("IDCtaBeneficiario").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IDCtaBeneficiario") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
Opcion = "-1"
|
||||
|
||||
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString <> "" Then
|
||||
Opcion = Request("Opcion").ToString
|
||||
If Opcion = "OE" Then
|
||||
LtTitulo.Text = "Otros Egresos Presupuestales"
|
||||
End If
|
||||
End If
|
||||
|
||||
ActivaAC()
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub DdlTipoMovimiento_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
TrPI.Visible = False
|
||||
TrPE.Visible = False
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
If DdlTipoMovimiento.SelectedValue = "15" Or DdlTipoMovimiento.SelectedValue = "17" Then
|
||||
TrPE.Visible = True
|
||||
ElseIf DdlTipoMovimiento.SelectedValue = "16" Then
|
||||
TrPI.Visible = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos()
|
||||
CargaCuentas()
|
||||
CargaTipoMovimientos()
|
||||
CargaTipoTrasaccion()
|
||||
End Sub
|
||||
Private Sub CargaCuentas()
|
||||
DdlCuentas.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
DdlCuentas.DataBind()
|
||||
DdlCuentas.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoMovimientos()
|
||||
If Opcion = "OE" Then
|
||||
DdlTipoMovimiento.Items.Insert(0, New ListItem("Pago Seguridad Social", "19"))
|
||||
DdlTipoMovimiento.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Else
|
||||
DdlTipoMovimiento.DataSource = GlobalDTContaPlantillasPolizas(1, -1).FiltraParametros("CvePlantillaPoliza IN (15,16,17,50)")
|
||||
DdlTipoMovimiento.DataBind()
|
||||
DdlTipoMovimiento.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoTrasaccion()
|
||||
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones() '.FiltraParametros("Tipo='Egs'")
|
||||
DdlTipoTransaccion.DataBind()
|
||||
DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " AC "
|
||||
Private Sub ActivaAC()
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
HdnEjercicioAC.Value = UsuarioActual.Empresa.EjercicioActual.ToString
|
||||
CargaPresupuestoEgresos(UsuarioActual.Empresa.EjercicioActual)
|
||||
CargaPresupuestoIngresos()
|
||||
LtEjercioTitulo.Visible = True
|
||||
LtEjercicio.Text = UsuarioActual.Empresa.EjercicioActual.ToString
|
||||
TxtFecha.Attributes.Add("onchange", "CambiaFecha();")
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnCambiaFecha_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
Dim AC As New ClsAC
|
||||
If AC.GetPresupuestoEgresos(-1, True, HdnEjercicioAC.Value.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
DtPresupuestosEgresos = AC.DtResultados.Copy
|
||||
Else
|
||||
Alert("Ocurrio un error al cargar los Presupuestos de Egresos. Por favor vuelva a cargar la página.", TipoMensaje.MsgError)
|
||||
End If
|
||||
AC.Dispose()
|
||||
|
||||
If DtPresupuestosEgresos.Rows.Count > 0 Then
|
||||
DdlACGeneral1.DataSource = DtPresupuestosEgresos.FiltraParametros("", DistinctColumns:={"CveProgramaOperativo", "ProgramaOperativo"})
|
||||
DdlACGeneral1.DataBind()
|
||||
|
||||
CalculaSaldoAC()
|
||||
End If
|
||||
End If
|
||||
|
||||
LtEjercicio.Text = HdnEjercicioAC.Value
|
||||
End Sub
|
||||
|
||||
#Region " PRESUPUESTO EGRESOS "
|
||||
Private Sub CargaPresupuestoEgresos(EjercicioActual As Integer)
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
Dim AC As New ClsAC
|
||||
If AC.GetPresupuestoEgresos(-1, True, EjercicioActual, UsuarioActual.CveEmpresa) Then
|
||||
DtPresupuestosEgresos = AC.DtResultados.Copy
|
||||
Else
|
||||
Alert("Ocurrio un error al cargar los Presupuestos de Egresos. Por favor vuelva a cargar la página.", TipoMensaje.MsgError)
|
||||
End If
|
||||
AC.Dispose()
|
||||
|
||||
If DtPresupuestosEgresos.Rows.Count > 0 Then
|
||||
CargaDdlsAC()
|
||||
CalculaSaldoAC()
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlsAC()
|
||||
'Panel General
|
||||
DdlACGeneral1.DataSource = DtPresupuestosEgresos.FiltraParametros("", DistinctColumns:={"CveProgramaOperativo", "ProgramaOperativo"})
|
||||
DdlACGeneral1.DataBind()
|
||||
DdlACGeneral2.DataSource = DtPresupuestosEgresos.FiltraParametros("", DistinctColumns:={"CveUnidadAdministrativa", "UnidadAdministrativa"}, Orderby:="UnidadAdministrativa")
|
||||
DdlACGeneral2.DataBind()
|
||||
DdlACGeneral3.DataSource = DtPresupuestosEgresos.FiltraParametros("", DistinctColumns:={"CveFuenteFinanciamiento", "FuenteFinanciamiento"}, Orderby:="FuenteFinanciamiento")
|
||||
DdlACGeneral3.DataBind()
|
||||
DdlACGeneral4.DataSource = DtPresupuestosEgresos.FiltraParametros("", DistinctColumns:={"CveTipoGasto", "TipoGasto"})
|
||||
DdlACGeneral4.DataBind()
|
||||
DdlACGeneral5.DataSource = DtPresupuestosEgresos.FiltraParametros("NOT CodigoCOG like '1%'", DistinctColumns:={"CveClasificacion", "CodigoClasificacion"}, Orderby:="CodigoClasificacion")
|
||||
DdlACGeneral5.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlACGeneral_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CalculaSaldoAC()
|
||||
End Sub
|
||||
|
||||
Private Sub CalculaSaldoAC()
|
||||
Dim ContPaq As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
Dim DtPresupuestosTemp = DtPresupuestosEgresos.FiltraParametros(String.Format("CveProgramaOperativo = {0} and CveUnidadAdministrativa = {1} and CveFuenteFinanciamiento = {2} and CveTipoGasto= {3} and CveClasificacion = {4}", DdlACGeneral1.SelectedValue.ToString, DdlACGeneral2.SelectedValue.ToString, DdlACGeneral3.SelectedValue.ToString, DdlACGeneral4.SelectedValue.ToString, DdlACGeneral5.SelectedValue.ToString))
|
||||
If DtPresupuestosTemp.Rows.Count > 0 Then
|
||||
|
||||
Dim IdCuenta = DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero
|
||||
|
||||
LbACGeneralSaldo.Text = ContPaq.GetSaldoCuenta(IdCuenta, 0, TxtFecha.Text.ToDate.Year).ToString.FormatoNumero
|
||||
|
||||
CvePresupuestoEgresos = DtPresupuestosTemp.Rows(0)("CvePresupuestoEgreso").ToString.ToEntero
|
||||
Else
|
||||
LbACGeneralSaldo.Text = "0.00"
|
||||
End If
|
||||
ContPaq.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " PRESUPUESTO INGRESOS "
|
||||
Private Sub CargaPresupuestoIngresos()
|
||||
Dim AC As New ClsAC
|
||||
If AC.GetPresupuestoIngresos(-1, -1, True, UsuarioActual.CveEmpresa) Then
|
||||
DdlFuenteRecaudacion.DataSource = AC.DtResultados()
|
||||
DtPresupuestosIngresos = AC.DtResultados()
|
||||
End If
|
||||
AC.Dispose()
|
||||
|
||||
DdlFuenteRecaudacion.DataBind()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CALCULA FOLIO "
|
||||
Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ObtieneFolio()
|
||||
End Sub
|
||||
Protected Sub DdlCuentas_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ObtieneFolio()
|
||||
End Sub
|
||||
Private Sub ObtieneFolio()
|
||||
Dim Banco As New ClsBancos
|
||||
Dim Folio = Banco.GetNextFolio(DdlCuentas.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero)
|
||||
Banco.Dispose()
|
||||
TxtFolio.Text = Folio.ToString
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GUARDAR "
|
||||
|
||||
Protected Sub BtnGuardar(sender As Object, e As System.EventArgs)
|
||||
'Alert("EN PROCESO...", TipoMensaje.MsgAdvertencia)
|
||||
'Exit Sub
|
||||
|
||||
If TrPE.Visible = True AndAlso Not LbACGeneralSaldo.Text.ToDouble > 0 Then
|
||||
Alert("El Presupuesto de Egresos Seleccionado debe tener saldo. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'Objetos Clase
|
||||
Dim ObjBancos As New ClsBancos
|
||||
Dim ObjMov As New ClsContabilidad(ObjBancos.IniciaTransacSQL)
|
||||
|
||||
|
||||
Dim ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjContaAC.IniciaTransacSQL()
|
||||
|
||||
'Variables de controles
|
||||
Dim Importe As Double = TxtImporte.Text.ToDouble
|
||||
Dim CveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero(String.Format("CveCuenta = {0}", DdlCuentas.SelectedValue))("CveMoneda").ToString.ToEntero()
|
||||
Dim Fecha = TxtFecha.Text.ToDate
|
||||
|
||||
'Variables de error
|
||||
Dim ErrorTransaccion = False
|
||||
Dim ErrorAC = False
|
||||
|
||||
Dim CvePrePoliza = -1
|
||||
Dim IdPoliza = -1
|
||||
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("Banc", DdlTipoMovimiento.SelectedValue.ToEntero, Importe, Importe, CveMoneda, TxtFecha.Text.ToDate, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim CveIE As Integer = ObjBancos.AddBancos_IE(DdlCuentas.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFecha.Text.ToDate, TxtFolio.Text, "", Importe, CveMoneda, 0, TxtObservacion.Text.Trim, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
'Dim TipoMovto As Boolean
|
||||
|
||||
'If DdlTipoMovimiento.SelectedValue = "15" Or DdlTipoMovimiento.SelectedValue = "17" Or DdlTipoMovimiento.SelectedValue = "50" Then
|
||||
' TipoMovto = True
|
||||
'ElseIf DdlTipoMovimiento.SelectedValue = "16" Then
|
||||
' TipoMovto = False
|
||||
'End If
|
||||
|
||||
'OBTIENE LA CUENTA CONTABLE DEL BANCO
|
||||
Dim DtCuentas = GlobalDTBancosCuentas(-1, DdlCuentas.SelectedValue.ToEntero).FiltraParametros("", "", {"CveCuenta", "IdCtaContable"})
|
||||
Dim CtaCuenta = -1
|
||||
|
||||
If DtCuentas.Rows.Count = 1 Then
|
||||
CtaCuenta = DtCuentas.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
Else
|
||||
ErrorTransaccion = True
|
||||
End If
|
||||
|
||||
If CveIE > 0 Then
|
||||
|
||||
'MOVIMIENTOS PREPOLIZA
|
||||
'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Importe, "", DdlTipoMovimiento.SelectedValue.ToEntero, TxtConcepto.Text.Trim, Now, 0, -1, CveIE) Then
|
||||
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 30, TxtConcepto.Text.Trim, Now, 0, -1, CveIE) Then
|
||||
' ErrorTransaccion = True
|
||||
' End If
|
||||
'Else
|
||||
' ErrorTransaccion = True
|
||||
'End If
|
||||
|
||||
Dim CvePlantilaPoliza = DdlTipoMovimiento.SelectedValue.ToString.ToEntero
|
||||
Dim idCuentaContabilizacion As Long = 1
|
||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||
Dim CuentasContablesInvalidas As New StringBuilder
|
||||
|
||||
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantilaPoliza) Then
|
||||
For Each Row As DataRow In ObjMov.DtResultados.Rows
|
||||
|
||||
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
|
||||
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
Dim importeMovimiento As Decimal
|
||||
Dim FechaMovimiento As Date = Now
|
||||
Dim IdCtaContablePP As Integer = 0
|
||||
|
||||
Select Case ConceptoContable
|
||||
|
||||
Case 45, 46, 47, 67
|
||||
importeMovimiento = Importe.ToString.ToDecimal
|
||||
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
IdCtaContablePP = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
End If
|
||||
|
||||
Case 30
|
||||
importeMovimiento = Importe.ToString.ToDecimal
|
||||
IdCtaContablePP = CtaCuenta
|
||||
|
||||
End Select
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If IdCtaContablePP = 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDouble, "", ConceptoContable, TxtConcepto.Text, FechaMovimiento, IdCtaContablePP, -1, CveIE) Then
|
||||
ErrorTransaccion = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
'Por el momento no hay movimiento para estas plantillas y no debe entrar aqui
|
||||
If UsuarioActual.Empresa.Funcionalidad(200).ToEntero > 0 And Not ErrorTransaccion Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, 0) Then
|
||||
Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
|
||||
End If
|
||||
Else
|
||||
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas))
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorTransaccion = True
|
||||
End If
|
||||
|
||||
|
||||
''SI USA AC
|
||||
If Not ErrorTransaccion AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
|
||||
If DdlTipoMovimiento.SelectedValue = "15" Or DdlTipoMovimiento.SelectedValue = "17" Or DdlTipoMovimiento.SelectedValue = "50" Then
|
||||
'PRESUPUESTO EGRESOS
|
||||
IdPoliza = ObjContaAC.AddPoliza(3, TxtConcepto.Text.Trim, Importe, Importe, UsuarioActual.CveUsuario, TxtFecha.Text.ToDate)
|
||||
|
||||
If IdPoliza > 0 Then
|
||||
Dim DtPresupuestosTemp As DataTable
|
||||
Dim IdCuentaComprometido, IdCuentaPorEjercer, IdCuentaDevengado, IdCuentaMatriz, IdCuentaEjercido, IdCuentaPagado As Integer
|
||||
|
||||
DtPresupuestosTemp = DtPresupuestosEgresos.FiltraParametros(String.Format("CvePresupuestoEgreso = {0}", CvePresupuestoEgresos))
|
||||
If DtPresupuestosTemp.Rows.Count <> 1 Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
|
||||
If Not ErrorAC Then
|
||||
IdCuentaComprometido = DtPresupuestosTemp.Rows(0)("IdCuentaComprometido").ToString.ToEntero
|
||||
IdCuentaPorEjercer = DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero
|
||||
IdCuentaDevengado = DtPresupuestosTemp.Rows(0)("IdCuentaDevengado").ToString.ToEntero
|
||||
IdCuentaEjercido = DtPresupuestosTemp.Rows(0)("IdCuentaEjercido").ToString.ToEntero
|
||||
IdCuentaPagado = DtPresupuestosTemp.Rows(0)("IdCuentaPagado").ToString.ToEntero
|
||||
IdCuentaMatriz = DtPresupuestosTemp.Rows(0)("IdCuentaMatriz").ToString.ToEntero
|
||||
|
||||
|
||||
'COMPROMETIDO
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaComprometido, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaPorEjercer, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'DEVENGADO
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaDevengado, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaComprometido, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'EJERCIDO
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaEjercido, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaDevengado, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'PAGADO
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaPagado, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaEjercido, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'MATRIZ EGRESOS
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaMatriz, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, CtaCuenta, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
'TERMINA PRESUPUESTO EGRESOS
|
||||
End If
|
||||
|
||||
|
||||
If DdlTipoMovimiento.SelectedValue = "16" Then
|
||||
'PRESUPUESTO INGRESOS
|
||||
IdPoliza = ObjContaAC.AddPoliza(1, TxtConcepto.Text.Trim, Importe, Importe, UsuarioActual.CveUsuario, Fecha)
|
||||
|
||||
If IdPoliza > 0 Then
|
||||
Dim DtPresupuestosTemp As DataTable
|
||||
Dim IdCuentaPorEjecutar, IdCuentaDevengado, IdCuentaRecaudado, IdCuentaMatriz As Integer
|
||||
|
||||
DtPresupuestosTemp = DtPresupuestosIngresos.FiltraParametros(String.Format("CvePresupuestoIngreso = {0}", DdlFuenteRecaudacion.SelectedValue.ToEntero))
|
||||
If DtPresupuestosTemp.Rows.Count <> 1 Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
|
||||
|
||||
If Not ErrorAC Then
|
||||
IdCuentaPorEjecutar = DtPresupuestosTemp.Rows(0)("IdCuentaPorEjecutar").ToString.ToEntero
|
||||
IdCuentaDevengado = DtPresupuestosTemp.Rows(0)("IdCuentaDevengado").ToString.ToEntero
|
||||
IdCuentaRecaudado = DtPresupuestosTemp.Rows(0)("IdCuentaRecaudado").ToString.ToEntero
|
||||
IdCuentaMatriz = DtPresupuestosTemp.Rows(0)("IdCuentaMatriz").ToString.ToEntero
|
||||
|
||||
'DEVENGADO
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaPorEjecutar, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaDevengado, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'RECAUDADO
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaDevengado, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaRecaudado, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'MATRIZ INGRESOS
|
||||
If Not ErrorAC Then
|
||||
If ObjContaAC.AddMovimiento(IdPoliza, CtaCuenta, False, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaMatriz, True, Importe, "", TxtConcepto.Text.Trim, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
'TERMINA PRESUPUESTO INGRESOS
|
||||
|
||||
End If
|
||||
|
||||
'AJUSTA POLIZA
|
||||
If Not ErrorAC Then
|
||||
If Not ObjContaAC.AjustaPoliza(IdPoliza) Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If ErrorTransaccion Or ErrorAC Then
|
||||
ObjBancos.RollBack()
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||
|
||||
Alert(If(ErrorTransaccion, "Ocurrió un error al ingresar la PrePoliza. Por favor vuelva a intentar.", "Ocurrió un error al ingresar la Poliza. Por favor vuelva a intentar."), TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjBancos.Commit()
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
||||
LimpiaDatos()
|
||||
UPRegistroIE.Update()
|
||||
|
||||
Dim TextoPoliza = If(UsuarioActual.Empresa.UsaAC, String.Format("<br/> <br/> <a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza), "")
|
||||
|
||||
Alert(String.Format("Movimientos realizados con exito {0}", TextoPoliza), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
ObjMov.Dispose()
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub LimpiaDatos()
|
||||
DdlCuentas.SelectedValue = "-1"
|
||||
DdlTipoTransaccion.SelectedValue = "-1"
|
||||
TxtFolio.Text = ""
|
||||
TxtImporte.Text = ""
|
||||
TxtFecha.Text = ""
|
||||
DdlTipoMovimiento.SelectedValue = "-1"
|
||||
TrPE.Visible = False
|
||||
TrPI.Visible = False
|
||||
TxtConcepto.Text = ""
|
||||
TxtObservacion.Text = ""
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
2156
Ventas/ProductosServicios.aspx
Normal file
2156
Ventas/ProductosServicios.aspx
Normal file
File diff suppressed because it is too large
Load Diff
2462
Ventas/ProductosServicios.aspx.vb
Normal file
2462
Ventas/ProductosServicios.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
330
Ventas/Promociones.aspx
Normal file
330
Ventas/Promociones.aspx
Normal file
@@ -0,0 +1,330 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Promociones.aspx.vb" Inherits="Ventas_Promociones" %>
|
||||
|
||||
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="CSS" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="E" runat="Server">
|
||||
Promociones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<asp:UpdatePanel ID="UpGenerales" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">DATOS GENERALES</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Promoción:</label>
|
||||
<div class="col-md-10">
|
||||
<asp:TextBox ID="TxtPromocion" Width="90%" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-4">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<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="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" 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="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaI''</b> no tiene 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="VCOFechaI1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaI2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-2 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-4">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<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="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaF" 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="CEFechaF" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaF''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaF''</b> no tiene 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="VCOFechaF1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaF2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Sucursal:</label>
|
||||
<div class="col-md-4">
|
||||
<%-- <asp:DropDownList ID="DdlSucursal" DataTextField="Sucursal" DataValueField="CveSucursal" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVSucursal" runat="server" ControlToValidate="DdlSucursal" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESucursal" runat="server" HighlightCssClass="vco" TargetControlID="RFVSucursal" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
||||
<asp:DropDownList ID="DdlSubProyecto" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCESubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Vendedor:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlVendedor" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="DdlVendedor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Cliente:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlCliente" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCliente" runat="server" ControlToValidate="DdlCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECliente" runat="server" HighlightCssClass="vco" TargetControlID="RFVCliente" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Moneda:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlMoneda" DataTextField="Moneda" DataValueField="CveMoneda" CssClass="select2me" runat="server" Width="350px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVMoneda" runat="server" ControlToValidate="DdlCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Moneda''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEMoneda" runat="server" HighlightCssClass="vco" TargetControlID="RFVMoneda" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-2 truncate">Estatus:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">PRODUCTOS / SERVICIOS</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<asp:LinkButton ID="LbAgregarModal" OnClick="LbAgregarModal_Click" runat="server" data-toggle="tooltip" title="Agregar Producto/Servicio" AlternateText="Agregar Producto/Servicio" CssClass="btn btn-circle btn-default" Text="<i class='fa fa-plus'></i>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="CvePromocionDetalle, CveClasificacion, CvePS, CodigoPS, HoraInicio, HoraFin, CveTipoPromocion, Promocion, PUAnterior, AplicaRestriccion, AplicaLunes, AplicaMartes, AplicaMiercoles, AplicaJueves, AplicaViernes, AplicaSabado, AplicaDomingo" CssClass="table table-striped table-hover Widthall mysmallbtn" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no se registran detalles" runat="server">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Producto / Servicio" DataField="CodigoPS" ItemStyle-Width="30%" />
|
||||
<%--<asp:BoundField HeaderText="Producto / Servicio" DataField="PS" ItemStyle-Width="30%" />--%>
|
||||
<asp:BoundField HeaderText="P.U. Actual" DataField="PUAnterior" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Tipo Promoción" DataField="TipoPromocion" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Promoción" DataField="Promocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="P.U. Promoción" DataField="PUPromocion" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,###.00##}" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Condiciones" ItemStyle-HorizontalAlign="Center" DataField="AplicaRestriccionTexto" ItemStyle-Width="15%" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandArgument='<%# Container.DataItemIndex%>' CommandName="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" 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>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGuardar" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" OnClick="BtnGuardar_Click" runat="server" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="DivAgregar" class="modal fade">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="background-color: #258FD7; height: 30px; padding-top: 3px;">
|
||||
<button type="button" class="close" data-dismiss="modal" style="top: 3px !important; margin-top: 6px !important;"></button>
|
||||
<h4 class="modal-title" style="color: #FFF; text-align: center;">Agregar Producto/Servicio</h4>
|
||||
</div>
|
||||
<div class="modal-body rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Clasificación:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlClasificacion" DataTextField="Clasificacion" DataValueField="CveClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClasificacion_SelectedIndexChanged" CssClass="select2me" Width="100%" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Producto:</label>
|
||||
<div class="col-md-9">
|
||||
<ADS:Dropdownlost runat="server" Enabled="true" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">P.U. Actual:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:Label Text="" ID="LbPUActual" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Tipo Promoción:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlTipoPromocion" DataTextField="TipoPromocion" DataValueField="CveTipoPromocion" Width="100%" CssClass="select2me" runat="server">
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Importe $" Value="1" />
|
||||
<asp:ListItem Text="Descuento %" Value="2" />
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoPromocion" runat="server" InitialValue="-1" ControlToValidate="DdlTipoPromocion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Promoción''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoPromocion" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoPromocion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Promoción:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtPromocionConcepto" Text="" runat="server" />
|
||||
<asp:Label Text="" ID="LbFormatoPromoción" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Condiciones:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:CheckBox ID="ChkRestricciones" OnCheckedChanged="ChkRestricciones_CheckedChanged" AutoPostBack="true" CssClass="md-check" Text="" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivRestricciones" runat="server" visible="false">
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Hora Inicio:</label>
|
||||
<div class="col-md-3">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 60px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtHoraInicio" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 50px" MaxLength="5"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<img src="/Imagenes/timepicker.png" alt="Hora" />
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEHoraInicio" runat="server" TargetControlID="TxtHoraInicio" Mask="99:99" MaskType="time" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVHoraInicio" runat="server" ControlToValidate="TxtHoraInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''HoraInicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOHoraInicio1" runat="server" HighlightCssClass="vco" TargetControlID="RFVHoraInicio" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-3 truncate" style="max-width: 85px;">Hora Fin:</label>
|
||||
<div class="col-md-3">
|
||||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 60px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtHoraFin" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 50px" MaxLength="5"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<img src="/Imagenes/timepicker.png" alt="Hora" />
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEHoraFin" runat="server" TargetControlID="TxtHoraFin" Mask="99:99" MaskType="time" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVHoraFin" runat="server" ControlToValidate="TxtHoraFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''HoraFin''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOHoraFin1" runat="server" HighlightCssClass="vco" TargetControlID="RFVHoraFin" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Días:</label>
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkLunes" Text="Lunes" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkMartes" Text="Martes" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkMiercoles" Text="Miercoles" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkJueves" Text="Jueves" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkViernes" Text="Viernes" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkSabado" Text="Sabado" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkDomingo" Text="Domingo" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" data-dismiss="modal" class="btn btn-">Cerrar</button>
|
||||
<asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregar" OnClick="BtnAgregar_Click" ValidationGroup="GrpAgregar" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
473
Ventas/Promociones.aspx.vb
Normal file
473
Ventas/Promociones.aspx.vb
Normal file
@@ -0,0 +1,473 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class Ventas_Promociones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property TempDT As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TempDT"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TempDT") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CvePromocion As Integer
|
||||
Get
|
||||
Return ViewState("CvePromocion").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePromocion") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveConsecutivo As Integer
|
||||
Get
|
||||
Return ViewState("CveConsecutivo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveConsecutivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtSubProyectos As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtSubProyectos")), Nothing, CType(ViewState("DtSubProyectos"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSubProyectos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CvePromocion = -1
|
||||
CargaValoresIniciales()
|
||||
CargaMonedas()
|
||||
If Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
|
||||
CvePromocion = Request("CvePromocion").ToString.ToEntero
|
||||
CargaDatos()
|
||||
Else
|
||||
ChkEstatus.Enabled = True
|
||||
ChkEstatus.Checked = True
|
||||
CreaDT()
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " VALORES INICIALES "
|
||||
|
||||
Private Sub CargaValoresIniciales()
|
||||
|
||||
'CLASIFICACIONES
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
'CARGA PS
|
||||
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
If Not DdlPS.UsaWebService AndAlso CType(DdlPS.DataSource, DataTable) Is Nothing Then
|
||||
DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
DdlPS.DataBind()
|
||||
End If
|
||||
|
||||
'CARGA SUBPROYECTOS
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlCliente.DataBind()
|
||||
DdlCliente.Items.Insert(0, New ListItem("todos", "-1"))
|
||||
|
||||
TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDT()
|
||||
TempDT = New DataTable
|
||||
|
||||
TempDT.Columns.Add("Estatus", GetType(Integer))
|
||||
TempDT.Columns.Add("CvePromocionDetalle", GetType(Integer))
|
||||
TempDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TempDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TempDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TempDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TempDT.Columns.Add("PUAnterior", GetType(Decimal))
|
||||
TempDT.Columns.Add("PUPromocion", GetType(Decimal))
|
||||
TempDT.Columns.Add("CveTipoPromocion", GetType(Integer))
|
||||
TempDT.Columns.Add("TipoPromocion", GetType(String))
|
||||
TempDT.Columns.Add("Promocion", GetType(String))
|
||||
|
||||
TempDT.Columns.Add("AplicaRestriccionTexto", GetType(String))
|
||||
TempDT.Columns.Add("AplicaRestriccion", GetType(Boolean))
|
||||
TempDT.Columns.Add("HoraInicio", GetType(DateTime))
|
||||
TempDT.Columns.Add("HoraFin", GetType(DateTime))
|
||||
TempDT.Columns.Add("AplicaLunes", GetType(Boolean))
|
||||
TempDT.Columns.Add("AplicaMartes", GetType(Boolean))
|
||||
TempDT.Columns.Add("AplicaMiercoles", GetType(Boolean))
|
||||
TempDT.Columns.Add("AplicaJueves", GetType(Boolean))
|
||||
TempDT.Columns.Add("AplicaViernes", GetType(Boolean))
|
||||
TempDT.Columns.Add("AplicaSabado", GetType(Boolean))
|
||||
TempDT.Columns.Add("AplicaDomingo", GetType(Boolean))
|
||||
End Sub
|
||||
|
||||
#Region " PS "
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ChangeDdlProducto()
|
||||
End Sub
|
||||
Private Sub ChangeDdlProducto()
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
|
||||
DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero).FiltraParametros("", "PSCodigo")
|
||||
DdlPS.DataBind()
|
||||
DdlPS.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
Else
|
||||
DdlPS.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.SelectedValue)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetPromociones(CvePromocion, "-1", -1, -1, -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjVentas.DtResultados.Rows.Count = 1 Then
|
||||
Dim Dr = ObjVentas.DtResultados.Rows(0)
|
||||
TxtPromocion.Text = Dr("Promocion").ToString
|
||||
TxtFechaI.Text = Dr("FechaInicio").ToString.ToDate.ToShortDateString
|
||||
TxtFechaF.Text = Dr("FechaFin").ToString.ToDate.ToShortDateString
|
||||
DdlSubProyecto.SelectedValue = Dr("CveSubProyecto").ToString
|
||||
If Dr("CveVendedor").ToString.ToEntero > 0 Then DdlVendedor.SelectedValue = Dr("CveVendedor").ToString
|
||||
If Dr("CveCliente").ToString.ToEntero > 0 Then DdlCliente.SelectedValue = Dr("CveCliente").ToString
|
||||
ChkEstatus.Checked = If(Dr("Estatus").ToString = "True", True, False)
|
||||
DdlMoneda.SelectedValueExist(Dr("CveMoneda").ToString)
|
||||
|
||||
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
|
||||
TempDT = ObjVentas.DtResultados
|
||||
CargaGrid()
|
||||
Else
|
||||
Alert("Ocurrió un error al consultar los detalles de la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al consultar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
Private Sub CargaGrid()
|
||||
GvDatos.DataSource = TempDT.FiltraParametros("Estatus <> 2")
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaMonedas()
|
||||
DdlMoneda.DataSource = GlobalDTMonedas
|
||||
DdlMoneda.DataBind()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " AGREGAR "
|
||||
Protected Sub LbAgregarModal_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#DivAgregar').modal('show')")
|
||||
CveConsecutivo = -1
|
||||
|
||||
DdlClasificacion.SelectedValue = "-1"
|
||||
ChangeDdlProducto()
|
||||
|
||||
LbPUActual.Text = ""
|
||||
DdlTipoPromocion.SelectedValue = "-1"
|
||||
TxtPromocionConcepto.Text = ""
|
||||
|
||||
ChkRestricciones.Checked = False
|
||||
'DivRestricciones.Visible = False
|
||||
ChkLunes.Checked = False
|
||||
ChkMartes.Checked = False
|
||||
ChkMiercoles.Checked = False
|
||||
ChkJueves.Checked = False
|
||||
ChkViernes.Checked = False
|
||||
ChkSabado.Checked = False
|
||||
ChkDomingo.Checked = False
|
||||
|
||||
BtnAgregar.Text = "Agregar"
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlPS.SelectedValue.ToEntero <= 0 Then
|
||||
Alert("Debe seleccionar un Producto/Servicio.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Dr As DataRow = Nothing
|
||||
|
||||
If CveConsecutivo >= 0 Then
|
||||
Dr = TempDT.Rows(CveConsecutivo)
|
||||
Dr("Estatus") = 1
|
||||
Else
|
||||
Dr = TempDT.NewRow
|
||||
Dr("Estatus") = 0
|
||||
End If
|
||||
|
||||
If DdlClasificacion.SelectedValue.ToEntero > 0 Then
|
||||
Dr("CveClasificacion") = DdlClasificacion.SelectedValue
|
||||
Dr("Clasificacion") = DdlClasificacion.SelectedItem.Text
|
||||
Else
|
||||
Dr("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("CveClasificacion")
|
||||
Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("Clasificacion")
|
||||
End If
|
||||
|
||||
Dr("CvePS") = DdlPS.SelectedValue
|
||||
Dr("CodigoPS") = DdlPS.SelectedText
|
||||
Dr("PUAnterior") = LbPUActual.Text.ToDecimal
|
||||
|
||||
Dr("CveTipoPromocion") = DdlTipoPromocion.SelectedValue.ToEntero
|
||||
Dr("TipoPromocion") = DdlTipoPromocion.SelectedItem.Text
|
||||
Dr("Promocion") = TxtPromocionConcepto.Text
|
||||
|
||||
If DdlTipoPromocion.SelectedValue.ToEntero = 1 Then
|
||||
Dr("PUPromocion") = TxtPromocionConcepto.Text.ToDecimal
|
||||
Else
|
||||
Dr("PUPromocion") = LbPUActual.Text.ToDecimal - (LbPUActual.Text.ToDecimal * TxtPromocionConcepto.Text.ToDecimal / 100)
|
||||
End If
|
||||
|
||||
If ChkRestricciones.Checked Then
|
||||
Dr("AplicaRestriccionTexto") = "Si"
|
||||
Dr("AplicaRestriccion") = True
|
||||
Dr("HoraInicio") = Now.ToShortDateString.ToDate.AddHours(TxtHoraInicio.Text.Trim.Substring(0, 2).ToEntero).AddMinutes(TxtHoraInicio.Text.Trim.Substring(2, 2).ToEntero)
|
||||
Dr("HoraFin") = Now.ToShortDateString.ToDate.AddHours(TxtHoraFin.Text.Trim.Substring(0, 2).ToEntero).AddMinutes(TxtHoraFin.Text.Trim.Substring(2, 2).ToEntero)
|
||||
Dr("AplicaLunes") = ChkLunes.Checked
|
||||
Dr("AplicaMartes") = ChkMartes.Checked
|
||||
Dr("AplicaMiercoles") = ChkMiercoles.Checked
|
||||
Dr("AplicaJueves") = ChkJueves.Checked
|
||||
Dr("AplicaViernes") = ChkViernes.Checked
|
||||
Dr("AplicaSabado") = ChkSabado.Checked
|
||||
Dr("AplicaDomingo") = ChkDomingo.Checked
|
||||
Else
|
||||
Dr("AplicaRestriccionTexto") = "No"
|
||||
Dr("AplicaRestriccion") = False
|
||||
Dr("HoraInicio") = MinFecha.ToDateTime
|
||||
Dr("HoraFin") = MaxFecha.ToDateTime
|
||||
Dr("AplicaLunes") = False
|
||||
Dr("AplicaMartes") = False
|
||||
Dr("AplicaMiercoles") = False
|
||||
Dr("AplicaJueves") = False
|
||||
Dr("AplicaViernes") = False
|
||||
Dr("AplicaSabado") = False
|
||||
Dr("AplicaDomingo") = False
|
||||
End If
|
||||
|
||||
If CveConsecutivo >= 0 Then
|
||||
Dr.AcceptChanges()
|
||||
Else
|
||||
TempDT.Rows.Add(Dr)
|
||||
End If
|
||||
|
||||
CargaGrid()
|
||||
RegistraScript("$('#DivAgregar').modal('hide')")
|
||||
End Sub
|
||||
Protected Sub ChkRestricciones_CheckedChanged(sender As Object, e As EventArgs)
|
||||
DivRestricciones.Visible = ChkRestricciones.Checked
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GV PS "
|
||||
Private Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
|
||||
|
||||
If e.CommandName = "Editar" Then
|
||||
Dim Gvr = GvDatos.Rows(e.CommandArgument.ToString.ToEntero)
|
||||
|
||||
RegistraScript("$('#DivAgregar').modal('show')")
|
||||
CveConsecutivo = e.CommandArgument.ToString.ToEntero
|
||||
|
||||
DdlClasificacion.SelectedValue = Gvr.DataKey("CveClasificacion")
|
||||
ChangeDdlProducto()
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then
|
||||
DdlPS.SelectedValue = Gvr.DataKey("CvePS")
|
||||
Else
|
||||
DdlPS.SelectedValue = Gvr.DataKey("CvePS")
|
||||
DdlPS.SelectedText = Gvr.DataKey("CodigoPS")
|
||||
End If
|
||||
|
||||
LbPUActual.Text = Gvr.DataKey("PUAnterior").FormatoNumero
|
||||
DdlTipoPromocion.SelectedValue = Gvr.DataKey("CveTipoPromocion")
|
||||
TxtPromocionConcepto.Text = Gvr.DataKey("Promocion").FormatoNumero(4)
|
||||
|
||||
TxtHoraInicio.Text = $"{Gvr.DataKey("HoraInicio").ToDate.Hour}:{Gvr.DataKey("HoraInicio").ToDate.Minute}"
|
||||
TxtHoraFin.Text = $"{Gvr.DataKey("HoraFin").ToDate.Hour}:{Gvr.DataKey("HoraFin").ToDate.Minute}"
|
||||
|
||||
ChkRestricciones.Checked = CBool(Gvr.DataKey("AplicaRestriccion"))
|
||||
DivRestricciones.Visible = CBool(Gvr.DataKey("AplicaRestriccion"))
|
||||
ChkLunes.Checked = CBool(Gvr.DataKey("AplicaLunes"))
|
||||
ChkMartes.Checked = CBool(Gvr.DataKey("AplicaMartes"))
|
||||
ChkMiercoles.Checked = CBool(Gvr.DataKey("AplicaMiercoles"))
|
||||
ChkJueves.Checked = CBool(Gvr.DataKey("AplicaJueves"))
|
||||
ChkViernes.Checked = CBool(Gvr.DataKey("AplicaViernes"))
|
||||
ChkSabado.Checked = CBool(Gvr.DataKey("AplicaSabado"))
|
||||
ChkDomingo.Checked = CBool(Gvr.DataKey("AplicaDomingo"))
|
||||
|
||||
BtnAgregar.Text = "Actualizar"
|
||||
|
||||
UpAgregar.Update()
|
||||
GvDatos.EditIndex = -1
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim DbRow = TempDT.Rows(e.RowIndex)
|
||||
|
||||
If CvePromocion > 0 Then
|
||||
DbRow("Estatus") = 2
|
||||
Else
|
||||
TempDT.Rows.Remove(DbRow)
|
||||
End If
|
||||
|
||||
CargaGrid()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GUARDAR "
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If CvePromocion > 0 Then
|
||||
ActualizaPromocion()
|
||||
Else
|
||||
GuardaPromocion()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub GuardaPromocion()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim TieneError = False
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero)
|
||||
|
||||
If CvePromocion > 0 Then
|
||||
For Each Dr As DataRow In TempDT.Rows
|
||||
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjVentas.Commit()
|
||||
Alert("La promoción se guardo correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/CatPromociones.aspx"";")
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
Alert("Ocurrió un error al guardar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
Private Sub ActualizaPromocion()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim TieneError = False
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
|
||||
If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CvePromocion, DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
|
||||
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows
|
||||
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not TieneError Then
|
||||
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 1").Rows
|
||||
If Not ObjVentas.UpdatePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero, CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
|
||||
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
|
||||
Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 2").Rows
|
||||
If Not ObjVentas.RemovePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjVentas.Commit()
|
||||
Alert("La promoción se guardo correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/CatPromociones.aspx"";")
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
Alert("Ocurrió un error al guardar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " ELIMINAR "
|
||||
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
Dim TieneError = False
|
||||
|
||||
If ObjVentas.RemovePromocionesDetalle(CvePromocion) Then
|
||||
If Not ObjVentas.RemovePromociones(CvePromocion, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
ObjVentas.Commit()
|
||||
Alert("La promoción se elimino correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/CatPromociones.aspx"";")
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
Alert("Ocurrió un error al registrar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
68
Ventas/PuntoVenta.aspx
Normal file
68
Ventas/PuntoVenta.aspx
Normal file
@@ -0,0 +1,68 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PuntoVenta.aspx.vb" Inherits="Ventas_PuntoVenta" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
<asp:Literal ID="LtlTitulo" runat="server" Text="Punto de Venta"></asp:Literal>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<div id="silverlightControlHost" style="background-color: aliceblue; height: 100%; text-align: center; vertical-align: middle;">
|
||||
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
|
||||
<param name="source" value="../ClientBin/PV6.xap" />
|
||||
<param name="onError" value="onSilverlightError" />
|
||||
<param name="background" value="white" />
|
||||
<param name="minRuntimeVersion" value="5.0.61118.0" />
|
||||
<param name="autoUpgrade" value="true" />
|
||||
<param name="initParams" value="n=DLN" />
|
||||
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration: none">
|
||||
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style: none" />
|
||||
</a>
|
||||
</object>
|
||||
<iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript" src="Silverlight.js"></script>
|
||||
<script type="text/javascript">
|
||||
function onSilverlightError(sender, args) {
|
||||
var appSource = "";
|
||||
if (sender != null && sender != 0) {
|
||||
appSource = sender.getHost().Source;
|
||||
}
|
||||
|
||||
var errorType = args.ErrorType;
|
||||
var iErrorCode = args.ErrorCode;
|
||||
|
||||
if (errorType == "ImageError" || errorType == "MediaError") {
|
||||
return;
|
||||
}
|
||||
|
||||
var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";
|
||||
|
||||
errMsg += "Code: " + iErrorCode + " \n";
|
||||
errMsg += "Category: " + errorType + " \n";
|
||||
errMsg += "Message: " + args.ErrorMessage + " \n";
|
||||
|
||||
if (errorType == "ParserError") {
|
||||
errMsg += "File: " + args.xamlFile + " \n";
|
||||
errMsg += "Line: " + args.lineNumber + " \n";
|
||||
errMsg += "Position: " + args.charPosition + " \n";
|
||||
}
|
||||
else if (errorType == "RuntimeError") {
|
||||
if (args.lineNumber != 0) {
|
||||
errMsg += "Line: " + args.lineNumber + " \n";
|
||||
errMsg += "Position: " + args.charPosition + " \n";
|
||||
}
|
||||
errMsg += "MethodName: " + args.methodName + " \n";
|
||||
}
|
||||
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
51
Ventas/PuntoVenta.aspx.vb
Normal file
51
Ventas/PuntoVenta.aspx.vb
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
Partial Class Ventas_PuntoVenta
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If Request("PV_CveUsuario") Is Nothing Then
|
||||
Dim fe As String = Now().ToString("dd-MM-yyyy HH:mm:ss")
|
||||
Dim fi As String = encriptarHEX("AD_SISTEMAS_PV_" + fe)
|
||||
|
||||
Response.Redirect(String.Format("/Ventas/PuntoVenta.aspx?PV_CveUsuario={0}&PV_fe={1}&PV_fi={2}", UsuarioActual.CveUsuario, fe, fi))
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function encriptar(ByVal vsValue As String) As String
|
||||
Dim hashValue As New System.Security.Cryptography.SHA1CryptoServiceProvider()
|
||||
|
||||
' Convert the original string to array of Bytes
|
||||
Dim byteValue As [Byte]() = System.Text.Encoding.UTF8.GetBytes(vsValue)
|
||||
|
||||
' Compute the Hash, returns an array of Bytes
|
||||
Dim byteHash As [Byte]() = hashValue.ComputeHash(byteValue)
|
||||
|
||||
hashValue.Clear()
|
||||
|
||||
' Return a base 64 encoded string of the Hash value
|
||||
Return (Convert.ToBase64String(byteHash))
|
||||
|
||||
End Function
|
||||
|
||||
Public Function encriptarHEX(ByVal vsValue As String) As String
|
||||
Dim hashValue As New System.Security.Cryptography.SHA1CryptoServiceProvider()
|
||||
Dim Respuesta As String = ""
|
||||
' Convert the original string to array of Bytes
|
||||
Dim byteValue As [Byte]() = System.Text.Encoding.UTF8.GetBytes(vsValue)
|
||||
|
||||
' Compute the Hash, returns an array of Bytes
|
||||
Dim byteHash As [Byte]() = hashValue.ComputeHash(byteValue)
|
||||
|
||||
hashValue.Clear()
|
||||
|
||||
' Return a base 64 encoded string of the Hash value
|
||||
Dim i As Integer
|
||||
For i = 0 To byteHash.Length - 1
|
||||
Respuesta = Respuesta + Hex(byteHash(i)).ToString.PadLeft(2, "0")
|
||||
Next
|
||||
|
||||
Return Respuesta
|
||||
End Function
|
||||
End Class
|
||||
132
Ventas/RepABT.aspx
Normal file
132
Ventas/RepABT.aspx
Normal file
@@ -0,0 +1,132 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepABT.aspx.vb" Inherits="Ventas_RepABT" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="H" runat="Server">
|
||||
<img src="/Imagenes/separador02.gif" alt="" />
|
||||
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="CSS" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="E" runat="Server">
|
||||
<asp:Label ID="LbTitulo" Text="Reporte ABT" runat="server"></asp:Label>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<%--<asp:UpdatePanel runat="server" ID="UpFiltros" UpdateMode="Conditional">
|
||||
<ContentTemplate>--%>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" Text="Consultar" runat="server" />
|
||||
<a href="javascript;" class="expand" data-original-title="" title=""></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row">
|
||||
<label class="col-md-1">Ejercicio:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEjercicio" CssClass="form-control input-sm input-small select2me" runat="server" >
|
||||
<asp:ListItem Text="2014" Value="2014"></asp:ListItem>
|
||||
<asp:ListItem Text="2015" Value="2015"></asp:ListItem>
|
||||
</asp:DropDownList></div>
|
||||
<label class="col-md-1">Periodo:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlPeriodo" CssClass="form-control input-small input-sm select2me" runat="server" >
|
||||
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
|
||||
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
|
||||
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
|
||||
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
|
||||
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
|
||||
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
|
||||
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
|
||||
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
|
||||
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
|
||||
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
|
||||
</asp:DropDownList></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- </ContentTemplate>
|
||||
</asp:UpdatePanel>--%>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvRepABT" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Reporte ABT">
|
||||
<HeaderTemplate>
|
||||
<table CssClass="table table-smallpadding Widthall">
|
||||
<tr>
|
||||
<td style="width: 5%">Tipo</td>
|
||||
<td style="width: 5%">Folio</td>
|
||||
<td style="width: 25%">Cliente</td>
|
||||
<td style="width: 25%">Sucursal</td>
|
||||
<td style="width: 10%">Fecha Venta</td>
|
||||
<td style="width: 5%">Mesa</td>
|
||||
<td style="width: 5%"># Per</td>
|
||||
<td style="width: 10%">Fecha Corte</td>
|
||||
<td style="width: 10%" align="right">Total</td>
|
||||
</tr>
|
||||
</table>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<table width="995px">
|
||||
<tr>
|
||||
<td style="width: 5%"><b><%# Eval("TipoDocto") %></b></td>
|
||||
<td style="width: 5%"><b><%# Eval("SerieFolio") %></b></td>
|
||||
<td style="width: 25%"><b><%# Eval("Cliente")%></b></td>
|
||||
<td style="width: 25%"><b><%# Eval("Sucursal")%></b></td>
|
||||
<td style="width: 10%"><b><%# Eval("FechaVenta", "{0:d}")%></td>
|
||||
<td style="width: 5%"><b><%# Eval("Mesa")%></b></td>
|
||||
<td style="width: 5%"><b><%# Eval("NumeroPersonas")%></b></td>
|
||||
<td style="width: 10%"><b><%# Eval("FechaCorte", "{0:d}")%></b></td>
|
||||
<td style="width: 10%" align="right"><b><%# Eval("TotalRemision", "{0:F2}")%></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"></td>
|
||||
<td colspan="5" align="right">
|
||||
<asp:GridView ID="GvD" CssClass="table table-hover table-advance table-smallpadding Widthall" BorderWidth="0" GridLines="None" runat="server" AutoGenerateColumns="false" ShowHeader="false" >
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Folio" ItemStyle-Width="5%"/>
|
||||
<asp:BoundField DataField="Concepto" HeaderText="Concepto" ItemStyle-Width="80%"/>
|
||||
<asp:BoundField DataField="TotalConcepto" HeaderText="TotalConcepto" DataFormatString="{0:F2}" ItemStyle-HorizontalAlign="right" ItemStyle-Width="15%"/>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<%--<asp:Label ID="Label1" runat="server" Text='<%# Bind("TipoDocto") %>'></asp:Label>--%>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:BoundField DataField="SerieFolio" HeaderText="Folio"/>
|
||||
<asp:BoundField DataField="Cliente" HeaderText="Cliente"/>
|
||||
<asp:BoundField DataField="Sucursal" HeaderText="Sucursal"/>
|
||||
<asp:BoundField DataField="FechaVenta" HeaderText="Fecha Venta" DataFormatString="{0:dd/MM/yyyy}"/>
|
||||
<asp:BoundField DataField="Mesa" HeaderText="Mesa"/>
|
||||
<asp:BoundField DataField="NumeroPersonas" HeaderText="Número de Personas"/>
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cant."/>
|
||||
<asp:BoundField DataField="Concepto" HeaderText="Concepto"/>
|
||||
<asp:BoundField DataField="PU" HeaderText="P. U."/>
|
||||
<asp:BoundField DataField="Descuento" HeaderText="Desct."/>
|
||||
<asp:BoundField DataField="TotalConcepto" HeaderText="Total Concepto"/>
|
||||
<asp:BoundField DataField="TotalRemision" HeaderText="Total Remisión"/>
|
||||
<asp:BoundField DataField="FechaCorte" HeaderText="Fecha Corte" DataFormatString="{0:dd/MM/yyyy}"/>--%>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<RowStyle CssClass="Texto" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
73
Ventas/RepABT.aspx.vb
Normal file
73
Ventas/RepABT.aspx.vb
Normal file
@@ -0,0 +1,73 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Ventas_RepABT
|
||||
Inherits ClsPaginas
|
||||
|
||||
'Private ReadOnly Property Ejercicio As Integer
|
||||
' Get
|
||||
' Return ViewState("Ejercicio")
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private ReadOnly Property Periodo As Integer
|
||||
' Get
|
||||
' Return ViewState("Periodo")
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Private Property DtDatos As datatable
|
||||
Get
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As datatable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
'If Request("Ejercicio") IsNot Nothing AndAlso IsNumeric(Request("Ejercicio")) Then
|
||||
' ViewState("Ejercicio") = Request("Ejercicio")
|
||||
'End If
|
||||
'If Request("Periodo") IsNot Nothing AndAlso IsNumeric(Request("Periodo")) Then
|
||||
' ViewState("Periodo") = Request("Periodo")
|
||||
'End If
|
||||
DdlEjercicio.SelectedValue = Now.Year.ToString
|
||||
DdlPeriodo.SelectedValue = Now.Month.ToString
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetRepABT(DdlEjercicio.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero) Then
|
||||
GvRepABT.DataSource = ObjVentas.DtResultados.FiltraParametros("", DistinctColumns:={"CveVenta", "TipoDocto", "SerieFolio", "Cliente", "SubProyecto", "FechaVenta", "Mesa", "NumeroPersonas", "TotalRemision", "FechaCorte"})
|
||||
Else
|
||||
GvRepABT.DataSource = Nothing
|
||||
End If
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
ObjVentas.Dispose()
|
||||
GvRepABT.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvRepABT.ExportToExcel("Reporte ABT")
|
||||
End Sub
|
||||
|
||||
Protected Sub GvRepABT_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRepABT.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.FCGridView("GvD").DataSource = DtDatos.FiltraParametros(String.Format("CveVenta = {0}", e.Row.DBCampo("CveVenta")))
|
||||
e.Row.FCGridView("GvD").DataBind()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
End Class
|
||||
202
Ventas/RepAnticipo-NC-IXC.aspx
Normal file
202
Ventas/RepAnticipo-NC-IXC.aspx
Normal file
@@ -0,0 +1,202 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepAnticipo-NC-IXC.aspx.cs" Inherits="Ventas_RepAnticipo_NC_IXC" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Anticipos - NC X Aplicar - Ingresos X Comprobar
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="PFiltro" class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" OnClick="BtnConsultar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<label class="col-md-1 " id="LblDdlSucursal" runat="server">Sucursal:</label>
|
||||
<div class="col-md-2" id="DivDdlSucursal" runat="server">
|
||||
<asp:DropDownList ID="DdlSucursal" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 " id="LblCliente" runat="server">Cliente:</label>
|
||||
<div class="col-md-2" id="DivDdlCliente" runat="server">
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="">Fecha Ini Doc:</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="margin-top: -5px; padding: 5px 0px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Style="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>
|
||||
<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>
|
||||
<div class="col-md-1" style="margin-left: 25px">Fecha Fin Doc:</div>
|
||||
<div class="col-md-1" style="margin-left: -10px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="margin-top: -5px; padding: 5px 0px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Style="width: 80px;"></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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<div class="col-md-1" title="Fecha Inicio de Aplicación">Fecha Ini. Ap:</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaICorte" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" ></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaICorte" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaICorte" runat="server" TargetControlID="TxtFechaICorte" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaICorte" TargetControlID="TxtFechaICorte" PopupButtonID="LnkFechaICorte" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CVFechaICorte" runat="server" ControlToValidate="TxtFechaICorte" Display="None" ErrorMessage="El campo <b>''Fecha Inicial Corte''</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="VCEFechaICorte2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaICorte" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" title="Fecha Fin de Aplicación">Fecha Fin Ap:</div>
|
||||
<div class="col-md-1" >
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaFCorte" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" ></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaFCorte" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaFCorte" runat="server" TargetControlID="TxtFechaFCorte" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaFCorte" TargetControlID="TxtFechaFCorte" PopupButtonID="LnkFechaFCorte" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CVFechaFCorte" runat="server" ControlToValidate="TxtFechaFCorte" Display="None" ErrorMessage="El campo <b>''Fecha Final Corte''</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="VCEFechaFCorte2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaFCorte" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="width: 5%">Con Saldo:</div>
|
||||
<div class="col-md-2" style="display:flex; width:20%">
|
||||
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlConSaldo" runat="server" Width="40%" Class="table-group-action-input form-control input-inline input-small input-sm">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Text="Si" Value="1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<div style="width:30%;text-align:center">Vendedor:</div>
|
||||
<div id="DivDdlVendedor" runat="server" style="width:55%;display:flex">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 15px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<table class="table Widthall ">
|
||||
<tr>
|
||||
<td style="width: 37%;"></td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 21%; border-right: 3px solid white;">Anticipos</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 21%; border-right: 3px solid white;">NC X Aplicar</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 21%; border-right: 3px solid white;">Ingresos X Comprobar</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GvDatos" runat="server" OnRowDataBound="GvDatos_RowDataBound" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False"
|
||||
EmptyDataText="No se encontraron registros" data-sort="true" Width="99%" DataKeyNames="CveCliente,CveMoneda,CveSubProyecto,FechaI,FechaF,FechaICorte,FechaFCorte,TipoCambio,TCEspecifico,ConSaldo">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NombreComercial" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="OriginalAnticipos" ItemStyle-Width="7%" HeaderText="Original" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="AplicadoAnticipos" ItemStyle-Width="7%" HeaderText="Aplicado" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="TotalAnticipos" ItemStyle-Width="7%" HeaderText="Saldo" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="OriginalNC" ItemStyle-Width="7%" HeaderText="Original" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="AplicadoNC" ItemStyle-Width="7%" HeaderText="Aplicado" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="TotalNC" ItemStyle-Width="7%" HeaderText="Saldo" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="OriginalIXC" ItemStyle-Width="7%" HeaderText="Original" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="AplicadoIXC" ItemStyle-Width="7%" HeaderText="Aplicado" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="TotalIXC" ItemStyle-Width="7%" HeaderText="Saldo" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivTipoCambio" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Cambiar Tipo Cambio de Dólares"></asp:Label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
|
||||
Especifico:
|
||||
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnTipoCambio" runat="server" OnClick="BtnTipoCambio_Click" Text="Aceptar" class="btn btn-primary" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
212
Ventas/RepAnticipo-NC-IXC.aspx.cs
Normal file
212
Ventas/RepAnticipo-NC-IXC.aspx.cs
Normal file
@@ -0,0 +1,212 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Ventas_RepAnticipo_NC_IXC : ClsPaginas
|
||||
{
|
||||
|
||||
#region PROPIEDADES
|
||||
private DataTable DtDatos
|
||||
{
|
||||
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
|
||||
set { ViewState["DtDatos"] = value; }
|
||||
}
|
||||
|
||||
private double TCEspecifico
|
||||
{
|
||||
get { return TCEspecifico = (double)ViewState["TCEspecifico"]; }
|
||||
set { ViewState["TCEspecifico"] = value; }
|
||||
}
|
||||
|
||||
private int TipoCambio
|
||||
{
|
||||
get { return TipoCambio = (int)ViewState["TipoCambio"]; }
|
||||
set { ViewState["TipoCambio"] = value; }
|
||||
}
|
||||
|
||||
private int Vendedor
|
||||
{
|
||||
get { return Vendedor = (int)ViewState["Vendedor"]; }
|
||||
set { ViewState["Vendedor"] = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializaValores()
|
||||
{
|
||||
txtFechaI.Text = "01/01/2000";
|
||||
txtFechaF.Text = DateTime.Today.ToString();
|
||||
TxtFechaFCorte.Text = DateTime.Today.ToString();
|
||||
TipoCambio = 1;
|
||||
TCEspecifico = -1;
|
||||
Vendedor = 0;
|
||||
CargaSucursales();
|
||||
CargaClientes();
|
||||
CargaVendedores();
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void CargaSucursales()
|
||||
{
|
||||
DdlSucursal.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa);
|
||||
DdlSucursal.DataBind();
|
||||
DdlSucursal.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
}
|
||||
|
||||
protected void CargaClientes()
|
||||
{
|
||||
DdlCliente.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa,-1);
|
||||
DdlCliente.DataBind();
|
||||
DdlCliente.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
}
|
||||
protected void CargaVendedores()
|
||||
{
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.DataBind();
|
||||
DdlVendedor.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
//DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor);
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
|
||||
DateTime FechaICorte;
|
||||
if (TxtFechaICorte.Text != "") { FechaICorte = TxtFechaICorte.Text.ToDate(); } else { FechaICorte=DateTime.MinValue; }
|
||||
DateTime FechaFCorte;
|
||||
if (TxtFechaFCorte.Text != "") { FechaFCorte = TxtFechaFCorte.Text.ToDate(); } else { FechaFCorte = DateTime.MaxValue; }
|
||||
ClsVentas ObjVenta = new ClsVentas();
|
||||
if (ObjVenta.GetRepAnticiposNCIXC(DdlCliente.SelectedValue.ToEntero(), DdlSucursal.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(),
|
||||
txtFechaF.Text.ToDate(),UsuarioActual.CveEmpresa, FechaICorte, FechaFCorte, TipoCambio, TCEspecifico, DdlVendedor.SelectedValue.ToEntero(),DdlConSaldo.SelectedValue.ToEntero()))
|
||||
{
|
||||
GvDatos.DataSource = ObjVenta.DtResultados;
|
||||
DtDatos = ObjVenta.DtResultados;
|
||||
}
|
||||
ObjVenta.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
Vendedor = DdlVendedor.SelectedIndex;
|
||||
}
|
||||
|
||||
protected void LnkExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("EXCEL");
|
||||
}
|
||||
|
||||
protected void LnkPdf_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("PDF");
|
||||
}
|
||||
|
||||
protected void GenerarPDF(String Opcion)
|
||||
{
|
||||
String FechaI;
|
||||
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = ""; } else { FechaI = $" <b>Fecha Inicial:</b> {txtFechaI.Text}"; }
|
||||
String FechaF;
|
||||
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = ""; } else { FechaF = $" <b>Fecha Final:</b> {txtFechaF.Text}"; }
|
||||
String FechaICorte;
|
||||
if (TxtFechaICorte.Text == "" || TxtFechaICorte.Text == "__/__/____") { FechaICorte = ""; } else { FechaICorte = $" <b>Fecha Inicial Corte:</b> {TxtFechaICorte.Text}"; }
|
||||
String FechaFCorte;
|
||||
if (TxtFechaFCorte.Text == "" || TxtFechaFCorte.Text == "__/__/____") { FechaFCorte = ""; } else { FechaFCorte = $" <b>Fecha Final Corte:</b> {TxtFechaFCorte.Text}"; }
|
||||
String Sucursal;
|
||||
if (DdlSucursal.SelectedValue != "-1") { Sucursal = $" <b>Sucursal:</b> {DdlSucursal.SelectedItem.Text}"; } else { Sucursal = ""; }
|
||||
String Cliente;
|
||||
if (DdlCliente.SelectedValue != "-1") { Cliente = $" <b>Cliente:</b> {DdlCliente.SelectedItem.Text}"; } else { Cliente = ""; }
|
||||
if (DtDatos.Rows.Count > 0)
|
||||
{
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
List<ReportParameter> para = new List<ReportParameter>();
|
||||
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
|
||||
para.Add(new ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Cliente}{Sucursal}{FechaI}{FechaF}{FechaICorte}{FechaFCorte}"));
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
para.Add(new ReportParameter("LogoPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
para.Add(new ReportParameter("LogoPath", ""));
|
||||
}
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepAnt-NC-IXC.rdlc", DtDatos, para, "Reporte de Anticipos - NCXAplicar - IXC", Opcion);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
|
||||
if (e.Row.DBCampo("CveCliente").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
if (e.Row.DBCampo("CveMoneda").ToEntero() == 1)
|
||||
{
|
||||
e.Row.Cells[0].Text = "Total Pesos";
|
||||
}
|
||||
else if (e.Row.DBCampo("CveMoneda").ToEntero() == 2)
|
||||
{
|
||||
e.Row.Cells[0].Text = "Total Dolares";
|
||||
}
|
||||
}
|
||||
|
||||
String Css = "Texto";
|
||||
String Liga = "";
|
||||
String VendedorValidate = Vendedor == 0 ? "" : $"&CveVendedor={Vendedor}";
|
||||
Liga = $"/Ventas/RepAnticipo-NC-IXCDetalle.aspx?&CveCliente={e.Row.DataKey("CveCliente")}&CveMoneda={e.Row.DataKey("CveMoneda")}&Tipo=-1&CveSubProyecto={e.Row.DataKey("CveSubProyecto")}&FechaI={e.Row.DataKey("FechaI").ToDate().ToShortDateString()}&FechaF={e.Row.DataKey("FechaF").ToDate().ToShortDateString()}&FechaICorte={e.Row.DataKey("FechaICorte").ToDate().ToShortDateString()}&FechaFCorte={e.Row.DataKey("FechaFCorte").ToDate().ToShortDateString()}&TipoCambio={e.Row.DataKey("TipoCambio")}&TCEspecifico={e.Row.DataKey("TCEspecifico")}&ConSaldo={e.Row.DataKey("ConSaldo")}{VendedorValidate}";
|
||||
e.Row.Cells[0].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[0].Text + "</a>";
|
||||
|
||||
Liga = $"/Ventas/RepAnticipo-NC-IXCDetalle.aspx?&CveCliente={e.Row.DataKey("CveCliente")}&CveMoneda={e.Row.DataKey("CveMoneda")}&Tipo=1&CveSubProyecto={e.Row.DataKey("CveSubProyecto")}&FechaI={e.Row.DataKey("FechaI").ToDate().ToShortDateString()}&FechaF={e.Row.DataKey("FechaF").ToDate().ToShortDateString()}&FechaICorte={e.Row.DataKey("FechaICorte").ToDate().ToShortDateString()}&FechaFCorte={e.Row.DataKey("FechaFCorte").ToDate().ToShortDateString()}&TipoCambio={e.Row.DataKey("TipoCambio")}&TCEspecifico={e.Row.DataKey("TCEspecifico")}&ConSaldo={e.Row.DataKey("ConSaldo")}{VendedorValidate}";
|
||||
e.Row.Cells[3].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[3].Text + "</a>";
|
||||
|
||||
Liga = $"/Ventas/RepAnticipo-NC-IXCDetalle.aspx?&CveCliente={e.Row.DataKey("CveCliente")}&CveMoneda={e.Row.DataKey("CveMoneda")}&Tipo=2&CveSubProyecto={e.Row.DataKey("CveSubProyecto")}&FechaI={e.Row.DataKey("FechaI").ToDate().ToShortDateString()}&FechaF={e.Row.DataKey("FechaF").ToDate().ToShortDateString()}&FechaICorte={e.Row.DataKey("FechaICorte").ToDate().ToShortDateString()}&FechaFCorte={e.Row.DataKey("FechaFCorte").ToDate().ToShortDateString()}&TipoCambio={e.Row.DataKey("TipoCambio")}&TCEspecifico={e.Row.DataKey("TCEspecifico")}&ConSaldo={e.Row.DataKey("ConSaldo")}{VendedorValidate}";
|
||||
e.Row.Cells[6].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[6].Text + "</a>";
|
||||
|
||||
Liga = $"/Ventas/RepAnticipo-NC-IXCDetalle.aspx?&CveCliente={e.Row.DataKey("CveCliente")}&CveMoneda={e.Row.DataKey("CveMoneda")}&Tipo=3&CveSubProyecto={e.Row.DataKey("CveSubProyecto")}&FechaI={e.Row.DataKey("FechaI").ToDate().ToShortDateString()}&FechaF={e.Row.DataKey("FechaF").ToDate().ToShortDateString()}&FechaICorte={e.Row.DataKey("FechaICorte").ToDate().ToShortDateString()}&FechaFCorte={e.Row.DataKey("FechaFCorte").ToDate().ToShortDateString()}&TipoCambio={e.Row.DataKey("TipoCambio")}&TCEspecifico={e.Row.DataKey("TCEspecifico")}&ConSaldo={e.Row.DataKey("ConSaldo")}{VendedorValidate}";
|
||||
e.Row.Cells[9].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[9].Text + "</a>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnTipoCambio_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"));
|
||||
}
|
||||
|
||||
protected void RblTipoCambio_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
TipoCambio = RblTipoCambio.SelectedValue.ToEntero();
|
||||
if (TipoCambio == 3)
|
||||
{
|
||||
LiEspecifico.Visible = true;
|
||||
TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble();
|
||||
TxtEspecifico.Text = TCEspecifico.ToString();
|
||||
}else
|
||||
{
|
||||
LiEspecifico.Visible = false;
|
||||
}
|
||||
UpBodyTipoCambio.Update();
|
||||
}
|
||||
}
|
||||
250
Ventas/RepAnticipo-NC-IXCDetalle.aspx
Normal file
250
Ventas/RepAnticipo-NC-IXCDetalle.aspx
Normal file
@@ -0,0 +1,250 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepAnticipo-NC-IXCDetalle.aspx.cs" Inherits="Ventas_RepAnticipo_NC_IXCDetalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Anticipos - NC X Aplicar - Ingresos X Comprobar Detalle
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
|
||||
</li>
|
||||
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkHabilitarSaldar" OnClick="LnkHabilitarSaldar_Click" runat="server">Otros Ingresos</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkSaldar" Visible="false" OnClick="LnkSaldar_Click" runat="server">Saldar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="PFiltro" class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" OnClick="BtnConsultar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<label class="col-md-1 " id="LblDdlSucursal" runat="server">Sucursal:</label>
|
||||
<div class="col-md-2" id="DivDdlSucursal" runat="server">
|
||||
<asp:DropDownList ID="DdlSucursal" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 " id="LblCliente" runat="server">Cliente:</label>
|
||||
<div class="col-md-2" id="DivDdlCliente" runat="server">
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="">Fecha Ini Doc:</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="margin-top: -5px; padding: 5px 0px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Style="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>
|
||||
<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>
|
||||
<div class="col-md-1" style="margin-left: 25px">Fecha Fin Doc:</div>
|
||||
<div class="col-md-1" style="margin-left: -10px">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="margin-top: -5px; padding: 5px 0px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Style="width: 80px;"></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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<div class="col-md-1">Tipo:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlTipo" runat="server" Width="100%" Class="table-group-action-input form-control input-inline input-small input-sm">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Anticipos" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Text="NC X Aplicar" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Ingresos X Comprobar" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" style="width: 5%">Con Saldo:</div>
|
||||
<div class="col-md-2" style="display:flex; width:20%">
|
||||
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlConSaldo" runat="server" Width="15%" Class="table-group-action-input form-control input-inline input-small input-sm">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Selected="True" Text="Si" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<div style="width:30%;text-align:center">Vendedor:</div>
|
||||
<div id="DivDdlVendedor" runat="server" style="width:55%;display:flex">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">Fecha Ini. Ap:</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaICorte" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaICorte" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaICorte" runat="server" TargetControlID="TxtFechaICorte" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaICorte" TargetControlID="TxtFechaICorte" PopupButtonID="LnkFechaICorte" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CVFechaICorte" runat="server" ControlToValidate="TxtFechaICorte" Display="None" ErrorMessage="El campo <b>''Fecha Inicial Corte''</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="VCEFechaICorte2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaICorte" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" style="margin-left: 20px">Fecha Fin Ap:</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaFCorte" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaFCorte" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaFCorte" runat="server" TargetControlID="TxtFechaFCorte" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaFCorte" TargetControlID="TxtFechaFCorte" PopupButtonID="LnkFechaFCorte" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CVFechaFCorte" runat="server" ControlToValidate="TxtFechaFCorte" Display="None" ErrorMessage="El campo <b>''Fecha Final Corte''</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="VCEFechaFCorte2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaFCorte" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 15px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:GridView ID="GvDatos" runat="server" OnRowDataBound="GvDatos_RowDataBound" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False"
|
||||
EmptyDataText="No se encontraron registros" data-sort="true" Width="99%"
|
||||
DataKeyNames="CveCliente,CveMoneda,Saldo,Folio,CveVenta,NombreComercial,CveVentaAmortizacion,SerieFolioAmortizacion,SerieFolio,Total,
|
||||
Fecha,FechaAmortizacion,SubTotal,SubTotalAmortizacion,ImporteAmortizacion,CveIE,Tipo,SaldoAcumulativo">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chk" Checked="false" Visible="false" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="TipoColumna" HeaderText="" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="SerieFolio" HeaderText="Cliente/Folio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Fecha" ItemStyle-Width="10%" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="SubTotal" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="ImporteAmortizacion" ItemStyle-Width="10%" HeaderText="Aplicado" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Saldo" ItemStyle-Width="10%" HeaderText="Saldo" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Abreviatura" ItemStyle-Width="5%" HeaderText="Moneda" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Costo" ItemStyle-Width="10%" HeaderText="Costo" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalSaldar" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog modal" runat="server" ID="UPModalCort" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="ltlCorttitulo" Text="Saldar" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2" style="text-align: left">Fecha:</div>
|
||||
<div class="col-md-2">
|
||||
<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="TxtFecha" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkCortfecha" class="btn default " Text=" <i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEECortfecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEECortfecha" TargetControlID="TxtFecha" PopupButtonID="LnkCortfecha" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RfvCortfecha" runat="server" ControlToValidate="TxtFecha" 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="VgGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoCortfecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvCortfecha"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtConcepto" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RfvConcepto"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtConcepto.ClientID.ToString()%>">Concepto:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnSaldar" OnClick="BtnSaldar_Click" runat="server" Text="Saldar" CssClass="btn btn-primary" ValidationGroup="VgGuardar" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivTipoCambio" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Cambiar Tipo Cambio de Dólares"></asp:Label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
|
||||
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
|
||||
Especifico:
|
||||
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnTipoCambio" runat="server" OnClick="BtnTipoCambio_Click" Text="Aceptar" class="btn btn-primary" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
425
Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs
Normal file
425
Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs
Normal file
@@ -0,0 +1,425 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
|
||||
{
|
||||
|
||||
#region PROPIEDADES
|
||||
private DataTable DtDatos
|
||||
{
|
||||
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
|
||||
set { ViewState["DtDatos"] = value; }
|
||||
}
|
||||
|
||||
private int Tipo
|
||||
{
|
||||
get { return Tipo = (int)ViewState["Tipo"]; }
|
||||
set { ViewState["Tipo"] = value; }
|
||||
}
|
||||
|
||||
private int CveMoneda
|
||||
{
|
||||
get { return CveMoneda = (int)ViewState["CveMoneda"]; }
|
||||
set { ViewState["CveMoneda"] = value; }
|
||||
}
|
||||
private double TCEspecifico
|
||||
{
|
||||
get { return TCEspecifico = (double)ViewState["TCEspecifico"]; }
|
||||
set { ViewState["TCEspecifico"] = value; }
|
||||
}
|
||||
|
||||
private int TipoCambio
|
||||
{
|
||||
get { return TipoCambio = (int)ViewState["TipoCambio"]; }
|
||||
set { ViewState["TipoCambio"] = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
protected void InicializaDatos()
|
||||
{
|
||||
txtFechaI.Text = "01/01/2000";
|
||||
txtFechaF.Text = DateTime.Today.ToString();
|
||||
TxtFecha.Text = DateTime.Today.ToString();
|
||||
TxtFechaFCorte.Text = DateTime.Today.ToString();
|
||||
CargaSucursales();
|
||||
CargaClientes();
|
||||
DdlCliente.SelectedValueExist(Request["CveCliente"] == null ? "-1" : Request["CveCliente"].ToString());
|
||||
DdlSucursal.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString());
|
||||
DdlTipo.SelectedValueExist(Request["Tipo"] == null ? "-1" : Request["Tipo"].ToString());
|
||||
CveMoneda = Request["CveMoneda"] == null ? -1 : Request["CveMoneda"].ToString().ToEntero();
|
||||
txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.ToString() : Request["FechaI"].ToString();
|
||||
txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.ToString() : Request["FechaF"].ToString();
|
||||
TipoCambio = Request["TipoCambio"] == null ? 1 : Request["TipoCambio"].ToString().ToEntero();
|
||||
TCEspecifico = Request["TCEspecifico"] == null ? -1 : Request["TCEspecifico"].ToString().ToDouble();
|
||||
DdlConSaldo.SelectedValueExist(Request["ConSaldo"] == null ? "-1" : Request["ConSaldo"].ToString());
|
||||
RblTipoCambio.SelectedValue = TipoCambio.ToString();
|
||||
LiEspecifico.InnerText = TCEspecifico.FormatoNumero();
|
||||
|
||||
DateTime FechaICorte;
|
||||
FechaICorte = Request["FechaICorte"] == null ? DateTime.MinValue : Request["FechaICorte"].ToString().ToDate();
|
||||
if (FechaICorte <= DateTime.MinValue) { TxtFechaICorte.Text = ""; } else { TxtFechaICorte.Text = FechaICorte.ToShortDateString(); }
|
||||
DateTime FechaFCorte;
|
||||
FechaFCorte = Request["FechaFCorte"] == null ? DateTime.MaxValue : Request["FechaFCorte"].ToString().ToDate();
|
||||
if (FechaFCorte >= DateTime.MaxValue) { TxtFechaFCorte.Text = ""; } else { TxtFechaFCorte.Text = FechaFCorte.ToShortDateString(); }
|
||||
CargaDatos();
|
||||
CargaVendedores();
|
||||
if (Request["CveVendedor"]!=null)
|
||||
{
|
||||
DdlVendedor.SelectedValue = Request["CveVendedor"];
|
||||
}
|
||||
}
|
||||
|
||||
protected void CargaSucursales()
|
||||
{
|
||||
DdlSucursal.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa);
|
||||
DdlSucursal.DataBind();
|
||||
DdlSucursal.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlSucursal.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
protected void CargaClientes()
|
||||
{
|
||||
DdlCliente.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1);
|
||||
DdlCliente.DataBind();
|
||||
DdlCliente.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlCliente.SelectedValue = "-1";
|
||||
}
|
||||
|
||||
protected void CargaVendedores()
|
||||
{
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.DataBind();
|
||||
DdlVendedor.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
//DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor);
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
|
||||
if (TipoCambio != 1) { CveMoneda = -1; }
|
||||
DateTime FechaICorte;
|
||||
if (TxtFechaICorte.Text != "") { FechaICorte = TxtFechaICorte.Text.ToDate(); } else { FechaICorte = DateTime.MinValue; }
|
||||
DateTime FechaFCorte;
|
||||
if (TxtFechaFCorte.Text != "") { FechaFCorte = TxtFechaFCorte.Text.ToDate(); } else { FechaFCorte = DateTime.MaxValue; }
|
||||
ClsVentas ObjVenta = new ClsVentas();
|
||||
if (ObjVenta.GetRepAnticiposNCIXCDetalle(DdlCliente.SelectedValue.ToEntero(), DdlSucursal.SelectedValue.ToEntero(), txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(),
|
||||
UsuarioActual.CveEmpresa, DdlConSaldo.SelectedValue.ToEntero(), DdlTipo.SelectedValue.ToEntero(), CveMoneda, FechaICorte, FechaFCorte, TipoCambio, TCEspecifico))
|
||||
{
|
||||
GvDatos.DataSource = ObjVenta.DtResultados;
|
||||
DtDatos = ObjVenta.DtResultados;
|
||||
}
|
||||
ObjVenta.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
if (TxtFechaFCorte.Text != DateTime.Now.ToShortDateString() && txtFechaI.Text != "") { LnkHabilitarSaldar.Visible = false; LnkSaldar.Visible = false; } else { LnkHabilitarSaldar.Visible = true; }
|
||||
if (LnkSaldar.Visible) { HabilitarCheckbox(); }
|
||||
Tipo = DdlTipo.SelectedValue.ToEntero();
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void LnkExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("EXCEL");
|
||||
}
|
||||
|
||||
protected void LnkPdf_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenerarPDF("PDF");
|
||||
}
|
||||
|
||||
protected void GenerarPDF(String Opcion)
|
||||
{
|
||||
String FechaI;
|
||||
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" <b>Fecha Inicial:</b> {txtFechaI.Text}"; }
|
||||
String FechaF;
|
||||
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $" <b>Fecha Final:</b> {txtFechaF.Text}"; }
|
||||
String FechaICorte;
|
||||
if (TxtFechaICorte.Text == "" || TxtFechaICorte.Text == "__/__/____") { FechaICorte = ""; } else { FechaICorte = $" <b>Fecha Inicial Corte:</b> {TxtFechaICorte.Text}"; }
|
||||
String FechaFCorte;
|
||||
if (TxtFechaFCorte.Text == "" || TxtFechaFCorte.Text == "__/__/____") { FechaFCorte = ""; } else { FechaFCorte = $" <b>Fecha Final Corte:</b> {TxtFechaFCorte.Text}"; }
|
||||
String Sucursal;
|
||||
if (DdlSucursal.SelectedValue != "-1") { Sucursal = $" <b>Sucursal:</b> {DdlSucursal.SelectedItem.Text}"; } else { Sucursal = ""; }
|
||||
String Cliente;
|
||||
if (DdlCliente.SelectedValue != "-1") { Cliente = $" <b>Cliente:</b> {DdlCliente.SelectedItem.Text}"; } else { Cliente = ""; }
|
||||
String ConSaldo;
|
||||
if (DdlConSaldo.SelectedValue != "-1") { ConSaldo = $" <b>Con Saldo:</b> {DdlConSaldo.SelectedItem.Text}"; } else { ConSaldo = ""; }
|
||||
String Tipo2;
|
||||
if (DdlTipo.SelectedValue != "-1") { Tipo2 = $" <b>Tipo:</b> {DdlTipo.SelectedItem.Text}"; } else { Tipo2 = ""; }
|
||||
if (DtDatos.Rows.Count > 0)
|
||||
{
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
List<ReportParameter> para = new List<ReportParameter>();
|
||||
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
|
||||
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
|
||||
para.Add(new ReportParameter("Tipo", Tipo.ToString()));
|
||||
para.Add(new ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {Cliente}{Sucursal}{ConSaldo}{Tipo2}{FechaI}{FechaF}{FechaICorte}{FechaFCorte}"));
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
para.Add(new ReportParameter("LogoPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
para.Add(new ReportParameter("LogoPath", ""));
|
||||
}
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepAnt-NC-IXCDetalle.rdlc", DtDatos, para, "Reporte de Anticipos - NCXAplicar - IXC Detalle", Opcion);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
String Css = "Texto";
|
||||
String Liga = "";
|
||||
if (e.Row.DataKey("Tipo").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales3";
|
||||
e.Row.Cells[2].Text = e.Row.DBCampo("Moneda").ToString();
|
||||
}
|
||||
else if (e.Row.DataKey("CveCliente").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales2";
|
||||
switch (e.Row.DataKey("Tipo").ToEntero())
|
||||
{
|
||||
case 1:
|
||||
e.Row.Cells[2].Text = "Anticipos";
|
||||
break;
|
||||
case 2:
|
||||
e.Row.Cells[2].Text = "NC X Aplicar";
|
||||
break;
|
||||
case 3:
|
||||
e.Row.Cells[2].Text = "Ingresos X Comprobar";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (e.Row.DataKey("CveVentaAmortizacion").ToEntero() < 1 && e.Row.DataKey("CveVenta").ToEntero() < 1 && e.Row.DataKey("CveIE").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
e.Row.Cells[2].Text = e.Row.DataKey("NombreComercial");
|
||||
e.Row.Cells[7].Text = "";
|
||||
}
|
||||
else if (e.Row.DataKey("CveVentaAmortizacion").ToEntero() < 1 && e.Row.DataKey("CveVenta").ToEntero() > 0)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales";
|
||||
e.Row.Cells[2].Text = e.Row.DataKey("SerieFolio");
|
||||
e.Row.Cells[3].Text = e.Row.DataKey("Fecha").ToDate().ToShortDateString();
|
||||
if (DdlTipo.SelectedValue.ToEntero() == 1)
|
||||
{
|
||||
e.Row.Cells[4].Text = "$" + e.Row.DataKey("SubTotal").FormatoNumero();
|
||||
}
|
||||
else if (DdlTipo.SelectedValue.ToEntero() == 2)
|
||||
{
|
||||
e.Row.Cells[4].Text = "$" + e.Row.DataKey("Total").FormatoNumero();
|
||||
}
|
||||
Liga = $"/Ventas/Ventas.aspx?&CveVenta={e.Row.DataKey("CveVenta")}";
|
||||
e.Row.Cells[2].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[2].Text + "</a>";
|
||||
}
|
||||
else if (e.Row.DataKey("CveIE").ToEntero() > 0 && e.Row.DataKey("CveVentaAmortizacion").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales";
|
||||
e.Row.Cells[2].Text = e.Row.DataKey("SerieFolio");
|
||||
e.Row.Cells[3].Text = e.Row.DataKey("Fecha").ToDate().ToShortDateString();
|
||||
e.Row.Cells[4].Text = "$" + e.Row.DataKey("Total").FormatoNumero();
|
||||
Liga = $"/Bancos/IE.aspx?&CveIE={e.Row.DataKey("CveIE")}";
|
||||
e.Row.Cells[2].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[2].Text + "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Row.Cells[2].Text = e.Row.DataKey("SerieFolioAmortizacion");
|
||||
e.Row.Cells[3].Text = e.Row.DataKey("FechaAmortizacion").ToDate().ToShortDateString();
|
||||
e.Row.Cells[4].Text = "$" + e.Row.DataKey("ImporteAmortizacion").FormatoNumero();
|
||||
e.Row.Cells[5].Text = "$" + e.Row.DataKey("ImporteAmortizacion").FormatoNumero();
|
||||
e.Row.Cells[6].Text = "$" + e.Row.DataKey("SaldoAcumulativo").FormatoNumero();
|
||||
Liga = $"/Ventas/Ventas.aspx?&CveVenta={e.Row.DataKey("CveVentaAmortizacion")}";
|
||||
e.Row.Cells[2].Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.Cells[2].Text + "</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region SALDAR
|
||||
|
||||
private void HabilitarCheckbox()
|
||||
{
|
||||
|
||||
foreach (GridViewRow Gv in GvDatos.Rows)
|
||||
{
|
||||
if ((Gv.DataKey("CveVenta").ToEntero() > 0 || Gv.DataKey("CveIE").ToEntero() > 0) && (Gv.DataKey("CveVentaAmortizacion").ToEntero() < 1))
|
||||
{
|
||||
Gv.FCCheckBox("Chk").Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkHabilitarSaldar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
HabilitarCheckbox();
|
||||
LnkSaldar.Visible = true;
|
||||
LnkHabilitarSaldar.Visible = false;
|
||||
UpLnkAgregar.Update();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
protected void LnkSaldar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Tipo == 1)
|
||||
{
|
||||
TxtConcepto.Text = "Cancelación de Anticipos";
|
||||
}
|
||||
else if (Tipo == 2)
|
||||
{
|
||||
TxtConcepto.Text = "Cancelación de Saldo de Nota de crédito";
|
||||
}
|
||||
else if (Tipo == 3)
|
||||
{
|
||||
TxtConcepto.Text = "Cancelación de Ingresos por Comprobar";
|
||||
}
|
||||
UPModalCort.Update();
|
||||
RegistraScript("$('#DivModalSaldar').modal();");
|
||||
}
|
||||
|
||||
protected void BtnSaldar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsContabilidad ObjConta = new ClsContabilidad();
|
||||
ObjConta.IniciaTransacSQL();
|
||||
int CvePrePoliza = 0, ConceptoContable1 = 0, ConceptoContable2 = 0, CveVenta = -1, CveIE = -1;
|
||||
decimal Saldo = 0;
|
||||
string MsgError = "";
|
||||
if (Tipo == 2)
|
||||
{
|
||||
ConceptoContable1 = 91;
|
||||
ConceptoContable2 = 12;
|
||||
}
|
||||
else if (Tipo == 1)
|
||||
{
|
||||
ConceptoContable1 = 11;
|
||||
ConceptoContable2 = 3;
|
||||
}
|
||||
else if (Tipo == 3)
|
||||
{
|
||||
ConceptoContable1 = 92;
|
||||
ConceptoContable2 = 92;
|
||||
}
|
||||
|
||||
foreach (GridViewRow Gv in GvDatos.Rows)
|
||||
{
|
||||
if (Gv.FCCheckBox("Chk").Checked)
|
||||
{
|
||||
if (Tipo == 1 || Tipo == 2)
|
||||
{
|
||||
CveVenta = Gv.DataKey("CveVenta").ToEntero();
|
||||
Saldo = -Gv.DataKey("Saldo").ToDecimal();
|
||||
}
|
||||
else if (Tipo == 3)
|
||||
{
|
||||
CveIE = Gv.DataKey("CveIE").ToEntero();
|
||||
Saldo = Gv.DataKey("Saldo").ToDecimal();
|
||||
}
|
||||
|
||||
int IdCtaContable = 0, CveCuenta = 0;
|
||||
if (ObjConta.GetRetCuenta(ConceptoContable1, Gv.DataKey("CveCliente").ToEntero()))
|
||||
{
|
||||
if (ObjConta.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
if (Tipo == 1 || Tipo == 2)
|
||||
{
|
||||
IdCtaContable = ObjConta.DtResultados.Rows[0]["IdCtaContable"].ToString().ToEntero();
|
||||
CveCuenta = ObjConta.DtResultados.Rows[0]["IdCtaContableSIG"].ToString().ToEntero();
|
||||
|
||||
}
|
||||
else if (Tipo == 3)
|
||||
{
|
||||
IdCtaContable = ObjConta.DtResultados.Rows[0]["IdCtaContClientes"].ToString().ToEntero();
|
||||
CveCuenta = ObjConta.DtResultados.Rows[0]["CveCuentaCliente"].ToString().ToEntero();
|
||||
}
|
||||
}
|
||||
}
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 6, Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("CveMoneda").ToEntero(), TxtFecha.Text.ToDate(), "Saldo de NC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
|
||||
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Saldo, Gv.DataKey("Folio").ToString(), ConceptoContable2, TxtConcepto.Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero(), ImporteMX: Saldo, CveCuenta: CveCuenta))
|
||||
{
|
||||
MsgError = "Ocurrio un error al saldar el movimiento";
|
||||
}
|
||||
|
||||
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Gv.DataKey("Saldo").ToDecimal(), Gv.DataKey("Folio").ToString(), 78, TxtConcepto.Text, TxtFecha.Text.ToDate(), UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE, CveVenta, ImporteMX: Gv.DataKey("Saldo").ToDecimal(), CveCuenta: -1))
|
||||
{
|
||||
MsgError = "Ocurrio un error al saldar el movimiento";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (MsgError == "")
|
||||
{
|
||||
ObjConta.Commit();
|
||||
Alert("Los movimientos se saldaron correctamente.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjConta.RollBack();
|
||||
Alert(MsgError, ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
LnkSaldar.Visible = false;
|
||||
LnkHabilitarSaldar.Visible = true;
|
||||
CargaDatos();
|
||||
UpLnkAgregar.Update();
|
||||
ObjConta.Dispose();
|
||||
RegistraScript("$('#DivModalSaldar').modal('hide');");
|
||||
TxtFecha.Text = DateTime.Today.ToString();
|
||||
UPModalCort.Update();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TIPO DE CAMBIO
|
||||
|
||||
protected void BtnTipoCambio_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"));
|
||||
}
|
||||
|
||||
protected void RblTipoCambio_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
TipoCambio = RblTipoCambio.SelectedValue.ToEntero();
|
||||
if (TipoCambio == 3)
|
||||
{
|
||||
LiEspecifico.Visible = true;
|
||||
TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble();
|
||||
TxtEspecifico.Text = TCEspecifico.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
LiEspecifico.Visible = false;
|
||||
}
|
||||
UpBodyTipoCambio.Update();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
219
Ventas/RepAnticiposEspeciales.aspx
Normal file
219
Ventas/RepAnticiposEspeciales.aspx
Normal file
@@ -0,0 +1,219 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnticiposEspeciales.aspx.vb" Inherits="Ventas_RepAnticiposEspeciales" %>
|
||||
|
||||
<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;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Anticipos Especiales
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpGral" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<%--Tabla con los campos para filtrar--%>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<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="btConsultar" OnClick="btConsultar_Click" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" /></td>
|
||||
<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 magindate">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Inicio:</div>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<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="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate" style="text-align: right!important">Fecha Fin:</div>
|
||||
<div class="col-md-1 ">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
|
||||
<asp:TextBox Style="width: 80px !important;" ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<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="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate" style="text-align: right!important">Sucursal:</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlSucursal" CssClass="form-control input-sm select2me" runat="server" Width="100px" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate" style="text-align: right!important">Especiales:</div>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlEspeciales" CssClass="form-control input-sm select2me" runat="server" Width="100px" DataTextField="NombreComercial" DataValueField="CveCliente">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
<asp:ListItem Value="0">Anticipos</asp:ListItem>
|
||||
<asp:ListItem Value="1">Especiales</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="row">
|
||||
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvAnticiposEspeciales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvAnticiposEspeciales.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin: 5px">
|
||||
<asp:UpdatePanel ID="UPGvAnticiposEspeciales" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvAnticiposEspeciales" runat="server" AutoGenerateColumns="False"
|
||||
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
data-freezerows="1"
|
||||
GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Folio">
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink ID="LblAnticiposEspeciales" runat="server" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveVenta","/Ventas/Ventas.aspx?CveVenta={0}") %>'>></asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Sucursal">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="SubTotal" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("SubTotal", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("IVA", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="IEPS" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("IEPS", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("Total", "{0:N2}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Moneda">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Anticipo Especial">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("AnticipoEspecial") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("EstatusFactura") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
|
||||
66
Ventas/RepAnticiposEspeciales.aspx.vb
Normal file
66
Ventas/RepAnticiposEspeciales.aspx.vb
Normal file
@@ -0,0 +1,66 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class Ventas_RepAnticiposEspeciales
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property CveAnticiposEspeciales As Integer
|
||||
Get
|
||||
If Not ViewState("CveAnticiposEspeciales") Is Nothing Then
|
||||
Return ViewState("CveAnticiposEspeciales").ToString.ToEntero
|
||||
Else
|
||||
Return -1
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveAnticiposEspeciales") = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
Cargadatos()
|
||||
CargadatosGvAnticiposEspeciales()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Cargadatos()
|
||||
TxtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
|
||||
TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
DdlSucursal.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSucursal.DataBind()
|
||||
DdlSucursal.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargadatosGvAnticiposEspeciales()
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetAnticiposEspeciales(TxtFechaI.Text.ToDateTime, TxtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero, DdlEspeciales.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvAnticiposEspeciales.DataSource = ObjVentas.DtResultados
|
||||
Else
|
||||
GvAnticiposEspeciales.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
UPGvAnticiposEspeciales.DataBind()
|
||||
UpGral.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargadatosGvAnticiposEspeciales()
|
||||
End Sub
|
||||
End Class
|
||||
136
Ventas/RepArqueos.aspx
Normal file
136
Ventas/RepArqueos.aspx
Normal file
@@ -0,0 +1,136 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepArqueos.aspx.vb" Inherits="Ventas_RepArqueos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Arqueos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server" OnClick="LnkPdf_Click"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server" OnClick="LnkExportar_Click"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPdf" />
|
||||
<asp:PostBackTrigger ControlID="LnkExportar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<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="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Sucursal:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlSubProyecto" runat="server" Width="200px" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Productos</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
|
||||
DataKeyNames=""
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Conceptos" DataField="Clasificacion" ItemStyle-Width="25%" />
|
||||
<asp:BoundField HeaderText="Anterior" DataField="Anterior" DataFormatString="{0:N0}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="DiaActual" DataField="DiaActual" DataFormatString="{0:N0}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Acumulado" DataField="Acumulado" DataFormatString="{0:N0}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">DEPOSITOS</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvTotales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTotales.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvTotales" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
|
||||
DataKeyNames="" OnRowDataBound="GvTotales_RowDataBound"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Transacción" DataField="TipoTransaccion" ItemStyle-Width="75%" />
|
||||
<asp:TemplateField ItemStyle-Width="25%" HeaderText="Total" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HpTotal" runat="server" Target="_blank" Text='<%# String.Format("{0:N2}", Eval("Total"))%>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
104
Ventas/RepArqueos.aspx.vb
Normal file
104
Ventas/RepArqueos.aspx.vb
Normal file
@@ -0,0 +1,104 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Data
|
||||
Partial Class Ventas_RepArqueos
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DtProductos As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtProductos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtProductos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDepositos As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtDepositos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDepositos") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos(Now.Year, -1)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaCombos()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("TipoSucursal = 1")
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos(Anio As Integer, CveSubProyecto As Integer)
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetRepArqueos(Anio, CveSubProyecto, UsuarioActual.CveEmpresa) Then
|
||||
DtProductos = ObjVentas.DataSetResultados.Tables(0).Copy()
|
||||
DtDepositos = ObjVentas.DataSetResultados.Tables(1).Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvDatos.DataSource = DtProductos
|
||||
GvTotales.DataSource = DtDepositos
|
||||
|
||||
GvDatos.DataBind()
|
||||
GvTotales.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
Protected Sub GvTotales_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveTipoTransaccion") = "-1" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
e.Row.FCHyperLink("HpTotal").NavigateUrl = String.Format("/Ventas/RepArqueosDetalle.aspx?CveSubProyecto={0}&Fecha={1}", DdlSubProyecto.SelectedValue.ToEntero(), Now.ToString("dd/MM/yyyy"))
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos(Now.Year, DdlSubProyecto.SelectedValue.ToEntero())
|
||||
End Sub
|
||||
Protected Sub GeneraPDF(Formato As String)
|
||||
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
|
||||
Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString()))
|
||||
|
||||
params.Add(New ReportParameter("Encabezado", String.Format("Sucursal:{0}", DdlSubProyecto.SelectedItem.Text)))
|
||||
|
||||
|
||||
Dim lrds As List(Of ReportDataSource) = New List(Of ReportDataSource)()
|
||||
Dim rds As ReportDataSource = New ReportDataSource()
|
||||
rds.Name = "DataSet1"
|
||||
rds.Value = DtProductos
|
||||
|
||||
Dim rds2 As ReportDataSource = New ReportDataSource()
|
||||
rds2.Name = "DataSet2"
|
||||
rds2.Value = DtDepositos
|
||||
|
||||
lrds.Add(rds)
|
||||
lrds.Add(rds2)
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepArqueos.rdlc", lrds, params, "Rep Arqueos", Formato)
|
||||
End Sub
|
||||
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
|
||||
GeneraPDF("PDF")
|
||||
End Sub
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs)
|
||||
GeneraPDF("EXCEL")
|
||||
End Sub
|
||||
End Class
|
||||
117
Ventas/RepArqueosDetalle.aspx
Normal file
117
Ventas/RepArqueosDetalle.aspx
Normal file
@@ -0,0 +1,117 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepArqueosDetalle.aspx.vb" Inherits="Ventas_RepArqueosDetalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
<asp:Literal ID="LtlTitulo" runat="server"></asp:Literal>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server" OnClick="LnkPdf_Click"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server" OnClick="LnkExportar_Click"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPdf" />
|
||||
<asp:PostBackTrigger ControlID="LnkExportar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Ventas</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron facturas"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Serie Folio" Target="_blank" DataTextField="SerieFolio" ItemStyle-Width="90px" DataTextFormatString="{0:N2}" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Cliente" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Sucursal" DataField="Sucursal" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="IEPS" DataField="IEPS" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Ret. IVA" DataField="RetIVA" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Ret ISR" DataField="RetISR" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">CUENTAS</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvCuentas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvCuentas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvCuentas" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
|
||||
DataKeyNames=""
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Folio" Target="_blank" DataTextField="Folio" ItemStyle-Width="25%" DataTextFormatString="{0:N2}" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Numero de Cuenta" DataField="NumCuenta" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="50%" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
108
Ventas/RepArqueosDetalle.aspx.vb
Normal file
108
Ventas/RepArqueosDetalle.aspx.vb
Normal file
@@ -0,0 +1,108 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Ventas_RepArqueosDetalle
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DtVentas As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtVentas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtCuentas As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtCuentas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCuentas") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
Dim Fecha As DateTime = Now
|
||||
If Request("CveSubProyecto") IsNot Nothing Then
|
||||
CveSubProyecto = Request("CveSubProyecto").ToString().ToEntero()
|
||||
End If
|
||||
If Request("Fecha") IsNot Nothing Then
|
||||
Fecha = Request("Fecha").ToString().ToDate()
|
||||
End If
|
||||
CargaDatos(Fecha, CveSubProyecto)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaDatos(Fecha As DateTime, CveSubProyecto As Integer)
|
||||
LtlTitulo.Text = String.Format("Reporte de Arqueos Detalle: Fecha {0:dd/MM/yyyy}", Fecha)
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetRepArqueosDetalle(Fecha, CveSubProyecto, UsuarioActual.CveEmpresa) Then
|
||||
DtVentas = ObjVentas.DataSetResultados.Tables(0).Copy()
|
||||
DtCuentas = ObjVentas.DataSetResultados.Tables(1).Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataSource = DtVentas
|
||||
GvCuentas.DataSource = DtCuentas
|
||||
GvDatos.DataBind()
|
||||
GvCuentas.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("SerieFolio") = "Total" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvCuentas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCuentas.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Folio") = "Total" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GeneraPDF(Formato As String)
|
||||
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
|
||||
Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString()))
|
||||
|
||||
params.Add(New ReportParameter("Encabezado", String.Format("Fecha:{0}", Request("Fecha").ToString().ToDate().ToString("dd/MM/yyyy"))))
|
||||
|
||||
|
||||
Dim lrds As List(Of ReportDataSource) = New List(Of ReportDataSource)()
|
||||
Dim rds As ReportDataSource = New ReportDataSource()
|
||||
rds.Name = "DataSet1"
|
||||
rds.Value = DtVentas
|
||||
|
||||
Dim rds2 As ReportDataSource = New ReportDataSource()
|
||||
rds2.Name = "DataSet2"
|
||||
rds2.Value = DtCuentas
|
||||
|
||||
lrds.Add(rds)
|
||||
lrds.Add(rds2)
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepArqueosDetalle.rdlc", lrds, params, "Rep Arqueos Detalle", Formato)
|
||||
End Sub
|
||||
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
|
||||
GeneraPDF("PDF")
|
||||
End Sub
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs)
|
||||
GeneraPDF("EXCEL")
|
||||
End Sub
|
||||
End Class
|
||||
43
Ventas/RepCancelacionesPorAtender.aspx
Normal file
43
Ventas/RepCancelacionesPorAtender.aspx
Normal file
@@ -0,0 +1,43 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepCancelacionesPorAtender.aspx.cs" Inherits="Ventas_RepCancelacionesPorAtender" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Cancelaciones por Atender
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron factura canceladas pendientes"
|
||||
DataKeyNames="FolioFiscal,RFC,Total"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie Folio" DataField="SerieFolio" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Proveedor" DataField="NombreProveedor" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" OnClick="btnAceptar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea aceptar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" OnClick="btnRechazar_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-remove'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea rechazar la cancelación?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
165
Ventas/RepCancelacionesPorAtender.aspx.cs
Normal file
165
Ventas/RepCancelacionesPorAtender.aspx.cs
Normal file
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
|
||||
public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
|
||||
{
|
||||
private string PACUsuario = "rene.molina@adsistemas.mx";
|
||||
private string PACContrasenia = "rene2018";
|
||||
private string XmlPendientes
|
||||
{
|
||||
get { return (ViewState["XmlPendientes"] == null) ? "" : ViewState["XmlPendientes"].ToString(); }
|
||||
set { ViewState["XmlPendientes"] = value; }
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargarPendientes();
|
||||
}
|
||||
}
|
||||
private void CargarPendientes()
|
||||
{
|
||||
Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
|
||||
Cancelacion.StructCancel resp = objServicio.ObtienePendientes(UsuarioActual.Empresa.RFC, "UserTest", "1234567890");
|
||||
if (resp.Estado == 0)
|
||||
{
|
||||
string XmlPendientes = DecodeBase64(resp.Xml);
|
||||
StringReader theReader = new StringReader(XmlPendientes);
|
||||
DataSet theDataSet = new DataSet();
|
||||
theDataSet.ReadXml(theReader);
|
||||
if (theDataSet.Tables[0].Rows[0]["Uuid"].ToString() != "null")
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (DataRow item in theDataSet.Tables[0].Rows)
|
||||
{
|
||||
sb.AppendFormat("{0};", item["Uuid"].ToString());
|
||||
}
|
||||
var ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetFacturasCanceladasPendientes(sb.ToString(), UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjVentas.DtResultados;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
GvDatos.DataSource = null;
|
||||
Alert("No se encontraron cancelaciones pendientes");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GvDatos.DataSource = null;
|
||||
Alert("Error al obtener cancelaciones pendientes: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
GvDatos.DataBind();
|
||||
UPDatos.Update();
|
||||
}
|
||||
protected void btnAceptar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
|
||||
try
|
||||
{
|
||||
|
||||
string ArchivoLLave = "", ArchivoCertificado = "", ClaveReceptor = "", RFCReceptor = "";
|
||||
|
||||
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
ClaveReceptor = UsuarioActual.Empresa.ContraseñaKey;
|
||||
RFCReceptor = UsuarioActual.Empresa.RFC;
|
||||
|
||||
if (!string.IsNullOrEmpty(ArchivoCertificado) && !string.IsNullOrEmpty(ArchivoLLave))
|
||||
{
|
||||
string CertB64 = Convert.ToBase64String(File.ReadAllBytes(ArchivoCertificado));
|
||||
string KeyB64 = Convert.ToBase64String(File.ReadAllBytes(ArchivoLLave));
|
||||
string Uuid = GvRow.DataKey("FolioFiscal");
|
||||
string Total = GvRow.DataKey("Total");
|
||||
string RFC = GvRow.DataKey("RFC");
|
||||
|
||||
//var acusesat = Timbrado.VerificarVigenciaSAT(Uuid, RFC, RFCReceptor, Total, true);
|
||||
//if (acusesat != null && acusesat.EsCancelable.Contains("Cancelable"))
|
||||
//{
|
||||
Cancelacion.StructCancel resp = objServicio.AceptaRechaza(RFCReceptor, PACUsuario, PACContrasenia, CertB64, KeyB64, ClaveReceptor, Uuid, "Aceptación");
|
||||
if (resp.Estado == 0)
|
||||
{
|
||||
Alert("Aceptación de cancelación exitosa");
|
||||
CargarPendientes();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Error en la aceptación: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Alert("No de pudo comprobar el estatus de la cancelación", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Alert(ex.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
protected void btnRechazar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
Cancelacion.CancelacionSoapClient objServicio = new Cancelacion.CancelacionSoapClient();
|
||||
|
||||
try
|
||||
{
|
||||
string ArchivoLLave = "", ArchivoCertificado = "", ClaveReceptor = "", RFCReceptor = "";
|
||||
|
||||
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\\{UsuarioActual.Empresa.ArchivoKey}";
|
||||
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\\{UsuarioActual.Empresa.ArchivoCer}";
|
||||
ClaveReceptor = UsuarioActual.Empresa.ContraseñaKey;
|
||||
RFCReceptor = UsuarioActual.Empresa.RFC;
|
||||
|
||||
if (!string.IsNullOrEmpty(ArchivoCertificado) && !string.IsNullOrEmpty(ArchivoLLave))
|
||||
{
|
||||
string CertB64 = Convert.ToBase64String(File.ReadAllBytes(ArchivoCertificado));
|
||||
string KeyB64 = Convert.ToBase64String(File.ReadAllBytes(ArchivoLLave));
|
||||
string Uuid = GvRow.DataKey("FolioFiscal");
|
||||
|
||||
//var acusesat = Timbrado.VerificarVigenciaSAT(Uuid, "", RFCReceptor, total, true);
|
||||
|
||||
Cancelacion.StructCancel resp = objServicio.AceptaRechaza(RFCReceptor, PACUsuario, PACContrasenia, CertB64, KeyB64, ClaveReceptor, Uuid, "Rechazo");
|
||||
if (resp.Estado == 0)
|
||||
{
|
||||
Alert("Aceptación de cancelación exitosa");
|
||||
CargarPendientes();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Error en la aceptación: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Alert(ex.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
private string DecodeBase64(string strXMLCodificado)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] decbuff = Convert.FromBase64String(strXMLCodificado);
|
||||
return System.Text.Encoding.UTF8.GetString(decbuff);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
134
Ventas/RepCancelacionesPorRespuesta.aspx
Normal file
134
Ventas/RepCancelacionesPorRespuesta.aspx
Normal file
@@ -0,0 +1,134 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepCancelacionesPorRespuesta.aspx.cs" Inherits="Ventas_RepCancelacionesPorRespuesta" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Cancelaciones por Respuesta
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkValidar" OnClick="LnkValidar_Click" runat="server"><i class="fa fa-check"></i>Verificar Cancelaciones</asp:LinkButton></li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Facturas Pendientes Por Respuesta</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
|
||||
DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,RFCCliente"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-Width="25%" />
|
||||
<asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" ItemStyle-Width="265px" />
|
||||
<asp:HyperLinkField HeaderText="Serie Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="80px" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Mon" DataField="Abreviatura" ItemStyle-Width="30px" />
|
||||
<asp:BoundField HeaderText="Estatus" DataField="EstatusFactura" ItemStyle-Width="160px" />
|
||||
<asp:TemplateField ItemStyle-Width="35px" HeaderText="Verificar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" OnClick="BtnValidar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivRefacturar" runat="server" visible="false" class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Facturas Pendientes Por Refacturar</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<div style="margin-right: 15px">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvRefacturaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRefacturaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvRefacturaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
|
||||
DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,RFCCliente"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-Width="25%" />
|
||||
<asp:BoundField HeaderText="Folio Fiscal" DataField="FolioFiscal" ItemStyle-Width="265px" />
|
||||
<asp:HyperLinkField HeaderText="Serie Folio" DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="80px" />
|
||||
<asp:BoundField HeaderText="Importe" DataField="Total" DataFormatString="{0:N2}" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Mon" DataField="Abreviatura" ItemStyle-Width="30px" />
|
||||
<asp:BoundField HeaderText="Estatus" DataField="EstatusFactura" ItemStyle-Width="160px" />
|
||||
<asp:TemplateField ItemStyle-Width="35px" HeaderText="Verificar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" OnClick="BtnValidar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField HeaderText="Refacturación" Text="Refacturar" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveDevolucion={0}&NuevaFactura=1" />
|
||||
<%-- <asp:TemplateField ItemStyle-Width="35px" HeaderText="Refacturar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" OnClick="BtnRefacturar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea verificar la cancelación?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Button ID="BtnRefacturarDocumento" runat="server" ClientIDMode="Static" Text="Refacturar Documento" Style="display: none;" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function BtnRefacturarDocumento() {
|
||||
$('#BtnRefacturarDocumento').click();
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
519
Ventas/RepCancelacionesPorRespuesta.aspx.cs
Normal file
519
Ventas/RepCancelacionesPorRespuesta.aspx.cs
Normal file
@@ -0,0 +1,519 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using static Extensiones.ModExtensiones;
|
||||
|
||||
public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
{
|
||||
private DataTable DtVentas
|
||||
{
|
||||
get { return (ViewState["DtVentas"] == null) ? null : (DataTable)ViewState["DtVentas"]; }
|
||||
set { ViewState["DtVentas"] = value; }
|
||||
}
|
||||
private int CveVenta
|
||||
{
|
||||
get { return (ViewState["CveVenta"] == null) ? -1 : ViewState["CveVenta"].ToString().ToEntero(); }
|
||||
set { ViewState["CveVenta"] = value; }
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
private void CargaDatos()
|
||||
{
|
||||
if (Request["CveVenta"] != null)
|
||||
{
|
||||
this.CveVenta = Request["CveVenta"].ToString().ToEntero();
|
||||
}
|
||||
var ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -2, -1, "-1", "-1", "-1", CveUsuarioConsulta: UsuarioActual.CveUsuario))
|
||||
{
|
||||
if (CveVenta > 0)
|
||||
{
|
||||
DtVentas = ObjVentas.DtResultados.FiltraParametros($"CveVenta={CveVenta}");
|
||||
}
|
||||
else
|
||||
{
|
||||
DtVentas = ObjVentas.DtResultados.Copy();
|
||||
}
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
GvDatos.DataSource = DtVentas.FiltraParametros("CveEstatusFactura = 20 AND CveEstatusRefacturacion = 0");
|
||||
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion = 1");
|
||||
if (DtRefacturar.Rows.Count > 0)
|
||||
{
|
||||
DivRefacturar.Visible = true;
|
||||
GvRefacturaciones.DataSource = DtRefacturar;
|
||||
GvRefacturaciones.DataBind();
|
||||
}
|
||||
GvDatos.DataBind();
|
||||
UPDatos.Update();
|
||||
}
|
||||
protected void BtnValidar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
|
||||
int CveCliente = GvRow.DataKey("CveCliente").ToEntero();
|
||||
string Total = GvRow.DataKey("Total");
|
||||
string SubTotal = GvRow.DataKey("SubTotal");
|
||||
string Uuid = GvRow.DataKey("FolioFiscal");
|
||||
string RFCCliente = GvRow.DataKey("RFCCliente");
|
||||
string Folio = GvRow.DataKey("Folio");
|
||||
string TipoDocto = GvRow.DataKey("TipoDocto");
|
||||
string Nombre = GvRow.DataKey("Nombre");
|
||||
if (CveVenta > 0)
|
||||
{
|
||||
Alert(VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total));
|
||||
}
|
||||
CargaDatos();
|
||||
}
|
||||
private string VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
var CancelacionAcuse = "";
|
||||
var CancelacionFecha = DateTime.Now;
|
||||
int CveEstatus = 4;
|
||||
try
|
||||
{
|
||||
var resp = Timbrado.VerificarVigenciaSAT(uuid, UsuarioActual.Empresa.RFC, receptor, total, UsuarioActual.Empresa.FacturaProduccion);
|
||||
if (resp != null)
|
||||
{
|
||||
if (resp.Estado == null)
|
||||
{
|
||||
sb.Append("No se pudo comprobar el estado de la factura. El servicio del sat no esta disponible");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
sb.AppendFormat("Folio Fiscal: {0} <br/>", uuid);
|
||||
sb.AppendFormat("Codigo Estado: {0} <br/>", resp.CodigoEstatus);
|
||||
sb.AppendFormat("Estado: {0} <br/>", resp.Estado);
|
||||
sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable);
|
||||
sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion);
|
||||
|
||||
if ((resp.EsCancelable.ToUpper() == "NO CANCELABLE"))
|
||||
{
|
||||
sb.Append("Esta factura no es cancelable.");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
if (resp.Estado.ToUpper().Trim() == "CANCELADO" || resp.EstatusCancelacion.ToUpper() == "PLAZO VENCIDO")
|
||||
{
|
||||
CveEstatus = 5;
|
||||
var solicitud = new WSGF.Service1SoapClient();
|
||||
var acuse = solicitud.GetAcuse(emisor, "rene.molina@adsistemas.mx", "rene2018", uuid);
|
||||
|
||||
if (acuse.Estado == 0)
|
||||
{
|
||||
var xmlAcuse = new System.Xml.XmlDocument();
|
||||
xmlAcuse.LoadXml(DecodeBase64(acuse.CfdiB64));
|
||||
|
||||
CancelacionAcuse = xmlAcuse.GetElementsByTagName("SignatureValue")[0].InnerText;
|
||||
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes["Fecha"].Value.ToDate();
|
||||
}
|
||||
|
||||
var FueCancelado = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC);
|
||||
sb.AppendFormat("{0} <br/>", FueCancelado);
|
||||
if (CveEstatus.Contiene(4, 5) && EsRefacturacion)
|
||||
{
|
||||
Response.Redirect(string.Format("Ventas.aspx?CveDevolucion={0}&NuevaFactura=1", CveVenta));
|
||||
}
|
||||
}
|
||||
else if (resp.EstatusCancelacion.ToUpper() == "SOLICITUD RECHAZADA")
|
||||
{
|
||||
//ASIGNAMOS ESTATUS EMITIDA
|
||||
CveEstatus = 3;
|
||||
var ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
sb.Append("El estatus de la factura fue cambiado a 'Emitida'.");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append("Ocurrió un error al cambiar el estatus de la factura.");
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append("No se pudo comprobar la vigencia de la factura.");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
sb.Append("Error al consumir el servicio: " + ex.Message);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
private string CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion)
|
||||
{
|
||||
string Mensaje = "";
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
ClsOIEventos ObjEventos = new ClsOIEventos(ObjVentas.IniciaTransacSQL());
|
||||
ClsContabilidad ObjConta = new ClsContabilidad(ObjVentas.IniciaTransacSQL());
|
||||
ClsContPAQi ObjContPaq = null;
|
||||
|
||||
try
|
||||
{
|
||||
if (UsuarioActual.Empresa.UsaAC || UsuarioActual.Empresa.Funcionalidad(200) == "1")
|
||||
{
|
||||
ObjContPaq = new ClsContPAQi(UsuarioActual.Empresa);
|
||||
ObjContPaq.IniciaTransacSQL();
|
||||
}
|
||||
bool ErrorCancelar = false;
|
||||
var ErrorList = new List<string>();
|
||||
|
||||
int IDPoliza = -1;
|
||||
int CvePrePolizaCancelacion = -1;
|
||||
|
||||
// CANCELA PREPOLIZA
|
||||
ErrorCancelar = !ObjVentas.ProcesoPrepolizasCancelacion(CveVenta, UsuarioActual.CveUsuario);
|
||||
|
||||
if (ErrorCancelar)
|
||||
{
|
||||
Mensaje = "Ocurrió un error al generar la prepoliza de cancelación.";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjVentas.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
CvePrePolizaCancelacion = ObjVentas.DtResultados.FiltroPrimeroValor("CvePrepolizaCancelacion").ToEntero();
|
||||
if (CvePrePolizaCancelacion <= 0)
|
||||
{
|
||||
ErrorCancelar = true;
|
||||
Mensaje = "Ocurrió un error al generar la prepoliza de cancelación.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorCancelar = true;
|
||||
Mensaje = "Ocurrió un error al generar la prepoliza de cancelación.";
|
||||
}
|
||||
}
|
||||
|
||||
// POLIZA DE CANCELACION
|
||||
if (!ErrorCancelar)
|
||||
{
|
||||
if (UsuarioActual.Empresa.UsaAC)
|
||||
{
|
||||
IDPoliza = GenerarPolizaAC(ObjContPaq, CveVenta, Folio, CveCliente, TipoComprobante, DateTime.Now, true);
|
||||
if ((IDPoliza <= 0))
|
||||
{
|
||||
ErrorCancelar = true;
|
||||
Mensaje = "Ocurrió un error al generar la poliza de cancelación.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//AUTO CONTABILIDAD
|
||||
if (!ErrorCancelar)
|
||||
{
|
||||
if (UsuarioActual.Empresa.Funcionalidad(200) == "1" & !ErrorCancelar && CvePrePolizaCancelacion > 0)
|
||||
{
|
||||
if (!ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta: ObjContPaq))
|
||||
{
|
||||
ErrorCancelar = true;
|
||||
Mensaje = "Ocurrió un error al contabilizar. Favor de ponerse en contacto con Soporte Técnico";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ACTUALIZA ESTATUS
|
||||
if (!ErrorCancelar)
|
||||
{
|
||||
switch (TipoComprobante)
|
||||
{
|
||||
case "Rem":
|
||||
CveEstatus = 12;
|
||||
break;
|
||||
case "Com":
|
||||
CveEstatus = 9;
|
||||
break;
|
||||
}
|
||||
if (!ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion))
|
||||
{
|
||||
ErrorCancelar = true;
|
||||
Mensaje = "Ocurrió un error al guardar el estatus de cancelación.";
|
||||
}
|
||||
}
|
||||
|
||||
if (!ErrorCancelar)
|
||||
{
|
||||
if (ObjContPaq != null)
|
||||
{
|
||||
ObjContPaq.Commit();
|
||||
}
|
||||
ObjVentas.Commit();
|
||||
Mensaje = "El Documento se canceló correctamente";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjContPaq != null)
|
||||
{
|
||||
ObjContPaq.RollBack();
|
||||
}
|
||||
ObjVentas.RollBack();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ObjVentas.RollBack();
|
||||
if (ObjContPaq != null)
|
||||
{
|
||||
ObjContPaq.RollBack();
|
||||
}
|
||||
Mensaje = "Ocurrió un error al cancelar la factura";
|
||||
this.OnError(Mensaje, ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ObjVentas.Dispose();
|
||||
ObjEventos.Dispose();
|
||||
ObjConta.Dispose();
|
||||
if (ObjContPaq != null)
|
||||
{
|
||||
ObjContPaq.Dispose();
|
||||
}
|
||||
}
|
||||
return Mensaje;
|
||||
}
|
||||
|
||||
private int GenerarPolizaAC(ClsContPAQi ObjAC, int CveVenta, string Folio, int CveCliente, string TipoComprobante, DateTime Fecha, bool CancelacionIngreso = false)
|
||||
{
|
||||
int CtaCliente = 0;
|
||||
int OrdenPago = 0;
|
||||
string NombreCliente = "";
|
||||
|
||||
var ObjClientes = new ClsClientes();
|
||||
if (ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
CtaCliente = ObjClientes.IdCtaContClientes;
|
||||
NombreCliente = ObjClientes.NombreComercial;
|
||||
}
|
||||
ObjClientes.Dispose();
|
||||
|
||||
var ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (ObjVentas.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
OrdenPago = ObjVentas.DtResultados.Rows[0]["Num3"].ToEntero();
|
||||
}
|
||||
}
|
||||
|
||||
int Retorno = 0;
|
||||
int IDPoliza = 0;
|
||||
bool ErrorAC = false;
|
||||
string Concepto = string.Format("GD {0}", NombreCliente);
|
||||
int Paridad = 1;
|
||||
bool TipoMovto = false;
|
||||
if (CancelacionIngreso)
|
||||
{
|
||||
Concepto = string.Format("Cancelación GD {0}", NombreCliente);
|
||||
Paridad = -1;
|
||||
TipoMovto = true;
|
||||
}
|
||||
var TipoPoliza = TipoComprobante.Contiene("OP", "Com") ? 3 : 1;
|
||||
DataRow dr = null;
|
||||
int CtaISSSTESON = 643;
|
||||
int CtaISPT = 1745;
|
||||
var AC = new ClsAC();
|
||||
|
||||
//var ObjAC = new ClsContPAQi(UsuarioActual.Empresa);
|
||||
//ObjAC.IniciaTransacSQL();
|
||||
|
||||
IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, 0, 0, UsuarioActual.CveUsuario, Fecha);
|
||||
|
||||
if (IDPoliza > 0)
|
||||
{
|
||||
if (TipoComprobante == "OP")
|
||||
{
|
||||
//Orden de PAGO
|
||||
if (OrdenPago == 1)
|
||||
{
|
||||
//ISSSTESON
|
||||
if (ObjAC.AddMovimiento(IDPoliza, CtaCliente, false, (Paridad * 0d), "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
if (!ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, true, (Paridad * 0d), "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
ErrorAC = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ISPT
|
||||
if (ObjAC.AddMovimiento(IDPoliza, CtaCliente, false, (Paridad * 0d), "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
if (!ObjAC.AddMovimiento(IDPoliza, CtaISPT, true, (Paridad * 0d), "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
ErrorAC = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//NORMAL
|
||||
DataTable Detalles = null;
|
||||
DataTable DTPresupuestoIngresos = null;
|
||||
if (ObjVentas.GetVentaDetalle(CveVenta))
|
||||
{
|
||||
Detalles = ObjVentas.DtResultados.Copy();
|
||||
}
|
||||
if (AC.GetPresupuestoIngresos(-1, DateTime.Now.Year, true, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DTPresupuestoIngresos = AC.DtResultados.Copy();
|
||||
}
|
||||
|
||||
if (Detalles != null && DTPresupuestoIngresos != null)
|
||||
{
|
||||
var query = from gvr in Detalles.AsEnumerable()
|
||||
group gvr by gvr["CvePresupuestoIngreso"].ToString().ToEntero() into g
|
||||
select new { TotalImporte = g.Sum((x) => x["Total"].ToString().ToDouble()), CvePresupuestoIngreso = g.Key };
|
||||
|
||||
foreach (var item in query)
|
||||
{
|
||||
dr = DTPresupuestoIngresos.FiltroPrimero(string.Format("CvePresupuestoIngreso = {0}", item.CvePresupuestoIngreso));
|
||||
if (dr != null)
|
||||
{
|
||||
Concepto = string.Format("{0} - {1}: {2}", NombreCliente, TipoComprobante, Folio);
|
||||
if (ObjAC.AddMovimiento(IDPoliza, dr["IdCuentaPorEjecutar"].ToString().ToEntero(), false, (Paridad * item.TotalImporte), "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
if (ObjAC.AddMovimiento(IDPoliza, dr["IdCuentaDevengado"].ToString().ToEntero(), true, (Paridad * item.TotalImporte), "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
// CARGO la deuda del cliente
|
||||
if (ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, item.TotalImporte, "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
// abono,
|
||||
if (!ObjAC.AddMovimiento(IDPoliza, dr["IdCuentaMatriz"].ToString().ToEntero(), !TipoMovto, item.TotalImporte, "", Concepto, 0, Fecha, ""))
|
||||
{
|
||||
ErrorAC = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorAC = true;
|
||||
}
|
||||
|
||||
if (!ErrorAC)
|
||||
{
|
||||
ObjAC.AjustaPoliza(IDPoliza);
|
||||
Retorno = IDPoliza;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError);
|
||||
}
|
||||
AC.Dispose();
|
||||
ObjVentas.Dispose();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
private string DecodeBase64(string strXMLCodificado)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] decbuff = Convert.FromBase64String(strXMLCodificado);
|
||||
return System.Text.Encoding.UTF8.GetString(decbuff);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkValidar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (DtVentas != null)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (DataRow Row in DtVentas.Rows)
|
||||
{
|
||||
int CveVenta = Row["CveVenta"].ToEntero();
|
||||
string Total = Row["Total"].ToString();
|
||||
string SubTotal = Row["SubTotal"].ToString();
|
||||
string Uuid = Row["FolioFiscal"].ToString();
|
||||
string RFCCliente = Row["RFCCliente"].ToString();
|
||||
string Folio = Row["Folio"].ToString();
|
||||
string TipoDocto = Row["TipoDocto"].ToString();
|
||||
string Nombre = Row["Nombre"].ToString();
|
||||
int CveCliente = Row["CveCliente"].ToEntero();
|
||||
if (CveVenta > 0)
|
||||
{
|
||||
sb.AppendFormat("{0}<br/>", VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, SubTotal));
|
||||
}
|
||||
}
|
||||
Alert(sb.ToString());
|
||||
}
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0)
|
||||
{
|
||||
e.Row.Cells[8].Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
197
Ventas/RepComisiones.aspx
Normal file
197
Ventas/RepComisiones.aspx
Normal file
@@ -0,0 +1,197 @@
|
||||
<%@ Page Title="SIG | Reporte de Comisiones" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComisiones.aspx.vb" Inherits="Ventas_RepComisiones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
<li>
|
||||
<asp:HyperLink ID="HLModal" data-toggle="modal" data-target="#Modal" title="Ajuste Comisiones" runat="server"><i class="fa fa-pencil"></i> Ajuste comisiones</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Comisiones Vendedores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label style="max-width:80px;" class="col-md-1 truncate">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width:70px;" class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2" style="max-width:120px;">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width:90px;" class="col-md-1 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-2" style="max-width:140px;">
|
||||
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
<label style="max-width:80px;" class="col-md-1 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>Importes expresados en moneda nacional</h4>
|
||||
</div>
|
||||
<div class="col-md-6" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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" DataKeyNames="CveVendedor,Comision,FechaI,FechaF,ImporteAjuste" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Vendedor" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLVendedor" Target="_blank" Text='<%# Eval("Vendedor") %>' runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Importe Venta" DataField="ImporteVenta" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:BoundField HeaderText="Nivel" DataField="Nivel" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
|
||||
<%--<asp:BoundField HeaderText="Tipo Comision" DataField="TipoComisionTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:BoundField HeaderText="Comisión %" DataField="Comision" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Utilidad" DataField="Importe" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Ajuste" DataField="ImporteAjuste" Visible="false" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--<asp:BoundField HeaderText="Importe Venta" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
<asp:BoundField HeaderText="Comisión $" DataField="ComisionGanancia" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Importe Cobrado" DataField="Cobrado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Pendiente x Cobrar" DataField="Pendiente" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Total al Dia" DataField="PendienteXDia" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12" align="center">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button Text="Pagar Comisiones" ID="BtnPagar" OnClick="BtnPagar_Click" Visible="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea registrar el pago de comisiones?" data-btn-ok-label="si" CssClass="btn btn-primary" runat="server" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpModal" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div id="Modal" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Ajuste Comisiones</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpAjuste" runat="server">
|
||||
<ContentTemplate>
|
||||
<label class="col-md-2 truncate">Vendedor:</label>
|
||||
<div class="col-md-5">
|
||||
<asp:DropDownList ID="DdlVendedorAjuste" OnSelectedIndexChanged="DdlVendedorAjuste_SelectedIndexChanged" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVVendedor" runat="server" ControlToValidate="DdlVendedorAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAjuste"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEVendedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-2 truncate">Ajuste:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:TextBox Text="0" ID="TxtImporteAjuste" Width="80px" runat="server" />
|
||||
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars=".,-" />
|
||||
<%--<asp:RangeValidator ID="RVImporteAjuste" runat="server" Type="Currency" MinimumValue="0.01" MaximumValue="999999" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Ajuste''</b> debe ser mayor a cero. Por favor especifiquelo." ControlToValidate="TxtImporteAjuste" Display="None" ValidationGroup="GrpImporteAjuste"></asp:RangeValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste1" runat="server" HighlightCssClass="vco" TargetControlID="RVImporteAjuste" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe Ajuste''</b> es necesario. Por favor seleccione uno." InitialValue="" ValidationGroup="GrpImporteAjuste"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste2" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnGuardarAjuste" OnClick="BtnGuardarAjuste_Click" runat="server" Text="Guardar Ajuste" CssClass="btn btn-primary" ValidationGroup="GrpAjuste" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
215
Ventas/RepComisiones.aspx.vb
Normal file
215
Ventas/RepComisiones.aspx.vb
Normal file
@@ -0,0 +1,215 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Ventas_RepComisiones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
InicializaValores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
|
||||
Private Sub InicializaValores()
|
||||
txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
DdlVendedorAjuste.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedorAjuste.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones()
|
||||
|
||||
Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
|
||||
Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha)
|
||||
|
||||
If ObjComisiones.GetRepComisiones(DdlVendedor.SelectedValue.ToEntero, FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjComisiones.DtResultados
|
||||
If ObjComisiones.DtResultados.SUM("ImporteAjuste") <> 0 Then
|
||||
GvDatos.Columns(5).Visible = True
|
||||
End If
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjComisiones.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
If GvDatos.Rows.Count > 0 Then
|
||||
BtnPagar.Visible = True
|
||||
ImgExcel.Visible = True
|
||||
Else
|
||||
BtnPagar.Visible = False
|
||||
ImgExcel.Visible = False
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GV DATOS "
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim CveVendedorURL = DdlVendedor.SelectedValue.ToEntero
|
||||
|
||||
If e.Row.DBCampo("CveVendedor") = "" Then
|
||||
e.Row.FCHyperLink("HLVendedor").Text = "Total"
|
||||
e.Row.CssClass = "SubTotales"
|
||||
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
|
||||
Else
|
||||
CveVendedorURL = e.Row.DBCampo("CveVendedor").ToEntero
|
||||
End If
|
||||
|
||||
e.Row.FCHyperLink("HLVendedor").NavigateUrl = String.Format("/Ventas/RepComisionesDetalle.aspx?CveVendedor={0}&FI={1}&FF={2}&CveSubProyecto={3}", CveVendedorURL, If(txtFechaI.Text.Trim() = "", "-1", txtFechaI.Text.Trim()), If(txtFechaF.Text.Trim() = "", "-1", txtFechaF.Text.Trim()), DdlSubProyecto.SelectedValue.ToEntero)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " PAGAR COMISIONES "
|
||||
Protected Sub BtnPagar_Click(sender As Object, e As EventArgs)
|
||||
If Not GvDatos.Rows.Count > 0 Then
|
||||
Alert("No se encuentra ninguna comision por pagar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones
|
||||
ObjComisiones.IniciaTransacSQL()
|
||||
Dim TieneError = False
|
||||
|
||||
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||
If Gvr.DataKey("CveVendedor").ToString.ToEntero > 0 Then
|
||||
|
||||
If ObjComisiones.GetComisionesPagadas(Gvr.DataKey("Comision").ToString.ToDouble,
|
||||
Gvr.DataKey("CveVendedor").ToString.ToEntero,
|
||||
Gvr.DataKey("FechaI").ToString.ToDate,
|
||||
Gvr.DataKey("FechaF").ToString.ToDate,
|
||||
UsuarioActual.CveEmpresa) Then
|
||||
|
||||
For Each Dr As DataRow In ObjComisiones.DtResultados.Rows
|
||||
If Not ObjComisiones.AddComisionesPagadas(Dr("CveVenta").ToString.ToEntero,
|
||||
Dr("CveVendedor").ToString.ToEntero,
|
||||
Dr("ImporteVenta").ToString.ToDouble,
|
||||
Dr("CostoVenta").ToString.ToDouble,
|
||||
Dr("UtilidadVenta").ToString.ToDouble,
|
||||
Dr("TipoComision").ToString.ToEntero,
|
||||
Dr("ComisionPorcentaje").ToString.ToDouble,
|
||||
Dr("ComisionImporte").ToString.ToDouble,
|
||||
Dr("ImporteAjuste").ToString.ToDouble,
|
||||
UsuarioActual.CveUsuario) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjComisiones.Commit()
|
||||
Alert("Las comisiones se registraron correctamente.", TipoMensaje.MsgInformacion)
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
Else
|
||||
ObjComisiones.RollBack()
|
||||
Alert("Ocurrió un error al registrar las comisiones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjComisiones.Dispose()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " AJUSTE "
|
||||
Protected Sub DdlVendedorAjuste_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones
|
||||
|
||||
If ObjComisiones.GetAjusteComisiones(DdlVendedorAjuste.SelectedValue.ToEntero) Then
|
||||
If ObjComisiones.DtResultados.Rows.Count = 1 Then
|
||||
TxtImporteAjuste.Text = ObjComisiones.DtResultados.Rows(0)("Importe").ToString.FormatoNumero
|
||||
UpAjuste.Update()
|
||||
End If
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener el ajuste de comisiones del vendedor. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjComisiones.Dispose()
|
||||
End Sub
|
||||
Protected Sub BtnGuardarAjuste_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones
|
||||
Dim TieneError = False
|
||||
|
||||
If ObjComisiones.AddUpdateAjusteComisiones(DdlVendedorAjuste.SelectedValue.ToEntero, TxtImporteAjuste.Text.ToDecimal) Then
|
||||
Alert("El ajuste de comisiones se guardo correctamente.", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al guardar el ajuste de comisiones. Por favor vuelva a intentar", TipoMensaje.MsgError)
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
ObjComisiones.Dispose()
|
||||
|
||||
If Not TieneError Then
|
||||
DdlVendedorAjuste.SelectedValue = "-1"
|
||||
TxtImporteAjuste.Text = "0"
|
||||
RegistraScript("$('#Modal').modal('hide');")
|
||||
UpAjuste.Update()
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " EXCEL "
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvDatos.ExportToExcel("ReporteComisiones_" & Now.ToShortDateString)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
139
Ventas/RepComisionesDetalle.aspx
Normal file
139
Ventas/RepComisionesDetalle.aspx
Normal file
@@ -0,0 +1,139 @@
|
||||
<%@ Page Title="SIG | Reporte de Comisiones Detalle" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComisionesDetalle.aspx.vb" Inherits="Ventas_RepComisionesDetalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.sinlink td a {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
color: black;
|
||||
font-size: small;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Comisiones Vendedores Detalle
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label style="max-width: 80px;" class="col-md-1 truncate">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width: 70px;" class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2" style="max-width: 120px;">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width: 90px;" class="col-md-1 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-2" style="max-width: 140px;">
|
||||
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
<label style="max-width: 80px;" class="col-md-1 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>Importes expresados en moneda nacional</h4>
|
||||
</div>
|
||||
<div class="col-md-6" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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 encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Venta" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLVenta" Target="_blank" Text='<%# Eval("SerieFolio") %>' runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Venta Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Venta Importe" DataField="ImporteVenta" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Venta Costo" DataField="CostoVenta" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Venta Utilidad" DataField="UtilidadVenta" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="% Utilidad" DataField="UtilidadPorcentaje" DataFormatString="{0:N2}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--<asp:BoundField HeaderText="Tipo Comision" DataField="TipoComisionTexto" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:BoundField HeaderText="Comision %" DataField="Comision" DataFormatString="{0:N2}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
|
||||
<%--<asp:BoundField HeaderText="Importe" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
<%--<asp:BoundField HeaderText="Importe Venta" DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
<asp:TemplateField HeaderText="Comision Ganancia" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLGanancia" Target="_blank" Text='<%# Eval("ComisionGanancia", "{0:N2}") %>' runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--<asp:BoundField HeaderText="Comision Ganancia" DataField="ComisionGanancia" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
115
Ventas/RepComisionesDetalle.aspx.vb
Normal file
115
Ventas/RepComisionesDetalle.aspx.vb
Normal file
@@ -0,0 +1,115 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class Ventas_RepComisionesDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
InicializaValores()
|
||||
CargaParametrosUrl()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
|
||||
Private Sub InicializaValores()
|
||||
txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataBind()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA PARAMETROS URL "
|
||||
Private Sub CargaParametrosUrl()
|
||||
Dim FechaI, FechaF, CveVendedor, CveSubProyecto As String
|
||||
|
||||
CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor").ToEntero() > 0, Request("CveVendedor").ToEntero(), -1).ToString
|
||||
CveSubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() > 0, Request("CveSubProyecto").ToEntero(), -1).ToString
|
||||
FechaI = If(Request("FI") IsNot Nothing, Request("FI").ToString, "-1").ToString
|
||||
FechaF = If(Request("FF") IsNot Nothing, Request("FF").ToString, "-1").ToString
|
||||
|
||||
txtFechaI.Text = If(FechaI = "1", "", FechaI)
|
||||
txtFechaF.Text = If(FechaI = "1", "", FechaF)
|
||||
DdlVendedor.SelectedValue = CveVendedor
|
||||
DdlSubProyecto.SelectedValue = CveSubProyecto
|
||||
|
||||
BtnConsultar_Click(BtnConsultar, EventArgs.Empty)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones()
|
||||
|
||||
Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
|
||||
Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha)
|
||||
|
||||
If ObjComisiones.GetRepComisionesDetalle(DdlVendedor.SelectedValue.ToEntero, FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjComisiones.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If ObjComisiones.DtResultados.Rows.Count > 0 Then
|
||||
ImgExcel.Visible = True
|
||||
Else
|
||||
ImgExcel.Visible = False
|
||||
End If
|
||||
|
||||
ObjComisiones.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GV DATOS "
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("CveVenta") = "" Then
|
||||
e.Row.FCHyperLink("HLVenta").NavigateUrl = ""
|
||||
e.Row.FCHyperLink("HLVenta").Text = e.Row.DBCampo("Vendedor")
|
||||
e.Row.CssClass = "SubTotales"
|
||||
e.Row.Cells(0).CssClass = "SubTotales sinlink"
|
||||
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
|
||||
ElseIf e.Row.DBCampo("CveVenta") = "99999999999" Then
|
||||
e.Row.Cells(5).Text = ""
|
||||
Else
|
||||
e.Row.FCHyperLink("HLVenta").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"))
|
||||
End If
|
||||
|
||||
e.Row.FCHyperLink("HLGanancia").NavigateUrl = String.Format("/Ventas/RepComisionesDetallePS.aspx?CveVendedor={0}&FI={1}&FF={2}&CveVenta={3}&CveSubProyecto={4}", e.Row.DBCampo("CveVendedor"), If(txtFechaI.Text.Trim() = "", "-1", txtFechaI.Text.Trim()), If(txtFechaF.Text.Trim() = "", "-1", txtFechaF.Text.Trim()), If(e.Row.DBCampo("CveVenta") = "", "-1", e.Row.DBCampo("CveVenta")), DdlSubProyecto.SelectedValue.ToEntero)
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " EXCEL "
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvDatos.ExportToExcel("ReporteComisionesDetalle_" & Now.ToShortDateString)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
137
Ventas/RepComisionesDetallePS.aspx
Normal file
137
Ventas/RepComisionesDetallePS.aspx
Normal file
@@ -0,0 +1,137 @@
|
||||
<%@ Page Title="SIG | Reporte de Comisiones Detalle" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepComisionesDetallePS.aspx.vb" Inherits="Ventas_RepComisionesDetallePS" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</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;
|
||||
}
|
||||
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Comisiones Vendedores Detalle - Producto/Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-Width="35%">
|
||||
<ItemStyle Width="35%" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField HeaderText="Venta Importe" DataField="ImporteVenta" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemStyle HorizontalAlign="Right" Width="10%" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField HeaderText="Venta Costo" DataField="CostoVenta" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemStyle HorizontalAlign="Right" Width="10%" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField HeaderText="Venta Utilidad" DataField="UtilidadVenta" DataFormatString="{0:N2}" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemStyle HorizontalAlign="Right" Width="10%" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField HeaderText="% Utilidad">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# (cdbl(Eval("UtilidadVenta")) / cdbl(Eval("ImporteVenta")) * 100).Tostring("N2") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" Width="5%" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Comision %" DataField="Comision" DataFormatString="{0:N2}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemStyle HorizontalAlign="Right" Width="5%" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField HeaderText="Comision Ganancia" DataField="ComisionGanancia" DataFormatString="{0:N2}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" >
|
||||
<ItemStyle HorizontalAlign="Right" Width="15%" />
|
||||
</asp:BoundField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
|
||||
<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;
|
||||
}
|
||||
$('#GvDatos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
69
Ventas/RepComisionesDetallePS.aspx.vb
Normal file
69
Ventas/RepComisionesDetallePS.aspx.vb
Normal file
@@ -0,0 +1,69 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class Ventas_RepComisionesDetallePS
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaParametrosUrl()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " CARGA PARAMETROS URL "
|
||||
Private Sub CargaParametrosUrl()
|
||||
Dim FechaI, FechaF As String
|
||||
Dim CveVendedor, CveVenta, CveSubProyecto As Integer
|
||||
|
||||
CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor").ToEntero() > 0, Request("CveVendedor").ToEntero(), -1)
|
||||
CveSubProyecto = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() > 0, Request("CveSubProyecto").ToEntero(), -1)
|
||||
CveVenta = If(Request("CveVenta") IsNot Nothing AndAlso Request("CveVenta").ToEntero() > 0, Request("CveVenta").ToEntero(), -1)
|
||||
FechaI = If(Request("FI") IsNot Nothing, Request("FI").ToString, "-1").ToString
|
||||
FechaF = If(Request("FF") IsNot Nothing, Request("FF").ToString, "-1").ToString
|
||||
|
||||
CargaDatos(CveVendedor, FechaI, FechaF, CveVenta, CveSubProyecto)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos(CveVendedor As Integer, FI As String, FF As String, CveVenta As Integer, CveSubProyecto As Integer)
|
||||
|
||||
Dim FechaI = If(IsDate(FI), FI.ToDate, MinFecha)
|
||||
Dim FechaF = If(IsDate(FF), FF.ToDate, MaxFecha)
|
||||
|
||||
Dim ObjComisiones As New ClsEsquemasComisiones()
|
||||
If ObjComisiones.GetRepComisionesDetallePS(CveVendedor, FechaI, FechaF, CveVenta, CveSubProyecto, UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjComisiones.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjComisiones.Dispose()
|
||||
|
||||
|
||||
If (GvDatos.Rows.Count > 0) Then
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
ImgExcel.Visible = True
|
||||
Else
|
||||
ImgExcel.Visible = False
|
||||
End If
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " EXCEL "
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvDatos.ExportToExcel("ReporteComisionesDetalle_" & Now.ToShortDateString)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
156
Ventas/RepComisionesJAM.aspx
Normal file
156
Ventas/RepComisionesJAM.aspx
Normal file
@@ -0,0 +1,156 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepComisionesJAM.aspx.cs" Inherits="Ventas_RepComisionesJAM" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Comisiones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Sucursal:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Fecha Inicial:</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: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" Text="01/09/2017" CausesValidation="true" Width="98%" 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>
|
||||
</div>
|
||||
<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: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="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<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>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-1 ">Fecha Final:</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: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" Text="31/08/2018" CausesValidation="true" Width="98%" 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>
|
||||
</div>
|
||||
<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: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="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<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>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Cliente:</label>
|
||||
<div class="col-md-3">
|
||||
<ADS:Dropdownlost ID="DdlCliente" runat="server" CssStyle="width: 95%;" DataTextField="NombreComercial" DataValueField="CveCliente"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<label class="col-md-1 ">Vendedor:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Tipo Saldo:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlTipoSaldo" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="70%">
|
||||
<asp:ListItem Text="Pagadas" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server"
|
||||
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares"
|
||||
EmptyDataText="No se han encontrado datos con los filtros especificados." data-sort="true" GridLines="None"
|
||||
CssClass="table table-hover table-striped Widthall ScrollAD " Width="100%" AutoGenerateColumns="False"
|
||||
OnRowDataBound="GvDatos_RowDataBound" OnPreRender="GvDatos_PreRender" >
|
||||
<Columns>
|
||||
<%-- 0 --%>
|
||||
<asp:HyperLinkField DataTextField="Nombre" Target="_blank" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 1 --%>
|
||||
<asp:BoundField DataField="Transaccion" HeaderText="Transac." ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 2 --%>
|
||||
<asp:HyperLinkField DataTextField="FolioPago" Target="_blank" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" HeaderText="Folio Pago" ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 3 --%>
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Folio Venta" ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 4 --%>
|
||||
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 5 --%>
|
||||
<asp:BoundField DataField="FechaDocumento" HeaderText="Fecha Doc." ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<%-- 6 --%>
|
||||
<asp:BoundField DataField="FechaPago" HeaderText="Fecha Pago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<%-- 7 --%>
|
||||
<asp:BoundField DataField="DiasPago" HeaderText="Dias Pago" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 8 --%>
|
||||
<asp:BoundField DataField="Remision" HeaderText="Dias Rem." ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 9 --%>
|
||||
<asp:BoundField DataField="TotDias" HeaderText="Total Dias" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 10 --%>
|
||||
<asp:BoundField DataField="SubTotal" HeaderText="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 11 --%>
|
||||
<asp:BoundField DataField="SubTotalPago" HeaderText="SubTotal Pago" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 12 --%>
|
||||
<asp:BoundField DataField="Moneda" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 13 --%>
|
||||
<asp:BoundField DataField="TipoCambio" HeaderText="TC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
|
||||
<%-- 14 --%>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Articulo" ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- 15 --%>
|
||||
<asp:BoundField DataField="Costo" HeaderText="Costo" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 16 --%>
|
||||
<asp:BoundField DataField="PLista" HeaderText="P.L." DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 17 --%>
|
||||
<asp:BoundField DataField="PVenta" HeaderText="P.V." DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 18 --%>
|
||||
<asp:BoundField DataField="ImportePS" HeaderText="Imp. Vta." DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 19 --%>
|
||||
<asp:BoundField DataField="Descuento" HeaderText="Descto." DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 20 --%>
|
||||
<asp:BoundField DataField="DescNC" HeaderText="Descto NC." DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 21 --%>
|
||||
<asp:BoundField DataField="Comision" HeaderText="Comision" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<%-- 22 --%>
|
||||
<asp:BoundField DataField="PorcentajeComision" HeaderText="% Comision" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
337
Ventas/RepComisionesJAM.aspx.cs
Normal file
337
Ventas/RepComisionesJAM.aspx.cs
Normal file
@@ -0,0 +1,337 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
using System.Web.UI;
|
||||
|
||||
public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
{
|
||||
|
||||
#region PROPIEDADES
|
||||
|
||||
private DataTable DtDatos
|
||||
{
|
||||
get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
|
||||
set { ViewState["DtDatos"] = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializaValores()
|
||||
{
|
||||
txtFechaI.Text = String.Format("01/{0}/{1}", DateTime.Now.Month, DateTime.Now.Year);
|
||||
txtFechaF.Text = String.Format("{0}/{1}/{2}", DateTime.Now.AddMonths(1).FirstDayOfMonth().AddDays(-1).Day, DateTime.Now.Month, DateTime.Now.Year);
|
||||
|
||||
if (UsuarioActual.CveUsuario == 1835) // usuario de alejandra alvarez
|
||||
{
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1);
|
||||
}
|
||||
DdlSubProyecto.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlSubProyecto.DataBind();
|
||||
|
||||
DdlCliente.setEsWebService(true);
|
||||
DdlCliente.Attributes.Add("data-metodo", "getcliente");
|
||||
DdlCliente.SelectedValue = "-1";
|
||||
DdlCliente.SelectedText = "Todos";
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlVendedor.DataBind();
|
||||
|
||||
if( UsuarioActual.CveVendedor > 0 && !UsuarioActual.TienePermisoProceso(263))
|
||||
{
|
||||
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString());
|
||||
DdlVendedor.Attributes.Add("disabled", "disabled");
|
||||
DdlVendedor.Enabled = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
GvDatos.Columns[15].Visible = UsuarioActual.TienePermisoProceso(201);
|
||||
|
||||
}
|
||||
|
||||
private void Consulta()
|
||||
{
|
||||
ClsVentas ObjVenta = new ClsVentas();
|
||||
if (ObjVenta.GetRepComisiones(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlSubProyecto.SelectedValue.ToEntero(), DdlVendedor.SelectedValue.ToEntero(), DdlCliente.SelectedValue.ToEntero(),
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTipoSaldo.SelectedValue.ToEntero()))
|
||||
{
|
||||
GvDatos.DataSource = ObjVenta.DtResultados;
|
||||
DtDatos = ObjVenta.DtResultados;
|
||||
}
|
||||
ObjVenta.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Consulta();
|
||||
}
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
|
||||
{
|
||||
|
||||
if (e.Row.RowIndex == 0)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
//e.Row.Cells[0].Text = "Total";
|
||||
}
|
||||
else if (e.Row.DBCampo("CveVendedor").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales";
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("SubProyecto").ToString();
|
||||
}
|
||||
else if (e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "SubTotales2";
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago")
|
||||
{
|
||||
if (e.Row.DBCampo("CveCategoria").ToEntero() < 1)
|
||||
{
|
||||
if (UsuarioActual.TienePermisoProceso(201))
|
||||
{
|
||||
e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Row.Cells[20].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria especificada.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if (e.Row.DBCampo("CveMoneda").ToEntero() != 1)
|
||||
//{
|
||||
// e.Row.Cells[15].Text = $"{e.Row.DBCampo("Costo").FormatoNumero()} <br> {e.Row.DBCampo("CostoDolares").FormatoNumero()}";
|
||||
// //e.Row.FCLabel("LblCostoDolares").Visible = false;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// e.Row.Cells[13].Text = "";
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void VerifyRenderingInServerForm(Control control)
|
||||
{
|
||||
//base.VerifyRenderingInServerForm(control);
|
||||
}
|
||||
|
||||
protected void LnkExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GvDatos.ExportToExcelG("Reporte de Comisiones", "Reporte de Comisiones",UsuarioActual);
|
||||
//GenerarPDFCrystal("EXCEL");
|
||||
}
|
||||
|
||||
|
||||
public void MergeRows(GridView gridView)
|
||||
{
|
||||
for (int rowIndex = gridView.Rows.Count - 2; rowIndex > 0; rowIndex--)
|
||||
{
|
||||
GridViewRow row = gridView.Rows[rowIndex];
|
||||
GridViewRow previousRow = gridView.Rows[rowIndex + 1];
|
||||
if (row.DataKey("CveVendedor").ToString().ToEntero() > 0 && row.DataKey("CveSubProyecto").ToString().ToEntero() > 0)
|
||||
{
|
||||
if (row.DataKey("CveCliente").ToString().ToEntero() == previousRow.DataKey("CveCliente").ToString().ToEntero())
|
||||
{
|
||||
row.Cells[0].RowSpan = previousRow.Cells[0].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[0].RowSpan + 1;
|
||||
previousRow.Cells[0].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["Nombre"] = "";
|
||||
}
|
||||
|
||||
if (row.DataKey("CveVenta").ToString().ToEntero() == previousRow.DataKey("CveVenta").ToString().ToEntero())
|
||||
{
|
||||
|
||||
row.Cells[3].RowSpan = previousRow.Cells[3].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[3].RowSpan + 1;
|
||||
previousRow.Cells[3].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["SerieFolio"] = "";
|
||||
|
||||
row.Cells[4].RowSpan = previousRow.Cells[4].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[4].RowSpan + 1;
|
||||
previousRow.Cells[4].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["Saldo"] = DBNull.Value;
|
||||
|
||||
row.Cells[5].RowSpan = previousRow.Cells[5].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[5].RowSpan + 1;
|
||||
previousRow.Cells[5].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["FechaDocumento"] = DBNull.Value;
|
||||
|
||||
row.Cells[10].RowSpan = previousRow.Cells[10].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[10].RowSpan + 1;
|
||||
previousRow.Cells[10].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["SubTotal"] = DBNull.Value;
|
||||
|
||||
|
||||
|
||||
//row.Cells[11].RowSpan = previousRow.Cells[11].RowSpan < 2 ? 2 :
|
||||
//previousRow.Cells[11].RowSpan + 1;
|
||||
//previousRow.Cells[11].Visible = false;
|
||||
//DtDatos.Rows[rowIndex]["IVA"] = DBNull.Value;
|
||||
}
|
||||
|
||||
if (row.DataKey("Transaccion").ToString() == "Pago")
|
||||
{
|
||||
if (row.DataKey("CveIE").ToString().ToEntero() == previousRow.DataKey("CveIE").ToString().ToEntero() && row.DataKey("Transaccion").ToString() == previousRow.DataKey("Transaccion").ToString())
|
||||
{
|
||||
row.Cells[1].RowSpan = previousRow.Cells[1].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[1].RowSpan + 1;
|
||||
previousRow.Cells[1].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["Transaccion"] = "";
|
||||
|
||||
row.Cells[2].RowSpan = previousRow.Cells[2].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[2].RowSpan + 1;
|
||||
previousRow.Cells[2].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["FolioPago"] = "";
|
||||
|
||||
}
|
||||
|
||||
if (row.DataKey("CveIE").ToString().ToEntero() == previousRow.DataKey("CveIE").ToString().ToEntero() && row.DataKey("CveVenta").ToString().ToEntero() == previousRow.DataKey("CveVenta").ToString().ToEntero())
|
||||
{
|
||||
row.Cells[6].RowSpan = previousRow.Cells[6].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[6].RowSpan + 1;
|
||||
previousRow.Cells[6].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["FechaPago"] = DBNull.Value;
|
||||
|
||||
row.Cells[7].RowSpan = previousRow.Cells[7].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[7].RowSpan + 1;
|
||||
previousRow.Cells[7].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["DiasPago"] = DBNull.Value;
|
||||
|
||||
row.Cells[11].RowSpan = previousRow.Cells[11].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[11].RowSpan + 1;
|
||||
previousRow.Cells[11].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["SubTotalPago"] = DBNull.Value;
|
||||
|
||||
row.Cells[10].RowSpan = previousRow.Cells[10].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[10].RowSpan + 1;
|
||||
previousRow.Cells[10].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["SubTotal"] = DBNull.Value;
|
||||
|
||||
row.Cells[9].RowSpan = previousRow.Cells[9].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[9].RowSpan + 1;
|
||||
previousRow.Cells[9].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["TotDias"] = DBNull.Value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (row.DataKey("Transaccion").ToString() == "Nota Crédito" || row.DataKey("Transaccion").ToString() == "Devolución")
|
||||
{
|
||||
row.Cells[2].Text = "";
|
||||
if (row.DataKey("CveVenta").ToString().ToEntero() == previousRow.DataKey("CveVenta").ToString().ToEntero() && row.DataKey("Transaccion").ToString() == previousRow.DataKey("Transaccion").ToString())
|
||||
{
|
||||
row.Cells[1].RowSpan = previousRow.Cells[1].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[1].RowSpan + 1;
|
||||
previousRow.Cells[1].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["Transaccion"] = "";
|
||||
|
||||
row.Cells[2].RowSpan = previousRow.Cells[2].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[2].RowSpan + 1;
|
||||
previousRow.Cells[2].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["FolioPago"] = "";
|
||||
|
||||
row.Cells[6].RowSpan = previousRow.Cells[6].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[6].RowSpan + 1;
|
||||
previousRow.Cells[6].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["FechaPago"] = DBNull.Value;
|
||||
|
||||
row.Cells[7].RowSpan = previousRow.Cells[7].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[7].RowSpan + 1;
|
||||
previousRow.Cells[7].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["DiasPago"] = DBNull.Value;
|
||||
|
||||
row.Cells[9].RowSpan = previousRow.Cells[9].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[9].RowSpan + 1;
|
||||
previousRow.Cells[9].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["TotDias"] = DBNull.Value;
|
||||
|
||||
row.Cells[10].RowSpan = previousRow.Cells[10].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[10].RowSpan + 1;
|
||||
previousRow.Cells[10].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["SubTotal"] = DBNull.Value;
|
||||
|
||||
row.Cells[11].RowSpan = previousRow.Cells[11].RowSpan < 2 ? 2 :
|
||||
previousRow.Cells[11].RowSpan + 1;
|
||||
previousRow.Cells[11].Visible = false;
|
||||
DtDatos.Rows[rowIndex]["SubTotalPago"] = DBNull.Value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void GvDatos_PreRender(object sender, EventArgs e)
|
||||
{
|
||||
MergeRows(GvDatos);
|
||||
}
|
||||
|
||||
private void GenerarPDFCrystal(string Formato = "PDF")
|
||||
{
|
||||
System.IO.FileInfo Imagen = new System.IO.FileInfo(string.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
|
||||
|
||||
var logouri = string.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
|
||||
|
||||
var Sucursal = DdlSubProyecto.SelectedValue == "-1" ? "" : String.Format("Cliente: {0} ", DdlSubProyecto.SelectedItem.Text);
|
||||
var Cliente = DdlCliente.SelectedValue == "-1" ? "" : String.Format("Cliente: {0} ", DdlCliente.SelectedText);
|
||||
var Vendedor = DdlVendedor.SelectedValue == "-1" ? "" : String.Format("Vendedor: {0} ", DdlVendedor.SelectedItem.Text);
|
||||
var TipoSaldo = DdlTipoSaldo.SelectedValue == "-1" ? "" : String.Format("Tipo Saldo: {0} ", DdlTipoSaldo.SelectedItem.Text);
|
||||
|
||||
string FechaIn = String.Format("Fecha Inicio: {0} ", txtFechaI.Text);
|
||||
string FechaFn = String.Format("Fecha Fin: {0} ", txtFechaF.Text);
|
||||
|
||||
var lista = new List<CrystalParametro>();
|
||||
|
||||
lista.Add(new CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa));
|
||||
lista.Add(new CrystalParametro("Filtros", String.Format("{0}{1}{2}{3}{4}{5}", Sucursal, Cliente, Vendedor, FechaIn, FechaFn, TipoSaldo)));
|
||||
|
||||
lista.Add(new CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
lista.Add(new CrystalParametro("FechaImpresion", DateTime.Now.ToString()));
|
||||
|
||||
string PermisoCosto = "";
|
||||
if (UsuarioActual.TienePermisoProceso(201)) { PermisoCosto = "1";} else { PermisoCosto = "0"; }
|
||||
lista.Add(new CrystalParametro("PermisoCosto", PermisoCosto));
|
||||
|
||||
if (Imagen.Exists)
|
||||
{
|
||||
lista.Add(new CrystalParametro("ImagenPath", logouri));
|
||||
}
|
||||
else
|
||||
{
|
||||
lista.Add(new CrystalParametro("ImagenPath", ""));
|
||||
103
Ventas/RepComisionesJAM2.aspx
Normal file
103
Ventas/RepComisionesJAM2.aspx
Normal file
@@ -0,0 +1,103 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepComisionesJAM2.aspx.cs" Inherits="Ventas_RepComisionesJAM2" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Reporte de Comisiones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" OnClick="BtnConsultar_Click" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label style="max-width:80px;" class="col-md-1 truncate">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width:70px;" class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2" style="max-width:120px;">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width:90px;" class="col-md-1 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-2" style="max-width:140px;">
|
||||
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
<label style="max-width:80px;" class="col-md-1 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>Importes expresados en moneda nacional</h4>
|
||||
</div>
|
||||
<div class="col-md-6" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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" DataKeyNames="CveVendedor" runat="server" AutoGenerateColumns="False"
|
||||
EmptyDataText="No se encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None"
|
||||
OnRowDataBound="GvDatos_RowDataBound" >
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="Vendedor" HeaderText="Vendedor" DataNavigateUrlFields="CveVendedor,CveSubProyecto,FechaI,FechaF" DataNavigateUrlFormatString="/Ventas/RepComisionesJAM2Detalle.aspx?CveVendedor={0}&CveSubProyecto={1}&FechaI={2}&FechaF={3}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Importe Venta" DataField="ImporteVenta" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Notas de Credito" DataField="ImporteNC" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Comisión %" DataField="PorcentajeComision" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Comisión $" DataField="Comision" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Cartera %" DataField="PorcentajeCartera" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
64
Ventas/RepComisionesJAM2.aspx.cs
Normal file
64
Ventas/RepComisionesJAM2.aspx.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Ventas_RepComisionesJAM2 : ClsPaginas
|
||||
{
|
||||
#region PROPIEDADES
|
||||
|
||||
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializaValores()
|
||||
{
|
||||
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
|
||||
txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.DataBind();
|
||||
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
DdlSubProyecto.DataBind();
|
||||
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsEsquemasComisiones ObjComisiones = new ClsEsquemasComisiones();
|
||||
|
||||
DateTime FechaI, FechaF;
|
||||
if (txtFechaI.Text != "") { FechaI = txtFechaI.Text.ToDate(); } else { FechaI = DateTime.MinValue; }
|
||||
if (txtFechaF.Text != "") { FechaF = txtFechaF.Text.ToDate(); } else { FechaF = DateTime.MaxValue; }
|
||||
|
||||
if (ObjComisiones.GetRepComisiones2(DdlVendedor.SelectedValue.ToEntero(), FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjComisiones.DtResultados;
|
||||
}
|
||||
ObjComisiones.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DBCampo("CveVendedor").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
}
|
||||
}
|
||||
}
|
||||
105
Ventas/RepComisionesJAM2Detalle.aspx
Normal file
105
Ventas/RepComisionesJAM2Detalle.aspx
Normal file
@@ -0,0 +1,105 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepComisionesJAM2Detalle.aspx.cs" Inherits="Ventas_RepComisionesJAM2Detalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Reporte de Comisiones Detalle
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" OnClick="BtnConsultar_Click" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label style="max-width:80px;" class="col-md-1 truncate">Vendedor:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width:70px;" class="col-md-1 truncate">Sucursal:</label>
|
||||
<div class="col-md-2" style="max-width:120px;">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label style="max-width:90px;" class="col-md-1 truncate">Fecha Inicio:</label>
|
||||
<div class="col-md-2" style="max-width:140px;">
|
||||
<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="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
<label style="max-width:80px;" class="col-md-1 truncate">Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<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="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" 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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>Importes expresados en moneda nacional</h4>
|
||||
</div>
|
||||
<div class="col-md-6" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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" DataKeyNames="CveVendedor" runat="server" AutoGenerateColumns="False"
|
||||
EmptyDataText="No se encontraron Comisiones con los filtros especificados" ToolTip="Listado de Comisiones" data-sort="true" CssClass="table table-striped table-hover Widthall SCrollAD" GridLines="None"
|
||||
OnRowDataBound="GvDatos_RowDataBound" >
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" HeaderText="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Fecha" ItemStyle-Width="5%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Importe Venta" DataField="ImporteVenta" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Notas de Credito" DataField="ImporteNC" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Utilidad" DataField="Utilidad" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Comisión %" DataField="PorcentajeComision" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Comisión $" DataField="Comision" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="DiasPago" HeaderText="Dias" DataFormatString="{0:#,##0.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Cartera %" DataField="PorcentajeCartera" DataFormatString="{0:###,###,##0.00}%" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
80
Ventas/RepComisionesJAM2Detalle.aspx.cs
Normal file
80
Ventas/RepComisionesJAM2Detalle.aspx.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class Ventas_RepComisionesJAM2Detalle : ClsPaginas
|
||||
{
|
||||
#region PROPIEDADES
|
||||
|
||||
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializaValores()
|
||||
{
|
||||
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
|
||||
txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.DataBind();
|
||||
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
DdlSubProyecto.DataBind();
|
||||
|
||||
DdlVendedor.SelectedValueExist(Request["CveVendedor"] == null ? "-1" : Request["CveVendedor"].ToString());
|
||||
DdlSubProyecto.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString());
|
||||
|
||||
txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.FirstDayOfMonth().ToShortDateString() : Request["FechaI"].ToString();
|
||||
txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.LastDayOfMonth().ToShortDateString() : Request["FechaF"].ToString();
|
||||
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsEsquemasComisiones ObjComisiones = new ClsEsquemasComisiones();
|
||||
|
||||
DateTime FechaI, FechaF;
|
||||
if (txtFechaI.Text != "") { FechaI = txtFechaI.Text.ToDate(); } else { FechaI = DateTime.MinValue; }
|
||||
if (txtFechaF.Text != "") { FechaF = txtFechaF.Text.ToDate(); } else { FechaF = DateTime.MaxValue; }
|
||||
|
||||
if (ObjComisiones.GetRepComisiones2Detalle(DdlVendedor.SelectedValue.ToEntero(), FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjComisiones.DtResultados;
|
||||
}
|
||||
ObjComisiones.Dispose();
|
||||
GvDatos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DBCampo("CveVendedor").ToEntero() < 1)
|
||||
{
|
||||
e.Row.Cells[0].Text = "Total";
|
||||
e.Row.CssClass = "Totales";
|
||||
}else if(e.Row.DBCampo("CveVenta").ToEntero() < 1)
|
||||
{
|
||||
e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
e.Row.CssClass = "SubTotales";
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Row.Cells[8].Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
157
Ventas/RepConciliacionEmitidosSat.aspx
Normal file
157
Ventas/RepConciliacionEmitidosSat.aspx
Normal file
@@ -0,0 +1,157 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepConciliacionEmitidosSat.aspx.cs" Inherits="Ventas_RepConciliacionEmitidosSat" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.GVConciliacionemitidasSAT tr th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.GVConciliacionemitidasSAT tr th:nth-child(6) {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.GVConciliacionemitidasSAT tr td:nth-child(6) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.GVConciliacionemitidasSAT tr th:nth-child(7),
|
||||
.GVConciliacionemitidasSAT tr td:nth-child(7) {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Conciliacion Emitidas Sat
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatosReporte" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="portlet light xspadding bordered " id="PorletDatos" style="margin-bottom: 0px;">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-blue">
|
||||
<i class="fa fa-file-text-o font-blue"></i>
|
||||
<span class="caption-subject bold uppercase">Facturas emitidas en el sat sin registrar (<%= GVConciliacionemitidasSAT.Rows.Count %>)</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="FiltrarTabla('TxtBusqueda','GVConciliacionemitidasSAT')" style="display: inline-block; margin-right: -20px; width: 150px;">
|
||||
<a href="javascript:;" onclick="FiltrarTabla('TxtBusqueda','GVConciliacionemitidasSAT')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold blue"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body ">
|
||||
<asp:GridView ID="GVConciliacionemitidasSAT" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVConciliacionemitidasSAT" AutoGenerateColumns="False"
|
||||
DataKeyNames="FolioFiscal,TipoDocto,ImporteTotal,Estatus,Fecha,Moneda,RFCReceptor,CveEmpresa,RutaXml,RFCEmisor,TipoDoctoTexto">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Tipo documento">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbltipoDocto" runat="server" Text='<%# Eval("TipoDoctoTexto")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Receptor">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblrFCReceptor" runat="server" Text='<%# Eval("RFCReceptor")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblfecha" runat="server" Text='<%# Eval("Fecha","{0:dd/MM/yyyy}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Serie-Folio">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblSerieFolio" runat="server" Text='<%# string.Format("{0}-{1}",Eval("Serie"),Eval("Folio"))%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Folio Fiscal">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblfolioFiscal" runat="server" Text='<%# Eval("FolioFiscal")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteTotal" runat="server" Text='<%# Eval("ImporteTotal","{0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Moneda">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblmoneda" runat="server" Text='<%# Eval("Moneda")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("EstatusFactura")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Xml" Visible="false">
|
||||
<ItemTemplate>
|
||||
<%--<asp:Label ID="lblrutaXml" runat="server" Text='<%# Eval("RutaXml")%>'> </asp:Label>--%>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkRegistrar" runat="server" data-toggle="tooltip" ToolTip="Registrar" CssClass="btn btn-circle btn-sm blue" OnClick="LnkRegistrar_Click"><i class="fa fa-plus"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="DModalDefaults" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel ID="UpModalDefaults" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content rowpadding">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" runat="server" style="text-align: left">Valores reconstruccion</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Estos Valores seran asignados en la venta en caso de que no coincida los valores del Xml con los ingresados en el sistema.
|
||||
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
|
||||
<asp:Label runat="server" Text="Sucursal" AssociatedControlID="DdlSubProyectoDatos"></asp:Label>
|
||||
<asp:DropDownList ID="DdlSubProyectoDatos" AutoPostBack="True" runat="server" CssClass="form-control input-sm select2me " DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
|
||||
<asp:Label runat="server" Text="Clasificación" AssociatedControlID="DdlClasificacion"></asp:Label>
|
||||
<asp:DropDownList ID="DdlClasificacion" CssClass="form-control input-sm select2me" runat="server" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
|
||||
<asp:Label runat="server" Text="Producto o Servicio" AssociatedControlID="DdlPS"></asp:Label>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS " CssClassDdl="select2me " IncluyeTodos="false" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkAceptarDefault" OnClick="LnkAceptarDefault_Click" CssClass="btn btn-success" runat="server">Aceptar</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
$('#DModalDefaults').modal();
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
1382
Ventas/RepConciliacionEmitidosSat.aspx.cs
Normal file
1382
Ventas/RepConciliacionEmitidosSat.aspx.cs
Normal file
File diff suppressed because it is too large
Load Diff
111
Ventas/RepCostoPromedioVenta.aspx
Normal file
111
Ventas/RepCostoPromedioVenta.aspx
Normal file
@@ -0,0 +1,111 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepCostoPromedioVenta.aspx.cs" Inherits="Ventas_RepCostoPromedioVenta" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Costo Promedio de Venta
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Proveedor:</label>
|
||||
<div class="col-md-2">
|
||||
<ADS:Dropdownlost ID="DdlProveedor" runat="server" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" ></ADS:Dropdownlost>
|
||||
</div>
|
||||
<label class="col-md-1 ">Fecha Inicial:</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: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" 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>
|
||||
</div>
|
||||
<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: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="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<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>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-1 ">Fecha Final:</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: 110px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" 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>
|
||||
</div>
|
||||
<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: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="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<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>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
<div class="col-md-1">SubProyecto:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" Width="150px" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; 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>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
|
||||
EmptyDataText="No se han encontrado datos con los filtros seleccionados" OnRowDataBound="GvDatos_RowDataBound"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False">
|
||||
<Columns>
|
||||
<asp:HyperLinkField HeaderText="Código" DataTextField="Codigo" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:HyperLinkField HeaderText="Articulo" DataTextField="PS" DataNavigateUrlFields="CvePS" DataNavigateUrlFormatString="/Ventas/ProductosServicios.aspx?CvePS={0}" Target="_blank" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="UnidadMedida" ItemStyle-HorizontalAlign="Left" HeaderText="U.V" />
|
||||
<asp:BoundField DataField="Cantidad" ItemStyle-HorizontalAlign="Right" HeaderText="Cantidad" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="CostoTotal" ItemStyle-HorizontalAlign="Right" HeaderText="Costo Total" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="ImporteTotal" ItemStyle-HorizontalAlign="Right" HeaderText="Importe Total" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="CostoUP" ItemStyle-HorizontalAlign="Right" HeaderText="Costo U.P" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="PorcentajeUtilidad" ItemStyle-HorizontalAlign="Right" HeaderText="% Utilidad" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="MinVenta" ItemStyle-HorizontalAlign="Right" HeaderText="Min." DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="MaxVenta" ItemStyle-HorizontalAlign="Right" HeaderText="Max." DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="PromVenta" ItemStyle-HorizontalAlign="Right" HeaderText="Prom." DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="PLista" ItemStyle-HorizontalAlign="Right" HeaderText="Lista" DataFormatString="{0:N2}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user