-cambios en conceptos
This commit is contained in:
@@ -1,373 +1,377 @@
|
||||
<%@ 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" AppendDataBoundItems="true" 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" Text='<%# Eval("PrecioLista", "{0:N2}")%>' 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" Text='<%# Eval("PrecioMinimo", "{0:N2}")%>' 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="PrecioMinimoAnterior" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Precio Mínimo Anterior" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" 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" style="width: 900px; margin: auto;">
|
||||
<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-3" style="text-align: left">
|
||||
<input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" /> Seleccionar Todos
|
||||
</div>
|
||||
<div class="col-md-9" 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" OnRowDataBound="gvSucursal_RowDataBound" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chkSucursal" runat="server" Checked="false" CssClass="CsMCheckGvSucursal" />
|
||||
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="30%">
|
||||
<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>
|
||||
<asp:BoundField HeaderText="Precio Mínimo Anterior" DataField="PrecioMinimoAnterior" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Usuario Modificó" DataField="Usuario" />
|
||||
<asp:BoundField HeaderText="Fecha Modificación" DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" />
|
||||
</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" AppendDataBoundItems="true" 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">
|
||||
<%@ 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" AppendDataBoundItems="true" 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>
|
||||
<div class="col-md-9">
|
||||
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;">
|
||||
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:ListBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" >
|
||||
<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" Text='<%# Eval("PrecioLista", "{0:N2}")%>' 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" Text='<%# Eval("PrecioMinimo", "{0:N2}")%>' 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="PrecioMinimoAnterior" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Precio Mínimo Anterior" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" 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" style="width: 900px; margin: auto;">
|
||||
<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-3" style="text-align: left">
|
||||
<input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" />
|
||||
Seleccionar Todos
|
||||
|
||||
</div>
|
||||
<div class="col-md-9" 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" OnRowDataBound="gvSucursal_RowDataBound" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chkSucursal" runat="server" Checked="false" CssClass="CsMCheckGvSucursal" />
|
||||
<asp:HiddenField ID="hdnEnBD" runat="server" Value='<%# If (IsDBNull(Eval("CvePS")),0,1) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="30%">
|
||||
<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>
|
||||
<asp:BoundField HeaderText="Precio Mínimo Anterior" DataField="PrecioMinimoAnterior" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField HeaderText="Usuario Modificó" DataField="Usuario" />
|
||||
<asp:BoundField HeaderText="Fecha Modificación" DataField="FechaModificacion" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" />
|
||||
</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" AppendDataBoundItems="true" 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() {
|
||||
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") {
|
||||
for (var i = 0; i < checks.length; i++) {
|
||||
if (checks[i].type == "checkbox") {
|
||||
debugger;
|
||||
|
||||
if (checks[i].checked) {
|
||||
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);
|
||||
}
|
||||
if ($get('C_GVPrecios_TxtPrecio_' + idd) != null) {
|
||||
$get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CambiaPrecio() {
|
||||
function CambiaPrecio() {
|
||||
var topLevelElem = document.getElementById("form1");
|
||||
var checks = topLevelElem.getElementsByTagName("input");
|
||||
var idd = '';
|
||||
@@ -378,42 +382,42 @@
|
||||
// $('.CssCamviaPrecio').val(valor);
|
||||
//}
|
||||
|
||||
for (var i = 0; i < checks.length; i++) {
|
||||
if (checks[i].type == "checkbox") {
|
||||
for (var i = 0; i < checks.length; i++) {
|
||||
if (checks[i].type == "checkbox") {
|
||||
debugger;
|
||||
|
||||
if (checks[i].checked) {
|
||||
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);
|
||||
}
|
||||
if ($get('C_GVPrecios_TxtPrecioMinimo_' + idd) != null) {
|
||||
$get('C_GVPrecios_TxtPrecioMinimo_' + idd).value = FormatoNumero(ToDouble(valor), 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CambiaPrecioModal() {
|
||||
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')) {
|
||||
if (!isNaN(valor) && valor.length > 0) {
|
||||
$(".CssMCamviaPrecio").each(function (index) {
|
||||
if ($($(ChecksGv).get(index)).attr('checked')) {
|
||||
|
||||
$(this).val(valor);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(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);
|
||||
}
|
||||
function SeleccionarTodosChkGvSucursa() {
|
||||
if ($('#ChkSeleccionarTodos').attr('checked')) {
|
||||
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', true);
|
||||
} else {
|
||||
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', false);
|
||||
}
|
||||
}
|
||||
function FncSeleccionaChk(chk) {
|
||||
chk.checked = true;
|
||||
@@ -421,6 +425,6 @@
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
|
||||
Dim ObjMarcas As New ClsProductosServicios
|
||||
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
DdlMarca.DataSource = ObjMarcas.DtResultados
|
||||
DdlMarca.DataSource = ObjMarcas.DtResultados.Copy
|
||||
End If
|
||||
ObjMarcas.Dispose()
|
||||
DdlMarca.DataBind()
|
||||
@@ -145,6 +145,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Dim objPS As New ClsProductosServicios
|
||||
Dim CveProveedor As Integer = -1
|
||||
Dim CvePS As Integer = -1
|
||||
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
|
||||
|
||||
If DDlPs.SelectedValue.ToEntero > 0 Then
|
||||
CvePS = DDlPs.SelectedValue.ToEntero
|
||||
@@ -155,7 +156,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
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
|
||||
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas) Then
|
||||
GVPrecios.DataSource = objPS.DtResultados
|
||||
End If
|
||||
objPS.Dispose()
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
padding-right: 4px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
.Vendedor{
|
||||
.GrupoSuperior{
|
||||
background-color:#000077;
|
||||
color:white;
|
||||
font-weight:bold;
|
||||
}
|
||||
.Vendedor:hover{
|
||||
.GrupoSuperior:hover{
|
||||
background-color:#000077;
|
||||
}
|
||||
</style>
|
||||
@@ -121,6 +121,14 @@
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%" DataValueField="CveCliente" DataTextField="NombreComercial"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 text-right">Grupo: </label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlGrupo" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="50%">
|
||||
<asp:ListItem Value="0" Text="Por Vendedor"></asp:ListItem>
|
||||
<asp:ListItem Value="1" Text="Por Sucursal"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="General"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -183,6 +191,21 @@
|
||||
<asp:Label ID="lblObjAcumulado" runat="server" Target="_blank" Text='<%# Eval("ObjAcumulado").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="%Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSAAPerc" runat="server" Target="_blank" Text='<%# Eval("VarVSAAPerc").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var vs AA" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSAA" runat="server" Target="_blank" Text='<%# Eval("VarVSAA").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Var vs ObjAcum" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVarVSObjAcum" runat="server" Target="_blank" Text='<%# Eval("VarVSObjAcum").ToString() %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -60,7 +60,7 @@ Partial Class MetasVendedores
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetRepMetasVendedores(TxtFechaMes.Text, UsuarioActual.CveEmpresa, DdlVendedorFiltro.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero,
|
||||
DdlClasificaciones.SelectedValue.ToEntero, DdlClasificacion2.SelectedValue.ToEntero, DdlMarcaFiltro.SelectedValue.ToEntero,
|
||||
DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero) Then
|
||||
DdlSubProyectoFiltro.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, DdlGrupo.SelectedValue.ToEntero) Then
|
||||
GV.DataSource = ObjVentas.DtResultados
|
||||
DtDatos = ObjVentas.DtResultados
|
||||
End If
|
||||
@@ -75,9 +75,21 @@ Partial Class MetasVendedores
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCLabel("lblRealMesPorcentaje").Text = String.Format("{0}{1}", e.Row.FCLabel("lblRealMesPorcentaje").Text, "%")
|
||||
e.Row.FCLabel("lblVarVSAAPerc").Text = String.Format("{0}{1}", e.Row.FCLabel("lblVarVSAAPerc").Text, "%")
|
||||
Select Case e.Row.DataKey("Etiqueta")
|
||||
Case "Vendedor"
|
||||
e.Row.CssClass = "Vendedor"
|
||||
Case "GrupoSuperior"
|
||||
e.Row.CssClass = "GrupoSuperior"
|
||||
e.Row.FCLabel("lblRealMes").Text = ""
|
||||
e.Row.FCLabel("lblVtaMesAA").Text = ""
|
||||
e.Row.FCLabel("lblObjMes").Text = ""
|
||||
e.Row.FCLabel("lblRealAcumulado").Text = ""
|
||||
e.Row.FCLabel("lblRealMesPorcentaje").Text = ""
|
||||
e.Row.FCLabel("lblAAntAcumulado").Text = ""
|
||||
e.Row.FCLabel("lblObjAcumulado").Text = ""
|
||||
e.Row.FCLabel("lblVarVSAAPerc").Text = ""
|
||||
e.Row.FCLabel("lblVarVSAA").Text = ""
|
||||
e.Row.FCLabel("lblVarVSObjAcum").Text = ""
|
||||
Case "Categoria"
|
||||
e.Row.CssClass = "Totales"
|
||||
Case "Clasificacion"
|
||||
|
||||
@@ -225,8 +225,8 @@
|
||||
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:RadioButtonList runat="server" ID="RblTipoCambio" AutoPostBack="true">
|
||||
<asp:ListItem Text="Moneda Original" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Selected="true" Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Selected="true" Text="Moneda Original" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="1"></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">
|
||||
|
||||
@@ -107,11 +107,11 @@ Partial Class Ventas_RepIngresos
|
||||
Dim Cves_Subprotectos As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
|
||||
Dim TiposDoc As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
|
||||
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
|
||||
TCEspecifico = TxtEspecifico.Text.ToDecimal
|
||||
Else
|
||||
TCEspecifico = -1
|
||||
End If
|
||||
'If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
|
||||
' TCEspecifico = TxtEspecifico.Text.ToDecimal
|
||||
'Else
|
||||
' TCEspecifico = -1
|
||||
'End If
|
||||
|
||||
Dim ObjRepI As New ClsVentas()
|
||||
If ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TiposDoc, Cves_Subprotectos, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico) Then
|
||||
@@ -174,20 +174,20 @@ Partial Class Ventas_RepIngresos
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("TipoAmortizacion") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
ElseIf e.Row.DBCampo("TipoAmortizacion") <> "" AndAlso e.Row.DBCampo("CveConceptoContable") = "-1" Then
|
||||
ElseIf e.Row.DBCampo("TipoAmortizacion") <> "" AndAlso e.Row.DBCampo("CveConceptoContable") = "" Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged
|
||||
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
|
||||
If TipoCambio = 3 Then
|
||||
LiEspecifico.Visible = True
|
||||
TCEspecifico = GlobalTipoCambio(Now).ToDecimal
|
||||
TxtEspecifico.Text = TCEspecifico.ToString
|
||||
Else
|
||||
LiEspecifico.Visible = False
|
||||
End If
|
||||
'If TipoCambio = 3 Then
|
||||
' LiEspecifico.Visible = True
|
||||
' TCEspecifico = GlobalTipoCambio(Now).ToDecimal
|
||||
' TxtEspecifico.Text = TCEspecifico.ToString
|
||||
'Else
|
||||
' LiEspecifico.Visible = False
|
||||
'End If
|
||||
UpBodyTipoCambio.Update()
|
||||
End Sub
|
||||
Private Sub BtnTipoCambio_Click(sender As Object, e As EventArgs) Handles BtnTipoCambio.Click
|
||||
|
||||
@@ -376,7 +376,7 @@ Partial Class RepVentaDetalle
|
||||
Private Sub CargaEstatus()
|
||||
DdlEstatus.Items.Clear()
|
||||
If DdlTipoComprobante.GetSelectedText <> "" Then
|
||||
DdlEstatus.DataSource = GlobalDTEstatusFactura.FiltraParametros(String.Format("TipoDocto IN ({0})", DdlTipoComprobante.GetSelectedValuesM(True)))
|
||||
DdlEstatus.DataSource = GlobalDTEstatusFactura.FiltraParametros(String.Format("TipoDocto IN ({0})", DdlTipoComprobante.GetSelectedValuesM(True).Replace("Ant", "Ing")))
|
||||
Else
|
||||
DdlEstatus.DataSource = GlobalDTEstatusFactura
|
||||
End If
|
||||
|
||||
@@ -9360,7 +9360,7 @@ Partial Class Ventas
|
||||
|
||||
Dim CveTipoRetencion As Integer = 0
|
||||
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
|
||||
CveTipoRetencion = DdlTipoRetencion.SelectedValue.ToEntero()
|
||||
CveTipoRetencion = factura.CveTipoRetencion
|
||||
End If
|
||||
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
|
||||
@@ -19169,7 +19169,7 @@ Partial Class Ventas
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = "Select * FROM [Hoja1$]"
|
||||
cmd.CommandText = "Select * FROM [Hoja1$] WHERE Cantidad >=1"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
Case Else
|
||||
@@ -19222,6 +19222,8 @@ Partial Class Ventas
|
||||
|
||||
dt.TableName = "Datos"
|
||||
|
||||
Dim DtSubProyecto As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DtSubProyecto.CaseSensitive = False
|
||||
If Not ErrorArchivo Then
|
||||
NumRow = 1
|
||||
Dim RowNoEncontrados As String = ""
|
||||
@@ -19246,8 +19248,6 @@ Partial Class Ventas
|
||||
NumRow = NumRow + 1
|
||||
|
||||
If Proyecto <> "" Then
|
||||
Dim DtSubProyecto As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DtSubProyecto.CaseSensitive = False
|
||||
DrProyecto = DtSubProyecto.FiltroPrimero($"(SubProyecto) = '{Proyecto}'")
|
||||
If DrProyecto IsNot Nothing Then
|
||||
CveSubProyecto = DrProyecto("CveSubProyecto").ToString.ToEntero
|
||||
@@ -19260,38 +19260,80 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If Codigo <> "" Then
|
||||
Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa, Codigo:=Codigo) Then
|
||||
If ObjPS.CvePS > 0 Then
|
||||
CvePS = ObjPS.CvePS
|
||||
CveUM = ObjPS.CveUnidadMedida
|
||||
|
||||
Else
|
||||
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados)
|
||||
End If
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados)
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
'Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
|
||||
'If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
'End If
|
||||
ElseIf CodigoBarras <> "" Then
|
||||
Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa, CodigoBarras:=CodigoBarras) Then
|
||||
If ObjPS.CvePS > 0 Then
|
||||
CvePS = ObjPS.CvePS
|
||||
CveUM = ObjPS.CveUnidadMedida
|
||||
|
||||
Else
|
||||
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados)
|
||||
End If
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados)
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
'Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
|
||||
'If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
'End If
|
||||
ElseIf ProductoServicio <> "" Then
|
||||
Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
|
||||
If StrArray.Length > 0 Then
|
||||
If CBool(StrArray(0)) = True Then
|
||||
CvePS = StrArray(1).ToEntero
|
||||
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa, CodigoBarras:=CodigoBarras) Then
|
||||
If ObjPS.CvePS > 0 Then
|
||||
CvePS = ObjPS.CvePS
|
||||
CveUM = ObjPS.CveUnidadMedida
|
||||
Else
|
||||
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados)
|
||||
End If
|
||||
Else
|
||||
RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados)
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
'Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
|
||||
'If StrArray.Length > 0 Then
|
||||
' If CBool(StrArray(0)) = True Then
|
||||
' CvePS = StrArray(1).ToEntero
|
||||
' Else
|
||||
' RowNoEncontrados &= StrArray(1) & "<\BR>"
|
||||
' End If
|
||||
'End If
|
||||
Else
|
||||
RowNoEncontrados &= "<\BR> - En la fila " & NumRow & " no se especificó código, código de barras ó descripción."
|
||||
End If
|
||||
|
||||
If CvePS > 0 Then
|
||||
CveUM = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString.ToEntero
|
||||
'CveUM = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString.ToEntero
|
||||
|
||||
AgregarProductoServicio(Cantidad, CveUM, UM, -1, "",
|
||||
CvePS, HdnPS.Value, Observaciones, PrecioUnitario, HdnDescuento.Value.ToDecimal,
|
||||
@@ -19343,17 +19385,21 @@ Partial Class Ventas
|
||||
Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
Private Function GetPS(Opt As String, Valor As String) As String
|
||||
Dim StrReturn As String = String.Empty
|
||||
Dim CvePS As Integer = 0
|
||||
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Opt & " = '" & Valor & "'").ToString.ToEntero
|
||||
If CvePS > 0 Then
|
||||
StrReturn = "True|" & CvePS.ToString
|
||||
Else
|
||||
StrReturn = "False| - No se encontró " & Valor & " en la fila " & NumRow & ", columna " & Opt
|
||||
End If
|
||||
Return StrReturn
|
||||
End Function
|
||||
|
||||
|
||||
'Private dtps As DataTable = Nothing
|
||||
'Private Function GetPS(Opt As String, Valor As String) As String
|
||||
' Dim StrReturn As String = String.Empty
|
||||
' Dim CvePS As Integer = 0
|
||||
' If dtps Is Nothing Then dtps = GlobalDTPS(UsuarioActual.CveEmpresa)
|
||||
' CvePS = dtps.FiltroPrimeroValor("CvePS", Opt & " = '" & Valor & "'").ToString().ToEntero()
|
||||
' If CvePS > 0 Then
|
||||
' StrReturn = "True|" & CvePS.ToString
|
||||
' Else
|
||||
' StrReturn = "False| - No se encontró " & Valor & " en la fila " & NumRow & ", columna " & Opt
|
||||
' End If
|
||||
' Return StrReturn
|
||||
'End Function
|
||||
#End Region
|
||||
|
||||
#Region "P E D I D O S"
|
||||
@@ -21553,13 +21599,22 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
DdlTipoComprobante.SelectedValue = "Egs"
|
||||
Dim AplicaImpuestosLocales As Boolean = False
|
||||
|
||||
AplicarNC(DdlNCPS.SelectedValue.ToEntero, EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked)
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClienteImpuestosLocales(CveCliente) Then
|
||||
'se cargan impuestos locales
|
||||
Dim DtClienteImpuesto As DataTable = ObjCliente.DtResultados.FiltraParametros("Seleccionado = 1", "Orden")
|
||||
AplicaImpuestosLocales = (DtClienteImpuesto IsNot Nothing AndAlso DtClienteImpuesto.Rows.Count > 0)
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
|
||||
AplicarNC(DdlNCPS.SelectedValue.ToEntero, EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales)
|
||||
|
||||
RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
|
||||
End Sub
|
||||
|
||||
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False)
|
||||
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True)
|
||||
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
If DrPS Is Nothing Then
|
||||
Alert("Ocurrió un error al cargar la información del producto. Por favor comuniquese con asistencia SIG", TipoMensaje.MsgError)
|
||||
@@ -21576,6 +21631,12 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not AplicaImpuestosLocales Then
|
||||
TmpDTImpuestos.Rows.Clear()
|
||||
GvImpuestosLocales2.DataSource = TmpDTImpuestos
|
||||
GvImpuestosLocales2.DataBind()
|
||||
End If
|
||||
|
||||
'CREAMOS DT PARA UTILIZAR AL TIMBRAR
|
||||
InicializaDTVentasNC()
|
||||
|
||||
@@ -21597,13 +21658,13 @@ Partial Class Ventas
|
||||
If AplicaNCMasiva Then
|
||||
If NCDescuento Then
|
||||
For Each RNC In ListaNCDesc
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True), True, MissingSchemaAction.Ignore)
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales), True, MissingSchemaAction.Ignore)
|
||||
Next
|
||||
Else
|
||||
|
||||
For Each Gvr As GridViewRow In GvCxC.Rows
|
||||
If Gvr.FCCheckBox("ChkCxC").Checked Then
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal), True, MissingSchemaAction.Ignore)
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales), True, MissingSchemaAction.Ignore)
|
||||
'CARGA FACTURA A LA CUAL SE APLICA LA NC
|
||||
AcumuladoNC += Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal
|
||||
CargaNCDT(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal)
|
||||
@@ -21611,7 +21672,7 @@ Partial Class Ventas
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
DtImpuestos = CargaDtImpuestosNC(CveVenta, TxtNCImporte.Text.Trim.ToDecimal)
|
||||
DtImpuestos = CargaDtImpuestosNC(CveVenta, TxtNCImporte.Text.Trim.ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales)
|
||||
|
||||
If EsNCAmortizacion Then
|
||||
If DtAnticipoAmortizacion Is Nothing Then
|
||||
@@ -21713,7 +21774,7 @@ Partial Class Ventas
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
CalculaTotalesVenta(True)
|
||||
CalculaTotalesVenta(RecalculaImpuestosLocales:=AplicaImpuestosLocales)
|
||||
|
||||
TrTipoRelacion.Visible = True
|
||||
DdlTiposRelacion.SelectedValueExist("1")
|
||||
@@ -21738,14 +21799,21 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False) As DataTable
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True) As DataTable
|
||||
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
|
||||
|
||||
Dim TmpDT As DataTable = Nothing
|
||||
Dim TmpDTImpuestos As DataTable = Nothing
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetVentaImpuestosLocales(CveVentaNC) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
TmpDTImpuestos = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVentaDetalle(CveVentaNC) Then
|
||||
TmpDT = ObjVentas.DtResultados
|
||||
TmpDT = ObjVentas.DtResultados.Copy()
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
End If
|
||||
@@ -21775,10 +21843,19 @@ Partial Class Ventas
|
||||
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
|
||||
Dim FiltroStr As String = ""
|
||||
Dim importePuTemp As Decimal = 0
|
||||
Dim TotalImpuestosLocales As Decimal = 0
|
||||
If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then
|
||||
TotalImpuestosLocales = TmpDTImpuestos.SUM("Importe").ToDecimal()
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In DtImpuestosLocal.Rows
|
||||
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto"))
|
||||
importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr).ToDecimal() - TmpDT.SUM("Descuento", FiltroStr).ToDecimal()))
|
||||
|
||||
If Not AplicaImpuestosLocales Then
|
||||
importePuTemp = importePuTemp - TotalImpuestosLocales
|
||||
End If
|
||||
|
||||
Dr("ImporteTotal") = importePuTemp.RoundSQL(2)
|
||||
|
||||
|
||||
@@ -21795,9 +21872,13 @@ Partial Class Ventas
|
||||
Dr("ImportePU") = importePuTemp.RoundSQL(6) 'Dr("ImporteTotal").ToString.ToDecimal.RoundSQL(2) '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal)
|
||||
Next
|
||||
|
||||
|
||||
Dim importeNC = (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
|
||||
If AplicaImpuestosLocales Then
|
||||
Importe = Importe + TotalImpuestosLocales
|
||||
End If
|
||||
'codigo para ajuste de centavo, si el importe total no cuadra con los totales
|
||||
Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
|
||||
Dim difTmp As Decimal = Importe - importeNC
|
||||
|
||||
If Math.Abs(difTmp) >= 0.01 Then
|
||||
'asusto la diferencia en el último concepto
|
||||
Dim ImporteAjustado As Decimal = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString.ToDecimal + difTmp
|
||||
|
||||
Reference in New Issue
Block a user