- mejoras
This commit is contained in:
@@ -129,9 +129,16 @@
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:GridView ID="GvA" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Usuarios con Órdenes de Servicio Asignadas"
|
||||
CssClass="table table-striped table-hover Widthall table-advance" GridLines="None">
|
||||
CssClass="table table-striped table-hover Widthall table-advance" GridLines="None" OnRowDataBound="GvA_RowDataBound">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="Nombre" HeaderText="Nombre" DataNavigateUrlFields="CveUsuarioAtendio" Target="_blank" DataNavigateUrlFormatString="~/OS/RepOrdenesServicios.aspx?CveUsuarioTecnico={0}" />
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Nombre
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink runat="server" ID="HplNombre" Text='<%#Eval("Nombre") %>' NavigateUrl='<%# Eval("CveUsuarioAtendio", "/OS/RepOrdenesServicios.aspx?CveUsuarioTecnico={0}") %>'></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.Entity.Core.Metadata.Edm
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports MKB.TimePicker
|
||||
@@ -68,9 +69,6 @@ Partial Class OS_Asignaciones
|
||||
End If
|
||||
ObjEstatusPermisos.Dispose()
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -153,7 +151,7 @@ Partial Class OS_Asignaciones
|
||||
DdlEstatusOS.DataBind()
|
||||
End Sub
|
||||
Private Sub DdlEstatusOS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstatusOS.SelectedIndexChanged
|
||||
Dim TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue))
|
||||
Dim TipoEstatus As String = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue))
|
||||
|
||||
If TipoEstatus.ToEntero = 1 Then
|
||||
DivTecnico.Visible = False
|
||||
@@ -171,15 +169,18 @@ Partial Class OS_Asignaciones
|
||||
TecnicosSubProyectos = ObjOS.DtResultados
|
||||
End If
|
||||
|
||||
For Each SubProyecto As DataRow In DtOSSubProyectos.Rows
|
||||
Dim TecnicosSubProyectoAux As DataTable = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}'", SubProyecto.Item("SubProyecto")))
|
||||
If TecnicosSubProyectoAux.Rows.Count > 0 Then
|
||||
Dim EstatusDeTipoProcesoMenor As Integer = TecnicosSubProyectoAux.Rows(0).Item("CveEstatusOrdenServicio").ToString.ToEntero
|
||||
Dim dtAuxiliar As New DataTable
|
||||
dtAuxiliar = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}' AND CveEstatusOrdenServicio = {1}", SubProyecto.Item("SubProyecto"), EstatusDeTipoProcesoMenor), "", {"CveUsuario", "Nombre"})
|
||||
TecnicosResultado.Merge(dtAuxiliar)
|
||||
End If
|
||||
Next
|
||||
If DtOSSubProyectos IsNot Nothing Then
|
||||
For Each SubProyecto As DataRow In DtOSSubProyectos.Rows
|
||||
Dim TecnicosSubProyectoAux As DataTable = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}'", SubProyecto.Item("SubProyecto")))
|
||||
If TecnicosSubProyectoAux.Rows.Count > 0 Then
|
||||
Dim EstatusDeTipoProcesoMenor As Integer = TecnicosSubProyectoAux.Rows(0).Item("CveEstatusOrdenServicio").ToString.ToEntero
|
||||
Dim dtAuxiliar As New DataTable
|
||||
dtAuxiliar = TecnicosSubProyectos.FiltraParametros(String.Format("SubProyecto = '{0}' AND CveEstatusOrdenServicio = {1}", SubProyecto.Item("SubProyecto"), EstatusDeTipoProcesoMenor), "", {"CveUsuario", "Nombre"})
|
||||
TecnicosResultado.Merge(dtAuxiliar)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
DtTecnicosSubProyectos = TecnicosResultado
|
||||
DdlTecnico.DataSource = TecnicosResultado
|
||||
DdlTecnico.DataBind()
|
||||
@@ -191,12 +192,11 @@ Partial Class OS_Asignaciones
|
||||
#Region "BTN'S"
|
||||
Protected Sub BtnAsignar_Click(sender As Object, e As EventArgs) Handles BtnAsignar.Click
|
||||
Dim ObjOS As New ClsOS
|
||||
Dim TieneError = False
|
||||
Dim CveEstatusOS = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC")
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CveEstatusOS As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC").ToEntero
|
||||
Dim time As DateTime
|
||||
Dim contadorOrdenesAsignadas As Integer = 0
|
||||
|
||||
|
||||
ObjOS.IniciaTransacSQL()
|
||||
|
||||
For Each row As GridViewRow In GvNA.Rows
|
||||
@@ -228,13 +228,9 @@ Partial Class OS_Asignaciones
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1"
|
||||
Dim RecurrenciaTipo As Integer = 0, Frecuencia As Integer = -1, DiasSemana As String = "-1", Dias As Integer = -1, Mes As Integer = -1, RecurrenciaFin As String = "-1"
|
||||
Dim Fecha As DateTime = time
|
||||
|
||||
|
||||
Dim OIDescripcion As String = $"{DdlTecnico.SelectedItem.Text} <b><a href='/OS/OrdenesServicios.aspx?CveOS={row.DataKey("CveOS")}' target='_blank' class='Texto' >Orden de servicio {row.DataKey("Folio")} </a></b>"
|
||||
|
||||
Dim ObjEventos As New ClsOIEventos(ObjOS.IniciaTransacSQL())
|
||||
@@ -285,9 +281,9 @@ Partial Class OS_Asignaciones
|
||||
|
||||
Dim ObjOS As New ClsOS(TrasaccionSql)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim CveFolio = ""
|
||||
Dim CveFolio As String = ""
|
||||
|
||||
Dim TmpDTOS = New DataTable
|
||||
Dim TmpDTOS As New DataTable
|
||||
TmpDTOS.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
|
||||
TmpDTOS.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
@@ -315,7 +311,7 @@ Partial Class OS_Asignaciones
|
||||
TmpDTOS.Columns.Add("ComentarioTecnico", GetType(String))
|
||||
|
||||
|
||||
Dim TmpDTMaterialesOS = New DataTable
|
||||
Dim TmpDTMaterialesOS As New DataTable
|
||||
TmpDTMaterialesOS.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
TmpDTMaterialesOS.Columns.Add("CveConsecutivo", GetType(Integer))
|
||||
TmpDTMaterialesOS.Columns.Add("CveConsecutivoDetalle", GetType(Integer))
|
||||
@@ -440,7 +436,7 @@ Partial Class OS_Asignaciones
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue))
|
||||
Dim TipoEstatus As String = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue))
|
||||
|
||||
If TipoEstatus.ToEntero <= 1 Then
|
||||
CargaOrdenesServiciosNoAsignadas()
|
||||
@@ -512,4 +508,13 @@ Partial Class OS_Asignaciones
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepOSAsignacion.rdlc", dt, params, "OrdenesServicio")
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub GvA_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
e.Row.FCHyperLink("HplNombre").NavigateUrl = $"/OS/RepOSMedicas.aspx?CveUsuarioTecnico={e.Row.DBCampo("CveUsuarioAtendio")}"
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1277,9 +1277,9 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvMaterialUtilizado" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||
<asp:GridView ID="GvMU" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial"
|
||||
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS,Descuento,Observaciones"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMaterialUtilizado_RowDataBound">
|
||||
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMU_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Cant.</HeaderTemplate>
|
||||
@@ -1290,7 +1290,7 @@
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Utilizado</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtDev" runat="server" Width="50px" ></asp:TextBox>
|
||||
<asp:TextBox ID="TxtUtilizado" runat="server" Width="50px" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtDev" ValidChars="123456789." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -1299,19 +1299,19 @@
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>' ></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Serie</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblLote" runat="server" Text='<%# Eval("Lote") %>' ></asp:Label>
|
||||
<asp:Label ID="LblSerie" runat="server" Text='<%# Eval("Serie") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Lote</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblSerie" runat="server" Text='<%# Eval("Serie") %>' ></asp:Label>
|
||||
<asp:Label ID="LblLote" runat="server" Text='<%# Eval("Lote") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha Cad.</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -3089,19 +3089,18 @@ Partial Class OS_OrdenesServicios
|
||||
Protected Sub LnkAccionesMaterialUtilizado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LnkModalMaterialUtilizado.Visible = True
|
||||
GvMaterialUtilizado.DataSource = Nothing
|
||||
DTSolicitudDev = New DataTable
|
||||
Dim Opcion As Integer = If(DdlTipoVenta.SelectedValue.Contiene("2", "3"), 2, 1)
|
||||
Dim ObjOS As New ClsOS
|
||||
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then
|
||||
DTSolicitudDev = ObjOS.DtResultados
|
||||
GvMaterialUtilizado.DataSource = DTSolicitudDev
|
||||
GvMaterialUtilizado.Columns(3).Visible = DTSolicitudDev.MIN("Serie") <> ""
|
||||
GvMaterialUtilizado.Columns(4).Visible = DTSolicitudDev.MIN("Lote") <> ""
|
||||
GvMaterialUtilizado.Columns(5).Visible = DTSolicitudDev.MIN("FechaCaducidad") <> ""
|
||||
GvMU.DataSource = DTSolicitudDev
|
||||
GvMU.Columns(3).Visible = DTSolicitudDev.MIN("Serie") <> ""
|
||||
GvMU.Columns(4).Visible = DTSolicitudDev.MIN("Lote") <> ""
|
||||
GvMU.Columns(5).Visible = DTSolicitudDev.MIN("FechaCaducidad") <> ""
|
||||
End If
|
||||
ObjOS.Dispose()
|
||||
GvMaterialUtilizado.DataBind()
|
||||
GvMU.DataBind()
|
||||
|
||||
Dim EsDevolucionVenta As Boolean = (DTSolicitudDev.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
|
||||
|
||||
@@ -3116,11 +3115,11 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvMaterialUtilizado_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
Protected Sub GvMU_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.FCTextBox("TxtDev").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad")))
|
||||
e.Row.FCTextBox("TxtUtilizado").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad")))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -3131,88 +3130,42 @@ Partial Class OS_OrdenesServicios
|
||||
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")
|
||||
Alert("No se encontró almacen de entrega por adelantado", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim SbErroresDev As New StringBuilder
|
||||
|
||||
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||
|
||||
If GvRow.DataKey("Cantidad").ToDecimal > 0 Then
|
||||
|
||||
Dim sbTemperror As New StringBuilder
|
||||
Dim ErrorCountDev As Integer = 0
|
||||
'sbTemperror.Append($"Producto: {GvRow.DataKey("CodigoPS") } requiere: ")
|
||||
'If Boolean.Parse(GvRow.DataKey("AplicaSerie")) Then
|
||||
' If GvRow.FCTextBox("TxtSerie").Text.Trim = String.Empty Then
|
||||
' sbTemperror.Append($" Serie, ")
|
||||
' ErrorCountDev = ErrorCountDev + 1
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'If Boolean.Parse(GvRow.DataKey("AplicaLote")) Then
|
||||
' If GvRow.FCTextBox("TxtLote").Text = String.Empty Then
|
||||
' sbTemperror.Append($" Lote, ")
|
||||
' ErrorCountDev = ErrorCountDev + 1
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'If Boolean.Parse(GvRow.DataKey("AplicaCaducidad")) Then
|
||||
' If Not IsDate(GvRow.FCTextBox("TxtFechaCaducidad").Text) Then
|
||||
' sbTemperror.Append($" Fecha de caducidad")
|
||||
' ErrorCountDev = ErrorCountDev + 1
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'If ErrorCountDev > 0 Then
|
||||
' sbTemperror.Append($"<br/>")
|
||||
' SbErroresDev.AppendLine(sbTemperror.ToString)
|
||||
'End If
|
||||
End If
|
||||
Next
|
||||
|
||||
'If SbErroresDev.ToString.Length > 0 Then
|
||||
' Alert($"Se encontraron los siguientes errores: <br> {SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
Dim ProcesoOK As Boolean = True
|
||||
Dim ObjV As New ClsVentas
|
||||
ObjV.IniciaTransacSQL()
|
||||
Dim ClsOS As New ClsOS(ObjV.IniciaTransacSQL())
|
||||
|
||||
|
||||
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
If ProcesoOK Then
|
||||
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||
|
||||
Dim AplicaDevolucion As Boolean = False
|
||||
For Each GvRow As GridViewRow In GvMU.Rows
|
||||
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
|
||||
Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||
|
||||
Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||
If CantidadDev > 0 Then
|
||||
AplicaDevolucion = True
|
||||
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
|
||||
ProcesoOK = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If AplicaDevolucion Then
|
||||
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
Dim DtVentaDetalle As New DataTable
|
||||
|
||||
If ProcesoOK Then
|
||||
|
||||
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
|
||||
|
||||
If Respuesta.CveVenta > 0 Then
|
||||
@@ -3224,7 +3177,6 @@ Partial Class OS_OrdenesServicios
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ProcesoOK Then
|
||||
@@ -3237,21 +3189,21 @@ Partial Class OS_OrdenesServicios
|
||||
If CveMovimiento > 0 Then
|
||||
|
||||
Dim IndexMov1 As Integer = 0
|
||||
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||
For Each GvRow As GridViewRow In GvMU.Rows
|
||||
|
||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||
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 = DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
|
||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
|
||||
Dim Serie As String = GvRow.DataKey("Serie")
|
||||
Dim Lote As String = GvRow.DataKey("Lote")
|
||||
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate
|
||||
|
||||
If CantidadRegistro > 0 Then
|
||||
Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
|
||||
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
|
||||
Dim Serie As String = GvRow.DataKey("Serie")
|
||||
Dim Lote As String = GvRow.DataKey("Lote")
|
||||
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate
|
||||
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)
|
||||
ProcesoOK = False
|
||||
@@ -3300,6 +3252,11 @@ Partial Class OS_OrdenesServicios
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
If ProcesoOK Then
|
||||
If Not ClsOS.UpdateOrdenesServiciosFinaliza(CveOS, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = False
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
@@ -3321,12 +3278,9 @@ Partial Class OS_OrdenesServicios
|
||||
Private Function GeneraRemision(CveVentaPedido As Integer, ByRef TransaccionSQL As SqlTransaction) As RespuestaFacturacion
|
||||
|
||||
Dim Respuesta As New RespuestaFacturacion()
|
||||
|
||||
Dim CveRemiocionGenerada As Integer = -1
|
||||
|
||||
Dim ObjVentas As New ClsVentas(TransaccionSQL)
|
||||
Dim ProcesoOK As Boolean = True
|
||||
|
||||
Dim CveSubProyectoPedido As Integer = -1
|
||||
Dim CveMoneda As Integer = -1
|
||||
|
||||
@@ -3340,29 +3294,27 @@ Partial Class OS_OrdenesServicios
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso ProcesoOK Then
|
||||
|
||||
|
||||
|
||||
ObjFactura.CveMedico = DdlMedico.SelectedValue.ToEntero
|
||||
ObjFactura.CveProcedimiento = DdlProcedimiento.SelectedValue.ToEntero
|
||||
ObjFactura.CveTipoVenta = DdlTipoVenta.SelectedValue.ToEntero
|
||||
|
||||
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
|
||||
For Each GvRow As GridViewRow In GvMU.Rows
|
||||
|
||||
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
|
||||
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
|
||||
Dim CantidadRegistro As Decimal = Cantidad - CantidadDev
|
||||
Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtUtilizado").Text.ToDecimal
|
||||
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
|
||||
Dim Descuento As Decimal = GvRow.DataKey("Descuento").ToDecimal
|
||||
Dim Obs As String = GvRow.DataKey("Observaciones")
|
||||
|
||||
If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido) Then
|
||||
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
||||
ProcesoOK = False
|
||||
Exit For
|
||||
If CantidadRegistro > 0 Then
|
||||
If Not ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido) Then
|
||||
Alert("Error al agregar producto", TipoMensaje.MsgAdvertencia)
|
||||
ProcesoOK = False
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
If ProcesoOK Then
|
||||
ObjFactura.CalculaTotales()
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOS" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataTextField="Folio" Target="_blank" />
|
||||
<%--<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<%--1--%>
|
||||
<asp:BoundField DataField="FechaCita" HeaderText="Fecha Cita" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
|
||||
<asp:BoundField DataField="FechaCita" HeaderText="Fecha Cirugía" ItemStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
|
||||
<%--2--%>
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
|
||||
<%--3--%>
|
||||
@@ -181,7 +181,7 @@
|
||||
<%--6--%>
|
||||
<asp:BoundField HeaderText="Estatus" DataField="EstatusOrdenServicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<%--7--%>
|
||||
<asp:BoundField HeaderText="Técnico" DataField="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Técnico" DataField="NombreUsuario" ItemStyle-HorizontalAlign="Left" />
|
||||
<%--8--%>
|
||||
<asp:BoundField HeaderText="Paciente" DataField="Paciente" ItemStyle-HorizontalAlign="Left" />
|
||||
<%--9--%>
|
||||
|
||||
@@ -29,24 +29,26 @@ Partial Class OS_RepOSMedicas
|
||||
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
||||
DdlEstatusOS.DataBind()
|
||||
DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
Dim DTTecnicos As New DataTable
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
|
||||
If ObjUsuarios.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 351, UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0")
|
||||
Else
|
||||
DTTecnicos = ObjUsuarios.DtResultados.FiltraParametros(" CveProcesoUsuarioAcceso > 0 and CveUsuario <> 100")
|
||||
End If
|
||||
Dim DTTecnicos As DataTable = Nothing
|
||||
|
||||
Dim ObjOS As New ClsOS
|
||||
If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then
|
||||
DTTecnicos = ObjOS.DtResultados
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
ObjOS.Dispose()
|
||||
|
||||
DdlTecnico.DataSource = DTTecnicos 'GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True'")
|
||||
DdlTecnico.DataSource = DTTecnicos
|
||||
DdlTecnico.DataBind()
|
||||
DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlTecnico.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
|
||||
|
||||
|
||||
If IfNull(Request("CveUsuarioTecnico"), 0).ToString.ToEntero > 0 Then
|
||||
DdlTecnico.SelectedValueExist(Request("CveUsuarioTecnico").ToString)
|
||||
Else
|
||||
ViewState("CveUsuarioTecnico") = -1
|
||||
End If
|
||||
|
||||
'CargaClientes
|
||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_RepOrdenesServicios
|
||||
@@ -30,9 +29,6 @@ Partial Class OS_RepOrdenesServicios
|
||||
Private Sub CargaCombos()
|
||||
'CargaClientes
|
||||
DdlClientes.setEsWebService(True)
|
||||
'DdlClientes.DataSource() = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
'DdlClientes.DataBind()
|
||||
'DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'CargaSubProyectos
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
||||
|
||||
Reference in New Issue
Block a user