Error al consultar precios masivamente.

This commit is contained in:
2022-05-27 19:20:52 -07:00
parent 367a3a4125
commit e997ed175d

View File

@@ -178,10 +178,10 @@
<asp:BoundField DataField="PrecioLista" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" /> <asp:BoundField DataField="PrecioLista" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Importe" DataFormatString="$ {0:N2}" ItemStyle-HorizontalAlign="right" />
<asp:TemplateField HeaderText=""> <asp:TemplateField HeaderText="">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("PrecioLista", "{0:N2}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox> <asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("PrecioLista", "{0:0.######}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecio" FilterType="Numbers,Custom" ValidChars="." /> <%--<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})?$" /> <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> <ajax:ValidatorCalloutExtender ID="VCPrecio" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecio" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Precio Mínimo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Precio Mínimo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
@@ -191,10 +191,10 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText=""> <asp:TemplateField HeaderText="">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtPrecioMinimo" runat="server" Text='<%# Eval("PrecioMinimo", "{0:N2}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px"></asp:TextBox> <asp:TextBox ID="TxtPrecioMinimo" runat="server" Text='<%# Eval("PrecioMinimo", "{0:0.######}")%>' CssClass="CssCamviaPrecio" MaxLength="39" Width="60px" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." /> <%-- <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})?$" /> <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> <ajax:ValidatorCalloutExtender ID="VCTxtPrecioMinimo" runat="server" HighlightCssClass="vco" TargetControlID="REVTxtPrecioMinimo" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
@@ -239,7 +239,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3" style="text-align: left"> <div class="col-md-3" style="text-align: left">
<input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" /> <input id="ChkSeleccionarTodos" type="checkbox" title="Seleccionar Todos" onclick="SeleccionarTodosChkGvSucursa()" />
Seleccionar Todos Seleccionar Todos
</div> </div>
<div class="col-md-9" style="text-align: right"> <div class="col-md-9" style="text-align: right">
@@ -266,7 +266,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Precio Mínimo"> <asp:TemplateField HeaderText="Precio Mínimo">
<ItemTemplate> <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:TextBox ID="TxtPrecioMinimo" Style="text-align: right" runat="server" CausesValidation="true" MaxLength="39" Text='<%# Eval("PrecioMinimo", "{0:0.######}")%>' 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> <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: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=",-+" /> <ajax:FilteredTextBoxExtender ID="FilTxtPrecioMinimo" runat="server" TargetControlID="TxtPrecioMinimo" FilterType="Numbers,Custom" ValidChars="." InvalidChars=",-+" />
@@ -364,84 +364,99 @@
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script> <script>
function onlyNumberKey(evt) {
// Only ASCII character in that range allowed
var ASCIICode = (evt.which) ? evt.which : evt.keyCode
if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57))
{
if (ASCIICode == 46) {
return true
} else {
return false;
}
}
return true;
}
function CambiaImporte() { function CambiaImporte() {
var topLevelElem = document.getElementById("form1"); var topLevelElem = document.getElementById("form1");
var checks = topLevelElem.getElementsByTagName("input"); var checks = topLevelElem.getElementsByTagName("input");
var idd = ''; var idd = '';
var valor = $('#<%= TxtImporte.ClientID %>').val(); var valor = $('#<%= TxtImporte.ClientID %>').val();
for (var i = 0; i < checks.length; i++) { for (var i = 0; i < checks.length; i++) {
if (checks[i].type == "checkbox") { if (checks[i].type == "checkbox") {
debugger; debugger;
if (checks[i].checked) { if (checks[i].checked) {
idd = checks[i].id.replace('C_GVPrecios_chkPS_', '') idd = checks[i].id.replace('C_GVPrecios_chkPS_', '')
if ($get('C_GVPrecios_TxtPrecio_' + idd) != null) { if ($get('C_GVPrecios_TxtPrecio_' + idd) != null) {
$get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2); $get('C_GVPrecios_TxtPrecio_' + idd).value = FormatoNumero(ToDouble(valor), 2);
} }
} }
} }
} }
} }
function CambiaPrecio() { function CambiaPrecio() {
var topLevelElem = document.getElementById("form1"); var topLevelElem = document.getElementById("form1");
var checks = topLevelElem.getElementsByTagName("input"); var checks = topLevelElem.getElementsByTagName("input");
var idd = ''; var idd = '';
var valor = $('#<%= TxtPrecio.ClientID %>').val(); var valor = $('#<%= TxtPrecio.ClientID %>').val();
//if (!isNaN(valor) && valor.length > 0) { //if (!isNaN(valor) && valor.length > 0) {
// $('.CssCamviaPrecio').val(valor); // $('.CssCamviaPrecio').val(valor);
//} //}
for (var i = 0; i < checks.length; i++) { for (var i = 0; i < checks.length; i++) {
if (checks[i].type == "checkbox") { if (checks[i].type == "checkbox") {
debugger; debugger;
if (checks[i].checked) { if (checks[i].checked) {
idd = checks[i].id.replace('C_GVPrecios_chkPS_', '') idd = checks[i].id.replace('C_GVPrecios_chkPS_', '')
if ($get('C_GVPrecios_TxtPrecioMinimo_' + idd) != null) { if ($get('C_GVPrecios_TxtPrecioMinimo_' + idd) != null) {
$get('C_GVPrecios_TxtPrecioMinimo_' + idd).value = FormatoNumero(ToDouble(valor), 2); $get('C_GVPrecios_TxtPrecioMinimo_' + idd).value = FormatoNumero(ToDouble(valor), 2);
} }
} }
} }
} }
} }
function CambiaPrecioModal() { function CambiaPrecioModal() {
var ChecksGv = $('.CsMCheckGvSucursal').find('input[type=checkbox]'); var ChecksGv = $('.CsMCheckGvSucursal').find('input[type=checkbox]');
var valor = $('#<%= TxtAplicarPrecio.ClientID %>').val(); var valor = $('#<%= TxtAplicarPrecio.ClientID %>').val();
if (!isNaN(valor) && valor.length > 0) { if (!isNaN(valor) && valor.length > 0) {
$(".CssMCamviaPrecio").each(function (index) { $(".CssMCamviaPrecio").each(function (index) {
if ($($(ChecksGv).get(index)).attr('checked')) { if ($($(ChecksGv).get(index)).attr('checked')) {
$(this).val(valor); $(this).val(valor);
} }
}); });
} }
} }
function SeleccionarTodosChkGvSucursa() { function SeleccionarTodosChkGvSucursa() {
if ($('#ChkSeleccionarTodos').attr('checked')) { if ($('#ChkSeleccionarTodos').attr('checked')) {
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', true); $('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', true);
} else { } else {
$('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', false); $('.CsMCheckGvSucursal').find('input[type=checkbox]').prop('checked', false);
} }
} }
function FncSeleccionaChk(chk) { function FncSeleccionaChk(chk) {
chk.checked = true; chk.checked = true;
} }
</script> </script>
</asp:Content> </asp:Content>