Indicadores Medicos, procedimientos
This commit is contained in:
@@ -806,7 +806,7 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvMaterialesModal" CssClass="table table-hover table-smallpadding Widthall" GridLines="None" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMaterial,CvePS,CveOSDetalle,CveConsecutivo, CveMovimiento" EmptyDataText="Sin Materiales en la Orden de Servicio" ToolTip="Listado de Materiales de Orden de Servicio" Style="text-align: center;">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Cantidad" ItemStyle-Width="15%" />
|
||||
<asp:BoundField DataField="Cantidad" ItemStyle-Width="15%" />
|
||||
<asp:BoundField DataField="UM" ItemStyle-Width="15%" />
|
||||
<asp:TemplateField ItemStyle-Width="45%">
|
||||
<ItemTemplate>
|
||||
@@ -1278,13 +1278,13 @@
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvSolicitarDevolucion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||
DataKeyNames="CveVentaDetalle,Cantidad"
|
||||
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvSolicitarDevolucion_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Cant.</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad") %>'></asp:Literal>
|
||||
<asp:Literal ID="LblCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:F2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
|
||||
@@ -291,6 +291,17 @@ Partial Class OS_OrdenesServicios
|
||||
ViewState("ClienteMail") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTSolicitudDev As DataTable
|
||||
Get
|
||||
Return If(ViewState("DTSolicitudDev") Is Nothing, New DataTable, DirectCast(ViewState("DTSolicitudDev"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTSolicitudDev") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
|
||||
@@ -1932,7 +1943,7 @@ Partial Class OS_OrdenesServicios
|
||||
e.Row.FCLabel("LtlCuentaEquipoS").Visible = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
e.Row.FCHtmlTableRow("TREspecificaiones").Visible = False
|
||||
End If
|
||||
|
||||
@@ -3042,20 +3053,21 @@ Partial Class OS_OrdenesServicios
|
||||
LnkModalSolicitarDevolucion.Visible = True
|
||||
|
||||
GvSolicitarDevolucion.DataSource = Nothing
|
||||
DTSolicitudDev = New DataTable
|
||||
|
||||
Dim ObjOS As New ClsOS
|
||||
Dim DTTemp As New DataTable
|
||||
|
||||
|
||||
|
||||
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
DTTemp = ObjOS.DtResultados
|
||||
GvSolicitarDevolucion.DataSource = DTTemp
|
||||
DTSolicitudDev = ObjOS.DtResultados
|
||||
GvSolicitarDevolucion.DataSource = DTSolicitudDev
|
||||
End If
|
||||
|
||||
ObjOS.Dispose()
|
||||
GvSolicitarDevolucion.DataBind()
|
||||
|
||||
Dim EsDevolucionVenta As Boolean = (DTTemp.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
||||
Dim EsDevolucionVenta As Boolean = (DTSolicitudDev.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
||||
|
||||
RegistraScript("$('#DVModalSolicitarDevolucion').modal();")
|
||||
|
||||
@@ -3077,6 +3089,18 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
Protected Sub LnkModalSolicitarDevolucion_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
||||
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
||||
Dim CveSubProyectoPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
||||
|
||||
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
|
||||
|
||||
If Not CveAlmacenDestino > 0 Then
|
||||
Alert("No se encontro almacen de entrega por adelantado")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim PropcesoOK As Boolean = True
|
||||
Dim ObjV As New ClsVentas
|
||||
ObjV.IniciaTransacSQL()
|
||||
@@ -3101,6 +3125,76 @@ Partial Class OS_OrdenesServicios
|
||||
Next
|
||||
End If
|
||||
|
||||
If PropcesoOK Then
|
||||
|
||||
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL())
|
||||
|
||||
Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino)
|
||||
|
||||
If CveMovimiento > 0 Then
|
||||
|
||||
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows
|
||||
|
||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||
Dim CantidadRegistro = Cantidad - CantidadDev
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
|
||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
Dim Lote As String = GvRow.DataKey("Lote")
|
||||
Dim Serie As String = GvRow.DataKey("Serie")
|
||||
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDateTime
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
||||
PropcesoOK = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If PropcesoOK Then
|
||||
|
||||
Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaPedido, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimiento)
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
For Each dRow As DataRow In ObjInventario.DtResultados.Rows
|
||||
|
||||
Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
|
||||
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
|
||||
Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero
|
||||
Dim PU As Decimal = dRow("PU").ToString.ToDecimal
|
||||
Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero
|
||||
Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
|
||||
Dim Lote As String = dRow("Lote").ToString
|
||||
Dim Serie As String = dRow("Serie").ToString
|
||||
Dim FechaCaducidad As DateTime = dRow("FechaCaducidad").ToString.ToDateTime
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then
|
||||
Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
|
||||
PropcesoOK = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Else
|
||||
PropcesoOK = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
PropcesoOK = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If PropcesoOK Then
|
||||
'ObjV.RollBack()
|
||||
|
||||
Reference in New Issue
Block a user