Correcciones Cancelación OP
This commit is contained in:
254
OP/OP.aspx
254
OP/OP.aspx
@@ -309,6 +309,19 @@
|
||||
background: #f8f9fa;
|
||||
cursor: pointer;
|
||||
}
|
||||
/* Alinear celda y contenido a la derecha */
|
||||
.celda-derecha {
|
||||
text-align: right !important;
|
||||
|
||||
}
|
||||
|
||||
.txt-merma {
|
||||
/* Ancho reducido al 50% */
|
||||
margin-left: 30px !important; /* Mueve el TextBox a la derecha dentro de la celda */
|
||||
display: block !important; /* Permite que margin-left:auto funcione */
|
||||
/* Alinea el texto interno a la derecha */
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
@@ -338,7 +351,7 @@
|
||||
<div class="labeltruncate labeltext labelbold">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<div class="form-group">
|
||||
<label for="<%= DdlClientes.ClientID.ToString()%>">Cliente</label>
|
||||
<ADS:Dropdownlost ID="DdlClientes" runat="server"
|
||||
CssClassDdl="form-control" DataTextField="NombreComercial"
|
||||
@@ -346,88 +359,85 @@
|
||||
DataValueField="CveCliente" Enabled="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Centro de Costo -->
|
||||
<div class="portlet-body form">
|
||||
<div class="labeltruncate labeltext labelbold">
|
||||
<div class="row">
|
||||
<div class="col-md-16">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:Label ID="LblProyecto" runat="server">
|
||||
<label>Proyecto:</label>
|
||||
</asp:Label>
|
||||
<div runat="server" id="DivProyecto">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="form-control select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-2">
|
||||
<label>Subproyecto:</label>
|
||||
</asp:Label>
|
||||
<div runat="server" id="DivSubProyecto" class="col-md-4">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="form-control select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Descripción -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server"
|
||||
CssClass="form-control"
|
||||
Style="width: 95%; height: 40px;"
|
||||
ValidationGroup="GrpGuardar"
|
||||
TextMode="MultiLine"
|
||||
Rows="2"
|
||||
MaxLength="1000" />
|
||||
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server"
|
||||
ControlToValidate="TxtDescripcion"
|
||||
ErrorMessage="Descripción requerida"
|
||||
Display="None"
|
||||
CssClass="text-danger"
|
||||
ValidationGroup="GrpGuardar" />
|
||||
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripcion</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Fecha -->
|
||||
<div class="form-section">
|
||||
<div class="row">
|
||||
<!-- Columna Fecha-->
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<div class="col-md-1">
|
||||
<label class="mb-0">Fecha</label>
|
||||
<label>Fecha</label>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker" style="height: 30px;" data-date-format="dd/mm/yyyy">
|
||||
<asp:TextBox ID="Txtfecha" runat="server"
|
||||
CssClass="form-control"
|
||||
style="margin-top: -6px;"
|
||||
Width="100%"
|
||||
CausesValidation="true"
|
||||
MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " style="margin-top: -11px; height: 29px;" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</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: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="Txtfecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="Txtfecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="Txtfecha" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="Txtfecha" 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="Txtfecha" 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>
|
||||
|
||||
|
||||
<!-- Centro de Costo -->
|
||||
<div class="portlet-body form" style="margin-top: -15px;">
|
||||
<div class="labeltruncate labeltext labelbold">
|
||||
<div class="row">
|
||||
<div class="col-md-16">
|
||||
<div class="form-group">
|
||||
<asp:Label ID="LblProyecto" runat="server">
|
||||
<label>Proyecto:</label>
|
||||
</asp:Label>
|
||||
<div runat="server" id="DivProyecto">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="form-control select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-2">
|
||||
<label>Subproyecto:</label>
|
||||
</asp:Label>
|
||||
<div runat="server" id="DivSubProyecto" class="col-md-4">
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="form-control select2me" Style="width: 100%;"></asp:DropDownList>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="Txtfecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="Txtfecha" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="Txtfecha" 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="Txtfecha" 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>
|
||||
|
||||
|
||||
<!-- Descripción -->
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server"
|
||||
CssClass="form-control"
|
||||
Style="width: 95%; height: 40px;"
|
||||
ValidationGroup="GrpGuardar"
|
||||
TextMode="MultiLine"
|
||||
Rows="2"
|
||||
MaxLength="1000" />
|
||||
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server"
|
||||
ControlToValidate="TxtDescripcion"
|
||||
ErrorMessage="Descripción requerida"
|
||||
Display="None"
|
||||
CssClass="text-danger"
|
||||
ValidationGroup="GrpGuardar" />
|
||||
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripcion</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="portlet light xspadding bordered">
|
||||
<div class="portlet-title">
|
||||
@@ -437,23 +447,17 @@
|
||||
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<asp:TextBox ID="TxtEstatus" runat="server" CssClass="form-control" Width="150px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatus" runat="server"
|
||||
ControlToValidate="TxtEstatus"
|
||||
Display="Dynamic"
|
||||
ErrorMessage="Estatus requerido"
|
||||
CssClass="text-danger"
|
||||
ValidationGroup="GrpGuardar" />
|
||||
<asp:Label ID="TxtEstatus" runat="server" CssClass="form-control" Width="150px"></asp:Label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<!-- GridViews -->
|
||||
<asp:UpdatePanel ID="UpGvDatosOP" runat="server" UpdateMode="Conditional">
|
||||
<asp:UpdatePanel ID="UpGvDatosOP" runat="server" UpdateMode="Conditional" style="margin-top: -170px;">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
@@ -466,13 +470,15 @@
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
<label class="col-md-1" style="max-width: 70px;">Producto</label>
|
||||
<div id="PanelProducto" runat="server">
|
||||
<asp:label ID="LblProducto" class="col-md-1" runat="server" style="max-width: 70px;" Text="Producto"></asp:label>
|
||||
<div class="col-md-3">
|
||||
<ADS:Dropdownlost ID="DdlPS" runat="server" Width="100%" CssStyle="width: 100%;"
|
||||
CssClass="select2me"
|
||||
CssClassDdl="form-control" DataTextField="PSCodigo"
|
||||
DataValueField="CvePS" Enabled="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 d-flex align-items-center" style="gap: 10px;">
|
||||
<asp:LinkButton ID="BtnAgregarProducto" runat="server"
|
||||
CssClass="btn btn-primary"
|
||||
@@ -760,31 +766,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Área de acción: Guardar, Terminar y Cancelar -->
|
||||
<asp:UpdatePanel runat="server" ID="UpBtns" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12 d-flex justify-content-end align-items-center">
|
||||
<!-- Botón Guardar -->
|
||||
<asp:Button
|
||||
ID="BtnGuardarOP" runat="server"
|
||||
Text="Guardar Orden de Producción"
|
||||
CssClass="btn btn-success me-2"
|
||||
OnClick="BtnGuardarOP_Click"
|
||||
ValidationGroup="GrpGuardar" />
|
||||
|
||||
<!-- Botón para Guardar la OP -->
|
||||
<div class="form-group" style="margin-top: 20px;">
|
||||
<asp:Button ID="BtnGuardarOP" runat="server" Text="Guardar Orden de Producción"
|
||||
CssClass="btn btn-success" OnClick="BtnGuardarOP_Click"
|
||||
ValidationGroup="GrpGuardar" />
|
||||
</div>
|
||||
<!-- Botones Derecha: Terminar y Cancelar -->
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<asp:Button ID="BtnFinalizarOP" runat="server" Text="Terminar"
|
||||
CssClass="btn btn-success mr-2" OnClick="BtnFinalizarOP_Click"
|
||||
Visible="false" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12 d-flex justify-content-end">
|
||||
<asp:Button ID="BtnCancelarOP" runat="server" Text="Cancelar OP"
|
||||
CssClass="btn btn-danger" Visible="false"
|
||||
OnClick="BtnCancelarOP_Click" />
|
||||
</div>
|
||||
</div>
|
||||
<asp:Button
|
||||
ID="BtnFinalizarOP" runat="server"
|
||||
Text="Terminar"
|
||||
CssClass="btn btn-success mr-2"
|
||||
OnClick="BtnFinalizarOP_Click"
|
||||
Visible="false" />
|
||||
|
||||
<asp:Button
|
||||
ID="BtnCancelarOP" runat="server"
|
||||
Text="Cancelar OP"
|
||||
CssClass="btn btn-danger"
|
||||
OnClick="BtnCancelarOP_Click"
|
||||
Visible="false" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="DVModalFinalizarOP" class="modal ADS fade" role="dialog" data-backdrop="static">
|
||||
<div class="modal-dialog" style="width: 750px;">
|
||||
@@ -838,11 +852,13 @@
|
||||
<asp:TextBox ID="TxtCantidadPT" runat="server"
|
||||
Text='<%# Bind("Cantidad") %>'
|
||||
CssClass="form-control"
|
||||
style="text-align: right;"
|
||||
TextMode="Number"
|
||||
min="0"
|
||||
step="1"
|
||||
data-original='<%# Eval("Cantidad") %>'
|
||||
onchange="validarCantidad(this)" />
|
||||
onchange="validarCantidad(this)"
|
||||
ItemStyle-HorizontalAlign="Right"/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -856,17 +872,18 @@
|
||||
CssClass="table table-striped table-hover" GridLines="None" Width="100%">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="PSCodigo" HeaderText="Producto" />
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"/>
|
||||
<asp:TemplateField HeaderText="Devolución">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtDevolucionMP" runat="server"
|
||||
Text="0"
|
||||
CssClass="form-control"
|
||||
style="width: 50%; text-align: right; margin-left: 38px; display: block;"
|
||||
TextMode="Number"
|
||||
min="0"
|
||||
step="1"
|
||||
data-original='<%# Eval("Cantidad") %>'
|
||||
onchange="validarCantidad(this)" />
|
||||
onchange="validarCantidad(this)"
|
||||
/>
|
||||
</ItemTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
@@ -929,13 +946,17 @@
|
||||
<asp:TemplateField HeaderText="Merma">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtMerma" runat="server" Text="0"
|
||||
CssClass="form-control" TextMode="Number" step="0.01" min="0" />
|
||||
CssClass="txt-merma" TextMode="Number" step="0.01" min="0"
|
||||
style="width: 50%; text-align: right;"
|
||||
onchange="calcularDevolucion(this);"
|
||||
data-original='<%# Eval("Cantidad")%>'
|
||||
/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Devolución">
|
||||
<asp:TemplateField HeaderText="Devolución" ItemStyle-CssClass="celda-derecha">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtDevolucionCancel" runat="server" Text="0"
|
||||
CssClass="form-control" TextMode="Number" step="0.01" min="0" />
|
||||
<asp:Label ID="LblDevolucion" runat="server" Text='<%# Eval("Cantidad", "{0:N2}") %>' CssClass="devolucion-label" style="text-align: right;"/>
|
||||
<asp:HiddenField ID="HfDevolucion" runat="server" Value='<%# Eval("Cantidad", "{0:N2}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -969,7 +990,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
function calcularDevolucion(input) {
|
||||
var cantidadOriginal = parseFloat(input.dataset.original) || 0; // Usar dataset.original
|
||||
var merma = parseFloat(input.value) || 0;
|
||||
|
||||
if (merma > cantidadOriginal) {
|
||||
input.value = cantidadOriginal.toFixed(2);
|
||||
merma = cantidadOriginal;
|
||||
}
|
||||
|
||||
var devolucion = cantidadOriginal - merma;
|
||||
var row = input.closest('tr');
|
||||
row.querySelector('.devolucion-label').innerText = devolucion.toFixed(2);
|
||||
row.querySelector('[id$="HfDevolucion"]').value = devolucion.toFixed(2);
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
Reference in New Issue
Block a user