This commit is contained in:
2025-04-05 18:16:03 -07:00
parent 62aabff160
commit 9edefb27e0
2 changed files with 15 additions and 14 deletions

View File

@@ -1306,11 +1306,11 @@
</div>
<%--MODAL FINALIZAR ORDEN INICIO --%>
<div id="DivModalMaterialUtilizado" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalMaterialUtilizado" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpModalMaterialUtilizado" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content" style="width:800px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
@@ -1365,7 +1365,7 @@
<div class="col-md-12">
<asp:GridView ID="GvMU" runat="server" AutoGenerateColumns="False" EmptyDataText="No se ha capturado material utilizado"
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS,Descuento,Observaciones"
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS,Descuento,Observaciones,CantidadConversion"
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMU_RowDataBound">
<Columns>
<asp:TemplateField>
@@ -1413,7 +1413,6 @@
</div>
</div>
</div>
<div class="modal-footer">
<div class="row">
@@ -1428,12 +1427,10 @@
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:UpdatePanel>
</div>
</asp:Content>

View File

@@ -3575,6 +3575,7 @@ Partial Class OS_OrdenesServicios
TmpDTMat.Columns.Add("Lote", GetType(String))
TmpDTMat.Columns.Add("FechaCaducidad", GetType(Date))
TmpDTMat.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDTMat.Columns.Add("CantidadConversion", GetType(Decimal))
'unificar en un solo producto, y generar las salidas a esa relación
Dim tdtt As DataTable = AgrupadoProductos(GvMU)
'se recorren los renglones agrupados por producto y acumuladas las cantidades
@@ -3584,7 +3585,7 @@ Partial Class OS_OrdenesServicios
Dim PU As Decimal = drr("PU").ToString.ToDecimal
Dim Descuento As Decimal = drr("Descuento").ToString.ToDecimal
Dim Obs As String = ""
If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido, CveVentaDetallePadre:=drr("CveVentaDetallePadre").ToString.ToEntero) Then
If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido, CveVentaDetallePadre:=drr("CveVentaDetallePadre").ToString.ToEntero, CantidadConversion:=drr("CantidadConversion").ToString.ToDecimal) Then
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
ProcesoOK = False
@@ -3655,17 +3656,19 @@ Partial Class OS_OrdenesServicios
.PU = PU,
.Descuento = Descuento,
.CveVentaDetallePadre = Group.Max(Function(r) r.DataKey("CveVentaDetalle").ToEntero()),
.CantidadConversion = Group.Max(Function(r) r.DataKey("CantidadConversion").ToDecimal()),
.Cantidad = Group.Sum(Function(r) Convert.ToDecimal(r.FCTextBox("TxtUtilizado").Text.ToDecimal)),
.Lotes = String.Join(", ", Group.Select(Function(r) gridView.DataKeys(r.RowIndex)("Lote").ToString()).Distinct())
}
' Crear un nuevo DataTable para almacenar los resultados agrupados
Dim resultTable As New DataTable()
resultTable.Columns.Add("CvePS")
resultTable.Columns.Add("PU")
resultTable.Columns.Add("Descuento")
resultTable.Columns.Add("CveVentaDetallePadre")
resultTable.Columns.Add("CvePS", GetType(Integer))
resultTable.Columns.Add("PU", GetType(Decimal))
resultTable.Columns.Add("Descuento", GetType(Decimal))
resultTable.Columns.Add("CveVentaDetallePadre", GetType(Integer))
resultTable.Columns.Add("Cantidad", GetType(Decimal))
resultTable.Columns.Add("CantidadConversion", GetType(Decimal))
For Each item In groupedData
If item.Cantidad > 0 Then
@@ -3675,6 +3678,7 @@ Partial Class OS_OrdenesServicios
newRow("Descuento") = item.Descuento
newRow("CveVentaDetallePadre") = item.CveVentaDetallePadre
newRow("Cantidad") = item.Cantidad
newRow("CantidadConversion") = item.CantidadConversion
resultTable.Rows.Add(newRow)
End If
Next